This commit is contained in:
parent
80dd6a0481
commit
cdd97294a9
@ -140,9 +140,12 @@ public class EnergyPortalBlock extends SimpleBlock {
|
|||||||
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
|
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
|
||||||
super.onEntityCollision(state, world, pos, entity);
|
super.onEntityCollision(state, world, pos, entity);
|
||||||
|
|
||||||
if (!world.isClient() && !entity.hasVehicle() && entity.canUsePortals() && !((PortalCooldownEntity) entity).isEnergyPortalCooldown() && VoxelShapes.matchesAnywhere(VoxelShapes.cuboid(entity.getBoundingBox().offset(-pos.getX(), -pos.getY(), -pos.getZ())), state.getOutlineShape(world, pos), BooleanBiFunction.AND)) {
|
if (!world.isClient() && !entity.hasVehicle() && entity.canUsePortals() && VoxelShapes.matchesAnywhere(VoxelShapes.cuboid(entity.getBoundingBox().offset(-pos.getX(), -pos.getY(), -pos.getZ())), state.getOutlineShape(world, pos), BooleanBiFunction.AND)) {
|
||||||
|
boolean cooling = ((PortalCooldownEntity) entity).isEnergyPortalCooldown();
|
||||||
((PortalCooldownEntity) entity).resetEnergyPortalCooldown();
|
((PortalCooldownEntity) entity).resetEnergyPortalCooldown();
|
||||||
EnergyTeleporter.teleport((ServerWorld) world, entity.getPos(), pos, entity);
|
if (!cooling) {
|
||||||
|
EnergyTeleporter.teleport((ServerWorld) world, entity.getPos(), pos, entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 490 B |
Reference in New Issue
Block a user