예제 #1
0
 private HandbookRegistry(MachineRegistry m, int o) {
   machine = m;
   offset = o;
   isParent = false;
   item = null;
   crafted = m.getCraftedMetadataProduct(o);
 }
예제 #2
0
 public List<ItemStack> getCrafting() {
   if (!this.isCrafting()) return null;
   if (this == SHAFT) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     for (int i = 0; i < MaterialRegistry.values().length; i++) {
       li.add(MachineRegistry.SHAFT.getCraftedMetadataProduct(i));
     }
     return li;
   }
   if (this == GEARBOX) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     for (int i = 0; i < MaterialRegistry.values().length; i++) {
       li.add(MachineRegistry.GEARBOX.getCraftedMetadataProduct(i));
     }
     return li;
   }
   if (this == COIL) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     ItemStack is = MachineRegistry.ADVANCEDGEARS.getCraftedMetadataProduct(2);
     li.add(is);
     is = is.copy();
     is.stackTagCompound = new NBTTagCompound();
     is.stackTagCompound.setBoolean("bedrock", true);
     li.add(is);
     return li;
   }
   if (this == FLYWHEEL) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     for (int i = 0; i < 4; i++) {
       li.add(MachineRegistry.FLYWHEEL.getCraftedMetadataProduct(i));
     }
     return li;
   }
   if (this == OTHERGEAR) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     li.add(ItemStacks.woodgear);
     li.add(ItemStacks.stonegear);
     li.add(ItemStacks.diamondgear);
     li.add(ItemStacks.bedrockgear);
     return li;
   }
   if (this == OTHERSHAFT) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     li.add(ItemStacks.stonerod);
     li.add(ItemStacks.diamondshaft);
     li.add(ItemStacks.bedrockshaft);
     return li;
   }
   if (this == OTHERGEARUNIT) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     li.add(ItemStacks.wood2x);
     li.add(ItemStacks.wood4x);
     li.add(ItemStacks.wood8x);
     li.add(ItemStacks.wood16x);
     li.add(ItemStacks.stone2x);
     li.add(ItemStacks.stone4x);
     li.add(ItemStacks.stone8x);
     li.add(ItemStacks.stone16x);
     li.add(ItemStacks.diamond2x);
     li.add(ItemStacks.diamond4x);
     li.add(ItemStacks.diamond8x);
     li.add(ItemStacks.diamond16x);
     li.add(ItemStacks.bedrock2x);
     li.add(ItemStacks.bedrock4x);
     li.add(ItemStacks.bedrock8x);
     li.add(ItemStacks.bedrock16x);
     return li;
   }
   if (crafted != null) return ReikaJavaLibrary.makeListFrom(crafted);
   if (machine != null && machine.isPipe())
     return ReikaJavaLibrary.makeListFrom(machine.getCraftedProduct());
   if (this == BEDTOOLS) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     li.add(ItemRegistry.BEDPICK.getStackOf());
     li.add(ItemRegistry.BEDSHOVEL.getStackOf());
     li.add(ItemRegistry.BEDAXE.getStackOf());
     li.add(ItemRegistry.BEDSWORD.getStackOf());
     li.add(ItemRegistry.BEDHOE.getStackOf());
     li.add(ItemRegistry.BEDSHEARS.getStackOf());
     li.add(ItemRegistry.BEDSICKLE.getStackOf());
     return li;
   }
   if (this == BEDARMOR) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     li.add(ItemRegistry.BEDHELM.getStackOf());
     li.add(ItemRegistry.BEDCHEST.getStackOf());
     li.add(ItemRegistry.BEDLEGS.getStackOf());
     li.add(ItemRegistry.BEDBOOTS.getStackOf());
     return li;
   }
   if (this == STEELTOOLS) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     li.add(ItemRegistry.STEELPICK.getStackOf());
     li.add(ItemRegistry.STEELSHOVEL.getStackOf());
     li.add(ItemRegistry.STEELAXE.getStackOf());
     li.add(ItemRegistry.STEELSWORD.getStackOf());
     li.add(ItemRegistry.STEELHOE.getStackOf());
     li.add(ItemRegistry.STEELSHEARS.getStackOf());
     li.add(ItemRegistry.STEELSICKLE.getStackOf());
     return li;
   }
   if (this == STEELARMOR) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     li.add(ItemRegistry.STEELHELMET.getStackOf());
     li.add(ItemRegistry.STEELCHEST.getStackOf());
     li.add(ItemRegistry.STEELLEGS.getStackOf());
     li.add(ItemRegistry.STEELBOOTS.getStackOf());
     return li;
   }
   if (this == SOLAR)
     return ReikaJavaLibrary.makeListFrom(MachineRegistry.SOLARTOWER.getCraftedProduct());
   if (this.getParent() == ENGINEDESC)
     return ReikaJavaLibrary.makeListFrom(EngineType.engineList[offset].getCraftedProduct());
   if (machine == MachineRegistry.ADVANCEDGEARS)
     return ReikaJavaLibrary.makeListFrom(
         MachineRegistry.ADVANCEDGEARS.getCraftedMetadataProduct(offset));
   if (this.getParent() == TRANSDESC || this.isMachine()) {
     if (machine.hasCustomPlacerItem())
       return ReikaJavaLibrary.makeListFrom(machine.getCraftedMetadataProduct(0));
     return ReikaJavaLibrary.makeListFrom(machine.getCraftedProduct());
   }
   if (this == DECOBLOCKS) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     li.add(ItemStacks.steelblock);
     li.add(ItemStacks.anthrablock);
     li.add(ItemStacks.lonsblock);
     return li;
   }
   if (this == SLIDES) {
     List<ItemStack> li = new ArrayList<ItemStack>();
     for (int i = 0; i < ItemRegistry.SLIDE.getNumberMetadatas(); i++)
       li.add(ItemRegistry.SLIDE.getStackOfMetadata(i));
     return li;
   }
   // if (this == BEDINGOT)
   //	return ReikaJavaLibrary.makeListFrom(ItemStacks.bedingot);
   if (this == ALLOYING) {
     ArrayList<ItemStack> is = new ArrayList();
     ArrayList<BlastFurnacePattern> li = RecipesBlastFurnace.getRecipes().getAllAlloyingRecipes();
     for (BlastFurnacePattern p : li) {
       is.add(p.outputItem());
     }
     return is;
   }
   if (this == AMMONIUM) return ReikaJavaLibrary.makeListFrom(ItemStacks.nitrate);
   if (this == SALT) return ReikaJavaLibrary.makeListFrom(ItemStacks.salt);
   if (this == SILVERIODIDE) return ReikaJavaLibrary.makeListFrom(ItemStacks.silveriodide);
   if (this == EXPLOSIVES) return ReikaJavaLibrary.makeListFrom(ItemRegistry.SHELL.getStackOf());
   if (this == MINECART) return ReikaJavaLibrary.makeListFrom(ItemRegistry.MINECART.getStackOf());
   return ReikaJavaLibrary.makeListFrom(ItemStacks.basepanel);
 }