From 1ad751583b811781b7fa7a1f1e438322882a77d7 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 30 Mar 2021 15:49:35 +0200 Subject: [PATCH] fixed a serverside projectile generator crash Closes #202 --- .../ellpeck/naturesaura/blocks/BlockProjectileGenerator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockProjectileGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockProjectileGenerator.java index 75a87673..6843e3e7 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockProjectileGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockProjectileGenerator.java @@ -43,6 +43,7 @@ import java.util.function.Function; import java.util.function.Supplier; public class BlockProjectileGenerator extends BlockContainerImpl implements ITESRProvider, ICustomBlockState { + public BlockProjectileGenerator() { super("projectile_generator", TileEntityProjectileGenerator::new, Properties.create(Material.ROCK).hardnessAndResistance(2.5F).sound(SoundType.STONE)); @@ -58,7 +59,8 @@ public class BlockProjectileGenerator extends BlockContainerImpl implements ITES DispenserBlock.registerDispenseBehavior(Items.TRIDENT, new ProjectileDispenseBehavior() { @Override protected ProjectileEntity getProjectileEntity(World worldIn, IPosition position, ItemStack stackIn) { - TridentEntity ret = new TridentEntity(worldIn, position.getX(), position.getY(), position.getZ()); + TridentEntity ret = new TridentEntity(EntityType.TRIDENT, worldIn); + ret.setPosition(position.getX(), position.getY(), position.getZ()); // set thrownStack ObfuscationReflectionHelper.setPrivateValue(TridentEntity.class, ret, stackIn.copy(), "field_203054_h"); ret.pickupStatus = AbstractArrowEntity.PickupStatus.ALLOWED;