use of net.minecraft.block.PortalSize in project minecolonies by ldtteam.
the class EntityAIWorkNether method openPortal.
/**
* Open the portal to the nether if it's not open
*/
protected IAIState openPortal() {
// Attempt to light the portal and travel
final BlockPos portal = getOwnBuilding().getPortalLocation();
final BlockState block = world.getBlockState(portal);
if (portal != null && currentRecipeStorage != null) {
final Optional<PortalSize> ps = PortalSize.findPortalShape(world, portal, p -> p.isValid(), Direction.Axis.X);
if (!ps.isPresent()) {
// Can't find the portal
return IDLE;
}
if (!block.is(Blocks.NETHER_PORTAL)) {
useFlintAndSteel();
ps.get().createPortalBlocks();
return NETHER_LEAVE;
}
}
return START_WORKING;
}
use of net.minecraft.block.PortalSize in project minecolonies by Minecolonies.
the class EntityAIWorkNether method openPortal.
/**
* Open the portal to the nether if it's not open
*/
protected IAIState openPortal() {
// Attempt to light the portal and travel
final BlockPos portal = building.getPortalLocation();
if (portal != null && currentRecipeStorage != null) {
if (walkToBlock(portal, 1)) {
return getState();
}
final BlockState block = world.getBlockState(portal);
final Optional<PortalSize> ps = PortalSize.findPortalShape(world, portal, p -> p.isValid(), Direction.Axis.X);
if (!ps.isPresent()) {
// Can't find the portal
return IDLE;
}
if (!block.is(Blocks.NETHER_PORTAL)) {
useFlintAndSteel();
ps.get().createPortalBlocks();
return NETHER_LEAVE;
}
}
return START_WORKING;
}
Aggregations