Java 类net.minecraft.block.material.MaterialTransparent 实例源码

项目:IceAndShadow2    文件:NyxBlockAltarTransfusion.java   
@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;
}
项目:IceAndShadow2    文件:NyxBlockAltarTransfusion.java   
@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);
    }
}
项目:IceAndShadow2    文件:IaSBaseBlockAirlike.java   
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();
}
项目:IceAndShadow2    文件:IaSBlockHelper.java   
public static boolean isAir(Block bl) {
    return bl == null || bl.getMaterial() instanceof MaterialTransparent;
}