mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Added Emerald Drill + Fixed NEI Booklet Handler ignoring meta items
This commit is contained in:
parent
abf4202da8
commit
50f2dbba0d
9 changed files with 70 additions and 15 deletions
|
@ -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);
|
||||
|
|
|
@ -107,7 +107,7 @@ public class InitBooklet{
|
|||
ArrayList<BookletPage> aiotPages = new ArrayList<BookletPage>();
|
||||
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));
|
||||
|
|
|
@ -37,6 +37,7 @@ public class BookletPage{
|
|||
protected BookletChapter chapter;
|
||||
private HashMap<String, String> textReplacements = new HashMap<String, String>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ public class ItemCrafting{
|
|||
public static IRecipe recipeTinyChar;
|
||||
public static ArrayList<IRecipe> recipesMashedFood = new ArrayList<IRecipe>();
|
||||
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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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))));
|
||||
|
|
|
@ -532,6 +532,7 @@ booklet.actuallyadditions.chapter.potionRings.text.1=The <item>Potion Rings<r> h
|
|||
|
||||
booklet.actuallyadditions.chapter.drill.name=Drills
|
||||
booklet.actuallyadditions.chapter.drill.text.1=The <item>Drill<r> works like a Pickaxe and a Shovel. It uses <imp>RF<r> per block. It can be <imp>charged in an Energizer<r> and upgraded by <imp>right-clicking<r> with it in your hand. There is <imp>a lot of upgrades<r>, but here is an explanation of some of them: <n>The <item>Mining Uprgades<r> enlarge the hole which the Drill digs. <n>The <item>Placement Upgrade<r>, after you right-click it in any slot of your hotbar, will make the Drill able to <imp>place a block from that slot by right-clicking<r>. You can also put a <item>Battery<r> inside the Drill to give it more charge.
|
||||
booklet.actuallyadditions.chapter.drill.text.2=The <item>Drill<r> can be crafted from either <imp>Diamond<r> or <imp>Emerald<r>. Its color will change accordingly.
|
||||
|
||||
booklet.actuallyadditions.chapter.staff.name=Staff
|
||||
booklet.actuallyadditions.chapter.staff.text.1=The <item>Teleport Staff<r>, when charged in an Energizer, can be <imp>right-clicked<r> to <imp>teleport you to where you're looking<r>. 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 <imp>5 degrees<r>, otherwise the teleport will fail.
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 529 B |
Loading…
Reference in a new issue