Some work on getting bags off the ground, also learned how to do multiple render passes and overlays of overlays (yay!). Note: the bags aren't functional at all yet; just viewable in game. Much more work to be done.
This commit is contained in:
parent
666dd4f656
commit
bc1740ebee
10 changed files with 177 additions and 5 deletions
|
@ -83,6 +83,9 @@ public class ConfigurationHandler {
|
|||
ItemIds.ALCHEMY_DUST = configuration
|
||||
.getItem(Strings.ALCHEMY_DUST_NAME, ItemIds.ALCHEMY_DUST_DEFAULT)
|
||||
.getInt(ItemIds.ALCHEMY_DUST_DEFAULT);
|
||||
ItemIds.ALCHEMY_BAG = configuration
|
||||
.getItem(Strings.ALCHEMY_BAG_NAME, ItemIds.ALCHEMY_BAG_DEFAULT)
|
||||
.getInt(ItemIds.ALCHEMY_BAG_DEFAULT);
|
||||
|
||||
/* KeyBinding Configs */
|
||||
configuration.addCustomCategoryComment(CATEGORY_KEYBIND, "");
|
||||
|
|
130
ee3_common/ee3/common/item/ItemAlchemyBag.java
Normal file
130
ee3_common/ee3/common/item/ItemAlchemyBag.java
Normal file
|
@ -0,0 +1,130 @@
|
|||
package ee3.common.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.src.CreativeTabs;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.MathHelper;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.Side;
|
||||
import cpw.mods.fml.common.asm.SideOnly;
|
||||
import ee3.common.EquivalentExchange3;
|
||||
import ee3.common.lib.Colours;
|
||||
import ee3.common.lib.Strings;
|
||||
|
||||
public class ItemAlchemyBag extends ItemEE {
|
||||
|
||||
public static final String[] alchemyBagNames = new String[] { "white", "orange", "magenta", "light_blue", "yellow", "lime", "pink", "gray", "light_gray", "cyan", "purple", "blue", "brown", "green", "red", "black" };
|
||||
|
||||
public ItemAlchemyBag(int id) {
|
||||
|
||||
super(id);
|
||||
this.setHasSubtypes(true);
|
||||
this.setIconCoord(6, 0);
|
||||
this.setItemName(Strings.ALCHEMY_BAG_NAME);
|
||||
this.setCreativeTab(EquivalentExchange3.tabsEE3);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getIconFromDamageForRenderPass(int meta, int renderPass) {
|
||||
|
||||
if (renderPass == 0) {
|
||||
return this.getIconFromDamage(meta);
|
||||
}
|
||||
else {
|
||||
return this.getIconFromDamage(meta) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getIconFromDamage(int meta) {
|
||||
|
||||
if (FMLClientHandler.instance().getClient().currentScreen != null) {
|
||||
return (this.iconIndex + 2);
|
||||
}
|
||||
|
||||
return this.iconIndex;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getItemNameIS(ItemStack stack) {
|
||||
|
||||
int meta = MathHelper.clamp_int(stack.getItemDamage(), 0, 15);
|
||||
return super.getItemName() + "." + alchemyBagNames[meta];
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack itemStack, int renderPass) {
|
||||
|
||||
int returnValue = Integer.parseInt(Colours.PURE_WHITE, 16);
|
||||
|
||||
if (renderPass == 0) {
|
||||
switch (itemStack.getItemDamage()) {
|
||||
case 0:
|
||||
returnValue = Integer.parseInt(Colours.BAG_WHITE, 16);
|
||||
break;
|
||||
case 1:
|
||||
returnValue = Integer.parseInt(Colours.BAG_ORANGE, 16);
|
||||
break;
|
||||
case 2:
|
||||
returnValue = Integer.parseInt(Colours.BAG_MAGENTA, 16);
|
||||
break;
|
||||
case 3:
|
||||
returnValue = Integer.parseInt(Colours.BAG_LIGHT_BLUE, 16);
|
||||
break;
|
||||
case 4:
|
||||
returnValue = Integer.parseInt(Colours.BAG_YELLOW, 16);
|
||||
break;
|
||||
case 5:
|
||||
returnValue = Integer.parseInt(Colours.BAG_LIME, 16);
|
||||
break;
|
||||
case 6:
|
||||
returnValue = Integer.parseInt(Colours.BAG_PINK, 16);
|
||||
break;
|
||||
case 7:
|
||||
returnValue = Integer.parseInt(Colours.BAG_GRAY, 16);
|
||||
break;
|
||||
case 8:
|
||||
returnValue = Integer.parseInt(Colours.BAG_LIGHT_GRAY, 16);
|
||||
break;
|
||||
case 9:
|
||||
returnValue = Integer.parseInt(Colours.BAG_CYAN, 16);
|
||||
break;
|
||||
case 10:
|
||||
returnValue = Integer.parseInt(Colours.BAG_PURPLE, 16);
|
||||
break;
|
||||
case 11:
|
||||
returnValue = Integer.parseInt(Colours.BAG_BLUE, 16);
|
||||
break;
|
||||
case 12:
|
||||
returnValue = Integer.parseInt(Colours.BAG_BROWN, 16);
|
||||
break;
|
||||
case 13:
|
||||
returnValue = Integer.parseInt(Colours.BAG_GREEN, 16);
|
||||
break;
|
||||
case 14:
|
||||
returnValue = Integer.parseInt(Colours.BAG_RED, 16);
|
||||
break;
|
||||
case 15:
|
||||
returnValue = Integer.parseInt(Colours.BAG_BLACK, 16);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int id, CreativeTabs creativeTab, List list) {
|
||||
|
||||
for (int meta = 0; meta < 16; ++meta) {
|
||||
list.add(new ItemStack(id, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -32,8 +32,7 @@ public class ItemAlchemyDust extends ItemEE {
|
|||
|
||||
super(id);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
this.setIconCoord(0, 3);
|
||||
this.setIconCoord(10, 0);
|
||||
this.setItemName(Strings.ALCHEMY_DUST_NAME);
|
||||
this.setCreativeTab(EquivalentExchange3.tabsEE3);
|
||||
maxStackSize = 64;
|
||||
|
@ -42,10 +41,11 @@ public class ItemAlchemyDust extends ItemEE {
|
|||
@SideOnly(Side.CLIENT)
|
||||
public int getIconFromDamage(int meta) {
|
||||
|
||||
int i = MathHelper.clamp_int(meta, 0, 11);
|
||||
int i = MathHelper.clamp_int(meta, 0, 5);
|
||||
return (this.iconIndex + i);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getItemNameIS(ItemStack stack) {
|
||||
|
||||
int meta = MathHelper.clamp_int(stack.getItemDamage(), 0, 5);
|
||||
|
|
|
@ -27,6 +27,7 @@ public class ModItems {
|
|||
public static Item miniumStone;
|
||||
public static Item philStone;
|
||||
public static Item alchemyDust;
|
||||
public static Item alchemyBag;
|
||||
|
||||
public static void init() {
|
||||
/* Initialize each mod item individually */
|
||||
|
@ -35,6 +36,7 @@ public class ModItems {
|
|||
miniumStone = new ItemMiniumStone(ItemIds.MINIUM_STONE);
|
||||
philStone = new ItemPhilosopherStone(ItemIds.PHILOSOPHER_STONE);
|
||||
alchemyDust = new ItemAlchemyDust(ItemIds.ALCHEMY_DUST);
|
||||
alchemyBag = new ItemAlchemyBag(ItemIds.ALCHEMY_BAG);
|
||||
|
||||
miniumStone.setContainerItem(miniumStone);
|
||||
philStone.setContainerItem(philStone);
|
||||
|
|
|
@ -10,12 +10,30 @@ package ee3.common.lib;
|
|||
*
|
||||
*/
|
||||
public class Colours {
|
||||
|
||||
|
||||
public static final String PURE_WHITE = "ffffff";
|
||||
public static final String PURE_RED = "ff0000";
|
||||
|
||||
/* Text colour related constants */
|
||||
public static final String TEXT_COLOUR_PREFIX_YELLOW = "\u00a7e";
|
||||
|
||||
public static final String TEXT_COLOUR_PREFIX_WHITE = "\u00a7f";
|
||||
|
||||
/* Bag colour related constants */
|
||||
public static final String BAG_WHITE = "ffffff";
|
||||
public static final String BAG_ORANGE = "db7d3e";
|
||||
public static final String BAG_MAGENTA = "b350bc";
|
||||
public static final String BAG_LIGHT_BLUE = "6b8ac9";
|
||||
public static final String BAG_YELLOW = "b1a627";
|
||||
public static final String BAG_LIME = "41ae38";
|
||||
public static final String BAG_PINK = "d08499";
|
||||
public static final String BAG_GRAY = "868d8d";
|
||||
public static final String BAG_LIGHT_GRAY = "c8c8be";
|
||||
public static final String BAG_CYAN = "2e6e89";
|
||||
public static final String BAG_PURPLE = "7e3db5";
|
||||
public static final String BAG_BLUE = "2e388d";
|
||||
public static final String BAG_BROWN = "4f321f";
|
||||
public static final String BAG_GREEN = "35461b";
|
||||
public static final String BAG_RED = "963430";
|
||||
public static final String BAG_BLACK = "404040";
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ public class ItemIds {
|
|||
public static int MINIUM_STONE_DEFAULT = 27002;
|
||||
public static int PHILOSOPHER_STONE_DEFAULT = 27003;
|
||||
public static int ALCHEMY_DUST_DEFAULT = 27004;
|
||||
public static int ALCHEMY_BAG_DEFAULT = 27005;
|
||||
|
||||
/* Current item ids */
|
||||
public static int MINIUM_SHARD;
|
||||
|
@ -24,5 +25,6 @@ public class ItemIds {
|
|||
public static int MINIUM_STONE;
|
||||
public static int PHILOSOPHER_STONE;
|
||||
public static int ALCHEMY_DUST;
|
||||
public static int ALCHEMY_BAG;
|
||||
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ public class Strings {
|
|||
public static final String MINIUM_STONE_NAME = "miniumStone";
|
||||
public static final String PHILOSOPHER_STONE_NAME = "philStone";
|
||||
public static final String ALCHEMY_DUST_NAME = "alchemyDust";
|
||||
public static final String ALCHEMY_BAG_NAME = "alchemyBag";
|
||||
|
||||
/* TileEntity name constants */
|
||||
public static final String TE_CALCINATOR_NAME = "tileCalcinator";
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.8 KiB |
Binary file not shown.
|
@ -16,6 +16,22 @@
|
|||
<entry key="item.alchemyDust.azure.name">Azure Dust</entry>
|
||||
<entry key="item.alchemyDust.amaranthine.name">Amaranthine Dust</entry>
|
||||
<entry key="item.alchemyDust.iridescent.name">Iridescent Dust</entry>
|
||||
<entry key="item.alchemyBag.white.name">White Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.orange.name">Orange Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.magenta.name">Magenta Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.light_blue.name">Light Blue Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.yellow.name">Yellow Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.lime.name">Lime Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.pink.name">Pink Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.gray.name">Gray Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.light_gray.name">Light Gray Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.cyan.name">Cyan Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.purple.name">Purple Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.blue.name">Blue Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.brown.name">Brown Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.green.name">Green Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.red.name">Red Alchemical Bag</entry>
|
||||
<entry key="item.alchemyBag.black.name">Black Alchemical Bag</entry>
|
||||
<entry key="tile.redWaterStill.name">Red Water (Still)</entry>
|
||||
<entry key="tile.redWaterFlowing.name">Red Water (Flowing)</entry>
|
||||
<entry key="tile.calcinator.name">Calcinator</entry>
|
||||
|
|
Loading…
Reference in a new issue