Java Code Examples for net.minecraft.init.Blocks#END_PORTAL
The following examples show how to use
net.minecraft.init.Blocks#END_PORTAL .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GTUtility.java From GT-Classic with GNU Lesser General Public License v3.0 | 6 votes |
public static boolean tryResetStrongholdPortal(World world, BlockPos pos) { List<BlockPos> portalBlockPos = AabbUtil.getTargets(world, pos, 5, new GTIBlockFilters.EndPortalFilter(), false, false, RotationList.ALL); if (portalBlockPos.isEmpty()) { return false; } BlockPos selectedPos = portalBlockPos.get(world.rand.nextInt(portalBlockPos.size() - 1)); IBlockState nearbyState = world.getBlockState(selectedPos); if (resetEndPortalFrame(world, selectedPos, nearbyState)) { boolean found = false; for (BlockPos portalPos : portalBlockPos) { if (world.getBlockState(portalPos).getBlock() == Blocks.END_PORTAL) { world.setBlockToAir(portalPos); world.removeTileEntity(portalPos); found = true; } } return found; } return false; }
Example 2
Source File: GTTileMagicEnergyAbsorber.java From GT-Classic with GNU Lesser General Public License v3.0 | 6 votes |
private void checkForEndPortal() { if (world.getTotalWorldTime() % 100 == 0) { this.isAbovePortal = world.getBlockState(this.pos.offset(EnumFacing.DOWN)).getBlock() == Blocks.END_PORTAL; this.updateGui(); if (this.portalMode && this.isAbovePortal) { if (world.rand.nextInt(512) == 0 && GTUtility.tryResetStrongholdPortal(world, pos)) { this.isAbovePortal = false; this.updateGui(); return; } if (GTConfig.general.oneMagicAbsorberPerEndPortal && GTUtility.tryExplodeOtherAbsorbers(this.world, this.pos)) { // TODO something here } } } }
Example 3
Source File: GTTileMagicEnergyAbsorber.java From GT-Classic with GNU Lesser General Public License v3.0 | 5 votes |
@SideOnly(Side.CLIENT) @Override public void randomTickDisplay(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) { if (this.isActive && this.portalMode && worldIn.getBlockState(this.pos.offset(EnumFacing.DOWN)).getBlock() == Blocks.END_PORTAL) { for (EnumFacing facing : EnumFacing.HORIZONTALS) { BlockPos sidePos = pos.offset(facing); if (world.getBlockState(sidePos).isFullBlock()) { continue; } for (int k = 3; k > 0; --k) { ParticleManager er = Minecraft.getMinecraft().effectRenderer; float multPos = (float) (.1 * 2) + 0.9F; double x = (double) ((float) sidePos.getX() + 0.05F + rand.nextFloat() * multPos); double y = (double) ((float) sidePos.getY() + 0.0F + rand.nextFloat() * 0.5F); double z = (double) ((float) sidePos.getZ() + 0.05F + rand.nextFloat() * multPos); double[] velocity = new double[] { 0.0D, 7.6D, 0.0D }; if (k < 4) { velocity[2] *= 0.55D; } float foo = rand.nextFloat() * .25F; float[] colour = new float[] { 0.0F, foo, foo }; er.addEffect(new EntityChargePadAuraFX(this.world, x, y, z, 8, velocity, colour, false)); } } } }
Example 4
Source File: GTIBlockFilters.java From GT-Classic with GNU Lesser General Public License v3.0 | 4 votes |
@Override public boolean isValidBlock(IBlockState state) { return state.getBlock() == Blocks.END_PORTAL || state.getBlock() == Blocks.END_PORTAL_FRAME; }
Example 5
Source File: GTIBlockFilters.java From GT-Classic with GNU Lesser General Public License v3.0 | 4 votes |
@Override public boolean isValidBlock(World world, BlockPos pos) { return world.getBlockState(pos).getBlock() == Blocks.END_PORTAL || world.getBlockState(pos).getBlock() == Blocks.END_PORTAL_FRAME; }
Example 6
Source File: MaterialCache.java From litematica with GNU Lesser General Public License v3.0 | 4 votes |
@Nullable protected ItemStack getStateToItemOverride(IBlockState state) { Block block = state.getBlock(); if (block == Blocks.PISTON_HEAD || block == Blocks.PISTON_EXTENSION || block == Blocks.PORTAL || block == Blocks.END_PORTAL || block == Blocks.END_GATEWAY) { return ItemStack.EMPTY; } else if (block == Blocks.FARMLAND) { return new ItemStack(Blocks.DIRT); } else if (block == Blocks.GRASS_PATH) { return new ItemStack(Blocks.GRASS); } else if (block == Blocks.BROWN_MUSHROOM_BLOCK) { return new ItemStack(Blocks.BROWN_MUSHROOM_BLOCK); } else if (block == Blocks.RED_MUSHROOM_BLOCK) { return new ItemStack(Blocks.RED_MUSHROOM_BLOCK); } else if (block == Blocks.LAVA) { if (state.getValue(BlockLiquid.LEVEL) == 0) { return new ItemStack(Items.LAVA_BUCKET); } else { return ItemStack.EMPTY; } } else if (block == Blocks.WATER) { if (state.getValue(BlockLiquid.LEVEL) == 0) { return new ItemStack(Items.WATER_BUCKET); } else { return ItemStack.EMPTY; } } else if (block instanceof BlockDoor && state.getValue(BlockDoor.HALF) == BlockDoor.EnumDoorHalf.UPPER) { return ItemStack.EMPTY; } else if (block instanceof BlockBed && state.getValue(BlockBed.PART) == BlockBed.EnumPartType.HEAD) { return ItemStack.EMPTY; } else if (block instanceof BlockDoublePlant && state.getValue(BlockDoublePlant.HALF) == BlockDoublePlant.EnumBlockHalf.UPPER) { return ItemStack.EMPTY; } return null; }