Add mana diamond and pearl 1/9th units, terrasteel nuggets crafted using them

This commit is contained in:
Vincent Lee committed 2017-08-07 21:07:09 -05:00
1 parent 63a7aeb8c9
commit bb55bf57c8
15 files changed
+119 -16

No files matched your search

@@ -132,11 +132,11 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
return false;
int meta = stack.getItemDamage();
if(meta == 0)
if(meta == 17)
ingot = stack;
else if(meta == 1)
else if(meta == 24)
pearl = stack;
else if(meta == 2)
else if(meta == 25)
diamond = stack;
else return false;
}
@@ -445,6 +445,8 @@ public final class ModItems {
OreDictionary.registerOre(LibOreDict.PEBBLE, new ItemStack(manaResource, 1, 21));
OreDictionary.registerOre(LibOreDict.MANAWEAVE_CLOTH, new ItemStack(manaResource, 1, 22));
OreDictionary.registerOre(LibOreDict.MANA_POWDER, new ItemStack(manaResource, 1, 23));
OreDictionary.registerOre(LibOreDict.MANA_PEARL_SHARD, new ItemStack(manaResource, 1, 24));
OreDictionary.registerOre(LibOreDict.MANA_DIAMOND_CHUNK, new ItemStack(manaResource, 1, 25));
OreDictionary.registerOre(LibOreDict.VIAL, new ItemStack(vial, 1, 0));
OreDictionary.registerOre(LibOreDict.FLASK, new ItemStack(vial, 1, 1));
@@ -10,6 +10,7 @@
*/
package vazkii.botania.common.item.material;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
@@ -23,6 +24,7 @@ import net.minecraft.util.NonNullList;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@@ -38,13 +40,12 @@ import vazkii.botania.common.entity.EntityDoppleganger;
import vazkii.botania.common.entity.EntityEnderAirBottle;
import vazkii.botania.common.item.ItemMod;
import vazkii.botania.common.lib.LibItemNames;
import vazkii.botania.common.lib.LibMisc;
import javax.annotation.Nonnull;
public class ItemManaResource extends ItemMod implements IFlowerComponent, IElvenItem {
final int types = 24;
public ItemManaResource() {
super(LibItemNames.MANA_RESOURCE);
setHasSubtypes(true);
@@ -117,7 +118,7 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
@Override
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> stacks) {
if(isInCreativeTab(tab)) {
for(int i = 0; i < types; i++) {
for(int i = 0; i < LibItemNames.MANA_RESOURCE_NAMES.length; i++) {
if("UNUSED".equals(LibItemNames.MANA_RESOURCE_NAMES[i]))
continue;
if(Botania.gardenOfGlassLoaded || i != 20 && i != 21)
@@ -129,7 +130,7 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
@Nonnull
@Override
public String getUnlocalizedName(ItemStack par1ItemStack) {
return "item." + LibItemNames.MANA_RESOURCE_NAMES[Math.min(types - 1, par1ItemStack.getItemDamage())];
return "item." + LibItemNames.MANA_RESOURCE_NAMES[Math.min(LibItemNames.MANA_RESOURCE_NAMES.length - 1, par1ItemStack.getItemDamage())];
}
@Override
@@ -158,7 +159,14 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
@SideOnly(Side.CLIENT)
@Override
public void registerModels() {
ModelHandler.registerItemMetas(this, LibItemNames.MANA_RESOURCE_NAMES.length, i -> LibItemNames.MANA_RESOURCE_NAMES[i]);
for(int i = 0; i < LibItemNames.MANA_RESOURCE_NAMES.length; i++) {
if("UNUSED".equals(LibItemNames.MANA_RESOURCE_NAMES[i]))
continue;
ModelLoader.setCustomModelResourceLocation(
this, i,
new ModelResourceLocation(LibMisc.MOD_ID + ":" + LibItemNames.MANA_RESOURCE_NAMES[i], "inventory")
);
}
}
}
@@ -68,10 +68,10 @@ public class PageTerrasteel extends PageRecipe {
renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8, gui.getTop() + 102, new ItemStack(block3), false);
GlStateManager.translate(0F, 0F, -10F);
renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8, gui.getTop() + 30, new ItemStack(ModItems.manaResource, 1, 4), false);
renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8, gui.getTop() + 80, new ItemStack(ModItems.manaResource, 1, 0), false);
renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8 - 20, gui.getTop() + 86, new ItemStack(ModItems.manaResource, 1, 1), false);
renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8 + 19, gui.getTop() + 86, new ItemStack(ModItems.manaResource, 1, 2), false);
renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8, gui.getTop() + 30, new ItemStack(ModItems.manaResource, 1, 18), false);
renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8, gui.getTop() + 80, new ItemStack(ModItems.manaResource, 1, 17), false);
renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8 - 20, gui.getTop() + 86, new ItemStack(ModItems.manaResource, 1, 24), false);
renderItem(gui, gui.getLeft() + gui.getWidth() / 2 - 8 + 19, gui.getTop() + 86, new ItemStack(ModItems.manaResource, 1, 25), false);
Minecraft.getMinecraft().renderEngine.bindTexture(terrasteelOverlay);
@@ -84,13 +84,13 @@ public class PageTerrasteel extends PageRecipe {
@Override
public void onPageAdded(LexiconEntry entry, int index) {
LexiconRecipeMappings.map(new ItemStack(ModItems.manaResource, 1, 4), entry, index);
LexiconRecipeMappings.map(new ItemStack(ModItems.manaResource, 1, 18), entry, index);
}
@Override
public List<ItemStack> getDisplayedRecipes() {
ArrayList<ItemStack> list = new ArrayList<>();
list.add(new ItemStack(ModItems.manaResource, 1, 4));
list.add(new ItemStack(ModItems.manaResource, 1, 18));
return list;
}
@@ -218,6 +218,8 @@ public final class LibItemNames {
"livingRoot",
"pebble",
"manaweaveCloth",
"manaPowder"
"manaPowder",
"manaPearlShard",
"manaDiamondChunk"
};
}
@@ -41,11 +41,12 @@ public final class LibOreDict {
public static final String PEBBLE = "pebble";
public static final String MANAWEAVE_CLOTH = "clothManaweave";
public static final String MANA_POWDER = "powderMana";
public static final String MANA_PEARL_SHARD = "shardManaPearl";
public static final String MANA_DIAMOND_CHUNK = "nuggetManaDiamond";
public static final String VIAL = "bVial";
public static final String FLASK = "bFlask";
public static final String PRISMARINE_BLOCK = "blockPrismarine";
public static final String BLAZE_BLOCK = "blockBlaze";
public static final String DYE_WILDCARD = "dye";