@Override public boolean onBlockActivated(World w, int x, int y, int z, EntityPlayer ep, int side, float xl, float yl, float zl) { final Block check = w.getBlock(x, y + 1, z); if (check != null && !(check.getMaterial() instanceof MaterialTransparent)) { IaSPlayerHelper.messagePlayer(ep, "That altar needs an empty space above it to work."); return false; } final TileEntity te = w.getTileEntity(x, y, z); if (!(te instanceof NyxTeTransfusionAltar)) return false; final NyxTeTransfusionAltar tte = (NyxTeTransfusionAltar) te; final ItemStack is = ep.getEquipmentInSlot(0); if (is == null) { final ItemStack its = tte.handleRemove(ep, ep.isSneaking()); if (its != null) { IaSPlayerHelper.giveItem(ep, its); } return true; } if (!tte.handlePlace(ep, is)) return true; else { ep.setCurrentItemOrArmor(0, null); } if (tte.canAttemptTransmutation()) { tte.handler = IaSRegistry.getHandlerTransmutation(tte.target, tte.catalyst); if (tte.handler != null) { tte.scheduleUpdate(x, y, z, tte.handler.getTransmuteTime(tte.target, tte.catalyst)); } } return true; }
@Override public void onNeighborBlockChange(World w, int x, int y, int z, Block bl) { final Block check = w.getBlock(x, y + 1, z); if (check != null && !(check.getMaterial() instanceof MaterialTransparent)) { final TileEntity te = w.getTileEntity(x, y, z); if (!(te instanceof NyxTeTransfusionAltar)) return; final NyxTeTransfusionAltar tte = (NyxTeTransfusionAltar) te; tte.dropItems(); w.markBlockForUpdate(x, y, z); w.setBlockToAir(x, y, z); w.setBlock(x, y, z, this); } }
public IaSBaseBlockAirlike(EnumIaSModule mod, String texName) { super(mod, texName, new MaterialTransparent(MapColor.airColor)); setBlockBounds(0.5F, 0.5F, 0.5F, 0.5F, 0.5F, 0.5F); this.fullCube = false; disableStats(); }
public static boolean isAir(Block bl) { return bl == null || bl.getMaterial() instanceof MaterialTransparent; }