Added a config option for turning Spring Water to Regular Water on pickup

This commit is contained in:
Adubbz G 2013-06-21 19:32:10 +10:00
parent c33cd82b00
commit 9571925ddf
3 changed files with 12 additions and 19 deletions

View File

@ -25,6 +25,7 @@ public class BOPConfiguration {
public static boolean dungeonLoot; public static boolean dungeonLoot;
public static boolean vanillaEnhanced; public static boolean vanillaEnhanced;
public static boolean netherOverride; public static boolean netherOverride;
public static boolean springWaterPickup;
public static int villageDistance; 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(); 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); 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); 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); vanillaEnhanced = config.get("Biome Settings", "Enhanced Vanilla Biomes", true).getBoolean(false);
promisedLandDimID = config.get("Dimension Settings", "Promised Land Dimension ID", 20, null).getInt(); promisedLandDimID = config.get("Dimension Settings", "Promised Land Dimension ID", 20, null).getInt();
netherOverride = config.get("Dimension Settings", "Enable Nether Override", true).getBoolean(true); netherOverride = config.get("Dimension Settings", "Enable Nether Override", true).getBoolean(true);

View File

@ -1,6 +1,7 @@
package biomesoplenty.helpers; package biomesoplenty.helpers;
import net.minecraft.block.BlockFluid; import net.minecraft.block.BlockFluid;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -11,6 +12,7 @@ import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.liquids.LiquidDictionary; import net.minecraftforge.liquids.LiquidDictionary;
import biomesoplenty.api.Liquids; import biomesoplenty.api.Liquids;
import biomesoplenty.configuration.BOPConfiguration;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -50,7 +52,14 @@ public class BOPLiquidHelper
{ {
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, 0); 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) if ((blockID == Liquids.liquidPoison.get().blockID) && meta == 0)

View File

@ -108,24 +108,6 @@ public class ItemBOPBucket extends Item
if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
return 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 else
{ {