@Override public Material getMaterial(IBlockState state) { // Fahrenheit 451 = 505.928 Kelvin // The temperature at which book-paper catches fire, and burns. if (temperature > 505) { return Material.LAVA; } else { return super.getMaterial(state); } }
@Override public Boolean isEntityInsideMaterial(IBlockAccess world, BlockPos blockpos, IBlockState iblockstate, Entity entity, double yToTest, Material materialIn, boolean testingHead) { if (this.density < 0) { return false; } if (testingHead) { return true; } // if (iblockstate.getMaterial().equals(this.blockMaterial)) { // if (yToTest <= blockpos.getY() + 1 + getQuantaPercentage(world, blockpos)) { // return true; // } // } return super.isEntityInsideMaterial(world, blockpos, iblockstate, entity, yToTest, materialIn, testingHead); }
@Override public boolean canDisplace(IBlockAccess world, BlockPos pos) { IBlockState blockState = world.getBlockState(pos); return !blockState.getMaterial().isLiquid() && super.canDisplace(world, pos); }
@Override public boolean displaceIfPossible(World world, BlockPos pos) { IBlockState blockState = world.getBlockState(pos); return !blockState.getMaterial().isLiquid() && super.displaceIfPossible(world, pos); }
@Override public void create() { fluidPlantMilk = new Fluid("plant_milk", new ResourceLocation(ModInfo.MODID_LOWER, "blocks/plant_milk_still"), new ResourceLocation(ModInfo.MODID_LOWER, "blocks/plant_milk_flow")); FluidRegistry.registerFluid(fluidPlantMilk); plantMilk = new BlockFluidClassic(fluidPlantMilk, Material.WATER) .setUnlocalizedName(ModInfo.MODID + ".plantMilk") .setRegistryName(ModInfo.MODID_LOWER, "plantMilk"); fluidPlantMilk.setBlock(plantMilk); fluidPlantMilk.setUnlocalizedName(plantMilk.getUnlocalizedName()); GameRegistry.register(plantMilk); GameRegistry.register(new ItemBlock(plantMilk).setRegistryName(plantMilk.getRegistryName())); FluidRegistry.addBucketForFluid(fluidPlantMilk); bucketPlantMilk = new ItemStack(Items.MILK_BUCKET); bucketPlantMilk.setStackDisplayName("Plant Milk Bucket"); }
BlockFluidBase fluidBlock = new BlockFluidClassic(fluid, net.minecraft.block.material.Material.WATER); fluidBlock.setRegistryName("fluid." + materialName); MetaBlocks.FLUID_BLOCKS.add(fluidBlock);
blockMoltenTritanium = register((BlockFluidClassic) new BlockFluidClassic(OverdriveFluids.moltenTritanium, Material.LAVA).setRegistryName(new ResourceLocation(Reference.MOD_ID, "molten_tritanium")));
@Override public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { super.updateTick(world, pos, state, rand);
@Override public boolean canDisplace(IBlockAccess world, BlockPos pos) { if (!shouldDisplaceFluids && world.getBlockState(pos).getMaterial().isLiquid()) { return false; } return super.canDisplace(world, pos); }
@Override public boolean displaceIfPossible(World world, BlockPos pos) { IBlockState blockState = world.getBlockState(pos); return !blockState.getMaterial().isLiquid() && super.displaceIfPossible(world, pos); }
@Override public void create() { fluidSoapSolution = new Fluid("fluid_soap_solution", new ResourceLocation(ModInfo.MODID_LOWER, "blocks/soap_solution_still"), new ResourceLocation(ModInfo.MODID_LOWER, "blocks/soap_solution_flow")); FluidRegistry.registerFluid(fluidSoapSolution); blockFluidSoapSolution = new BlockFluidClassic(fluidSoapSolution, Material.WATER) .setUnlocalizedName(ModInfo.MODID + ".fluidSoapSolution") .setRegistryName(ModInfo.MODID_LOWER, "fluidSoapSolution"); fluidSoapSolution.setBlock(blockFluidSoapSolution); fluidSoapSolution.setUnlocalizedName(blockFluidSoapSolution.getUnlocalizedName()); GameRegistry.register(blockFluidSoapSolution); GameRegistry.register(new ItemBlock(blockFluidSoapSolution).setRegistryName(blockFluidSoapSolution.getRegistryName())); soapSolution = new ItemSoapSolution() .setUnlocalizedName(ModInfo.MODID + ".soapSolution") .setCreativeTab(VeganOption.creativeTab) .setRegistryName(ModInfo.MODID_LOWER, "soapSolution") .setContainerItem(Items.GLASS_BOTTLE); GameRegistry.register(soapSolution); FluidContainerRegistry.registerFluidContainer(new FluidStack(fluidSoapSolution, Fluid.BUCKET_VOLUME), new ItemStack(soapSolution), new ItemStack(soapSolution.getContainerItem())); frozenBubble = new ItemFrozenBubble() .setUnlocalizedName(ModInfo.MODID + ".frozenBubble") .setCreativeTab(VeganOption.creativeTab) .setRegistryName(ModInfo.MODID_LOWER, "frozenBubble"); GameRegistry.register(frozenBubble); EntityRegistry.registerModEntity(EntityBubble.class, "bubble", ContentHelper.ENTITYID_BUBBLE, ModInfo.MODID, 80, 1, true); }
@Override public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { super.updateTick(world, pos, state, rand);
@Override public boolean canDisplace(IBlockAccess world, BlockPos pos) { IBlockState blockState = world.getBlockState(pos); return !blockState.getMaterial().isLiquid() && super.canDisplace(world, pos); }
@Override public boolean displaceIfPossible(World world, BlockPos pos) { IBlockState state = world.getBlockState(pos); return !state.getMaterial().isLiquid() && super.displaceIfPossible(world, pos); } }
@Override public void create() { oilPresser = new ItemStack(Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE); seedSunflower = new ItemFood(1, 0.05f, false) .setUnlocalizedName(ModInfo.MODID + ".seedSunflower") .setCreativeTab(VeganOption.creativeTab) .setRegistryName(ModInfo.MODID_LOWER, "seedsSunflower"); GameRegistry.register(seedSunflower); fluidVegetableOil = new Fluid("fluid_oil_vegetable", new ResourceLocation(ModInfo.MODID_LOWER, "blocks/vegetable_oil_still"), new ResourceLocation(ModInfo.MODID_LOWER, "blocks/vegetable_oil_flow")); FluidRegistry.registerFluid(fluidVegetableOil); fluidBlockVegetableOil = new BlockFluidClassic(fluidVegetableOil, Material.WATER) .setUnlocalizedName(ModInfo.MODID + ".fluidOilVegetable") .setRegistryName(ModInfo.MODID_LOWER, "fluidOilVegetable"); fluidVegetableOil.setBlock(fluidBlockVegetableOil); fluidVegetableOil.setUnlocalizedName(fluidBlockVegetableOil.getUnlocalizedName()); GameRegistry.register(fluidBlockVegetableOil); GameRegistry.register(new ItemBlock(fluidBlockVegetableOil).setRegistryName(fluidBlockVegetableOil.getRegistryName())); oilVegetable = new Item() .setUnlocalizedName(ModInfo.MODID + ".oilVegetable") .setCreativeTab(VeganOption.creativeTab) .setRegistryName(ModInfo.MODID_LOWER, "oilVegetable") .setContainerItem(Items.GLASS_BOTTLE); GameRegistry.register(oilVegetable); FluidContainerRegistry.registerFluidContainer(new FluidStack(fluidVegetableOil, Fluid.BUCKET_VOLUME), new ItemStack(oilVegetable), new ItemStack(oilVegetable.getContainerItem())); }
@Override public Material getMaterial(IBlockState state) { // Fahrenheit 451 = 505.928 Kelvin // The temperature at which book-paper catches fire, and burns. if (temperature > 505) { return Material.LAVA; } else { return super.getMaterial(state); } }
@Override public Boolean isEntityInsideMaterial(@Nonnull IBlockAccess world, @Nonnull BlockPos blockpos, @Nonnull IBlockState iblockstate, @Nonnull Entity entity, double yToTest, @Nonnull Material materialIn, boolean testingHead) { if (materialIn == material || materialIn == this.blockMaterial) { return Boolean.TRUE; } return super.isEntityInsideMaterial(world, blockpos, iblockstate, entity, yToTest, materialIn, testingHead); }
@Override public boolean canDisplace(IBlockAccess world, BlockPos pos) { if (world.getBlockState(pos).getMaterial().isLiquid()) return false; return super.canDisplace(world, pos); }
@Override public boolean displaceIfPossible(World world, BlockPos pos) { if (world.getBlockState(pos).getMaterial().isLiquid()) return false; return super.displaceIfPossible(world, pos); }
blackInk = new BlockFluidClassic(blackInkFluid, Material.WATER) .setUnlocalizedName(ModInfo.MODID + ".inkBlack") .setRegistryName(ModInfo.MODID_LOWER, "inkBlack"); blackInkFluid.setBlock(blackInk); whiteInk = new BlockFluidClassic(whiteInkFluid, Material.WATER) .setUnlocalizedName(ModInfo.MODID + ".inkWhite") .setRegistryName(ModInfo.MODID_LOWER, "inkWhite"); whiteInkFluid.setBlock(whiteInk);