diff --git a/build.gradle b/build.gradle index 9d37305..6d13318 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ repositories { // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. // See https://docs.gradle.org/current/userguide/declaring_repositories.html // for more information about repositories. - + // GeckoLib maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' } } @@ -30,12 +30,12 @@ dependencies { // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - // Uncomment the following line to enable the deprecated Fabric API modules. + // Uncomment the following line to enable the deprecated Fabric API modules. // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" - - //GeckoLib + + // GeckoLib modImplementation 'software.bernie.geckolib:geckolib-fabric-1.19:3.1.6' } diff --git a/gradle.properties b/gradle.properties index 46e2eef..d8fc672 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,14 +6,14 @@ # Fabric Properties # check these on https://fabricmc.net/develop - minecraft_version=1.19 - yarn_mappings=1.19+build.4 - loader_version=0.14.8 + minecraft_version=1.19.2 + yarn_mappings=1.19.2+build.28 + loader_version=0.14.10 # Mod Properties - mod_version = 1.0.0-1.19 + mod_version = 1.0.0-beta-1.19.2 maven_group = com.virus5600 archives_base_name = defensive-measures # Dependencies - fabric_version=0.57.0+1.19 \ No newline at end of file + fabric_version=0.66.0+1.19.2 \ No newline at end of file diff --git a/src/main/java/com/virus5600/DefensiveMeasures/entity/ModEntities.java b/src/main/java/com/virus5600/DefensiveMeasures/entity/ModEntities.java index 7f93544..f46098d 100644 --- a/src/main/java/com/virus5600/DefensiveMeasures/entity/ModEntities.java +++ b/src/main/java/com/virus5600/DefensiveMeasures/entity/ModEntities.java @@ -50,7 +50,7 @@ public class ModEntities { .dimensions(EntityDimensions.changing(0.875f, 0.875f)) .build() ); - + /// PROJECTILES // v1.0.0 public static final EntityType CANNONBALL = Registry.register( @@ -76,10 +76,10 @@ public class ModEntities { .dimensions(EntityDimensions.fixed(0.125f, 0.125f)) .build() ); - + public static void registerModEntities() { DefensiveMeasures.LOGGER.debug("REGISTERING ENTITIES FOR " + DefensiveMeasures.MOD_NAME); - + /// TURRETS // v1.0.0 EntityRendererRegistry.register(ModEntities.CANNON_TURRET, CannonTurretRenderer::new); @@ -88,7 +88,7 @@ public static void registerModEntities() { FabricDefaultAttributeRegistry.register(ModEntities.BALLISTA, BallistaTurretEntity.setAttributes()); EntityRendererRegistry.register(ModEntities.MG_TURRET, MGTurretRenderer::new); FabricDefaultAttributeRegistry.register(ModEntities.MG_TURRET, MGTurretEntity.setAttributes()); - + /// PROJECTILES // v1.0.0 EntityRendererRegistry.register(ModEntities.CANNONBALL, CannonballRenderer::new); diff --git a/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/BallistaTurretEntity.java b/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/BallistaTurretEntity.java index 22f2826..da3d46e 100644 --- a/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/BallistaTurretEntity.java +++ b/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/BallistaTurretEntity.java @@ -57,7 +57,7 @@ public class BallistaTurretEntity extends TurretEntity implements IAnimatable, R @Nullable private LivingEntity currentTarget = null; private double attCooldown = totalAttCooldown; - + // CONSTRUCTORS // public BallistaTurretEntity(EntityType entityType, World world) { super(entityType, world, TurretMaterial.WOOD, BallistaArrowEntity.class); @@ -65,19 +65,19 @@ public BallistaTurretEntity(EntityType entityType, World wo this.addHealables(healables); this.addEffectSource(effectSource); } - + // METHODS // // PRIVATE private PlayState idlePredicate(AnimationEvent event) { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.ballista.setup", true)); return PlayState.CONTINUE; } - + private PlayState lookAtTargetPredicate(AnimationEvent event) { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.ballista.look_at_target", true)); return PlayState.CONTINUE; } - + private boolean animPlayed = false; private PlayState deathPredicate(AnimationEvent event) { if (!this.isAlive() && !animPlayed) { @@ -87,17 +87,17 @@ private PlayState deathPredicate(AnimationEvent event } return PlayState.CONTINUE; } - + private PlayState firingSequencePredicate(AnimationEvent event) { if (this.hasTarget() && this.isShooting()) { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.ballista.shoot")); event.getController().markNeedsReload(); this.setShooting(false); } - + return PlayState.CONTINUE; } - + // PROTECTED @Override protected void initGoals() { @@ -105,7 +105,7 @@ protected void initGoals() { this.goalSelector.add(1, new ProjectileAttackGoal(this, 0, totalAttCooldown, 16.8125F)); this.goalSelector.add(2, new LookAtEntityGoal(this, MobEntity.class, 8.0F, 0.02F, true)); this.goalSelector.add(8, new LookAroundGoal(this)); - + // Targets this.targetSelector.add(1, new ActiveTargetGoal(this, MobEntity.class, 10, true, false, (entity) -> { return entity instanceof Monster; @@ -123,7 +123,7 @@ protected void initDataTracker() { protected SoundEvent getHurtSound(DamageSource source) { return ModSoundEvents.TURRET_BALLISTA_HURT; } - + @Nullable @Override protected SoundEvent getDeathSound() { @@ -138,7 +138,7 @@ public static DefaultAttributeContainer.Builder setAttributes() { .add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0f) .add(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, 999999f); } - + @Override public void registerControllers(AnimationData data) { data.addAnimationController(new AnimationController(this, "idle", 20, this::idlePredicate)); @@ -151,21 +151,21 @@ public void registerControllers(AnimationData data) { public AnimationFactory getFactory() { return this.factory; } - + public ItemStack getEntityItem() { ItemStack stack = new ItemStack(ModItems.BALLISTA, 1); return stack; } - + @Override public void attack(LivingEntity target, float pullProgress) { this.setShooting(true); - + if (target == null) { this.setShooting(false); return; } - + try { double vx = (target.getX() - this.getX()) * 1.0625; double vy = target.getBodyY(2/3) - this.getY() + 0.25; @@ -173,24 +173,24 @@ public void attack(LivingEntity target, float pullProgress) { double variance = Math.sqrt(vx * vx + vz * vz); float divergence = 0 + this.world.getDifficulty().getId() * 2; ProjectileEntity projectile = (ProjectileEntity) new BallistaArrowEntity(world, this); - + projectile.setVelocity(vx, vy + variance * 0.2f, vz, 1.5f, divergence); projectile.setPos(this.getX(), this.getY() + 0.8125, this.getZ()); - + this.playSound(this.getShootSound(), 1.0f, 1.0f / (this.getRandom().nextFloat() * 0.4f + 0.8f)); this.world.spawnEntity(projectile); } catch (IllegalArgumentException | SecurityException e) { e.printStackTrace(); } } - + @Override public void tick() { super.tick(); - + this.setYaw(0); this.setBodyYaw(0); - + if (!this.world.isClient()) { // FIRING ANIMATING RELATED this.setTrackedYaw(this.getHeadYaw()); @@ -198,14 +198,14 @@ public void tick() { this.setPos(X, this.getX()); this.setPos(Y, this.getY() + 0.5); this.setPos(Z, this.getZ()); - + if (this.hasTarget()) { this.setPos(TARGET_POS_X, this.getTarget().getX()); this.setPos(TARGET_POS_Y, this.getTarget().getBodyY(1/2)); this.setPos(TARGET_POS_Z, this.getTarget().getZ()); - + --this.attCooldown; - + if (this.attCooldown <= 0) this.attCooldown = 20 * 2.5; else if (this.attCooldown <= 45) @@ -218,12 +218,12 @@ else if (this.attCooldown <= 45) } } } - + @Override public ActionResult interactMob(PlayerEntity player, Hand hand) { return Itemable.tryItem(player, hand, this, ModItems.TURRET_REMOVER, ModItems.BALLISTA).orElse(super.interactMob(player, hand)); } - + static { healables = new HashMap() { private static final long serialVersionUID = 1L; @@ -236,7 +236,7 @@ public ActionResult interactMob(PlayerEntity player, Hand hand) { put(item, 25f); } }; - + effectSource = new HashMap>() { private static final long serialVersionUID = 1L; { diff --git a/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/CannonTurretEntity.java b/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/CannonTurretEntity.java index f0c3cc6..d39080a 100644 --- a/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/CannonTurretEntity.java +++ b/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/CannonTurretEntity.java @@ -73,19 +73,19 @@ public CannonTurretEntity(EntityType entityType, World worl this.addHealables(healables); this.addEffectSource(effectSource); } - + // METHODS // // PRIVATE private PlayState idlePredicate(AnimationEvent event) { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.cannon_turret.setup", true)); return PlayState.CONTINUE; } - + private PlayState lookAtTargetPredicate(AnimationEvent event) { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.cannon_turret.look_at_target", true)); return PlayState.CONTINUE; } - + private boolean animPlayed = false; private PlayState deathPredicate(AnimationEvent event) { if (!this.isAlive() && !animPlayed) { @@ -95,7 +95,7 @@ private PlayState deathPredicate(AnimationEvent event } return PlayState.CONTINUE; } - + private PlayState firingSequencePredicate(AnimationEvent event) { Vec3d fusePos = getRelativePos(0, 17.5, -0.6); Vec3d barrelPos = getRelativePos( @@ -103,23 +103,23 @@ private PlayState firingSequencePredicate(AnimationEvent MathHelper.nextDouble(this.random, -7.625, -7.375), 0.9 ); - + if (this.hasTarget() && this.isShooting()) { event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.cannon_turret.shoot")); event.getController().markNeedsReload(); - + if (!this.getShootingFXDone()) { int count = MathHelper.nextInt(this.random, 10, 25); double vx = (this.getPos(TARGET_POS_X) - this.getPos(X))/10; double vy = (this.getPos(TARGET_POS_Y) - this.getPos(Y)); double vz = (this.getPos(TARGET_POS_Z) - this.getPos(Z))/10; double variance = Math.sqrt(vx * vx + vz * vz) * 0.5; - + for (int i = 0; i < count; i++) { vx = vx == 0 ? MathHelper.nextDouble(this.random, -0.25, 0.25) : MathHelper.nextDouble(this.random, vx - 0.125, vx + 0.125); vy = MathHelper.nextDouble(this.random, vy, vy + 0.5); vz = vz == 0 ? MathHelper.nextDouble(this.random, -0.25, 0.25) : MathHelper.nextDouble(this.random, vz - 0.125, vz + 0.125); - + this.world.addParticle( ModParticles.CANNON_FLASH, true, @@ -132,9 +132,9 @@ private PlayState firingSequencePredicate(AnimationEvent ); } } - + } - + if (this.getFuseLit()) { this.world.addParticle( ModParticles.CANNON_FUSE, @@ -148,10 +148,10 @@ private PlayState firingSequencePredicate(AnimationEvent ); event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.cannon_turret.fuse", true)); } - + return PlayState.CONTINUE; } - + // PROTECTED @Override protected void initGoals() { @@ -159,7 +159,7 @@ protected void initGoals() { this.goalSelector.add(1, new ProjectileAttackGoal(this, 0, totalAttCooldown, 16.625F)); this.goalSelector.add(2, new LookAtEntityGoal(this, MobEntity.class, 8.0F, 0.02F, true)); this.goalSelector.add(8, new LookAroundGoal(this)); - + // Targets this.targetSelector.add(1, new ActiveTargetGoal(this, MobEntity.class, 10, true, false, (entity) -> { return entity instanceof Monster; @@ -178,30 +178,30 @@ protected void initDataTracker() { protected SoundEvent getHurtSound(DamageSource source) { return ModSoundEvents.TURRET_CANNON_HURT; } - + @Nullable @Override protected SoundEvent getDeathSound() { return ModSoundEvents.TURRET_CANNON_DESTROYED; } - + protected void setFuseLit(boolean lit) { this.dataTracker.set(FUSE_LIT, lit); } - + protected boolean getFuseLit() { return this.dataTracker.get(FUSE_LIT); } - + // PUBLIC public static DefaultAttributeContainer.Builder setAttributes() { return MobEntity.createMobAttributes() .add(EntityAttributes.GENERIC_FOLLOW_RANGE, 16) .add(EntityAttributes.GENERIC_MAX_HEALTH, 50) - .add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0f) - .add(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, 999999f); + .add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0) + .add(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, 1.0); } - + @Override public void registerControllers(AnimationData data) { data.addAnimationController(new AnimationController(this, "idle", 20, this::idlePredicate)); @@ -209,12 +209,12 @@ public void registerControllers(AnimationData data) { data.addAnimationController(new AnimationController(this, "death", 0, this::deathPredicate)); data.addAnimationController(new AnimationController(this, "firing_sequence", 0, this::firingSequencePredicate)); } - + @Override public AnimationFactory getFactory() { return factory; } - + @Override public ItemStack getEntityItem() { ItemStack stack = new ItemStack(ModItems.CANNON_TURRET, 1); @@ -227,9 +227,9 @@ public void attack(LivingEntity target, float pullProgress) { this.setShooting(false); return; } - + this.setShooting(true); - + try { double vx = (target.getX() - this.getX()) * 1.0625; double vy = target.getBodyY(2/3) - this.getY() + 0.25; @@ -237,24 +237,24 @@ public void attack(LivingEntity target, float pullProgress) { double variance = Math.sqrt(vx * vx + vz * vz); float divergence = 0 + this.world.getDifficulty().getId() * 2; ProjectileEntity projectile = (ProjectileEntity) new CannonballEntity(ModEntities.CANNONBALL, this, vx, vy, vz, world); - + projectile.setVelocity(vx, vy + variance * 0.1f, vz, 1.5f, divergence); projectile.setPos(this.getX(), this.getY() + 0.5, this.getZ()); - + this.playSound(this.getShootSound(), 1.0f, 1.0f / (this.getRandom().nextFloat() * 0.4f + 0.8f)); this.world.spawnEntity(projectile); } catch ( IllegalArgumentException | SecurityException e) { e.printStackTrace(); } } - + @Override public void tick() { super.tick(); - + this.setYaw(0); this.setBodyYaw(0); - + if (!this.world.isClient()) { // FIRING ANIMATING RELATED this.setTrackedYaw(this.getHeadYaw()); @@ -262,26 +262,26 @@ public void tick() { this.setPos(X, this.getX()); this.setPos(Y, this.getY() + 0.5); this.setPos(Z, this.getZ()); - + if (this.attCooldown >= 99) this.setShootingFXDone(false); else this.setShootingFXDone(true); - + if (this.attCooldown < 20) { this.setFuseLit(false); } else if (this.attCooldown <= 80 && this.attCooldown >= 10) { this.setFuseLit(true); } - + if (this.hasTarget()) { this.setPos(TARGET_POS_X, this.getTarget().getX()); this.setPos(TARGET_POS_Y, this.getTarget().getBodyY(1/2)); this.setPos(TARGET_POS_Z, this.getTarget().getZ()); - + --this.attCooldown; - + if (this.attCooldown <= 0) this.attCooldown = 20 * 5; else if (this.attCooldown <= 95) @@ -295,15 +295,15 @@ else if (this.attCooldown <= 95) } } } - + @Override public ActionResult interactMob(PlayerEntity player, Hand hand) { return Itemable.tryItem(player, hand, this, ModItems.TURRET_REMOVER, ModItems.CANNON_TURRET).orElse(super.interactMob(player, hand)); } - + static { FUSE_LIT = DataTracker.registerData(CannonTurretEntity.class, TrackedDataHandlerRegistry.BOOLEAN); - + healables = new HashMap() { private static final long serialVersionUID = 1L; { @@ -314,7 +314,7 @@ public ActionResult interactMob(PlayerEntity player, Hand hand) { put(Items.IRON_BLOCK, 100f); } }; - + effectSource = new HashMap>() { private static final long serialVersionUID = 1L; { diff --git a/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/MGTurretEntity.java b/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/MGTurretEntity.java index fc39369..1222070 100644 --- a/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/MGTurretEntity.java +++ b/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/MGTurretEntity.java @@ -277,7 +277,7 @@ public void tick() { @Override public ActionResult interactMob(PlayerEntity player, Hand hand) { - return Itemable.tryItem(player, hand, this, ModItems.TURRET_REMOVER, ModItems.BALLISTA).orElse(super.interactMob(player, hand)); + return Itemable.tryItem(player, hand, this, ModItems.TURRET_REMOVER, ModItems.MG_TURRET).orElse(super.interactMob(player, hand)); } static { diff --git a/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/TurretEntity.java b/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/TurretEntity.java index 8042b57..a3b2e5a 100644 --- a/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/TurretEntity.java +++ b/src/main/java/com/virus5600/DefensiveMeasures/entity/custom/TurretEntity.java @@ -547,6 +547,9 @@ public boolean canBeLeashedBy(PlayerEntity player) { @Override public boolean startRiding(Entity entity, boolean force) { + if (this.world.isClient()) { + this.prevAttachedBlock = null; + } return super.startRiding(entity, force); } diff --git a/src/main/resources/data/dm/loot_tables/entities/ballista.json b/src/main/resources/data/dm/loot_tables/entities/ballista.json new file mode 100644 index 0000000..5e8c0ec --- /dev/null +++ b/src/main/resources/data/dm/loot_tables/entities/ballista.json @@ -0,0 +1,55 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "weight": 20, + "name": "dm:entities/ballista/head_1" + }, + { + "type": "minecraft:loot_table", + "weight": 40, + "name": "dm:entities/ballista/head_2" + } + ] + }, + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:tag", + "weight": 4, + "name": "minecraft:wooden_fences", + "expand": true, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 1 + } + } + ] + }, + { + "type": "minecraft:tag", + "weight": 6, + "name": "minecraft:wooden_slabs", + "expand": true, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 0, + "max": 3 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/dm/loot_tables/entities/ballista/head_1.json b/src/main/resources/data/dm/loot_tables/entities/ballista/head_1.json new file mode 100644 index 0000000..a492e2c --- /dev/null +++ b/src/main/resources/data/dm/loot_tables/entities/ballista/head_1.json @@ -0,0 +1,35 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "weight": 35, + "name": "dm:ballista_bow", + "functions": [ + { + "function": "minecraft:set_count", + "count": 1 + } + ] + }, + { + "type": "minecraft:item", + "weight": 65, + "name": "minecraft:string", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 3 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/dm/loot_tables/entities/ballista/head_2.json b/src/main/resources/data/dm/loot_tables/entities/ballista/head_2.json new file mode 100644 index 0000000..683cf51 --- /dev/null +++ b/src/main/resources/data/dm/loot_tables/entities/ballista/head_2.json @@ -0,0 +1,39 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "weight": 40, + "name": "minecraft:stick", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 5, + "max": 9 + } + } + ] + }, + { + "type": "minecraft:tag", + "weight": 30, + "name": "minecraft:planks", + "expand": true, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 3 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/dm/loot_tables/entities/cannon_turret.json b/src/main/resources/data/dm/loot_tables/entities/cannon_turret.json new file mode 100644 index 0000000..7e5c4ea --- /dev/null +++ b/src/main/resources/data/dm/loot_tables/entities/cannon_turret.json @@ -0,0 +1,39 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "weight": 20, + "name": "dm:entities/cannon_turret/head_1" + }, + { + "type": "minecraft:loot_table", + "weight": 40, + "name": "dm:entities/cannon_turret/head_2" + } + ] + }, + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:tag", + "name": "minecraft:wooden_slabs", + "expand": true, + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 0, + "max": 3 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/dm/loot_tables/entities/cannon_turret/head_1.json b/src/main/resources/data/dm/loot_tables/entities/cannon_turret/head_1.json new file mode 100644 index 0000000..78831b0 --- /dev/null +++ b/src/main/resources/data/dm/loot_tables/entities/cannon_turret/head_1.json @@ -0,0 +1,32 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "weight": 20, + "name": "dm:cannon_head", + "functions": [ + { + "function": "minecraft:set_count", + "count": 1 + } + ] + }, + { + "type": "minecraft:item", + "weight": 50, + "name": "dm:unfinished_cannon_head", + "functions": [ + { + "function": "minecraft:set_count", + "count": 1 + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/dm/loot_tables/entities/cannon_turret/head_2.json b/src/main/resources/data/dm/loot_tables/entities/cannon_turret/head_2.json new file mode 100644 index 0000000..e9ed7a2 --- /dev/null +++ b/src/main/resources/data/dm/loot_tables/entities/cannon_turret/head_2.json @@ -0,0 +1,38 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "weight": 40, + "name": "minecraft:iron_nugget", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 5, + "max": 9 + } + } + ] + }, + { + "type": "minecraft:item", + "weight": 30, + "name": "minecraft:iron_ingot", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 3 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/dm/loot_tables/entities/mg_turret.json b/src/main/resources/data/dm/loot_tables/entities/mg_turret.json new file mode 100644 index 0000000..626b29a --- /dev/null +++ b/src/main/resources/data/dm/loot_tables/entities/mg_turret.json @@ -0,0 +1,38 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "weight": 20, + "name": "dm:entities/mg_turret/head_1" + }, + { + "type": "minecraft:loot_table", + "weight": 40, + "name": "dm:entities/mg_turret/head_2" + } + ] + }, + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:iron_ingot", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 0, + "max": 3 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/dm/loot_tables/entities/mg_turret/head_1.json b/src/main/resources/data/dm/loot_tables/entities/mg_turret/head_1.json new file mode 100644 index 0000000..5801c05 --- /dev/null +++ b/src/main/resources/data/dm/loot_tables/entities/mg_turret/head_1.json @@ -0,0 +1,32 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "weight": 20, + "name": "dm:machine_gun_head", + "functions": [ + { + "function": "minecraft:set_count", + "count": 1 + } + ] + }, + { + "type": "minecraft:item", + "weight": 50, + "name": "dm:machine_gun_stand", + "functions": [ + { + "function": "minecraft:set_count", + "count": 1 + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/dm/loot_tables/entities/mg_turret/head_2.json b/src/main/resources/data/dm/loot_tables/entities/mg_turret/head_2.json new file mode 100644 index 0000000..e9ed7a2 --- /dev/null +++ b/src/main/resources/data/dm/loot_tables/entities/mg_turret/head_2.json @@ -0,0 +1,38 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "weight": 40, + "name": "minecraft:iron_nugget", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 5, + "max": 9 + } + } + ] + }, + { + "type": "minecraft:item", + "weight": 30, + "name": "minecraft:iron_ingot", + "functions": [ + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 3 + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/dm/recipes/ballista_base.json b/src/main/resources/data/dm/recipes/ballista_base.json index 83bfbbb..b465980 100644 --- a/src/main/resources/data/dm/recipes/ballista_base.json +++ b/src/main/resources/data/dm/recipes/ballista_base.json @@ -7,7 +7,7 @@ ], "key": { "s": { - "tag": "minecraft:wooden_slab" + "tag": "minecraft:wooden_slabs" } }, "result": { diff --git a/src/main/resources/data/dm/recipes/cannon_base.json b/src/main/resources/data/dm/recipes/cannon_base.json index a7172ee..9e218df 100644 --- a/src/main/resources/data/dm/recipes/cannon_base.json +++ b/src/main/resources/data/dm/recipes/cannon_base.json @@ -6,7 +6,7 @@ ], "key": { "p": { - "tag": "minecraft:wooden_slab" + "tag": "minecraft:wooden_slabs" }, "s": { "item": "minecraft:smooth_stone_slab" diff --git a/src/main/resources/data/dm/recipes/machine_gun_base.json b/src/main/resources/data/dm/recipes/machine_gun_base.json index 629e57b..0a751f5 100644 --- a/src/main/resources/data/dm/recipes/machine_gun_base.json +++ b/src/main/resources/data/dm/recipes/machine_gun_base.json @@ -7,7 +7,7 @@ ], "key": { "b": { - "item": "minecraft:nether_bricks" + "item": "minecraft:nether_brick" }, "p": { "item": "minecraft:heavy_weighted_pressure_plate"