net.minecraft.block.material.Material Java Examples
The following examples show how to use
net.minecraft.block.material.Material.
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: BlockTofuDoor.java From TofuCraftReload with MIT License | 6 votes |
public BlockTofuDoor(Material material,TofuType tofuType){ super(material); this.tofuType = tofuType; this.setCreativeTab(CommonProxy.tab); if(material== Material.WOOD) { this.setSoundType(SoundType.CLOTH); if(tofuType == TofuType.kinu){ this.setHardness(0.6F); this.setResistance(2.0F); }else { this.setHardness(0.4F); this.setResistance(1.0F); } }else { if(material== Material.IRON){ this.setSoundType(SoundType.METAL); this.setHardness(5.0F); this.setResistance(11.0F); }else { this.setSoundType(SoundType.STONE); this.setHardness(1.8F); this.setResistance(9.0F); } } }
Example #2
Source File: TriggerBot.java From ehacks-pro with GNU General Public License v3.0 | 6 votes |
@Override public void onTicks() { try { if (Wrapper.INSTANCE.mc().objectMouseOver != null && Wrapper.INSTANCE.mc().objectMouseOver.entityHit != null && this.isValidTarget(Wrapper.INSTANCE.mc().objectMouseOver.entityHit) && TriggerBot.hasReached(150 + rand.nextInt(100))) { if (Criticals.isActive && !Wrapper.INSTANCE.player().isInWater() && !Wrapper.INSTANCE.player().isInsideOfMaterial(Material.lava) && !Wrapper.INSTANCE.player().isInsideOfMaterial(Material.web) && Wrapper.INSTANCE.player().onGround) { Wrapper.INSTANCE.player().motionY = 0.1; Wrapper.INSTANCE.player().fallDistance = 0.1f; Wrapper.INSTANCE.player().onGround = false; } if (AutoBlock.isActive && Wrapper.INSTANCE.player().getCurrentEquippedItem() != null && Wrapper.INSTANCE.player().getCurrentEquippedItem().getItem() instanceof ItemSword) { ItemStack lel = Wrapper.INSTANCE.player().getCurrentEquippedItem(); lel.useItemRightClick(Wrapper.INSTANCE.world(), Wrapper.INSTANCE.player()); } Wrapper.INSTANCE.player().swingItem(); Wrapper.INSTANCE.mc().playerController.attackEntity(Wrapper.INSTANCE.player(), Wrapper.INSTANCE.mc().objectMouseOver.entityHit); this.reset(); } } catch (Exception ex) { } }
Example #3
Source File: Events.java From ehacks-pro with GNU General Public License v3.0 | 6 votes |
@SubscribeEvent public void onAttack(AttackEntityEvent event) { if (!cheatEnabled) { return; } if (!(KillAura.isActive || MobAura.isActive || ProphuntAura.isActive || Forcefield.isActive || TriggerBot.isActive || !Criticals.isActive || Wrapper.INSTANCE.player().isInWater() || Wrapper.INSTANCE.player().isInsideOfMaterial(Material.lava) || Wrapper.INSTANCE.player().isInsideOfMaterial(Material.web) || !Wrapper.INSTANCE.player().onGround || !Wrapper.INSTANCE.mcSettings().keyBindAttack.getIsKeyPressed() || Wrapper.INSTANCE.mc().objectMouseOver == null || Wrapper.INSTANCE.mc().objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.ENTITY)) { event.setCanceled(true); Wrapper.INSTANCE.player().motionY = 0.1000000014901161; Wrapper.INSTANCE.player().fallDistance = 0.1f; Wrapper.INSTANCE.player().onGround = false; event.setCanceled(false); } if (event.target instanceof EntityPlayer) { EntityPlayer e = (EntityPlayer) event.target; if (SeeHealth.isActive) { InteropUtils.log("Health of &e" + e.getCommandSenderName() + "&f: &e" + e.getHealth(), "SeeHealth"); } } }
Example #4
Source File: EntityDabSquirrel.java From CommunityMod with GNU Lesser General Public License v2.1 | 6 votes |
@Override public void fall(float distance, float damageMultiplier) { if (distance > 1.0F) { this.playSound(SoundEvents.ENTITY_HORSE_LAND, 0.4F, 1.0F); } int i = MathHelper.ceil((distance * 0.5F - 3.0F) * damageMultiplier); if (i > 0) { this.attackEntityFrom(DamageSource.FALL, i); if (this.isBeingRidden()) { for (Entity entity : this.getRecursivePassengers()) { entity.attackEntityFrom(DamageSource.FALL, i); } } BlockPos pos = new BlockPos(this.posX, this.posY - 0.2D - this.prevRotationYaw, this.posZ); IBlockState iblockstate = this.world.getBlockState(pos); Block block = iblockstate.getBlock(); if (iblockstate.getMaterial() != Material.AIR && !this.isSilent()) { SoundType soundtype = block.getSoundType(block.getDefaultState(), this.world, pos, this); this.world.playSound((EntityPlayer) null, this.posX, this.posY, this.posZ, soundtype.getStepSound(), this.getSoundCategory(), soundtype.getVolume() * 0.5F, soundtype.getPitch() * 0.75F); } } }
Example #5
Source File: MoCEntityCrocodile.java From mocreaturesdev with GNU General Public License v3.0 | 6 votes |
@Override protected void jump() { if (isInsideOfMaterial(Material.water)) // super.jump(); { if (getHasCaughtPrey() || (entityToAttack == null && rand.nextInt(20) != 0)) { return; // if (entityToAttack == null) } motionY = 0.3D; if (isSprinting()) { float f = rotationYaw * 0.01745329F; motionX -= MathHelper.sin(f) * 0.2F; motionZ += MathHelper.cos(f) * 0.2F; } isAirBorne = true; } else if (entityToAttack != null || getHasCaughtPrey()) { super.jump(); } }
Example #6
Source File: BlockBlueprintArchive.java From Cyberware with MIT License | 6 votes |
public BlockBlueprintArchive() { super(Material.IRON); setHardness(5.0F); setResistance(10.0F); setSoundType(SoundType.METAL); String name = "blueprintArchive"; this.setRegistryName(name); GameRegistry.register(this); ItemBlock ib = new ItemBlockCyberware(this, "cyberware.tooltip.blueprintArchive"); ib.setRegistryName(name); GameRegistry.register(ib); this.setUnlocalizedName(Cyberware.MODID + "." + name); this.setCreativeTab(Cyberware.creativeTab); GameRegistry.registerTileEntity(TileEntityBlueprintArchive.class, Cyberware.MODID + ":" + name); CyberwareContent.blocks.add(this); this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); }
Example #7
Source File: BlockThinLogFence.java From GardenCollection with MIT License | 5 votes |
public boolean canConnectFenceTo (IBlockAccess world, int x, int y, int z) { Block block = world.getBlock(x, y, z); if (block != this) return (block.getMaterial().isOpaque() && block.renderAsNormalBlock()) ? block.getMaterial() != Material.gourd : false; return true; }
Example #8
Source File: BlockBarrel.java From TofuCraftReload with MIT License | 5 votes |
public boolean isUnderWeight(World world, BlockPos pos) { IBlockState weightBlock = world.getBlockState(pos.up()); IBlockState baseBlock = world.getBlockState(pos.down()); boolean isWeightValid = weightBlock != null && (weightBlock.getMaterial() == Material.ROCK || weightBlock.getMaterial() == Material.IRON); float baseHardness = baseBlock.getBlockHardness(world, pos.down()); boolean isBaseValid = baseBlock.isNormalCube() && (baseBlock.getMaterial() == Material.ROCK || baseBlock.getMaterial() == Material.IRON || baseHardness >= 1.0F || baseHardness < 0.0F); return isWeightValid && isBaseValid; }
Example #9
Source File: BlockLevelEmitterFluid.java From ExtraCells1 with MIT License | 5 votes |
public BlockLevelEmitterFluid(int id) { super(id, Material.rock); setCreativeTab(extracells.Extracells.ModTab); setUnlocalizedName("block.fluid.levelemitter"); setHardness(2.0F); setResistance(10.0F); }
Example #10
Source File: IC2.java From PneumaticCraft with GNU General Public License v3.0 | 5 votes |
@Override public void preInit(){ pneumaticGenerator = new BlockPneumaticGenerator(Material.iron).setHardness(3.0F).setResistance(10.0F).setBlockName("pneumaticGenerator"); electricCompressor = new BlockElectricCompressor(Material.iron).setHardness(3.0F).setResistance(10.0F).setBlockName("electricCompressor"); Blockss.registerBlock(pneumaticGenerator); Blockss.registerBlock(electricCompressor); GameRegistry.registerTileEntity(TileEntityPneumaticGenerator.class, "TileEntityPneumaticGenerator"); GameRegistry.registerTileEntity(TileEntityElectricCompressor.class, "TileEntityElectricCompressor"); PneumaticRegistry.getInstance().registerBlockTrackEntry(new BlockTrackEntryIC2()); }
Example #11
Source File: ENBlocks.java From ExNihiloAdscensio with MIT License | 5 votes |
public static void init() { dust = new BlockBaseFalling(SoundType.CLOTH, "blockDust"); dust.setCreativeTab(ExNihiloAdscensio.tabExNihilo); dust.setHardness(0.7F); netherrackCrushed = new BlockBaseFalling(SoundType.GROUND, "blockNetherrackCrushed"); netherrackCrushed.setCreativeTab(ExNihiloAdscensio.tabExNihilo); netherrackCrushed.setHardness(0.7F); endstoneCrushed = new BlockBaseFalling(SoundType.GROUND, "blockEndstoneCrushed"); endstoneCrushed.setCreativeTab(ExNihiloAdscensio.tabExNihilo); endstoneCrushed.setHardness(0.7F); barrelWood = new BlockBarrel(0, Material.WOOD); barrelWood.setCreativeTab(ExNihiloAdscensio.tabExNihilo); GameRegistry.registerTileEntity(TileBarrel.class, "blockBarrel0"); barrelStone = new BlockBarrel(1, Material.ROCK); barrelStone.setCreativeTab(ExNihiloAdscensio.tabExNihilo); GameRegistry.registerTileEntity(TileBarrel.class, "blockBarrel1"); infestedLeaves = new BlockInfestedLeaves(); GameRegistry.registerTileEntity(TileInfestedLeaves.class, "blockInfestedLeaves"); infestedLeaves.setCreativeTab(ExNihiloAdscensio.tabExNihilo); crucible = new BlockCrucible(); crucible.setCreativeTab(ExNihiloAdscensio.tabExNihilo); GameRegistry.registerTileEntity(TileCrucible.class, "blockCrucible"); sieve = new BlockSieve(); sieve.setCreativeTab(ExNihiloAdscensio.tabExNihilo); GameRegistry.registerTileEntity(TileSieve.class, "blockSieve"); fluidWitchwater = new FluidWitchWater(); blockWitchwater = new BlockFluidWitchwater(); FluidRegistry.addBucketForFluid(fluidWitchwater); }
Example #12
Source File: PrismarineBlocks.java From Et-Futurum with The Unlicense | 5 votes |
public PrismarineBlocks() { super(Material.rock, "rough", "bricks", "dark"); setHardness(1.5F); setResistance(10.0F); setBlockTextureName("prismarine"); setBlockName(Utils.getUnlocalisedName("prismarine_block")); setCreativeTab(EtFuturum.enablePrismarine ? EtFuturum.creativeTab : null); }
Example #13
Source File: MoCEntityEgg.java From mocreaturesdev with GNU General Public License v3.0 | 5 votes |
@Override public boolean handleWaterMovement() { if (worldObj.handleMaterialAcceleration(boundingBox, Material.water, this)) { this.inWater = true; return true; } else { this.inWater = false; return false; } }
Example #14
Source File: Ladder.java From EmergingTechnology with MIT License | 5 votes |
public Ladder() { super(Material.CIRCUITS); this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); this.setRegistryName(EmergingTechnology.MODID, _name); this.setUnlocalizedName(EmergingTechnology.MODID + "." + _name); this.setCreativeTab(EmergingTechnology.TECHNOLOGYTAB); this.setSoundType(SoundType.STONE); }
Example #15
Source File: BlockCrusherBlade.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
public BlockCrusherBlade() { super(Material.IRON); setUnlocalizedName("gt.crusher_blade"); setCreativeTab(GregTechAPI.TAB_GREGTECH); setHarvestLevel("pickaxe", 2); setHardness(3.0f); setResistance(5.0f); setLightOpacity(0); setDefaultState(getDefaultState() .withProperty(AXIS, Axis.Y) .withProperty(ACTIVE, false)); }
Example #16
Source File: Hydroponic.java From EmergingTechnology with MIT License | 5 votes |
public Hydroponic() { super(Material.IRON, "hydroponic"); this.setSoundType(SoundType.METAL); setDefaultState( blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(HAS_WATER, false)); }
Example #17
Source File: TofuVillageCollection.java From TofuCraftReload with MIT License | 5 votes |
private boolean isWoodDoor(BlockPos doorPos) { IBlockState iblockstate = this.world.getBlockState(doorPos); Block block = iblockstate.getBlock(); if (block instanceof BlockDoor) { return iblockstate.getMaterial() == Material.WOOD; } else { return false; } }
Example #18
Source File: BlockWalrus.java From ExtraCells1 with MIT License | 5 votes |
public BlockWalrus(int id) { super(id, Material.rock); setCreativeTab(extracells.Extracells.ModTab); setUnlocalizedName("block.walrus"); setHardness(2.0F); setResistance(10.0F); }
Example #19
Source File: BlockTraverseWoodDoor.java From CommunityMod with GNU Lesser General Public License v2.1 | 5 votes |
public BlockTraverseWoodDoor(String name) { super(Material.WOOD); setRegistryName(new ResourceLocation(TraverseConstants.MOD_ID, name + "_door")); setTranslationKey(getRegistryName().toString()); setCreativeTab(TraverseTab.TAB); setSoundType(SoundType.WOOD); setHardness(3.0F); setHarvestLevel("axe", 0); ShootingStar.registerModel(new ModelCompound(TraverseConstants.MOD_ID, this, "door", POWERED)); }
Example #20
Source File: BlockConcrete.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
public BlockConcrete() { super(Material.ROCK); setUnlocalizedName("concrete"); setHardness(2.0f); setResistance(3.0f); setSoundType(SoundType.STONE); setHarvestLevel("pickaxe", 1); setDefaultState(withVariant( ConcreteVariant.LIGHT_CONCRETE, ChiselingVariant.NORMAL)); }
Example #21
Source File: BlockSurgeryChamber.java From Cyberware with MIT License | 5 votes |
public BlockSurgeryChamber() { super(Material.IRON); this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(OPEN, Boolean.valueOf(false)).withProperty(HALF, EnumChamberHalf.LOWER)); setHardness(5.0F); setResistance(10.0F); setSoundType(SoundType.METAL); String name = "surgeryChamber"; this.setRegistryName(name); GameRegistry.register(this); ib = new ItemSurgeryChamber(this); ib.setRegistryName(name); GameRegistry.register(ib); this.setUnlocalizedName(Cyberware.MODID + "." + name); ib.setUnlocalizedName(Cyberware.MODID + "." + name); ib.setCreativeTab(Cyberware.creativeTab); GameRegistry.registerTileEntity(TileEntitySurgeryChamber.class, Cyberware.MODID + ":" + name); CyberwareContent.items.add(ib); }
Example #22
Source File: BlockEnderUtilities.java From enderutilities with GNU Lesser General Public License v3.0 | 5 votes |
public BlockEnderUtilities(String name, float hardness, float resistance, int harvestLevel, Material material) { super(material); this.setHardness(hardness); this.setResistance(resistance); this.setHarvestLevel("pickaxe", harvestLevel); this.setCreativeTab(CreativeTab.ENDER_UTILITIES_TAB); this.setSoundType(SoundType.STONE); this.blockName = name; this.unlocalizedNames = this.generateUnlocalizedNames(); this.tooltipNames = this.generateTooltipNames(); }
Example #23
Source File: GTBlockBattery.java From GT-Classic with GNU Lesser General Public License v3.0 | 5 votes |
public GTBlockBattery(String name, int tier, int transferLimit, int maxCharge) { super(Material.GROUND, GTLang.BATTERYBLOCK_LV, 3); this.maxCharge = maxCharge; this.transferLimit = transferLimit; this.tier = tier; this.name = name; this.setRegistryName(name.toLowerCase()); this.setResistance(20.0F); this.setSoundType(SoundType.METAL); this.setCreativeTab(GTMod.creativeTabGT); this.setHardness(0.2F); this.setSoundType(SoundType.CLOTH); }
Example #24
Source File: BlockMineral.java From GregTech with GNU Lesser General Public License v3.0 | 5 votes |
public BlockMineral() { super(Material.ROCK); setUnlocalizedName("mineral"); setHardness(3.0f); setResistance(6.0f); setSoundType(SoundType.STONE); setHarvestLevel("pickaxe", 1); setDefaultState(withVariant( MineralVariant.MARBLE, ChiselingVariant.NORMAL)); }
Example #25
Source File: BlockSnakestone.java From Chisel with GNU General Public License v2.0 | 5 votes |
public BlockSnakestone(String iconPrefix) { super(Material.rock); setHardness(1.5F); setResistance(10.0F); setStepSound(Block.soundTypeStone); setCreativeTab(Chisel.tabChisel); flipTopTextures = false; this.iconPrefix = iconPrefix; }
Example #26
Source File: CoarseDirt.java From Et-Futurum with The Unlicense | 5 votes |
public CoarseDirt() { super(Material.ground); setHardness(0.5F); setHarvestLevel("shovel", 0); setStepSound(soundTypeGravel); setBlockTextureName("coarse_dirt"); setBlockName(Utils.getUnlocalisedName("coarse_dirt")); setCreativeTab(EtFuturum.enableCoarseDirt ? EtFuturum.creativeTab : null); }
Example #27
Source File: BlockMarbleLamp.java From Chisel with GNU General Public License v2.0 | 5 votes |
public BlockMarbleLamp() { super(Material.redstoneLight); powered = false; blockUnpowered = this; blockPowered = new BlockMarbleLamp(this); setHardness(0.3F); }
Example #28
Source File: BlockLooseRocks.java From TFC2 with GNU General Public License v3.0 | 5 votes |
public BlockLooseRocks() { super(Material.GROUND, META_PROPERTY); this.setCreativeTab(TFCTabs.TFCBuilding); this.setBlockBounds(0.2f, 0, 0.2f, 0.8f, 0.1f, 0.8f); setSoundType(SoundType.STONE); setShowInCreative(false); this.setBreaksWhenSuspended(true); }
Example #29
Source File: BlockPortalPanel.java From enderutilities with GNU Lesser General Public License v3.0 | 5 votes |
public BlockPortalPanel(String name, float hardness, float resistance, int harvestLevel, Material material) { super(name, hardness, resistance, harvestLevel, material); this.propFacing = FACING; this.setDefaultState(this.getBlockState().getBaseState().withProperty(FACING, BlockEnderUtilities.DEFAULT_FACING)); }
Example #30
Source File: BlockNoren.java From Sakura_mod with MIT License | 5 votes |
public BlockNoren() { super(Material.CLOTH, false); this.setCreativeTab(CommonProxy.tab); this.setSoundType(SoundType.CLOTH); this.setTickRandomly(true); this.setResistance(0.5f); this.setHardness(0.5f); }