Search in sources :

Example 1 with BlockAnvil

use of net.minecraft.block.BlockAnvil in project SpongeCommon by SpongePowered.

the class DefaultTeleportHelperFilter method isSafeBodyMaterial.

@Override
public boolean isSafeBodyMaterial(BlockState blockState) {
    IBlockState state = BlockUtil.toNative(blockState);
    Material material = state.getMaterial();
    // Deny blocks that suffocate
    if (state.causesSuffocation()) {
        return false;
    }
    // Deny dangerous lava
    if (material == Material.LAVA) {
        return false;
    }
    // Deny non-passable non "full" blocks
    return !(state.getBlock() instanceof BlockSlab || state.getBlock() instanceof BlockCauldron || state.getBlock() instanceof BlockAnvil || state.getBlock() instanceof BlockFence || state.getBlock() instanceof BlockChorusPlant || state.getBlock() instanceof BlockSnow || material == Material.GLASS || material == Material.LEAVES);
}
Also used : BlockSnow(net.minecraft.block.BlockSnow) IBlockState(net.minecraft.block.state.IBlockState) BlockSlab(net.minecraft.block.BlockSlab) BlockCauldron(net.minecraft.block.BlockCauldron) BlockAnvil(net.minecraft.block.BlockAnvil) Material(net.minecraft.block.material.Material) BlockFence(net.minecraft.block.BlockFence) BlockChorusPlant(net.minecraft.block.BlockChorusPlant)

Example 2 with BlockAnvil

use of net.minecraft.block.BlockAnvil in project BaseMetals by MinecraftModDevelopmentMods.

the class Blocks method maybeMakeItemBlock.

private static void maybeMakeItemBlock(final Block block, final MMDMaterial material, final String fullName) {
    if (!(block instanceof BlockAnvil) && !(block instanceof BlockDoor) && !(block instanceof BlockSlab) && (!material.isEmpty())) {
        final ItemBlock itemBlock = new ItemMMDBlock(material, block);
        itemBlock.setRegistryName(block.getRegistryName());
        itemBlock.setUnlocalizedName(block.getRegistryName().getResourceDomain() + "." + fullName);
        material.addNewItem("ItemBlock_" + fullName, itemBlock);
    }
}
Also used : BlockDoor(net.minecraft.block.BlockDoor) ItemMMDBlock(com.mcmoddev.lib.item.ItemMMDBlock) BlockSlab(net.minecraft.block.BlockSlab) BlockAnvil(net.minecraft.block.BlockAnvil) ItemBlock(net.minecraft.item.ItemBlock)

Aggregations

BlockAnvil (net.minecraft.block.BlockAnvil)2 BlockSlab (net.minecraft.block.BlockSlab)2 ItemMMDBlock (com.mcmoddev.lib.item.ItemMMDBlock)1 BlockCauldron (net.minecraft.block.BlockCauldron)1 BlockChorusPlant (net.minecraft.block.BlockChorusPlant)1 BlockDoor (net.minecraft.block.BlockDoor)1 BlockFence (net.minecraft.block.BlockFence)1 BlockSnow (net.minecraft.block.BlockSnow)1 Material (net.minecraft.block.material.Material)1 IBlockState (net.minecraft.block.state.IBlockState)1 ItemBlock (net.minecraft.item.ItemBlock)1