From 9571925ddf2e8e1a7f8e3ff2ec86658c223e533e Mon Sep 17 00:00:00 2001 From: Adubbz G Date: Fri, 21 Jun 2013 19:32:10 +1000 Subject: [PATCH] Added a config option for turning Spring Water to Regular Water on pickup --- .../configuration/BOPConfiguration.java | 2 ++ .../biomesoplenty/helpers/BOPLiquidHelper.java | 11 ++++++++++- .../biomesoplenty/items/ItemBOPBucket.java | 18 ------------------ 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java index db545bcfa..fe202bd94 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java +++ b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java @@ -25,6 +25,7 @@ public class BOPConfiguration { public static boolean dungeonLoot; public static boolean vanillaEnhanced; public static boolean netherOverride; + public static boolean springWaterPickup; public static int villageDistance; @@ -510,6 +511,7 @@ public class BOPConfiguration { biomeSize = config.get("Biomes O\' Plenty World Type Settings", "Biome Size", 4, "Default World Type has 4. Large Biomes World Type has 6.").getInt(); achievements = config.get("Miscellanious Settings", "Add Biomes O\' Plenty Achievements", true).getBoolean(false); dungeonLoot = config.get("Miscellanious Settings", "Add Custom Dungeon Loot", true).getBoolean(false); + springWaterPickup = config.get("Miscellanious Settings", "Enable Spring Water Pickup", true).getBoolean(true); vanillaEnhanced = config.get("Biome Settings", "Enhanced Vanilla Biomes", true).getBoolean(false); promisedLandDimID = config.get("Dimension Settings", "Promised Land Dimension ID", 20, null).getInt(); netherOverride = config.get("Dimension Settings", "Enable Nether Override", true).getBoolean(true); diff --git a/src/minecraft/biomesoplenty/helpers/BOPLiquidHelper.java b/src/minecraft/biomesoplenty/helpers/BOPLiquidHelper.java index 53f1126e1..783b33256 100644 --- a/src/minecraft/biomesoplenty/helpers/BOPLiquidHelper.java +++ b/src/minecraft/biomesoplenty/helpers/BOPLiquidHelper.java @@ -1,6 +1,7 @@ package biomesoplenty.helpers; import net.minecraft.block.BlockFluid; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; @@ -11,6 +12,7 @@ import net.minecraftforge.event.entity.player.FillBucketEvent; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.liquids.LiquidDictionary; import biomesoplenty.api.Liquids; +import biomesoplenty.configuration.BOPConfiguration; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -50,7 +52,14 @@ public class BOPLiquidHelper { world.setBlock(pos.blockX, pos.blockY, pos.blockZ, 0); - return new ItemStack(Liquids.bopBucket.get(), 1, 0); + if (BOPConfiguration.springWaterPickup) + { + return new ItemStack(Liquids.bopBucket.get(), 1, 0); + } + else + { + return new ItemStack(Item.bucketWater); + } } if ((blockID == Liquids.liquidPoison.get().blockID) && meta == 0) diff --git a/src/minecraft/biomesoplenty/items/ItemBOPBucket.java b/src/minecraft/biomesoplenty/items/ItemBOPBucket.java index e269b1ef8..adee6dfd8 100644 --- a/src/minecraft/biomesoplenty/items/ItemBOPBucket.java +++ b/src/minecraft/biomesoplenty/items/ItemBOPBucket.java @@ -108,24 +108,6 @@ public class ItemBOPBucket extends Item if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) return par1ItemStack; - - if (par2World.getBlockMaterial(i, j, k) == Material.lava && par2World.getBlockMetadata(i, j, k) == 0) - { - par2World.setBlockToAir(i, j, k); - - if (par3EntityPlayer.capabilities.isCreativeMode) - return par1ItemStack; - - if (--par1ItemStack.stackSize <= 0) - return new ItemStack(Item.bucketLava); - - if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketLava))) - { - par3EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketLava.itemID, 1, 0)); - } - - return par1ItemStack; - } } else {