Java 类net.minecraft.block.BlockPressurePlate 实例源码

项目:harshencastle    文件:HarshenDimensionalFlatPlate.java   
public HarshenDimensionalFlatPlate() {
    super(Material.ROCK, BlockPressurePlate.Sensitivity.MOBS);
    setUnlocalizedName("harshen_dimensional_flat_plate");
    setRegistryName("harshen_dimensional_flat_plate");
    setHarvestLevel("pickaxe", 3);
       setHardness(3000.0f);
       setResistance(3000.0f);
}
项目:shifted-snow    文件:ClassProviders.java   
public static void addBush() {
  ShiftedSnowApi.addSimpleClassMapping(BlockBush.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockSign.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockAnvil.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockBush.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockPressurePlate.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockLever.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockRailBase.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockTripWire.class, EnumSnowType.MINUS_FULL);
  ShiftedSnowApi.addSimpleClassMapping(BlockTripWireHook.class, EnumSnowType.MINUS_FULL);
}
项目:PrimitiveCraft    文件:TileGrinder.java   
public boolean hasPressureplate()
{
    if(worldObj.getBlock(xCoord, yCoord + 1, zCoord) instanceof BlockPressurePlate)
    {
        return true;
    }
    return false;
}
项目:WuppyMods    文件:ModBlocks.java   
public static void loadBlocks()
{
    expore = new BlockExp();
    spell = new BlockSpell(BlockPressurePlate.Sensitivity.everything, Material.wood);

    GameRegistry.registerBlock(expore, ItemMagicalOresblock.class, "expore");
    GameRegistry.registerBlock(spell, ItemSpellBlock.class, "spell");
}
项目:WuppyMods    文件:BlockSpell.java   
public BlockSpell(BlockPressurePlate.Sensitivity sensitivity, Material par4Material)
{
    super(Material.wood);
    this.sensitivity = sensitivity;
    setTickRandomly(true);
    float var5 = 0.0625F;
    setBlockBounds(var5, 0.0F, var5, 1.0F - var5, 0.03125F, 1.0F - var5);
    setCreativeTab(MagicalExperience.meBlocks);
    setHardness(0.5F);
    setStepSound(soundTypeWood);
    setBlockName("spell");
}
项目:Artifacts    文件:BlockArtifactsPressurePlate.java   
public BlockArtifactsPressurePlate(String name, Material material, BlockPressurePlate.Sensitivity mobType, boolean invis, boolean camo) {
    super(name, material);
    this.invisible = invis;
    this.camouflaged = camo;
    this.triggerMobType = mobType;
    setHardness(0.5F);
    setStepSound(mobType == BlockPressurePlate.Sensitivity.everything ? Block.soundTypeWood : Block.soundTypeStone);
    setCreativeTab(DragonArtifacts.tabGeneral);
}
项目:Artifacts    文件:BlockArtifactsPressurePlate.java   
@Override
//getPlateState
protected int func_150065_e(World world, int x, int y, int z)
{
    List list = null;

    if (this.triggerMobType == BlockPressurePlate.Sensitivity.everything)
    {
        list = world.getEntitiesWithinAABBExcludingEntity((Entity)null, this.func_150061_a/*getSensitiveAABB*/(x, y, z));
    }

    if (this.triggerMobType == BlockPressurePlate.Sensitivity.mobs)
    {
        list = world.getEntitiesWithinAABB(EntityLivingBase.class, this.func_150061_a(x, y, z));
    }

    if (this.triggerMobType == BlockPressurePlate.Sensitivity.players)
    {
        list = world.getEntitiesWithinAABB(EntityPlayer.class, this.func_150061_a(x, y, z));
    }

    if (!list.isEmpty())
    {
        Iterator iterator = list.iterator();

        while (iterator.hasNext())
        {
            Entity entity = (Entity)iterator.next();

            if (!entity.doesEntityNotTriggerPressurePlate())
            {
                return 15;
            }
        }
    }

    return 0;
}
项目:Artifacts    文件:BlockWallPlate.java   
public BlockWallPlate(String textureName, Material material, BlockPressurePlate.Sensitivity triggerMob, boolean camo) {
    super(textureName, material);
    this.triggerMobType = triggerMob;
    this.camouflage = camo;
    setHardness(0.5F);
    setStepSound(triggerMob == BlockPressurePlate.Sensitivity.everything ? Block.soundTypeWood : Block.soundTypeStone);
    setCreativeTab(DragonArtifacts.tabGeneral);
}
项目:Artifacts    文件:BlockWallPlate.java   
@Override
//getPlateState
protected int func_150065_e(World world, int x, int y, int z)
{
    List list = null;
    int meta = world.getBlockMetadata(x, y, z);
    if (this.triggerMobType == BlockPressurePlate.Sensitivity.everything)
    {
        list = world.getEntitiesWithinAABBExcludingEntity((Entity)null, this.getMetaSensitiveAABB(x, y, z, meta));
    }

    if (this.triggerMobType == BlockPressurePlate.Sensitivity.mobs)
    {
        list = world.getEntitiesWithinAABB(EntityLivingBase.class, this.getMetaSensitiveAABB(x, y, z, meta));
    }

    if (this.triggerMobType == BlockPressurePlate.Sensitivity.players)
    {
        list = world.getEntitiesWithinAABB(EntityPlayer.class, this.getMetaSensitiveAABB(x, y, z, meta));
    }

    if (!list.isEmpty())
    {
        Iterator iterator = list.iterator();

        while (iterator.hasNext())
        {
            Entity entity = (Entity)iterator.next();
            if (!entity.doesEntityNotTriggerPressurePlate())
            {
                return 15;
            }
        }
    }


    return 0;
}
项目:Obsidian    文件:InternalAddon.java   
private void testAlphaContent() {
    final Material customMovingMaterial = new Material(MapColor.brownColor);
    new SimpleMovingBlock(this, "0b", "0b (Black)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "0w", "0w (White)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "1b", "1b (Black)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "1w", "1w (White)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "2b", "2b (Black)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "2w", "2w (White)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "3b", "3b (Black)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "3w", "3w (White)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "4b", "4b (Black)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "4w", "4w (White)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "5b", "5b (Black)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "5w", "5w (White)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "6b", "6b (Black)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "6w", "6w (White)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "7b", "7b (Black)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "7w", "7w (White)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "8b", "8b (Black)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "8w", "8w (White)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "9b", "9b (Black)", customMovingMaterial, true);
    new SimpleMovingBlock(this, "9w", "9w (White)", customMovingMaterial, true);

    new SimpleSword(this, "simple_blade", "Simple Blade", Item.ToolMaterial.EMERALD, true);
    new SimpleAxe(this, "simple_axe", "Simple Axe", Item.ToolMaterial.EMERALD, true);
    new SimplePickaxe(this, "simple_pickaxe", "Simple Pickaxe", Item.ToolMaterial.EMERALD, true);
    new SimpleSpade(this, "simple_shovel", "Simple Shovel", Item.ToolMaterial.EMERALD, true);

    final ItemArmor.ArmorMaterial customArmorMaterial = EnumHelper.addArmorMaterial("Custom", 100, new int[] {2, 3, 2, 2}, 15);
    new SimpleArmor(this, "simple_helmet", "Simple Helmet", customArmorMaterial, SimpleArmor.ArmorType.HEAD, true);
    new SimpleArmor(this, "simple_chestplate", "Simple Chestplate", customArmorMaterial, SimpleArmor.ArmorType.TORSO, true);
    new SimpleArmor(this, "simple_leggings", "Simple Leggings", customArmorMaterial, SimpleArmor.ArmorType.LEGS, true);
    new SimpleArmor(this, "simple_boots", "Simple Boots", customArmorMaterial, SimpleArmor.ArmorType.FEET, true);

    final Material customSlabMaterial = new Material(MapColor.blueColor);
    new SimpleSlab(this, "simple_slab", "Simple Slab", customSlabMaterial, true);

    final Material customBlockMaterial = new Material(MapColor.clayColor);
    final SimpleBlock block = new SimpleBlock(this, "simple_renderer", "Simple Renderer", customBlockMaterial, true);
    if (getGame().getSide().isClient()) {
        setupBlockRenderer(block);
    }

    final Material customFluidMaterial = new Material(MapColor.diamondColor);
    new SimpleBlockFluid(this, "simple_fluid", "Simple Fluid", customFluidMaterial, true);

    final Material customPressurePlate = new Material(MapColor.adobeColor);
    new SimplePressurePlate(this, "simple_plate", "Simple Plate", customPressurePlate, true, BlockPressurePlate.Sensitivity.everything);

    new SimpleFlower(this, "simple_flower", "Simple Flower", true);

    final Material customTrapDoor = new Material(MapColor.woodColor);
    new SimpleTrapDoor(this, "simple_trapdoor", "Simple Trapdoor", customTrapDoor, true);

    new SimpleBow(this, "simple_bow", "Simple Bow", true, 1);

    new SimpleCake(this, "simple_cake", "Simple Cake", Material.cake, true);

    new SimpleFlowerPot(this, "simple_flower_pot", "Simple Flower Pot", true);

    new SimpleLever(this, "simple_lever", "SimpleLever", true);

    new SimpleCactus(this, "simple_cactus", "Simple Cactus", true);
}
项目:WuppyMods    文件:BlockSpell.java   
@SuppressWarnings("rawtypes")
private void setStateIfMobInteractsWithPlate(World par1World, int par2, int par3, int par4)
   {
       boolean var5 = par1World.getBlockMetadata(par2, par3, par4) == 1;
       boolean var6 = false;
       float var7 = 0.125F;
       List var8 = null;

       if (this.sensitivity == BlockPressurePlate.Sensitivity.everything)
       {
           var8 = par1World.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getBoundingBox((double)((float)par2 + var7), (double)par3, (double)((float)par4 + var7), (double)((float)(par2 + 1) - var7), (double)par3 + 0.25D, (double)((float)(par4 + 1) - var7)));
       }

       if (this.sensitivity == BlockPressurePlate.Sensitivity.mobs)
       {
           var8 = par1World.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox((double)((float)par2 + var7), (double)par3, (double)((float)par4 + var7), (double)((float)(par2 + 1) - var7), (double)par3 + 0.25D, (double)((float)(par4 + 1) - var7)));
       }

       if (this.sensitivity == BlockPressurePlate.Sensitivity.players)
       {
           var8 = par1World.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox((double)((float)par2 + var7), (double)par3, (double)((float)par4 + var7), (double)((float)(par2 + 1) - var7), (double)par3 + 0.25D, (double)((float)(par4 + 1) - var7)));
       }

       if (!var8.isEmpty())
       {
           var6 = true;
       }

       if (var6 && !var5)
       {
           par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2);
           par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this);
           par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this);
           par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F);
       }

       if (!var6 && var5)
       {
           par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 2);
           par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this);
           par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this);
           par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F);
       }

       if (var6)
       {
           par1World.scheduleBlockUpdate(par2, par3, par4, this, this.tickRate(par1World));
       }
   }