diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/EntityTypes.java b/fabric/src/main/java/ziyue/tjmetro/mod/EntityTypes.java index b656c11..677276c 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/EntityTypes.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/EntityTypes.java @@ -9,7 +9,7 @@ public interface EntityTypes { - EntityTypeRegistryObject SEAT = Registry.registerEntityType("seat", EntitySeat::new, Float.MIN_VALUE, Float.MIN_VALUE); + EntityTypeRegistryObject SEAT = Registry.registerEntityType("seat", EntitySeat::new, 0, 0); static void registerEntities() { // Calling this class to initialize constants diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockBench.java b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockBench.java index 8a383f1..a7d7123 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockBench.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/block/BlockBench.java @@ -34,7 +34,7 @@ public BlockBench(BlockSettings blockSettings) { @Nonnull @Override public ActionResult onUse2(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - Entity entity = new Entity(new EntitySeat(world, pos.getX() + 0.5, pos.getY() + 0.35, pos.getZ() + 0.5)); + Entity entity = new Entity(new EntitySeat(world, pos.getX() + 0.5, pos.getY() + 0.55, pos.getZ() + 0.5)); world.spawnEntity(entity); player.startRiding(entity); return ActionResult.SUCCESS; diff --git a/fabric/src/main/java/ziyue/tjmetro/mod/entity/EntitySeat.java b/fabric/src/main/java/ziyue/tjmetro/mod/entity/EntitySeat.java index b5fd091..602a3e2 100644 --- a/fabric/src/main/java/ziyue/tjmetro/mod/entity/EntitySeat.java +++ b/fabric/src/main/java/ziyue/tjmetro/mod/entity/EntitySeat.java @@ -36,14 +36,8 @@ public boolean doesNotCollide2(double offsetX, double offsetY, double offsetZ) { } @Override - public void tick2() { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - if (!this.hasPassenger2(new Entity(this))) { - this.kill2(); - } + protected void removePassenger2(Entity passenger) { + super.removePassenger2(passenger); + if (!getWorld().isClient()) this.kill2(); } }