mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
trolling: troll harder
This commit is contained in:
parent
387071735c
commit
9ca0d83933
132
src/main/java/com/hbm/handler/nei/RadiolysisRecipeHandler.java
Normal file
132
src/main/java/com/hbm/handler/nei/RadiolysisRecipeHandler.java
Normal file
@ -0,0 +1,132 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.gui.GUIRadiolysis;
|
||||
import com.hbm.inventory.recipes.RadiolysisRecipes;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRectHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class RadiolysisRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
|
||||
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
|
||||
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
|
||||
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
|
||||
|
||||
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
|
||||
PositionedStack input;
|
||||
PositionedStack output1;
|
||||
PositionedStack output2;
|
||||
|
||||
public RecipeSet(ItemStack input, ItemStack output1, ItemStack output2) {
|
||||
input.stackSize = 1;
|
||||
this.input = new PositionedStack(input, 34, 25);
|
||||
this.output1 = new PositionedStack(output1, 118, 16);
|
||||
this.output2 = new PositionedStack(output2, 118, 34);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return getCycledIngredients(cycleticks / 20, Arrays.asList(input));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult() {
|
||||
return output1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getOtherStacks() {
|
||||
List<PositionedStack> stacks = new ArrayList<PositionedStack>();
|
||||
stacks.add(output2);
|
||||
return stacks;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return "Radiolysis";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return RefStrings.MODID + ":textures/gui/nei/gui_nei_radiolysis.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
|
||||
if(outputId.equals("ntmRadiolysis")) {
|
||||
HashMap<Object, Object[]> recipes = (HashMap<Object, Object[]>) RadiolysisRecipes.getRecipesForNEI();
|
||||
|
||||
for(Entry<Object, Object[]> recipe : recipes.entrySet()) {
|
||||
this.arecipes.add(new RecipeSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1]));
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
HashMap<Object, Object[]> recipes = (HashMap<Object, Object[]>) RadiolysisRecipes.getRecipesForNEI();
|
||||
|
||||
for(Entry<Object, Object[]> recipe : recipes.entrySet()) {
|
||||
if(NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[0], result) || NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue()[1], result))
|
||||
this.arecipes.add(new RecipeSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1]));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
||||
|
||||
if(inputId.equals("ntmRadiolysis")) {
|
||||
loadCraftingRecipes("ntmRadiolysis", new Object[0]);
|
||||
} else {
|
||||
super.loadUsageRecipes(inputId, ingredients);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
HashMap<Object, Object[]> recipes = (HashMap<Object, Object[]>) RadiolysisRecipes.getRecipesForNEI();
|
||||
|
||||
for(Entry<Object, Object[]> recipe : recipes.entrySet()) {
|
||||
if(NEIServerUtils.areStacksSameType((ItemStack)recipe.getKey(), ingredient))
|
||||
this.arecipes.add(new RecipeSet((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1]));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
drawProgressBar(52, 19, 5, 87, 64, 28, 60, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
transferRectsGui = new LinkedList<RecipeTransferRect>();
|
||||
guiGui = new LinkedList<Class<? extends GuiContainer>>();
|
||||
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(52, 19, 64, 27), "ntmRadiolysis"));
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(66, 25, 25, 14), "ntmRadiolysis"));
|
||||
guiGui.add(GUIRadiolysis.class);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
|
||||
}
|
||||
|
||||
}
|
||||
@ -31,6 +31,9 @@ public class ContainerRadiolysis extends Container {
|
||||
this.addSlotToContainer(new Slot(tile, 12, 148, 17));
|
||||
this.addSlotToContainer(new SlotMachineOutput(tile, 13, 148, 53));
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tile, 14, 8, 53));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
@ -57,11 +60,11 @@ public class ContainerRadiolysis extends Container {
|
||||
ItemStack stack = slot.getStack();
|
||||
var3 = stack.copy();
|
||||
|
||||
if(index <= 13) {
|
||||
if(!this.mergeItemStack(stack, 14, this.inventorySlots.size(), true)) {
|
||||
if(index <= 14) {
|
||||
if(!this.mergeItemStack(stack, 15, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else if(!this.mergeItemStack(stack, 0, 14, false)) {
|
||||
} else if(!this.mergeItemStack(stack, 0, 15, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ public class GUIMachineRTG extends GuiInfoContainer {
|
||||
|
||||
for(int i = 0; i < pellets.size(); i++) {
|
||||
ItemRTGPellet pellet = pellets.get(i);
|
||||
pelletText[i + 1] = I18nUtil.resolveKey("desc.gui.rtg.pelletPower", I18nUtil.resolveKey(pellet.getUnlocalizedName() + ".name"), pellet.getHeat() * 10);
|
||||
pelletText[i + 1] = I18nUtil.resolveKey("desc.gui.rtg.pelletPower", I18nUtil.resolveKey(pellet.getUnlocalizedName() + ".name"), pellet.getHeat() * 5);
|
||||
}
|
||||
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, pelletText);
|
||||
|
||||
@ -30,10 +30,10 @@ public class GUIRadiolysis extends GuiInfoContainer {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
radiolysis.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 61, guiTop + 17, 8, 52);
|
||||
radiolysis.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 17, 26, 16);
|
||||
radiolysis.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 53, 26, 16);
|
||||
radiolysis.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 87, guiTop + 17, 12, 16);
|
||||
radiolysis.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 87, guiTop + 53, 12, 16);
|
||||
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 17, 16, 52, radiolysis.power, radiolysis.maxPower);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 17, 16, 34, radiolysis.power, radiolysis.maxPower);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -51,15 +51,15 @@ public class GUIRadiolysis extends GuiInfoContainer {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int i = (int)(radiolysis.getPower() * 52 / radiolysis.getMaxPower());
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 69 - i, 240, 52 - i, 16, i);
|
||||
int i = (int)(radiolysis.getPower() * 34 / radiolysis.getMaxPower());
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 51 - i, 240, 34 - i, 16, i);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(radiolysis.tanks[0].getSheet());
|
||||
radiolysis.tanks[0].renderTank(this, guiLeft + 61, guiTop + 69, radiolysis.tanks[0].getTankType().textureX() * FluidTank.x, radiolysis.tanks[0].getTankType().textureY() * FluidTank.y, 8, 52);
|
||||
|
||||
for(byte j = 0; j < 2; j++) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(radiolysis.tanks[j].getSheet());
|
||||
radiolysis.tanks[j + 1].renderTank(this, guiLeft + 80, guiTop + 33 + j * 36, radiolysis.tanks[j + 1].getTankType().textureX() * FluidTank.x, radiolysis.tanks[j + 1].getTankType().textureY() * FluidTank.y, 26, 16);
|
||||
radiolysis.tanks[j + 1].renderTank(this, guiLeft + 87, guiTop + 33 + j * 36, radiolysis.tanks[j + 1].getTankType().textureX() * FluidTank.x, radiolysis.tanks[j + 1].getTankType().textureY() * FluidTank.y, 12, 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModItems.part_carbon, 1), new AStack[] {new ComparableStack(ModItems.plate_polymer, 1), new OreDictStack(COAL.dust(), 1), },50);
|
||||
makeRecipe(new ComparableStack(ModItems.part_copper, 1), new AStack[] {new ComparableStack(ModItems.plate_polymer, 1), new OreDictStack(CU.dust(), 1), },50);
|
||||
makeRecipe(new ComparableStack(ModItems.part_plutonium, 1), new AStack[] {new ComparableStack(ModItems.plate_polymer, 1), new ComparableStack(ModItems.powder_plutonium, 1), },50);
|
||||
makeRecipe(new ComparableStack(ModItems.thermo_element, 1), new AStack[] {new OreDictStack(STEEL.plate(), 3), new OreDictStack(IRON.plate(), 1), new OreDictStack(CU.plate(), 2), new ComparableStack(ModItems.wire_red_copper, 2), new ComparableStack(ModItems.wire_aluminium, 2), new OreDictStack(NETHERQUARTZ.dust(), 4), },150);
|
||||
makeRecipe(new ComparableStack(ModItems.thermo_element, 1), new AStack[] {new OreDictStack(STEEL.plate(), 2), new OreDictStack(IRON.plate(), 1), new OreDictStack(CU.plate(), 2), new ComparableStack(ModItems.wire_red_copper, 2), new ComparableStack(ModItems.wire_aluminium, 2), new OreDictStack(NETHERQUARTZ.dust(), 2), },150);
|
||||
makeRecipe(new ComparableStack(ModItems.limiter, 1), new AStack[] {new OreDictStack(STEEL.plate(), 3), new OreDictStack(IRON.plate(), 1), new ComparableStack(ModItems.circuit_copper, 2), new ComparableStack(ModItems.wire_copper, 4), },150);
|
||||
makeRecipe(new ComparableStack(ModItems.plate_dalekanium, 1), new AStack[] {new ComparableStack(ModBlocks.block_meteor, 1), },50);
|
||||
makeRecipe(new ComparableStack(ModBlocks.block_meteor, 1), new AStack[] {new ComparableStack(ModItems.fragment_meteorite, 100), },500);
|
||||
@ -264,7 +264,7 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_rtg_furnace_off, 1), new AStack[] {new ComparableStack(Blocks.furnace, 1), new ComparableStack(ModItems.rtg_unit, 3), new OreDictStack(PB.plate(), 6), new OreDictStack(OreDictManager.getReflector(), 4), new OreDictStack(CU.plate(), 2), },150);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_diesel, 1), new AStack[] {new ComparableStack(ModItems.hull_small_steel, 4), new ComparableStack(Blocks.piston, 4), new OreDictStack(STEEL.ingot(), 6), new OreDictStack(MINGRADE.ingot(), 2), new OreDictStack(CU.plate(), 4), new ComparableStack(ModItems.wire_red_copper, 6), },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_selenium, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(TI.plate(), 6), new OreDictStack(CU.plate(), 8), new ComparableStack(ModItems.hull_big_steel, 1), new ComparableStack(ModItems.hull_small_steel, 9), new ComparableStack(ModItems.pedestal_steel, 1), new ComparableStack(ModItems.coil_copper, 4), },250);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_rtg_grey, 1), new AStack[] {new ComparableStack(ModItems.rtg_unit, 5), new OreDictStack(STEEL.plate(), 8), new ComparableStack(ModItems.wire_red_copper, 4), new OreDictStack(POLYMER.ingot(), 6), },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_rtg_grey, 1), new AStack[] {new ComparableStack(ModItems.rtg_unit, 3), new OreDictStack(STEEL.plate(), 4), new ComparableStack(ModItems.wire_red_copper, 4), new OreDictStack(POLYMER.ingot(), 3), },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_battery, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(S.dust(), 12), new OreDictStack(PB.dust(), 12), new OreDictStack(MINGRADE.ingot(), 2), new ComparableStack(ModItems.wire_red_copper, 4), },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_lithium_battery, 1), new AStack[] {new OreDictStack(POLYMER.ingot(), 4), new OreDictStack(CO.dust(), 12), new OreDictStack(LI.dust(), 12), new OreDictStack(ALLOY.ingot(), 2), new ComparableStack(ModItems.wire_red_copper, 4), },400);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_schrabidium_battery, 1), new AStack[] {new OreDictStack(DESH.ingot(), 4), new OreDictStack(NP237.dust(), 12), new OreDictStack(SA326.dust(), 12), new OreDictStack(SA326.ingot(), 2), new ComparableStack(ModItems.wire_schrabidium, 4), },800);
|
||||
@ -930,6 +930,19 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.inf_water_mk2, 2)
|
||||
}, 200);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_radiolysis), new AStack[] {
|
||||
new OreDictStack(STEEL.ingot(), 10),
|
||||
new ComparableStack(ModBlocks.steel_beam, 16),
|
||||
new OreDictStack(DURA.ingot(), 12),
|
||||
new OreDictStack(DESH.ingot(), 4),
|
||||
new OreDictStack(PB.plate(), 12),
|
||||
new ComparableStack(ModItems.board_copper, 4),
|
||||
new ComparableStack(ModItems.thermo_element, 10),
|
||||
new ComparableStack(ModItems.circuit_copper, 3),
|
||||
new ComparableStack(ModItems.wire_red_copper, 8),
|
||||
new ComparableStack(ModItems.tank_steel, 3)
|
||||
}, 200);
|
||||
|
||||
if(Loader.isModLoaded("Mekanism")) {
|
||||
|
||||
Block mb = (Block) Block.blockRegistry.getObject("Mekanism:MachineBlock");
|
||||
|
||||
@ -28,12 +28,12 @@ public class FusionRecipes {
|
||||
|
||||
public static HashMap<FluidType, Integer> levels = new HashMap();
|
||||
static {
|
||||
levels.put(Fluids.PLASMA_DT, 1);
|
||||
levels.put(Fluids.PLASMA_DH3, 2);
|
||||
levels.put(Fluids.PLASMA_HD, 1);
|
||||
levels.put(Fluids.PLASMA_HT, 1);
|
||||
levels.put(Fluids.PLASMA_XM, 3);
|
||||
levels.put(Fluids.PLASMA_BF, 4);
|
||||
levels.put(Fluids.PLASMA_DT, 1000);
|
||||
levels.put(Fluids.PLASMA_DH3, 2000);
|
||||
levels.put(Fluids.PLASMA_HD, 1000);
|
||||
levels.put(Fluids.PLASMA_HT, 1000);
|
||||
levels.put(Fluids.PLASMA_XM, 3000);
|
||||
levels.put(Fluids.PLASMA_BF, 4000);
|
||||
}
|
||||
|
||||
public static int getBreedingLevel(FluidType plasma) {
|
||||
|
||||
@ -3,10 +3,12 @@ package com.hbm.inventory.recipes;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
@ -20,16 +22,24 @@ public class RadiolysisRecipes {
|
||||
/* I am proud of this but I don't think I should be */
|
||||
public static Map<Object, Object[]> getRecipesForNEI() {
|
||||
Map<Object, Object[]> recipes = new HashMap<Object, Object[]>();
|
||||
Iterator key = radiolysis.entrySet().iterator();
|
||||
Iterator values = radiolysis.values().iterator();
|
||||
Iterator itr = radiolysis.entrySet().iterator();
|
||||
|
||||
while(key.hasNext() && values.hasNext()) {
|
||||
Pair<FluidStack, FluidStack> pair = (Pair<FluidStack, FluidStack>) values.next();
|
||||
while(itr.hasNext()) {
|
||||
Map.Entry entry = (Entry) itr.next();
|
||||
Pair<FluidStack, FluidStack> pair = (Pair<FluidStack, FluidStack>) entry.getValue();
|
||||
ItemStack[] outputs = new ItemStack[2];
|
||||
if(pair.getKey().type == Fluids.NONE) {
|
||||
outputs[0] = new ItemStack(ModItems.nothing);
|
||||
} else {
|
||||
outputs[0] = ItemFluidIcon.make(pair.getKey().type, pair.getKey().fill);
|
||||
}
|
||||
if(pair.getValue().type == Fluids.NONE) {
|
||||
outputs[1] = new ItemStack(ModItems.nothing);
|
||||
} else {
|
||||
outputs[1] = ItemFluidIcon.make(pair.getValue().type, pair.getValue().fill);
|
||||
}
|
||||
|
||||
recipes.put(ItemFluidIcon.make((FluidType) key.next(), 100),
|
||||
new ItemStack[] {
|
||||
ItemFluidIcon.make(pair.getKey().type, pair.getKey().fill),
|
||||
ItemFluidIcon.make(pair.getValue().type, pair.getValue().fill) });
|
||||
recipes.put(ItemFluidIcon.make((FluidType) entry.getKey(), 100), outputs);
|
||||
}
|
||||
|
||||
return recipes;
|
||||
|
||||
@ -204,6 +204,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDeuteriumTower.class, new RenderDeuteriumTower());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCatalyticCracker.class, new RenderCatalyticCracker());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLiquefactor.class, new RenderLiquefactor());
|
||||
//ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadiolysis.class, new RenderRadiolysis());
|
||||
//AMS
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSBase.class, new RenderAMSBase());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSEmitter.class, new RenderAMSEmitter());
|
||||
|
||||
@ -57,6 +57,8 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.registerUsageHandler(new AnvilRecipeHandler());
|
||||
API.registerRecipeHandler(new FuelPoolHandler());
|
||||
API.registerUsageHandler(new FuelPoolHandler());
|
||||
API.registerRecipeHandler(new RadiolysisRecipeHandler());
|
||||
API.registerUsageHandler(new RadiolysisRecipeHandler());
|
||||
|
||||
//universal boyes
|
||||
API.registerRecipeHandler(new ZirnoxRecipeHandler());
|
||||
|
||||
@ -278,6 +278,9 @@ public class ResourceManager {
|
||||
public static final IModelCustom pylon_large = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/network/pylon_large.obj"));
|
||||
public static final IModelCustom substation = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/network/substation.obj"));
|
||||
|
||||
//Radiolysis
|
||||
//public static final IModelCustom radiolysis = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/radiolysis"));
|
||||
|
||||
////Textures TEs
|
||||
|
||||
public static final ResourceLocation universal = new ResourceLocation(RefStrings.MODID, "textures/models/TheGadget3_.png");
|
||||
@ -575,7 +578,8 @@ public class ResourceManager {
|
||||
public static final ResourceLocation pylon_large_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/pylon_large.png");
|
||||
public static final ResourceLocation substation_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/substation.png");
|
||||
|
||||
|
||||
//Radiolysis
|
||||
//public static final ResourceLocation radiolysis_tex = new ResourceLocation(RefStrings.MODID, "textures/models/radiolysis");
|
||||
|
||||
////Obj Items
|
||||
|
||||
|
||||
@ -1194,6 +1194,17 @@ public class ItemRenderLibrary {
|
||||
bindTexture(ResourceManager.liquefactor_tex); ResourceManager.liquefactor.renderPart("Main");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}});
|
||||
|
||||
/*renderers.put(Item.getItemFromBlock(ModBlocks.machine_radiolysis), new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -2.5, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.radiolysis_tex); ResourceManager.radiolysis.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}});*/
|
||||
}
|
||||
|
||||
private static void bindTexture(ResourceLocation res) {
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class RenderRadiolysis extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
/*GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.0D, y, z + 0.0D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(180F, 0F, 1F, 0F);
|
||||
switch(tileEntity.getBlockMetadata() - 10) {
|
||||
case 2:
|
||||
GL11.glRotatef(0F, 0F, 1F, 0F);
|
||||
GL11.glTranslatef(0F, 0F, -1F);
|
||||
break;
|
||||
case 3:
|
||||
GL11.glRotatef(180F, 0F, 1F, 0F);
|
||||
GL11.glTranslatef(1F, 0F, 0F);
|
||||
break;
|
||||
case 4:
|
||||
GL11.glRotatef(90F, 0F, 1F, 0F);
|
||||
GL11.glTranslatef(1F, 0F, -1F);
|
||||
break;
|
||||
case 5:
|
||||
GL11.glRotatef(270F, 0F, 1F, 0F);
|
||||
break;
|
||||
}
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.radiolysis_tex);
|
||||
ResourceManager.radiolysis.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glPopMatrix();*/
|
||||
}
|
||||
}
|
||||
@ -192,10 +192,10 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
|
||||
BreederRecipe out = BreederRecipes.getOutput(slots[1]);
|
||||
|
||||
if(slots[1] != null && slots[1].getItem() == ModItems.meteorite_sword_irradiated)
|
||||
out = new BreederRecipe(ModItems.meteorite_sword_fused, 1);
|
||||
out = new BreederRecipe(ModItems.meteorite_sword_fused, 1000);
|
||||
|
||||
if(slots[1] != null && slots[1].getItem() == ModItems.meteorite_sword_fused)
|
||||
out = new BreederRecipe(ModItems.meteorite_sword_baleful, 4);
|
||||
out = new BreederRecipe(ModItems.meteorite_sword_baleful, 4000);
|
||||
|
||||
if(out == null) {
|
||||
this.progress = 0;
|
||||
|
||||
@ -131,7 +131,7 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
|
||||
|
||||
// RTG ///
|
||||
this.hasRTG = RTGUtil.hasHeat(slots, RTGSlots);
|
||||
this.spin += RTGUtil.updateRTGs(slots, RTGSlots) * 0.1;
|
||||
this.spin += RTGUtil.updateRTGs(slots, RTGSlots) * 0.2;
|
||||
|
||||
if(this.spin > 0) {
|
||||
|
||||
|
||||
@ -210,7 +210,7 @@ public class TileEntityMachineRTG extends TileEntity implements ISidedInventory,
|
||||
if(heat > heatMax)
|
||||
heat = heatMax;
|
||||
|
||||
power += heat * 10;
|
||||
power += heat * 5;
|
||||
if(power > powerMax)
|
||||
power = powerMax;
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineRadiolysis extends TileEntityMachineBase implements IEnergyGenerator, IFluidAcceptor, IFluidSource, IFluidContainer {
|
||||
//TODO: TileMapping, Render file + resource location, container, gui, gui texture, further recipes; add registerRadiolysis to PostLoad
|
||||
//TODO: Render file + resource locations + itemrenderlibrary + clientproxy, gui texture, further recipes
|
||||
|
||||
public long power;
|
||||
public static final int maxPower = 1000000;
|
||||
@ -43,7 +43,7 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
private static final int[] slot_rtg = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||
|
||||
public TileEntityMachineRadiolysis() {
|
||||
super(14); //10 rtg slots, 2 fluid ID slots (io), 2 irradiation slots (io)
|
||||
super(15); //10 rtg slots, 2 fluid ID slots (io), 2 irradiation slots (io), battery slot
|
||||
tanks = new FluidTank[3];
|
||||
tanks[0] = new FluidTank(Fluids.NONE, 2000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.NONE, 2000, 1);
|
||||
@ -102,12 +102,15 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
power = Library.chargeItemsFromTE(slots, 14, power, maxPower);
|
||||
|
||||
int heat = RTGUtil.updateRTGs(slots, slot_rtg);
|
||||
power += heat * 15;
|
||||
power += heat * 8;
|
||||
|
||||
if(power > maxPower)
|
||||
power = maxPower;
|
||||
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
this.sendPower(worldObj, xCoord + 2, yCoord, zCoord, dir);
|
||||
this.sendPower(worldObj, xCoord - 2, yCoord, zCoord, dir);
|
||||
@ -178,28 +181,33 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
|
||||
// Code: pressure, sword, sterilize.
|
||||
private void sterilize() {
|
||||
if(!checkIfValid())
|
||||
return;
|
||||
|
||||
if(slots[12].getItem() instanceof ItemFood && !(slots[12].getItem() == ModItems.pancake)) {
|
||||
slots[12].stackSize -= 1;
|
||||
if(slots[12].stackSize <= 0)
|
||||
slots[12] = null;
|
||||
}
|
||||
|
||||
ItemStack output = slots[12].copy();
|
||||
output.stackSize = 1;
|
||||
|
||||
if(slots[13] == null) {
|
||||
slots[13] = output;
|
||||
slots[13].stackTagCompound.setBoolean("ntmContagion", false);
|
||||
} else if(slots[13].isItemEqual(output) && slots[13].stackSize + output.stackSize <= slots[13].getMaxStackSize()) {
|
||||
slots[12].stackSize -= output.stackSize;
|
||||
if(slots[12].stackSize <= 0)
|
||||
slots[12] = null;
|
||||
if(slots[12] != null) {
|
||||
if(slots[12].getItem() instanceof ItemFood && !(slots[12].getItem() == ModItems.pancake)) {
|
||||
slots[12].stackSize -= 1;
|
||||
if(slots[12].stackSize <= 0)
|
||||
slots[12] = null;
|
||||
}
|
||||
|
||||
slots[13].stackSize += output.stackSize;
|
||||
slots[13].stackTagCompound.setBoolean("ntmContagion", false);
|
||||
if(!checkIfValid())
|
||||
return;
|
||||
|
||||
ItemStack output = slots[12].copy();
|
||||
output.stackSize = 1;
|
||||
|
||||
if(slots[13] == null) {
|
||||
slots[12].stackSize -= output.stackSize;
|
||||
if(slots[12].stackSize <= 0)
|
||||
slots[12] = null;
|
||||
slots[13] = output;
|
||||
slots[13].stackTagCompound.setBoolean("ntmContagion", false);
|
||||
} else if(slots[13].isItemEqual(output) && slots[13].stackSize + output.stackSize <= slots[13].getMaxStackSize()) {
|
||||
slots[12].stackSize -= output.stackSize;
|
||||
if(slots[12].stackSize <= 0)
|
||||
slots[12] = null;
|
||||
|
||||
slots[13].stackSize += output.stackSize;
|
||||
slots[13].stackTagCompound.setBoolean("ntmContagion", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -270,10 +278,8 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
if(tank.getTankType() == type) {
|
||||
return tank.getMaxFill();
|
||||
}
|
||||
if(tanks[0].getTankType() == type) {
|
||||
return tanks[0].getMaxFill();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Loading…
x
Reference in New Issue
Block a user