mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 20:22:33 +00:00
Some work on the Terra Shatterer, mode enabling and disabled now works.
This commit is contained in:
1 parent
83c64b2a0f
commit
7b2b53d370
3 files changed
+28
-3
No files matched your search
@@ -11,21 +11,37 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.tool;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemTerraPick extends ItemManasteelPick {
|
||||
|
||||
private static final String TAG_ENABLED = "enabled";
|
||||
|
||||
IIcon iconTool, iconOverlay;
|
||||
|
||||
public ItemTerraPick() {
|
||||
super(BotaniaAPI.terrasteelToolMaterial, LibItemNames.TERRA_PICK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
ItemNBTHelper.setBoolean(par1ItemStack, TAG_ENABLED, !isEnabled(par1ItemStack));
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
iconTool = IconHelper.forItem(par1IconRegister, this, 0);
|
||||
@@ -39,11 +55,20 @@ public class ItemTerraPick extends ItemManasteelPick {
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int pass) {
|
||||
return pass == 2 && isEnabled(stack) ? iconOverlay : iconTool;
|
||||
return pass == 1 && isEnabled(stack) ? iconOverlay : iconTool;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack par1ItemStack, int par2) {
|
||||
if(par2 == 0 || !isEnabled(par1ItemStack))
|
||||
return 0xFFFFFF;
|
||||
|
||||
return Color.HSBtoRGB(0.375F, (float) Math.min(1F, (Math.sin((double) System.currentTimeMillis() / 200D) * 0.5 + 1F)), 1F);
|
||||
}
|
||||
|
||||
boolean isEnabled(ItemStack stack) {
|
||||
return false; // TODO
|
||||
return ItemNBTHelper.getBoolean(stack, TAG_ENABLED, false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -326,7 +326,7 @@ item.botania:redstoneRoot.name=Redstone Root
|
||||
item.botania:magnetRing.name=Ring of Magnetization
|
||||
item.botania:waterRing.name=Ring of Chordata
|
||||
item.botania:miningRing.name=Ring of the Mantle
|
||||
item.botania:terraPick.name=Terra Breaker
|
||||
item.botania:terraPick.name=Terra Shatterer
|
||||
|
||||
# GUI TEXT
|
||||
botania.gui.lexicon.header=Lexica Botania Index - Pick which category you would like to study:
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 3.1 KiB |
Reference in new issue
Block a user