Hotfix the fix

- More safety for the minecart controller capability
- Blaze burners now support comparators
This commit is contained in:
simibubi 2021-01-13 18:28:29 +01:00
parent de55778fc5
commit 511950b766
3 changed files with 27 additions and 3 deletions

View file

@ -102,9 +102,11 @@ public class CapabilityMinecartController implements ICapabilitySerializable<Com
if (world.isRemote && carts.containsKey(uniqueID)) {
MinecartController minecartController = carts.get(uniqueID);
AbstractMinecartEntity minecartEntity = minecartController.cart();
if (minecartEntity != null && minecartEntity.getEntityId() != cart.getEntityId())
continue; // Away with you, Fake Entities!
if (minecartController != null) {
AbstractMinecartEntity minecartEntity = minecartController.cart();
if (minecartEntity != null && minecartEntity.getEntityId() != cart.getEntityId())
continue; // Away with you, Fake Entities!
}
}
cartsWithCoupling.remove(uniqueID);
@ -145,6 +147,8 @@ public class CapabilityMinecartController implements ICapabilitySerializable<Com
.getPos();
Map<UUID, MinecartController> carts = loadedMinecartsByUUID.get(event.getWorld());
for (MinecartController minecartController : carts.values()) {
if (minecartController == null)
continue;
if (!minecartController.isPresent())
continue;
AbstractMinecartEntity cart = minecartController.cart();

View file

@ -216,6 +216,16 @@ public class BlazeBurnerBlock extends Block implements ITE<BlazeBurnerTileEntity
builder.addLootPool(poolBuilder.rolls(ConstantRange.of(1)));
return builder;
}
@Override
public boolean hasComparatorInputOverride(BlockState p_149740_1_) {
return true;
}
@Override
public int getComparatorInputOverride(BlockState state, World p_180641_2_, BlockPos p_180641_3_) {
return Math.max(0, state.get(HEAT_LEVEL).ordinal() -1);
}
@OnlyIn(Dist.CLIENT)
public void animateTick(BlockState state, World world, BlockPos pos, Random random) {

View file

@ -97,6 +97,16 @@ public class LitBlazeBurnerBlock extends Block {
}
}
}
@Override
public boolean hasComparatorInputOverride(BlockState p_149740_1_) {
return true;
}
@Override
public int getComparatorInputOverride(BlockState state, World p_180641_2_, BlockPos p_180641_3_) {
return 1;
}
@Override
public VoxelShape getCollisionShape(BlockState state, IBlockReader reader, BlockPos pos,