mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
crucible GUI work, material IDs
This commit is contained in:
parent
8910c6c662
commit
60b6ec494c
@ -1,8 +1,11 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerCrucible;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityCrucible;
|
||||
|
||||
@ -42,5 +45,17 @@ public class GUICrucible extends GuiInfoContainer {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int pGauge = crucible.progress * 33 / crucible.processTime;
|
||||
if(pGauge > 0) drawTexturedModalRect(guiLeft + 126, guiTop + 82, 176, 0, pGauge, 5);
|
||||
int hGauge = crucible.heat * 33 / crucible.maxHeat;
|
||||
if(hGauge > 0) drawTexturedModalRect(guiLeft + 126, guiTop + 91, 176, 5, hGauge, 5);
|
||||
|
||||
if(!crucible.recipeStack.isEmpty()) drawStack(crucible.recipeStack, 62, 97);
|
||||
if(!crucible.wasteStack.isEmpty()) drawStack(crucible.wasteStack, 17, 97);
|
||||
}
|
||||
|
||||
protected void drawStack(List<MaterialStack> stack, int x, int y) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,53 +23,77 @@ import net.minecraft.item.ItemStack;
|
||||
* @author hbm
|
||||
*/
|
||||
public class Mats {
|
||||
|
||||
|
||||
public static HashMap<String, MaterialShapes> prefixByName = new HashMap();
|
||||
public static HashMap<Integer, NTMMaterial> matById = new HashMap();
|
||||
public static HashMap<String, NTMMaterial> matByName = new HashMap();
|
||||
//public static HashMap<String, NTMMaterial> matRemap = new HashMap();
|
||||
public static HashMap<ComparableStack, List<MaterialStack>> materialEntries = new HashMap();
|
||||
public static HashMap<String, List<MaterialStack>> materialOreEntries = new HashMap();
|
||||
|
||||
//Vanilla
|
||||
public static final NTMMaterial MAT_STONE = makeSmeltable(df("Stone"), 0);
|
||||
public static final NTMMaterial MAT_COAL = make(COAL).smeltable(SmeltingBehavior.ADDITIVE);
|
||||
public static final NTMMaterial MAT_IRON = makeSmeltable(IRON, 0).omitAutoGen();
|
||||
public static final NTMMaterial MAT_GOLD = makeSmeltable(GOLD, 0).omitAutoGen();
|
||||
public static final NTMMaterial MAT_REDSTONE = makeSmeltable(REDSTONE, 0).omitAutoGen();
|
||||
/*
|
||||
* ItemStacks are saved with their metadata being truncated to a short, so the max meta is 32767
|
||||
* Format for elements: Atomic number *100, plus the last two digits of the mass number. Mass number is 0 for generic/undefined/mixed materials.
|
||||
* Vanilla numbers are in vanilla space (0-29), basic alloys use alloy space (30-99)
|
||||
*/
|
||||
|
||||
/* Vanilla Space, up to 30 materials, */
|
||||
public static final int _VS = 0;
|
||||
/* Alloy Space, up to 70 materials. Use >20_000 as an extension.*/
|
||||
public static final int _AS = 30;
|
||||
|
||||
//Vanilla and vanilla-like
|
||||
public static final NTMMaterial MAT_STONE = makeSmeltable(_VS + 00, df("Stone"), 0);
|
||||
public static final NTMMaterial MAT_COAL = makeAdditive( 1400, COAL, 0);
|
||||
public static final NTMMaterial MAT_LIGNITE = makeAdditive( 1401, LIGNITE, 0);
|
||||
public static final NTMMaterial MAT_COALCOKE = makeAdditive( 1410, COALCOKE, 0);
|
||||
public static final NTMMaterial MAT_PETCOKE = makeAdditive( 1411, PETCOKE, 0);
|
||||
public static final NTMMaterial MAT_LIGCOKE = makeAdditive( 1412, LIGCOKE, 0);
|
||||
public static final NTMMaterial MAT_GRAPHITE = makeAdditive( 1420, GRAPHITE, 0);
|
||||
public static final NTMMaterial MAT_IRON = makeSmeltable(2600, IRON, 0).omitAutoGen();
|
||||
public static final NTMMaterial MAT_GOLD = makeSmeltable(7900, GOLD, 0).omitAutoGen();
|
||||
public static final NTMMaterial MAT_REDSTONE = makeSmeltable(_VS + 01, REDSTONE, 0).omitAutoGen();
|
||||
|
||||
//Radioactive
|
||||
public static final NTMMaterial MAT_URANIUM = makeSmeltable(U, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_THORIUM = makeSmeltable(TH232, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_PLUTONIUM = makeSmeltable(PU, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_RADIUM = makeSmeltable(RA226, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_URANIUM = makeSmeltable(9200, U, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_THORIUM = makeSmeltable(9232, TH232, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_PLUTONIUM = makeSmeltable(9400, PU, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_RADIUM = makeSmeltable(8826, RA226, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
|
||||
|
||||
//Base metals
|
||||
public static final NTMMaterial MAT_TITANIUM = makeSmeltable(TI, 0).setShapes(INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_COPPER = makeSmeltable(CU, 0).setShapes(WIRE, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_TUNGSTEN = makeSmeltable(W, 0).setShapes(WIRE, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_ALUMINIUM = makeSmeltable(AL, 0).setShapes(WIRE, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_LEAD = makeSmeltable(PB, 0).setShapes(NUGGET, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_BISMUTH = makeSmeltable(df("Bismuth"), 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_ARSENIC = makeSmeltable(AS, 0).setShapes(NUGGET, INGOT);
|
||||
public static final NTMMaterial MAT_TANTALIUM = makeSmeltable(TA, 0).setShapes(NUGGET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_NIOBIUM = makeSmeltable(NB, 0).setShapes(NUGGET, DUSTTINY, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_BERYLLIUM = makeSmeltable(BE, 0).setShapes(NUGGET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_COBALT = makeSmeltable(CO, 0).setShapes(NUGGET, DUSTTINY, BILLET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_BORON = makeSmeltable(B, 0).setShapes(DUSTTINY, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_TITANIUM = makeSmeltable(2200, TI, 0).setShapes(INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_COPPER = makeSmeltable(2900, CU, 0).setShapes(WIRE, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_TUNGSTEN = makeSmeltable(7400, W, 0).setShapes(WIRE, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_ALUMINIUM = makeSmeltable(1300, AL, 0).setShapes(WIRE, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_LEAD = makeSmeltable(8200, PB, 0).setShapes(NUGGET, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_BISMUTH = makeSmeltable(8300, df("Bismuth"), 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_ARSENIC = makeSmeltable(3300, AS, 0).setShapes(NUGGET, INGOT);
|
||||
public static final NTMMaterial MAT_TANTALIUM = makeSmeltable(7300, TA, 0).setShapes(NUGGET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_NIOBIUM = makeSmeltable(4100, NB, 0).setShapes(NUGGET, DUSTTINY, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_BERYLLIUM = makeSmeltable(400, BE, 0).setShapes(NUGGET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_COBALT = makeSmeltable(2700, CO, 0).setShapes(NUGGET, DUSTTINY, BILLET, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_BORON = makeSmeltable(500, B, 0).setShapes(DUSTTINY, INGOT, DUST, BLOCK);
|
||||
|
||||
//Alloys
|
||||
public static final NTMMaterial MAT_STEEL = makeSmeltable(STEEL, 0).setShapes(DUSTTINY, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_MINGRADE = makeSmeltable(MINGRADE, 0).setShapes(WIRE, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_ALLOY = makeSmeltable(ALLOY, 0).setShapes(WIRE, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_TCALLOY = makeSmeltable(TCALLOY, 0).setShapes(INGOT, DUST);
|
||||
public static final NTMMaterial MAT_DURA = makeSmeltable(DURA, 0).setShapes(INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_MAGTUNG = makeSmeltable(MAGTUNG, 0).setShapes(INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_STEEL = makeSmeltable(_AS + 0, STEEL, 0).setShapes(DUSTTINY, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_MINGRADE = makeSmeltable(_AS + 1, MINGRADE, 0).setShapes(WIRE, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_ALLOY = makeSmeltable(_AS + 2, ALLOY, 0).setShapes(WIRE, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_DURA = makeSmeltable(_AS + 3, DURA, 0).setShapes(INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_SATURN = makeSmeltable(_AS + 4, BIGMT, 0).setShapes(INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_STAR = makeSmeltable(_AS + 5, STAR, 0).setShapes(INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_TCALLOY = makeSmeltable(_AS + 6, TCALLOY, 0).setShapes(INGOT, DUST);
|
||||
public static final NTMMaterial MAT_MAGTUNG = makeSmeltable(_AS + 7, MAGTUNG, 0).setShapes(INGOT, DUST, BLOCK);
|
||||
|
||||
public static NTMMaterial make(DictFrame dict) {
|
||||
return new NTMMaterial(dict);
|
||||
public static NTMMaterial make(int id, DictFrame dict) {
|
||||
return new NTMMaterial(id, dict);
|
||||
}
|
||||
|
||||
public static NTMMaterial makeSmeltable(DictFrame dict, int color) {
|
||||
return new NTMMaterial(dict).smeltable(SmeltingBehavior.SMELTABLE).setMoltenColor(color);
|
||||
public static NTMMaterial makeSmeltable(int id, DictFrame dict, int color) {
|
||||
return new NTMMaterial(id, dict).smeltable(SmeltingBehavior.SMELTABLE).setMoltenColor(color);
|
||||
}
|
||||
|
||||
public static NTMMaterial makeAdditive(int id, DictFrame dict, int color) {
|
||||
return new NTMMaterial(id, dict).smeltable(SmeltingBehavior.ADDITIVE).setMoltenColor(color);
|
||||
}
|
||||
|
||||
public static DictFrame df(String string) {
|
||||
|
||||
@ -9,19 +9,23 @@ import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
*/
|
||||
public class NTMMaterial {
|
||||
|
||||
public final int id;
|
||||
public String[] names;
|
||||
public MaterialShapes[] shapes = new MaterialShapes[0];
|
||||
public boolean omitItemGen = false;
|
||||
public SmeltingBehavior smeltable = SmeltingBehavior.NOT_SMELTABLE;
|
||||
public int moltenColor = 0xFF4A00;
|
||||
|
||||
public NTMMaterial(DictFrame dict) {
|
||||
public NTMMaterial(int id, DictFrame dict) {
|
||||
|
||||
this.names = dict.mats;
|
||||
this.id = id;
|
||||
|
||||
for(String name : dict.mats) {
|
||||
Mats.matByName.put(name, this);
|
||||
}
|
||||
|
||||
Mats.matById.put(id, this);
|
||||
}
|
||||
|
||||
/** Shapes for autogen */
|
||||
|
||||
@ -22,6 +22,7 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
@ -62,8 +63,39 @@ public class TileEntityCrucible extends TileEntityMachineBase implements IGUIPro
|
||||
if(!trySmelt()) {
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
int[] rec = new int[recipeStack.size() * 2];
|
||||
int[] was = new int[wasteStack.size() * 2];
|
||||
for(int i = 0; i < recipeStack.size(); i++) { MaterialStack sta = recipeStack.get(i); rec[i * 2] = sta.material.id; rec[i * 2 + 1] = sta.amount; }
|
||||
for(int i = 0; i < wasteStack.size(); i++) { MaterialStack sta = wasteStack.get(i); was[i * 2] = sta.material.id; was[i * 2 + 1] = sta.amount; }
|
||||
data.setIntArray("rec", rec);
|
||||
data.setIntArray("was", was);
|
||||
data.setInteger("progress", progress);
|
||||
data.setInteger("heat", heat);
|
||||
this.networkPack(data, 25);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
|
||||
this.recipeStack.clear();
|
||||
this.wasteStack.clear();
|
||||
|
||||
int[] rec = nbt.getIntArray("rec");
|
||||
for(int i = 0; i < rec.length / 2; i++) {
|
||||
recipeStack.add(new MaterialStack(Mats.matById.get(rec[i * 2]), rec[i * 2 + 1]));
|
||||
}
|
||||
|
||||
int[] was = nbt.getIntArray("was");
|
||||
for(int i = 0; i < was.length / 2; i++) {
|
||||
recipeStack.add(new MaterialStack(Mats.matById.get(was[i * 2]), was[i * 2 + 1]));
|
||||
}
|
||||
|
||||
this.progress = nbt.getInteger("progress");
|
||||
this.heat = nbt.getInteger("heat");
|
||||
}
|
||||
|
||||
protected void tryPullHeat() {
|
||||
TileEntity con = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Loading…
x
Reference in New Issue
Block a user