Tweak Energy Portal
All checks were successful
EnergonRelics/pipeline/head This commit looks good

This commit is contained in:
TheBrokenRail 2020-08-05 11:27:13 -04:00
parent 80dd6a0481
commit cdd97294a9
2 changed files with 5 additions and 2 deletions

View File

@ -140,9 +140,12 @@ public class EnergyPortalBlock extends SimpleBlock {
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity 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();
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