mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-21 12:42:50 +00:00
Added the Stone of Temperance.
This commit is contained in:
1 parent
30ab404d26
commit
0f6eb9486c
11 files changed
+115
-5
No files matched your search
@@ -166,6 +166,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.terraSword);
|
||||
addItem(ModItems.thornChakram);
|
||||
addItem(ModItems.terraPick);
|
||||
addItem(ModItems.temperanceStone);
|
||||
addItem(ModItems.terrasteelHelm);
|
||||
if(Botania.thaumcraftLoaded)
|
||||
addItem(ModItems.terrasteelHelmRevealing);
|
||||
|
||||
@@ -256,6 +256,7 @@ public final class ModCraftingRecipes {
|
||||
public static IRecipe recipeBlazeBlock;
|
||||
public static List<IRecipe> recipesAltarMeta;
|
||||
public static IRecipe recipeCorporeaCrystalCube;
|
||||
public static IRecipe recipeTemperanceStone;
|
||||
|
||||
public static void init() {
|
||||
// Lexicon Recipe
|
||||
@@ -1703,6 +1704,13 @@ public final class ModCraftingRecipes {
|
||||
'W', LibOreDict.DREAM_WOOD);
|
||||
recipeCorporeaCrystalCube = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Stone of Temperance Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.temperanceStone),
|
||||
" S ", "SRS", " S ",
|
||||
'S', "stone",
|
||||
'R', LibOreDict.RUNE[2]);
|
||||
recipeTemperanceStone = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Storage Block Recipes
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0),
|
||||
"III", "III", "III",
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. 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 the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [May 12, 2015, 5:56:45 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemTemperanceStone extends ItemMod {
|
||||
|
||||
IIcon enabledIcon;
|
||||
|
||||
public ItemTemperanceStone() {
|
||||
setUnlocalizedName(LibItemNames.TEMPERANCE_STONE);
|
||||
setMaxStackSize(1);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
int dmg = par1ItemStack.getItemDamage();
|
||||
par1ItemStack.setItemDamage(~dmg & 1);
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.orb", 0.3F, 0.1F);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this, 0);
|
||||
enabledIcon = IconHelper.forItem(par1IconRegister, this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return par1 == 1 ? enabledIcon : itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
if(par1ItemStack.getItemDamage() == 1)
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.active"), par3List);
|
||||
else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.inactive"), par3List);
|
||||
}
|
||||
|
||||
void addStringToTooltip(String s, List<String> tooltip) {
|
||||
tooltip.add(s.replaceAll("&", "\u00a7"));
|
||||
}
|
||||
|
||||
public static boolean hasTemperanceActive(EntityPlayer player) {
|
||||
IInventory inv = player.inventory;
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(stack != null && stack.getItem() == ModItems.temperanceStone && stack.getItemDamage() == 1)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -238,7 +238,8 @@ public final class ModItems {
|
||||
public static Item blackHoleTalisman;
|
||||
public static Item recordGaia1;
|
||||
public static Item recordGaia2;
|
||||
|
||||
public static Item temperanceStone;
|
||||
|
||||
public static void init() {
|
||||
lexicon = new ItemLexicon();
|
||||
petal = new ItemPetal();
|
||||
@@ -368,7 +369,8 @@ public final class ModItems {
|
||||
blackHoleTalisman = new ItemBlackHoleTalisman();
|
||||
recordGaia1 = new ItemRecordGaia1();
|
||||
recordGaia2 = new ItemRecordGaia2();
|
||||
|
||||
temperanceStone = new ItemTemperanceStone();
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
|
||||
|
||||
@@ -38,6 +38,7 @@ import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.crafting.recipe.TerraPickTippingRecipe;
|
||||
import vazkii.botania.common.item.ItemSpark;
|
||||
import vazkii.botania.common.item.ItemTemperanceStone;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemAuraRing;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemGreaterAuraRing;
|
||||
@@ -158,7 +159,11 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ
|
||||
boolean doY = thor || direction.offsetY == 0;
|
||||
boolean doZ = thor || direction.offsetZ == 0;
|
||||
|
||||
int level = getLevel(stack) + (thor ? 1 : 0);
|
||||
int origLevel = getLevel(stack);
|
||||
int level = origLevel + (thor ? 1 : 0);
|
||||
if(ItemTemperanceStone.hasTemperanceActive(player) && level > 2)
|
||||
level = 2;
|
||||
|
||||
int range = Math.max(0, level - 1);
|
||||
int rangeY = Math.max(1, range);
|
||||
|
||||
@@ -166,7 +171,7 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ
|
||||
return;
|
||||
|
||||
ToolCommons.removeBlocksInIteration(player, stack, world, x, y, z, doX ? -range : 0, doY ? -1 : 0, doZ ? -range : 0, doX ? range + 1 : 1, doY ? rangeY * 2 : 1, doZ ? range + 1 : 1, null, MATERIALS, silk, fortune, isTipped(stack));
|
||||
if(getLevel(stack) == 5)
|
||||
if(origLevel == 5)
|
||||
player.addStat(ModAchievements.rankSSPick, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -179,6 +179,7 @@ public final class LexiconData {
|
||||
public static LexiconEntry overgrowthSeed;
|
||||
public static LexiconEntry livingwoodBow;
|
||||
public static LexiconEntry crystalBow;
|
||||
public static LexiconEntry temperanceStone;
|
||||
|
||||
public static LexiconEntry enderAir;
|
||||
public static LexiconEntry enderEyeBlock;
|
||||
@@ -686,6 +687,9 @@ public final class LexiconData {
|
||||
crystalBow = new ALexiconEntry(LibLexicon.TOOL_CRYSTAL_BOW, categoryTools);
|
||||
crystalBow.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeCrystalBow));
|
||||
|
||||
temperanceStone = new BLexiconEntry(LibLexicon.TOOL_TEMPERANCE_STONE, categoryTools);
|
||||
temperanceStone.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeTemperanceStone));
|
||||
|
||||
// ENDER ENTRIES
|
||||
enderAir = new BLexiconEntry(LibLexicon.ENDER_AIR, categoryEnder);
|
||||
enderAir.setPriority().setLexiconPages(new PageText("0"));
|
||||
|
||||
@@ -141,6 +141,7 @@ public final class LibItemNames {
|
||||
public static final String BLACK_HOLE_TALISMAN = "blackHoleTalisman";
|
||||
public static final String RECORD_GAIA1 = "recordGaia1";
|
||||
public static final String RECORD_GAIA2 = "recordGaia2";
|
||||
public static final String TEMPERANCE_STONE = "temperanceStone";
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
|
||||
@@ -151,7 +151,8 @@ public final class LibLexicon {
|
||||
public static final String TOOL_OVERGROWTH_SEED = "overgrowthSeed";
|
||||
public static final String TOOL_LIVINGWOOD_BOW = "livingwoodBow";
|
||||
public static final String TOOL_CRYSTAL_BOW = "crystalBow";
|
||||
|
||||
public static final String TOOL_TEMPERANCE_STONE = "temperanceStone";
|
||||
|
||||
public static final String ENDER_AIR = "enderAir";
|
||||
public static final String ENDER_ENDER_EYE_BLOCK = "enderEyeBlock";
|
||||
public static final String ENDER_PISTON_RELAY = "pistonRelay";
|
||||
|
||||
Reference in new issue
Block a user