diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java b/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java index 93fee9833..ff038f104 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java @@ -101,13 +101,14 @@ public class InitBlocks{ public static Block blockLaserRelay; public static Block blockBlackLotus; - //public static Block blockCrystal; + public static Block blockCrystal; + public static Block blockAtomicReconstructor; public static void init(){ ModUtil.LOGGER.info("Initializing Blocks..."); - //blockCrystal = new BlockCrystal(); - //BlockUtil.register(blockCrystal, BlockCrystal.TheItemBlock.class); + blockCrystal = new BlockCrystal(); + BlockUtil.register(blockCrystal, BlockCrystal.TheItemBlock.class); blockBlackLotus = new BlockBlackLotus(); BlockUtil.register(blockBlackLotus); diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java index c81f0c2d1..265361ae8 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java @@ -107,7 +107,7 @@ public class InitBooklet{ ArrayList aiotPages = new ArrayList(); aiotPages.add(new PageTextOnly(aiotPages.size()+1)); for(IRecipe recipe : ToolCrafting.recipesPaxels){ - aiotPages.add(new PageCrafting(aiotPages.size()+1, recipe).setNoText()); + aiotPages.add(new PageCrafting(aiotPages.size()+1, recipe).setNoText().setPageStacksWildcard()); } new BookletChapter("aiots", entryItemsNonRF, new ItemStack(InitItems.emeraldPaxel), aiotPages.toArray(new BookletPage[aiotPages.size()])).setImportant(); @@ -121,7 +121,7 @@ public class InitBooklet{ new BookletChapter("potionRings", entryItemsNonRF, new ItemStack(InitItems.itemPotionRing), potionRingPages.toArray(new BookletPage[potionRingPages.size()])); //RF Using Items - new BookletChapter("drill", entryItemsRF, new ItemStack(InitItems.itemDrill), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeDrill).setNoText(), new PageCrafting(3, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(4, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial(); + new BookletChapter("drill", entryItemsRF, new ItemStack(InitItems.itemDrill), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeDrill, ItemCrafting.recipeDrillEmerald).setPageStacksWildcard(), new PageCrafting(3, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(4, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial(); new BookletChapter("staff", entryItemsRF, new ItemStack(InitItems.itemTeleStaff), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeStaff).setNoText()).setImportant(); new BookletChapter("magnetRing", entryItemsRF, new ItemStack(InitItems.itemMagnetRing), new PageCrafting(1, ItemCrafting.recipeMagnetRing)); new BookletChapter("growthRing", entryItemsRF, new ItemStack(InitItems.itemGrowthRing), new PageCrafting(1, ItemCrafting.recipeGrowthRing)); diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java index 25e709f90..963bd1308 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java @@ -37,6 +37,7 @@ public class BookletPage{ protected BookletChapter chapter; private HashMap textReplacements = new HashMap(); private boolean hasNoText; + public boolean arePageStacksWildcard; public BookletPage(int id){ this.id = id; @@ -171,4 +172,9 @@ public class BookletPage{ public void setChapter(BookletChapter chapter){ this.chapter = chapter; } + + public BookletPage setPageStacksWildcard(){ + this.arePageStacksWildcard = true; + return this; + } } diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java index b97ec3b16..78473314c 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java @@ -153,7 +153,17 @@ public class PageCrafting extends BookletPage{ @Override public ItemStack[] getItemStacksForPage(){ if(this.recipes != null && this.recipes.length > 0 && this.recipes[0] != null){ - return new ItemStack[]{this.recipes[0].getRecipeOutput()}; + ItemStack output = this.recipes[0].getRecipeOutput(); + if(output != null){ + if(!this.arePageStacksWildcard){ + return new ItemStack[]{output}; + } + else{ + ItemStack wildcardOutput = output.copy(); + wildcardOutput.setItemDamage(Util.WILDCARD); + return new ItemStack[]{wildcardOutput}; + } + } } return null; } diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java index 362b1d989..13fe527c4 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java @@ -42,6 +42,7 @@ public class ItemCrafting{ public static IRecipe recipeTinyChar; public static ArrayList recipesMashedFood = new ArrayList(); public static IRecipe recipeDrill; + public static IRecipe recipeDrillEmerald; public static IRecipe recipeDrillSpeedI; public static IRecipe recipeDrillSpeedII; public static IRecipe recipeDrillSpeedIII; @@ -143,6 +144,14 @@ public class ItemCrafting{ 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal()), 'I', "blockIron")); recipeDrill = Util.GetRecipes.lastIRecipe(); + + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrill, 1, 1), + "DDD", "CRC", "III", + 'D', "gemEmerald", + 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), + 'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal()), + 'I', "blockIron")); + recipeDrillEmerald = Util.GetRecipes.lastIRecipe(); } //Drill Core diff --git a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java index c9117e370..2b06cbecb 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java @@ -128,13 +128,13 @@ public class InitItems{ public static Item itemChestToCrateUpgrade; public static Item itemLaserWrench; - //public static Item itemCrystal; + public static Item itemCrystal; public static void init(){ ModUtil.LOGGER.info("Initializing Items..."); - //itemCrystal = new ItemCrystal(); - //ItemUtil.register(itemCrystal); + itemCrystal = new ItemCrystal(); + ItemUtil.register(itemCrystal); itemLaserWrench = new ItemLaserWrench(); ItemUtil.register(itemLaserWrench); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java index 27c984398..bd2ed66d3 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java @@ -25,6 +25,7 @@ import ellpeck.actuallyadditions.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -34,6 +35,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; @@ -43,13 +45,44 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import java.util.HashSet; +import java.util.List; import java.util.Set; @SuppressWarnings("unchecked") public class ItemDrill extends ItemEnergy{ + @SideOnly(Side.CLIENT) + private IIcon emeraldIcon; + public ItemDrill(){ super(500000, 5000); + this.setMaxDamage(0); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1){ + return par1 == 0 ? this.itemIcon : this.emeraldIcon; + } + + @Override + public int getMetadata(int damage){ + return damage; + } + + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tabs, List list){ + super.getSubItems(item, tabs, list); + + ItemStack stackFull = new ItemStack(this, 1, 1); + this.setEnergy(stackFull, this.getMaxEnergyStored(stackFull)); + list.add(stackFull); + + ItemStack stackEmpty = new ItemStack(this, 1, 1); + this.setEnergy(stackEmpty, 0); + list.add(stackEmpty); } @Override @@ -192,6 +225,7 @@ public class ItemDrill extends ItemEnergy{ @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.emeraldIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Emerald"); } @Override @@ -246,12 +280,6 @@ public class ItemDrill extends ItemEnergy{ return toReturn; } - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(ItemStack stack, int pass){ - return this.itemIcon; - } - @Override public boolean canHarvestBlock(Block block, ItemStack stack){ return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) && (this.hasExtraWhitelist(block) || block.getMaterial().isToolNotRequired() || (block == Blocks.snow_layer || block == Blocks.snow || (block == Blocks.obsidian ? ConfigIntValues.DRILL_HARVEST_LEVEL.getValue() >= 3 : (block != Blocks.diamond_block && block != Blocks.diamond_ore ? (block != Blocks.emerald_ore && block != Blocks.emerald_block ? (block != Blocks.gold_block && block != Blocks.gold_ore ? (block != Blocks.iron_block && block != Blocks.iron_ore ? (block != Blocks.lapis_block && block != Blocks.lapis_ore ? (block != Blocks.redstone_ore && block != Blocks.lit_redstone_ore ? (block.getMaterial() == Material.rock || (block.getMaterial() == Material.iron || block.getMaterial() == Material.anvil)) : ConfigIntValues.DRILL_HARVEST_LEVEL.getValue() >= 2) : ConfigIntValues.DRILL_HARVEST_LEVEL.getValue() >= 1) : ConfigIntValues.DRILL_HARVEST_LEVEL.getValue() >= 1) : ConfigIntValues.DRILL_HARVEST_LEVEL.getValue() >= 2) : ConfigIntValues.DRILL_HARVEST_LEVEL.getValue() >= 2) : ConfigIntValues.DRILL_HARVEST_LEVEL.getValue() >= 2)))); diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index fe8e56d2c..ef4347573 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -532,6 +532,7 @@ booklet.actuallyadditions.chapter.potionRings.text.1=The Potion Rings h booklet.actuallyadditions.chapter.drill.name=Drills booklet.actuallyadditions.chapter.drill.text.1=The Drill works like a Pickaxe and a Shovel. It uses RF per block. It can be charged in an Energizer and upgraded by right-clicking with it in your hand. There is a lot of upgrades, but here is an explanation of some of them: The Mining Uprgades enlarge the hole which the Drill digs. The Placement Upgrade, after you right-click it in any slot of your hotbar, will make the Drill able to place a block from that slot by right-clicking. You can also put a Battery inside the Drill to give it more charge. +booklet.actuallyadditions.chapter.drill.text.2=The Drill can be crafted from either Diamond or Emerald. Its color will change accordingly. booklet.actuallyadditions.chapter.staff.name=Staff booklet.actuallyadditions.chapter.staff.text.1=The Teleport Staff, when charged in an Energizer, can be right-clicked to teleport you to where you're looking. When you are looking at a block, it will teleport you there, however, when you aren't looking at a block, you can only be looking upwards up to 5 degrees, otherwise the teleport will fail. diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemDrillEmerald.png b/src/main/resources/assets/actuallyadditions/textures/items/itemDrillEmerald.png new file mode 100644 index 000000000..53e21306c Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/items/itemDrillEmerald.png differ