Skip to content

Commit 1f21e1d

Browse files
committed
Added config for shot power and pursuit distance, removed skeleton pirates temporarily
1 parent 61753bf commit 1f21e1d

File tree

7 files changed

+11
-8
lines changed

7 files changed

+11
-8
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ loader_version=0.15.10
1010
fabric_kotlin_version=1.10.19+kotlin.1.9.23
1111

1212
# Mod Properties
13-
mod_version=1.4.4
13+
mod_version=1.4.5
1414
maven_group=ace.actually.pirates
1515
archives_base_name=ValkyrienPirates
1616

src/main/java/ace/actually/pirates/ClientPirates.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ public class ClientPirates implements ClientModInitializer {
1919
public void onInitializeClient() {
2020

2121
EntityRendererRegistry.register(Pirates.PIRATE_ENTITY_TYPE, PirateEntityRenderer::new);
22-
EntityRendererRegistry.register(Pirates.SKELETON_PIRATE_ENTITY_TYPE, SkeletonPirateEntityRenderer::new);
22+
//EntityRendererRegistry.register(Pirates.SKELETON_PIRATE_ENTITY_TYPE, SkeletonPirateEntityRenderer::new);
2323
EntityRendererRegistry.register(Pirates.SHOT_ENTITY_TYPE, (context) -> new ShotEntityRenderer(context, 1,false));
2424

2525
BlockEntityRendererFactories.register(Pirates.CANNON_PRIMING_BLOCK_ENTITY, CannonPrimingBlockEntityRenderer::new);
2626

27-
EntityModelLayerRegistry.registerModelLayer(SKELETON_PIRATE, SkeletonPirateModel::getTexturedModelData);
27+
//EntityModelLayerRegistry.registerModelLayer(SKELETON_PIRATE, SkeletonPirateModel::getTexturedModelData);
2828

2929
}
3030

src/main/java/ace/actually/pirates/Pirates.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ public class Pirates implements ModInitializer {
5858
.build();
5959

6060
public static float baseShotPower;
61+
public static int pursuitDistance;
6162

6263
@Override
6364
public void onInitialize() {
6465

6566
ConfigUtils.checkConfigs();
6667
baseShotPower = Float.parseFloat(ConfigUtils.config.getOrDefault("base-shot-power","2.2"));
68+
pursuitDistance = Integer.parseInt(ConfigUtils.config.getOrDefault("pursuit-distance","10000"));
6769
registerEntityThings();
6870
//entity types do it themselves
6971
registerBlocks();
@@ -97,7 +99,7 @@ private void registerEntityThings()
9799
{
98100

99101
FabricDefaultAttributeRegistry.register(PIRATE_ENTITY_TYPE, PirateEntity.attributes());
100-
FabricDefaultAttributeRegistry.register(SKELETON_PIRATE_ENTITY_TYPE, SkeletonPirateEntity.attributes());
102+
//FabricDefaultAttributeRegistry.register(SKELETON_PIRATE_ENTITY_TYPE, SkeletonPirateEntity.attributes());
101103

102104
}
103105

@@ -166,7 +168,7 @@ private void registerItems()
166168

167169
public static final EntityType<PirateEntity> PIRATE_ENTITY_TYPE =registerEntity("pirate",SpawnGroup.MISC,EntityDimensions.changing(0.6f,1.9f),((type, world) -> new PirateEntity(world)));
168170

169-
public static final EntityType<SkeletonPirateEntity> SKELETON_PIRATE_ENTITY_TYPE =registerEntity("skeleton_pirate",SpawnGroup.MISC,EntityDimensions.changing(0.6f,1.9f),((type, world) -> new SkeletonPirateEntity(world)));
171+
public static final EntityType<SkeletonPirateEntity> SKELETON_PIRATE_ENTITY_TYPE = null; //=registerEntity("skeleton_pirate",SpawnGroup.MISC,EntityDimensions.changing(0.6f,1.9f),((type, world) -> new SkeletonPirateEntity(world)));
170172

171173

172174

src/main/java/ace/actually/pirates/blocks/entity/CrewSpawnerBlockEntity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private static Entity getEntityFromState(World world, BlockEntity be) {
110110
crew = new VillagerEntity(EntityType.VILLAGER, world, VillagerType.forBiome(world.getBiome(be.getPos())));
111111
} else if (be.getCachedState().get(CrewTypes.CREW_SPAWN_TYPE) == CrewSpawnType.SKELETON_PIRATE) {
112112
BlockPos blockToCrew = checkForBlocksToCrew(world, be.getPos());
113-
crew = new SkeletonPirateEntity(world, blockToCrew);
113+
crew = new PirateEntity(world, blockToCrew);
114114
ItemStack itemStack = new ItemStack(Items.BOW);
115115
if (world.getBlockState(blockToCrew).isOf(Pirates.MOTION_INVOKING_BLOCK)) {
116116
itemStack.addEnchantment(Enchantments.POWER, 2);

src/main/java/ace/actually/pirates/blocks/entity/MotionInvokingBlockEntity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public static void tick(World world, BlockPos pos, BlockState state, MotionInvok
101101
if(a.getId()==ship.getId()) return false;
102102
Vector3dc f1 = ship.getTransform().getPositionInWorld();
103103
Vector3dc f2 = a.getTransform().getPositionInWorld();
104-
return f1.distanceSquared(f2)<10000;
104+
return f1.distanceSquared(f2)<Pirates.pursuitDistance;
105105
}).toList();
106106
if(!ships.isEmpty())
107107
{

src/main/java/ace/actually/pirates/entities/pirate_abstract/AbstractPirateEntity.java

-1
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,4 @@ public void readCustomDataFromNbt(NbtCompound nbt) {
102102
this.blockToDisable = new BlockPos(x, y, z);
103103
}
104104
}
105-
106105
}

src/main/java/ace/actually/pirates/util/ConfigUtils.java

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ private static List<String> makeDefaults()
6868
defaults.add("controlled-ship-updates=100");
6969
defaults.add("#Base power for cannonball shot entity, default=2.2");
7070
defaults.add("base-shot-power=2.2");
71+
defaults.add("#Based squared distance to trigger NPC ship pursuit default=10000");
72+
defaults.add("pursuit-distance=10000");
7173

7274
return defaults;
7375
}

0 commit comments

Comments
 (0)