diff --git a/common/biomesoplenty/api/Items.java b/common/biomesoplenty/api/Items.java index c07dc97d9..e8455b6ef 100644 --- a/common/biomesoplenty/api/Items.java +++ b/common/biomesoplenty/api/Items.java @@ -48,4 +48,5 @@ public class Items public static Optional soulManipulator = Optional.absent(); public static Optional flowerBand = Optional.absent(); + public static Optional wadingBoots = Optional.absent(); } diff --git a/common/biomesoplenty/armor/ArmorWadingBoots.java b/common/biomesoplenty/armor/ArmorWadingBoots.java new file mode 100644 index 000000000..db96ac43a --- /dev/null +++ b/common/biomesoplenty/armor/ArmorWadingBoots.java @@ -0,0 +1,37 @@ +package biomesoplenty.armor; + +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.item.EnumArmorMaterial; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import biomesoplenty.BiomesOPlenty; +import biomesoplenty.api.Items; + +public class ArmorWadingBoots extends ItemArmor +{ + public int textureID = 0; + + public ArmorWadingBoots(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) + { + super(par1, par2EnumArmorMaterial, par3, par4); + textureID = par4; + setMaxDamage(0); + setCreativeTab(BiomesOPlenty.tabBiomesOPlenty); + } + + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { + if (stack.itemID == Items.wadingBoots.get().itemID) + return "biomesoplenty:textures/armor/wadingboots.png"; + + return null; + } + + @Override + public void registerIcons(IconRegister iconRegister) + { + if (textureID == 3) { itemIcon = iconRegister.registerIcon("biomesoplenty:wadingboots"); } + } +} diff --git a/common/biomesoplenty/blocks/BlockMud.java b/common/biomesoplenty/blocks/BlockMud.java index 019b6bc82..f9f1213f6 100644 --- a/common/biomesoplenty/blocks/BlockMud.java +++ b/common/biomesoplenty/blocks/BlockMud.java @@ -8,7 +8,13 @@ import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; @@ -82,9 +88,35 @@ public class BlockMud extends Block { if (world.getBlockMetadata(x, y, z) == 0) { - entity.motionX *= 0.1D; - entity.motionZ *= 0.1D; - } else { + if (!world.isRemote) + { + if (entity instanceof EntityLivingBase) + { + if (entity instanceof EntityPlayer) + { + InventoryPlayer inventory = ((EntityPlayer)entity).inventory; + + if (inventory.armorInventory[0] != null && inventory.armorInventory[0].itemID != Items.wadingBoots.get().itemID) + { + entity.motionX *= 0.1D; + entity.motionZ *= 0.1D; + } + } + else + { + entity.motionX *= 0.1D; + entity.motionZ *= 0.1D; + } + } + else + { + entity.motionX *= 0.1D; + entity.motionZ *= 0.1D; + } + } + } + else + { entity.setInWeb(); } } diff --git a/common/biomesoplenty/configuration/BOPConfiguration.java b/common/biomesoplenty/configuration/BOPConfiguration.java index 4637cdd8c..86c881e21 100644 --- a/common/biomesoplenty/configuration/BOPConfiguration.java +++ b/common/biomesoplenty/configuration/BOPConfiguration.java @@ -674,6 +674,7 @@ public class BOPConfiguration public static int scytheAmethystID; public static int flowerBandID; + public static int wadingBootsID; //Liquid IDs public static int springWaterStillID; @@ -971,6 +972,8 @@ public class BOPConfiguration scytheMudID = config.getItem("Mud Scythe ID", 21086).getInt(); scytheAmethystID = config.getItem("Amethyst Scythe ID", 21087).getInt(); + wadingBootsID = config.getItem("Wading Boots ID", 21088).getInt(); + //Liquid Ids springWaterStillID = config.get("Liquid IDs", "Spring Water Still ID (ID before this must be free!)", 1971, null).getInt(); liquidPoisonStillID = config.get("Liquid IDs", "Liquid Poison Still ID (ID before this must be free!)", 1973, null).getInt(); diff --git a/common/biomesoplenty/configuration/BOPItems.java b/common/biomesoplenty/configuration/BOPItems.java index e19e781d5..81a17686f 100644 --- a/common/biomesoplenty/configuration/BOPItems.java +++ b/common/biomesoplenty/configuration/BOPItems.java @@ -13,6 +13,7 @@ import biomesoplenty.api.Items; import biomesoplenty.armor.ArmorAmethyst; import biomesoplenty.armor.ArmorFlowerBand; import biomesoplenty.armor.ArmorMuddy; +import biomesoplenty.armor.ArmorWadingBoots; import biomesoplenty.items.ItemBOP; import biomesoplenty.items.ItemBOPAncientStaff; import biomesoplenty.items.ItemBOPAxe; @@ -45,6 +46,7 @@ public class BOPItems { public static EnumArmorMaterial EnumArmorMaterialAmethyst; public static EnumToolMaterial EnumToolMaterialAmethyst; public static EnumArmorMaterial EnumArmorMaterialFlowerBand; + public static EnumArmorMaterial EnumArmorMaterialWadingBoots; public static int clearItem(Item var1) { @@ -87,6 +89,7 @@ public class BOPItems { EnumArmorMaterialAmethyst = EnumHelper.addArmorMaterial("AMETHYST", 40, new int[]{6, 12, 10, 6}, 20); EnumToolMaterialAmethyst = EnumHelper.addToolMaterial("AMETHYST", 4, 2013, 15.0F, 5, 16); EnumArmorMaterialFlowerBand = EnumHelper.addArmorMaterial("FLOWERBAND", -1, new int[]{0, 0, 0, 0}, 0); + EnumArmorMaterialWadingBoots = EnumHelper.addArmorMaterial("WADINGBOOTS", -1, new int[]{0, 0, 0, 0}, 0); initializeItems(); @@ -141,5 +144,6 @@ public class BOPItems { Items.scytheAmethyst = Optional.of((new ItemBOPScythe(BOPConfiguration.IDs.scytheAmethystID, 2, EnumToolMaterialAmethyst, 6).setUnlocalizedName("bop.scytheAmethyst"))); Items.flowerBand = Optional.of((new ArmorFlowerBand(BOPConfiguration.IDs.flowerBandID, EnumArmorMaterialFlowerBand, BiomesOPlenty.proxy.addArmor("flowerBand"), 0)).setCreativeTab(BiomesOPlenty.tabBiomesOPlenty).setUnlocalizedName("bop.flowerBand")); + Items.wadingBoots = Optional.of((new ArmorWadingBoots(BOPConfiguration.IDs.wadingBootsID, EnumArmorMaterialWadingBoots, BiomesOPlenty.proxy.addArmor("wadingBoots"), 3)).setCreativeTab(BiomesOPlenty.tabBiomesOPlenty).setUnlocalizedName("bop.wadingBoots")); } } diff --git a/resources/assets/biomesoplenty/lang/en_US.xml b/resources/assets/biomesoplenty/lang/en_US.xml index 83d08d12c..7ac0ac757 100644 --- a/resources/assets/biomesoplenty/lang/en_US.xml +++ b/resources/assets/biomesoplenty/lang/en_US.xml @@ -355,6 +355,8 @@ Lush Flower Band Exotic Flower Band + Wading Boots + Amethyst Bucket Spring Water Amethyst Bucket diff --git a/resources/assets/biomesoplenty/textures/armor/wadingboots.png b/resources/assets/biomesoplenty/textures/armor/wadingboots.png new file mode 100644 index 000000000..923c688f1 Binary files /dev/null and b/resources/assets/biomesoplenty/textures/armor/wadingboots.png differ diff --git a/resources/assets/biomesoplenty/textures/blocks/burningblossom.png b/resources/assets/biomesoplenty/textures/blocks/burningblossom.png new file mode 100644 index 000000000..ae1cf4db9 Binary files /dev/null and b/resources/assets/biomesoplenty/textures/blocks/burningblossom.png differ diff --git a/resources/assets/biomesoplenty/textures/items/wadingboots.png b/resources/assets/biomesoplenty/textures/items/wadingboots.png new file mode 100644 index 000000000..87601cf92 Binary files /dev/null and b/resources/assets/biomesoplenty/textures/items/wadingboots.png differ