diff --git a/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java b/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java index 8c7dd9860..f531e2d4a 100644 --- a/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java +++ b/MODSRC/vazkii/botania/common/crafting/ModCrafingRecipes.java @@ -511,6 +511,15 @@ public final class ModCrafingRecipes { 'L', new ItemStack(Items.leather)); recipeTravelBelt = BotaniaAPI.getLatestAddedRecipe(); + // Tectonic Girdle Recipe + addOreDictRecipe(new ItemStack(ModItems.knockbackBelt), + "AL ", "L L", "SLE", + 'E', LibOreDict.RUNE[2], + 'A', LibOreDict.RUNE[1], + 'S', LibOreDict.MANA_STEEL, + 'L', new ItemStack(Items.leather)); + recipeKnocbackBelt = BotaniaAPI.getLatestAddedRecipe(); + // Snowflake Pendant Recipe addOreDictRecipe(new ItemStack(ModItems.icePendant), "WS ", "S S", "MSR", diff --git a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemBaubleModifier.java b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemBaubleModifier.java new file mode 100644 index 000000000..932dd68da --- /dev/null +++ b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemBaubleModifier.java @@ -0,0 +1,45 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under a + * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License + * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * + * File Created @ [Apr 26, 2014, 10:28:39 PM (GMT)] + */ +package vazkii.botania.common.item.equipment.bauble; + +import java.util.UUID; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.item.ItemStack; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; + +public abstract class ItemBaubleModifier extends ItemBauble { + + Multimap attributes = HashMultimap.create(); + + public ItemBaubleModifier(String name) { + super(name); + fillModifiers(attributes); + } + + @Override + public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) { + player.getAttributeMap().applyAttributeModifiers(attributes); + } + + @Override + public void onUnequipped(ItemStack stack, EntityLivingBase player) { + player.getAttributeMap().removeAttributeModifiers(attributes); + } + + abstract void fillModifiers(Multimap attributes); + +} diff --git a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemKnockbackBelt.java b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemKnockbackBelt.java index 68c182be4..baeb06fc4 100644 --- a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemKnockbackBelt.java +++ b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemKnockbackBelt.java @@ -23,31 +23,20 @@ import baubles.api.BaubleType; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; -public class ItemKnockbackBelt extends ItemBauble { +public class ItemKnockbackBelt extends ItemBaubleModifier { - static Multimap attributes = HashMultimap.create(); - static { - attributes.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(2745708 /** Random number **/, 43743), "Bauble modifier", 1.0, 0)); - } - public ItemKnockbackBelt() { super(LibItemNames.KNOCKBACK_BELT); } - - @Override - public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) { - player.getAttributeMap().applyAttributeModifiers(attributes); - } - - - @Override - public void onUnequipped(ItemStack stack, EntityLivingBase player) { - player.getAttributeMap().removeAttributeModifiers(attributes); - } @Override public BaubleType getBaubleType(ItemStack itemstack) { return BaubleType.BELT; } + @Override + void fillModifiers(Multimap attributes) { + attributes.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(2745708 /** Random number **/, 43743), "Bauble modifier", 1, 0)); + } + } diff --git a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java index 089336689..2a2ff8029 100644 --- a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java +++ b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java @@ -333,6 +333,9 @@ public final class LexiconData { travelBelt = new BLexiconEntry(LibLexicon.BAUBLE_TRAVEL_BELT, categoryBaubles); travelBelt.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeTravelBelt)); + knockbacklBelt = new BLexiconEntry(LibLexicon.BAUBLE_KNOCKBACK_BELT, categoryBaubles); + knockbacklBelt.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeKnocbackBelt)); + icePendant = new BLexiconEntry(LibLexicon.BAUBLE_ICE_PENDANT, categoryBaubles); icePendant.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeIcePendant)); diff --git a/resources/assets/botania/lang/en_US.lang b/resources/assets/botania/lang/en_US.lang index 0d7f24bc0..36a69358d 100644 --- a/resources/assets/botania/lang/en_US.lang +++ b/resources/assets/botania/lang/en_US.lang @@ -294,7 +294,7 @@ item.botania:auraRing.name=Band of Aura item.botania:manaRingGreater.name=Greater Band of Mana item.botania:auraRingGreater.name=Greater Band of Aura item.botania:travelBelt.name=Soujourner's Sash -item.botania:knockbackBelt.name=Tectonic Gridle +item.botania:knockbackBelt.name=Tectonic Girdle item.botania:icePendant.name=Snowflake Pendant # GUI TEXT @@ -715,6 +715,11 @@ botania.entry.travelBelt=Soujourner's Sash botania.page.travelBelt0=Traversing terrain sometimes proves to be a hassle. The &1Soujourner's Sash&0 can be equipped in the &4Belt&0 slot, and when worn will increase the movement speed, jump height and resistance to fall damage of the wearer.
Lastly, if not sneaking, it also allows the wearer to walk over 1 block high gaps without jumping with ease. botania.page.travelBelt1=...everell +# -- TECTONIC GIRDLE +botania.entry.knockbackBelt=Tectonic Girdle +botania.page.knockbackBelt0=By harnessing the forces of tectonic movement, the &1Tectonic Girdle&0, when worn, will negate any &4Knockback&0 applied to the wearer by outside attacks. +botania.page.knockbackBelt1=Don't... move + # -- SNOWFLAKE PENDANT botania.entry.icePendant=Snowflake Pendant botania.page.icePendant0=The &1Snowflake Pendant&0 is a &4Bauble&0 that resonates freezing energy, while it's worn, any nearby still &1Water&0 blocks at foot level will be converted into &1Ice&0.
The &1Ice&0 will melt shortly afterward the wearer leaves the area. Lastly, this charm will not freeze any blocks if the wearer is sneaking or fully submerged.