diff options
| author | aerospark <lukefay12@gmail.com> | 2015-06-23 15:29:05 -0700 |
|---|---|---|
| committer | aerospark <lukefay12@gmail.com> | 2015-06-23 15:29:05 -0700 |
| commit | a1504799f44ba2debdfef06317f24e7f9c1129d6 (patch) | |
| tree | 53e53ff64d2902c639951bd1d41f942ee171f836 /main/java/gregtech/nei | |
| parent | b803f59de5a66fcb4ef53e117b912fbbc2841392 (diff) | |
| download | GT5-Unofficial-a1504799f44ba2debdfef06317f24e7f9c1129d6.tar.gz GT5-Unofficial-a1504799f44ba2debdfef06317f24e7f9c1129d6.tar.bz2 GT5-Unofficial-a1504799f44ba2debdfef06317f24e7f9c1129d6.zip | |
strip linenumbers
Diffstat (limited to 'main/java/gregtech/nei')
| -rw-r--r-- | main/java/gregtech/nei/GT_NEI_DefaultHandler.java | 1642 | ||||
| -rw-r--r-- | main/java/gregtech/nei/NEI_GT_Config.java | 62 |
2 files changed, 852 insertions, 852 deletions
diff --git a/main/java/gregtech/nei/GT_NEI_DefaultHandler.java b/main/java/gregtech/nei/GT_NEI_DefaultHandler.java index 54d831e180..e9676de41f 100644 --- a/main/java/gregtech/nei/GT_NEI_DefaultHandler.java +++ b/main/java/gregtech/nei/GT_NEI_DefaultHandler.java @@ -1,568 +1,568 @@ -/* 1: */ package gregtech.nei;
-/* 2: */
-/* 3: */ import codechicken.lib.gui.GuiDraw;
-/* 4: */ import codechicken.nei.PositionedStack;
-/* 5: */ import codechicken.nei.guihook.GuiContainerManager;
-/* 6: */ import codechicken.nei.guihook.IContainerInputHandler;
-/* 7: */ import codechicken.nei.guihook.IContainerTooltipHandler;
-/* 8: */ import codechicken.nei.recipe.GuiCraftingRecipe;
-/* 9: */ import codechicken.nei.recipe.GuiRecipe;
-/* 10: */ import codechicken.nei.recipe.GuiUsageRecipe;
-/* 11: */ import codechicken.nei.recipe.TemplateRecipeHandler;
-/* 12: */ import codechicken.nei.recipe.TemplateRecipeHandler.CachedRecipe;
-/* 13: */ import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect;
-/* 14: */ import com.google.common.collect.ListMultimap;
-/* 15: */ import cpw.mods.fml.common.event.FMLInterModComms;
-/* 16: */ import gregtech.api.enums.GT_Values;
-/* 17: */ import gregtech.api.enums.OrePrefixes;
-/* 18: */ import gregtech.api.gui.GT_GUIContainer_BasicMachine;
-/* 19: */ import gregtech.api.objects.ItemData;
-/* 20: */ import gregtech.api.objects.MaterialStack;
-/* 21: */ import gregtech.api.util.GT_LanguageManager;
-/* 22: */ import gregtech.api.util.GT_OreDictUnificator;
-/* 23: */ import gregtech.api.util.GT_Recipe;
-/* 24: */ import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-/* 25: */ import gregtech.api.util.GT_Utility;
-/* 26: */ import java.awt.Point;
-/* 27: */ import java.awt.Rectangle;
-/* 28: */ import java.util.ArrayList;
-/* 29: */ import java.util.Collection;
-/* 30: */ import java.util.Iterator;
-/* 31: */ import java.util.LinkedList;
-/* 32: */ import java.util.List;
-/* 33: */ import net.minecraft.client.Minecraft;
-/* 34: */ import net.minecraft.client.gui.FontRenderer;
-/* 35: */ import net.minecraft.client.gui.inventory.GuiContainer;
-/* 36: */ import net.minecraft.init.Blocks;
-/* 37: */ import net.minecraft.item.ItemStack;
-/* 38: */ import net.minecraftforge.fluids.FluidContainerRegistry;
-/* 39: */ import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
-/* 40: */ import net.minecraftforge.fluids.FluidStack;
-/* 41: */ import org.lwjgl.opengl.GL11;
-/* 42: */
-/* 43: */ public class GT_NEI_DefaultHandler
-/* 44: */ extends TemplateRecipeHandler
-/* 45: */ {
-/* 46: */ protected final GT_Recipe.GT_Recipe_Map mRecipeMap;
-/* 47: */ public static final int sOffsetX = 5;
-/* 48: */ public static final int sOffsetY = 11;
-/* 49: */
-/* 50: */ public GT_NEI_DefaultHandler(GT_Recipe.GT_Recipe_Map aRecipeMap)
-/* 51: */ {
-/* 52: 43 */ this.mRecipeMap = aRecipeMap;
-/* 53: 44 */ this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier(), new Object[0]));
-/* 54: 46 */ if (!NEI_GT_Config.sIsAdded)
-/* 55: */ {
-/* 56: 47 */ FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + getRecipeName() + "@" + getOverlayIdentifier());
-/* 57: 48 */ GuiCraftingRecipe.craftinghandlers.add(this);
-/* 58: 49 */ GuiUsageRecipe.usagehandlers.add(this);
-/* 59: */ }
-/* 60: */ }
-/* 61: */
-/* 62: */ public TemplateRecipeHandler newInstance()
-/* 63: */ {
-/* 64: 55 */ return new GT_NEI_DefaultHandler(this.mRecipeMap);
-/* 65: */ }
-/* 66: */
-/* 67: */ public class FixedPositionedStack
-/* 68: */ extends PositionedStack
-/* 69: */ {
-/* 70: 59 */ public boolean permutated = false;
-/* 71: */ public final int mChance;
-/* 72: */
-/* 73: */ public FixedPositionedStack(Object object, int x, int y)
-/* 74: */ {
-/* 75: 63 */ this(object, x, y, 0);
-/* 76: */ }
-/* 77: */
-/* 78: */ public FixedPositionedStack(Object object, int x, int y, int aChance)
-/* 79: */ {
-/* 80: 67 */ super(object,x, y, true);
-/* 81: 68 */ this.mChance = aChance;
-/* 82: */ }
-/* 83: */
-/* 84: */ public void generatePermutations()
-/* 85: */ {
-/* 86: 73 */ if (this.permutated) {
-/* 87: 73 */ return;
-/* 88: */ }
-/* 89: 75 */ ArrayList<ItemStack> tDisplayStacks = new ArrayList();
-/* 90: 76 */ for (ItemStack tStack : this.items) {
-/* 91: 76 */ if (GT_Utility.isStackValid(tStack)) {
-/* 92: 77 */ if (tStack.getItemDamage() == 32767)
-/* 93: */ {
-/* 94: 78 */ List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem());
-/* 95: 79 */ if (!permutations.isEmpty())
-/* 96: */ {
-/* 97: */ ItemStack stack;
-/* 98: 80 */ for (Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[] { stack }))) {
-/* 99: 80 */ stack = (ItemStack)i$.next();
-/* 100: */ }
-/* 101: */ }
-/* 102: */ else
-/* 103: */ {
-/* 104: 82 */ ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize);
-/* 105: 83 */ base.stackTagCompound = tStack.stackTagCompound;
-/* 106: 84 */ tDisplayStacks.add(base);
-/* 107: */ }
-/* 108: */ }
-/* 109: */ else
-/* 110: */ {
-/* 111: 87 */ tDisplayStacks.add(GT_Utility.copy(new Object[] { tStack }));
-/* 112: */ }
-/* 113: */ }
-/* 114: */ }
-/* 115: 91 */ this.items = ((ItemStack[])tDisplayStacks.toArray(new ItemStack[0]));
-/* 116: 92 */ if (this.items.length == 0) {
-/* 117: 92 */ this.items = new ItemStack[] { new ItemStack(Blocks.fire) };
-/* 118: */ }
-/* 119: 93 */ this.permutated = true;
-/* 120: 94 */ setPermutationToRender(0);
-/* 121: */ }
-/* 122: */ }
-/* 123: */
-/* 124: */ public class CachedDefaultRecipe
-/* 125: */ extends TemplateRecipeHandler.CachedRecipe
-/* 126: */ {
-/* 127: */ public final GT_Recipe mRecipe;
-/* 128:101 */ public final List<PositionedStack> mOutputs = new ArrayList();
-/* 129:102 */ public final List<PositionedStack> mInputs = new ArrayList();
-/* 130: */
-/* 131: */ public List<PositionedStack> getIngredients()
-/* 132: */ {
-/* 133:106 */ return getCycledIngredients(GT_NEI_DefaultHandler.this.cycleticks / 10, this.mInputs);
-/* 134: */ }
-/* 135: */
-/* 136: */ public PositionedStack getResult()
-/* 137: */ {
-/* 138:111 */ return null;
-/* 139: */ }
-/* 140: */
-/* 141: */ public List<PositionedStack> getOtherStacks()
-/* 142: */ {
-/* 143:116 */ return this.mOutputs;
-/* 144: */ }
-/* 145: */
-/* 146: */ public CachedDefaultRecipe(GT_Recipe aRecipe)
-/* 147: */ {
-/* 148:119 */ super();
-/* 149:120 */ this.mRecipe = aRecipe;
-/* 150: */
-/* 151:122 */ int tStartIndex = 0;
-/* 152:124 */ switch (GT_NEI_DefaultHandler.this.mRecipeMap.mUsualInputCount)
-/* 153: */ {
-/* 154: */ case 0:
-/* 155: */ break;
-/* 156: */ case 1:
-/* 157:128 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 158:128 */ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
-/* 159: */ }
-/* 160:128 */ tStartIndex++;
-/* 161:129 */ break;
-/* 162: */ case 2:
-/* 163:131 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 164:131 */ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14));
-/* 165: */ }
-/* 166:131 */ tStartIndex++;
-/* 167:132 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 168:132 */ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
-/* 169: */ }
-/* 170:132 */ tStartIndex++;
-/* 171:133 */ break;
-/* 172: */ case 3:
-/* 173:135 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 174:135 */ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14));
-/* 175: */ }
-/* 176:135 */ tStartIndex++;
-/* 177:136 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 178:136 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 14));
-/* 179: */ }
-/* 180:136 */ tStartIndex++;
-/* 181:137 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 182:137 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
-/* 183: */ }
-/* 184:137 */ tStartIndex++;
-/* 185:138 */ break;
-/* 186: */ case 4:
-/* 187:140 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 188:140 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 5));
-/* 189: */ }
-/* 190:140 */ tStartIndex++;
-/* 191:141 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 192:141 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 5));
-/* 193: */ }
-/* 194:141 */ tStartIndex++;
-/* 195:142 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 196:142 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 23));
-/* 197: */ }
-/* 198:142 */ tStartIndex++;
-/* 199:143 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 200:143 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 23));
-/* 201: */ }
-/* 202:143 */ tStartIndex++;
-/* 203:144 */ break;
-/* 204: */ case 5:
-/* 205:146 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 206:146 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 5));
-/* 207: */ }
-/* 208:146 */ tStartIndex++;
-/* 209:147 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 210:147 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 5));
-/* 211: */ }
-/* 212:147 */ tStartIndex++;
-/* 213:148 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 214:148 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 5));
-/* 215: */ }
-/* 216:148 */ tStartIndex++;
-/* 217:149 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 218:149 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 23));
-/* 219: */ }
-/* 220:149 */ tStartIndex++;
-/* 221:150 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 222:150 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 23));
-/* 223: */ }
-/* 224:150 */ tStartIndex++;
-/* 225:151 */ break;
-/* 226: */ case 6:
-/* 227:153 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 228:153 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 5));
-/* 229: */ }
-/* 230:153 */ tStartIndex++;
-/* 231:154 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 232:154 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 5));
-/* 233: */ }
-/* 234:154 */ tStartIndex++;
-/* 235:155 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 236:155 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 5));
-/* 237: */ }
-/* 238:155 */ tStartIndex++;
-/* 239:156 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 240:156 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 23));
-/* 241: */ }
-/* 242:156 */ tStartIndex++;
-/* 243:157 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 244:157 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 23));
-/* 245: */ }
-/* 246:157 */ tStartIndex++;
-/* 247:158 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 248:158 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 23));
-/* 249: */ }
-/* 250:158 */ tStartIndex++;
-/* 251:159 */ break;
-/* 252: */ case 7:
-/* 253:161 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 254:161 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, -4));
-/* 255: */ }
-/* 256:161 */ tStartIndex++;
-/* 257:162 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 258:162 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, -4));
-/* 259: */ }
-/* 260:162 */ tStartIndex++;
-/* 261:163 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 262:163 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, -4));
-/* 263: */ }
-/* 264:163 */ tStartIndex++;
-/* 265:164 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 266:164 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 14));
-/* 267: */ }
-/* 268:164 */ tStartIndex++;
-/* 269:165 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 270:165 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 14));
-/* 271: */ }
-/* 272:165 */ tStartIndex++;
-/* 273:166 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 274:166 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
-/* 275: */ }
-/* 276:166 */ tStartIndex++;
-/* 277:167 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 278:167 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 32));
-/* 279: */ }
-/* 280:167 */ tStartIndex++;
-/* 281:168 */ break;
-/* 282: */ case 8:
-/* 283:170 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 284:170 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, -4));
-/* 285: */ }
-/* 286:170 */ tStartIndex++;
-/* 287:171 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 288:171 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, -4));
-/* 289: */ }
-/* 290:171 */ tStartIndex++;
-/* 291:172 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 292:172 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, -4));
-/* 293: */ }
-/* 294:172 */ tStartIndex++;
-/* 295:173 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 296:173 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 14));
-/* 297: */ }
-/* 298:173 */ tStartIndex++;
-/* 299:174 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 300:174 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 14));
-/* 301: */ }
-/* 302:174 */ tStartIndex++;
-/* 303:175 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 304:175 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
-/* 305: */ }
-/* 306:175 */ tStartIndex++;
-/* 307:176 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 308:176 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 32));
-/* 309: */ }
-/* 310:176 */ tStartIndex++;
-/* 311:177 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 312:177 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 32));
-/* 313: */ }
-/* 314:177 */ tStartIndex++;
-/* 315:178 */ break;
-/* 316: */ default:
-/* 317:180 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 318:180 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, -4));
-/* 319: */ }
-/* 320:180 */ tStartIndex++;
-/* 321:181 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 322:181 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, -4));
-/* 323: */ }
-/* 324:181 */ tStartIndex++;
-/* 325:182 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 326:182 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, -4));
-/* 327: */ }
-/* 328:182 */ tStartIndex++;
-/* 329:183 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 330:183 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 14));
-/* 331: */ }
-/* 332:183 */ tStartIndex++;
-/* 333:184 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 334:184 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 14));
-/* 335: */ }
-/* 336:184 */ tStartIndex++;
-/* 337:185 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 338:185 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
-/* 339: */ }
-/* 340:185 */ tStartIndex++;
-/* 341:186 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 342:186 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 12, 32));
-/* 343: */ }
-/* 344:186 */ tStartIndex++;
-/* 345:187 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 346:187 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 30, 32));
-/* 347: */ }
-/* 348:187 */ tStartIndex++;
-/* 349:188 */ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
-/* 350:188 */ this.mInputs.add(new FixedPositionedStack( aRecipe.getRepresentativeInput(tStartIndex), 48, 32));
-/* 351: */ }
-/* 352:188 */ tStartIndex++;
-/* 353: */ }
-/* 354:192 */ if (aRecipe.mSpecialItems != null) {
-/* 355:192 */ this.mInputs.add(new FixedPositionedStack( aRecipe.mSpecialItems, 120, 52));
-/* 356: */ }
-/* 357:194 */ tStartIndex = 0;
-/* 358:196 */ switch (GT_NEI_DefaultHandler.this.mRecipeMap.mUsualOutputCount)
-/* 359: */ {
-/* 360: */ case 0:
-/* 361: */ break;
-/* 362: */ case 1:
-/* 363:200 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 364:200 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 365: */ }
-/* 366:200 */ tStartIndex++;
-/* 367:201 */ break;
-/* 368: */ case 2:
-/* 369:203 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 370:203 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 371: */ }
-/* 372:203 */ tStartIndex++;
-/* 373:204 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 374:204 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 375: */ }
-/* 376:204 */ tStartIndex++;
-/* 377:205 */ break;
-/* 378: */ case 3:
-/* 379:207 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 380:207 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 381: */ }
-/* 382:207 */ tStartIndex++;
-/* 383:208 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 384:208 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 385: */ }
-/* 386:208 */ tStartIndex++;
-/* 387:209 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 388:209 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 389: */ }
-/* 390:209 */ tStartIndex++;
-/* 391:210 */ break;
-/* 392: */ case 4:
-/* 393:212 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 394:212 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex)));
-/* 395: */ }
-/* 396:212 */ tStartIndex++;
-/* 397:213 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 398:213 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex)));
-/* 399: */ }
-/* 400:213 */ tStartIndex++;
-/* 401:214 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 402:214 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex)));
-/* 403: */ }
-/* 404:214 */ tStartIndex++;
-/* 405:215 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 406:215 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex)));
-/* 407: */ }
-/* 408:215 */ tStartIndex++;
-/* 409:216 */ break;
-/* 410: */ case 5:
-/* 411:218 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 412:218 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex)));
-/* 413: */ }
-/* 414:218 */ tStartIndex++;
-/* 415:219 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 416:219 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex)));
-/* 417: */ }
-/* 418:219 */ tStartIndex++;
-/* 419:220 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 420:220 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex)));
-/* 421: */ }
-/* 422:220 */ tStartIndex++;
-/* 423:221 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 424:221 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex)));
-/* 425: */ }
-/* 426:221 */ tStartIndex++;
-/* 427:222 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 428:222 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex)));
-/* 429: */ }
-/* 430:222 */ tStartIndex++;
-/* 431:223 */ break;
-/* 432: */ case 6:
-/* 433:225 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 434:225 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex)));
-/* 435: */ }
-/* 436:225 */ tStartIndex++;
-/* 437:226 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 438:226 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex)));
-/* 439: */ }
-/* 440:226 */ tStartIndex++;
-/* 441:227 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 442:227 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex)));
-/* 443: */ }
-/* 444:227 */ tStartIndex++;
-/* 445:228 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 446:228 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex)));
-/* 447: */ }
-/* 448:228 */ tStartIndex++;
-/* 449:229 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 450:229 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex)));
-/* 451: */ }
-/* 452:229 */ tStartIndex++;
-/* 453:230 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 454:230 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 23, aRecipe.getOutputChance(tStartIndex)));
-/* 455: */ }
-/* 456:230 */ tStartIndex++;
-/* 457:231 */ break;
-/* 458: */ case 7:
-/* 459:233 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 460:233 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex)));
-/* 461: */ }
-/* 462:233 */ tStartIndex++;
-/* 463:234 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 464:234 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex)));
-/* 465: */ }
-/* 466:234 */ tStartIndex++;
-/* 467:235 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 468:235 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex)));
-/* 469: */ }
-/* 470:235 */ tStartIndex++;
-/* 471:236 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 472:236 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 473: */ }
-/* 474:236 */ tStartIndex++;
-/* 475:237 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 476:237 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 477: */ }
-/* 478:237 */ tStartIndex++;
-/* 479:238 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 480:238 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 481: */ }
-/* 482:238 */ tStartIndex++;
-/* 483:239 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 484:239 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex)));
-/* 485: */ }
-/* 486:239 */ tStartIndex++;
-/* 487:240 */ break;
-/* 488: */ case 8:
-/* 489:242 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 490:242 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex)));
-/* 491: */ }
-/* 492:242 */ tStartIndex++;
-/* 493:243 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 494:243 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex)));
-/* 495: */ }
-/* 496:243 */ tStartIndex++;
-/* 497:244 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 498:244 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex)));
-/* 499: */ }
-/* 500:244 */ tStartIndex++;
-/* 501:245 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 502:245 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 503: */ }
-/* 504:245 */ tStartIndex++;
-/* 505:246 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 506:246 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 507: */ }
-/* 508:246 */ tStartIndex++;
-/* 509:247 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 510:247 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 511: */ }
-/* 512:247 */ tStartIndex++;
-/* 513:248 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 514:248 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex)));
-/* 515: */ }
-/* 516:248 */ tStartIndex++;
-/* 517:249 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 518:249 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex)));
-/* 519: */ }
-/* 520:249 */ tStartIndex++;
-/* 521:250 */ break;
-/* 522: */ default:
-/* 523:252 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 524:252 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex)));
-/* 525: */ }
-/* 526:252 */ tStartIndex++;
-/* 527:253 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 528:253 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex)));
-/* 529: */ }
-/* 530:253 */ tStartIndex++;
-/* 531:254 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 532:254 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex)));
-/* 533: */ }
-/* 534:254 */ tStartIndex++;
-/* 535:255 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 536:255 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 537: */ }
-/* 538:255 */ tStartIndex++;
-/* 539:256 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 540:256 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 541: */ }
-/* 542:256 */ tStartIndex++;
-/* 543:257 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 544:257 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex)));
-/* 545: */ }
-/* 546:257 */ tStartIndex++;
-/* 547:258 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 548:258 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex)));
-/* 549: */ }
-/* 550:258 */ tStartIndex++;
-/* 551:259 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 552:259 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex)));
-/* 553: */ }
-/* 554:259 */ tStartIndex++;
-/* 555:260 */ if (aRecipe.getOutput(tStartIndex) != null) {
-/* 556:260 */ this.mOutputs.add(new FixedPositionedStack( aRecipe.getOutput(tStartIndex), 138, 32, aRecipe.getOutputChance(tStartIndex)));
-/* 557: */ }
-/* 558:260 */ tStartIndex++;
-/* 559: */ }
-/* 560:264 */ if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) {
-/* 561:264 */ this.mInputs.add(new FixedPositionedStack( GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 48, 52));
+package gregtech.nei;
+
+import codechicken.lib.gui.GuiDraw;
+import codechicken.nei.PositionedStack;
+import codechicken.nei.guihook.GuiContainerManager;
+import codechicken.nei.guihook.IContainerInputHandler;
+import codechicken.nei.guihook.IContainerTooltipHandler;
+import codechicken.nei.recipe.GuiCraftingRecipe;
+import codechicken.nei.recipe.GuiRecipe;
+import codechicken.nei.recipe.GuiUsageRecipe;
+import codechicken.nei.recipe.TemplateRecipeHandler;
+import codechicken.nei.recipe.TemplateRecipeHandler.CachedRecipe;
+import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect;
+import com.google.common.collect.ListMultimap;
+import cpw.mods.fml.common.event.FMLInterModComms;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.objects.ItemData;
+import gregtech.api.objects.MaterialStack;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
+import net.minecraftforge.fluids.FluidStack;
+import org.lwjgl.opengl.GL11;
+
+public class GT_NEI_DefaultHandler
+ extends TemplateRecipeHandler
+{
+ protected final GT_Recipe.GT_Recipe_Map mRecipeMap;
+ public static final int sOffsetX = 5;
+ public static final int sOffsetY = 11;
+
+ public GT_NEI_DefaultHandler(GT_Recipe.GT_Recipe_Map aRecipeMap)
+ {
+ this.mRecipeMap = aRecipeMap;
+ this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), getOverlayIdentifier(), new Object[0]));
+ if (!NEI_GT_Config.sIsAdded)
+ {
+ FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtech@" + getRecipeName() + "@" + getOverlayIdentifier());
+ GuiCraftingRecipe.craftinghandlers.add(this);
+ GuiUsageRecipe.usagehandlers.add(this);
+ }
+ }
+
+ public TemplateRecipeHandler newInstance()
+ {
+ return new GT_NEI_DefaultHandler(this.mRecipeMap);
+ }
+
+ public class FixedPositionedStack
+ extends PositionedStack
+ {
+ public boolean permutated = false;
+ public final int mChance;
+
+ public FixedPositionedStack(Object object, int x, int y)
+ {
+ this(object, x, y, 0);
+ }
+
+ public FixedPositionedStack(Object object, int x, int y, int aChance)
+ {
+ super(object,x, y, true);
+ this.mChance = aChance;
+ }
+
+ public void generatePermutations()
+ {
+ if (this.permutated) {
+ return;
+ }
+ ArrayList<ItemStack> tDisplayStacks = new ArrayList();
+ for (ItemStack tStack : this.items) {
+ if (GT_Utility.isStackValid(tStack)) {
+ if (tStack.getItemDamage() == 32767)
+ {
+ List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem());
+ if (!permutations.isEmpty())
+ {
+ ItemStack stack;
+ for (Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[] { stack }))) {
+ stack = (ItemStack)i$.next();
+ }
+ }
+ else
+ {
+ ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize);
+ base.stackTagCompound = tStack.stackTagCompound;
+ tDisplayStacks.add(base);
+ }
+ }
+ else
+ {
+ tDisplayStacks.add(GT_Utility.copy(new Object[] { tStack }));
+ }
+ }
+ }
+ this.items = ((ItemStack[])tDisplayStacks.toArray(new ItemStack[0]));
+ if (this.items.length == 0) {
+ this.items = new ItemStack[] { new ItemStack(Blocks.fire) };
+ }
+ this.permutated = true;
+ setPermutationToRender(0);
+ }
+ }
+
+ public class CachedDefaultRecipe
+ extends TemplateRecipeHandler.CachedRecipe
+ {
+ public final GT_Recipe mRecipe;
+ public final List<PositionedStack> mOutputs = new ArrayList();
+ public final List<PositionedStack> mInputs = new ArrayList();
+
+ public List<PositionedStack> getIngredients()
+ {
+ return getCycledIngredients(GT_NEI_DefaultHandler.this.cycleticks / 10, this.mInputs);
+ }
+
+ public PositionedStack getResult()
+ {
+ return null;
+ }
+
+ public List<PositionedStack> getOtherStacks()
+ {
+ return this.mOutputs;
+ }
+
+ public CachedDefaultRecipe(GT_Recipe aRecipe)
+ {
+ super();
+ this.mRecipe = aRecipe;
+
+ int tStartIndex = 0;
+ switch (GT_NEI_DefaultHandler.this.mRecipeMap.mUsualInputCount)
+ {
+ case 0:
+ break;
+ case 1:
+ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
+ }
+ tStartIndex++;
+ break;
+ case 2:
+ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14));
+ }
+ tStartIndex++;
+ if (aRecipe.getRepresentativeInput(tStartIndex) != null) {
+ this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14));
+ }
+ tStartIndex++;
+ break;
+ |
