better wire rendering, sat miner loot pool configs

This commit is contained in:
Boblet 2024-03-21 16:52:15 +01:00
parent 33e6237377
commit 3f3d7551d5
12 changed files with 147 additions and 100 deletions

View File

@ -35,6 +35,10 @@
* The particle accelerator as well as the schottky particle diodes now have presentations explaining how they work
* Loot pools are now configurable. Loot is divided into different categories, and structures may generate things from certain categories.
* The config currently includes all items spawned in dungeon chests/crates/safes/lockers, excluding black book spawns, but also including the loot pool for red room pedestals
* Also added satellites as configurable loot pools. Yay!
* Pylons and wire connectors now use a texture instead of a solid colored wire
* The cable model has been simplified, being only a single face instead of three faces stuck inside each other at weird angles
* Cables now sag slightly more at long ranges
## Fixed
* WarTec should now be compatible again
@ -48,3 +52,4 @@
* Fixed one of the woodburner's ports being offset in certain orientations
* Fixed fog caching causing weird behavior with the sky color change in response to crater biomes (or lack thereof)
* Fixed "F1 for help" keybind not working on non-standard inventories such as the NEI item list
* Fixed pylon wire rendering having incorrect corrdinates for brightness checks

View File

@ -50,6 +50,7 @@ public class ItemPoolConfigJSON {
JsonWriter writer = new JsonWriter(new FileWriter(file));
writer.setIndent(" ");
writer.beginObject();
writer.name("description").value("Format is as follows: First object is an array representing the itemstack in question, same rules apply here as they do for recipe configs but with one difference: Stacks accept NBT. NBT is contained in {curly brackets}, the format is the same as it is for the /give command. After the stack comes the minimum amount of items, then the maximum (the stack's own stacksize value is ignored). The final number is the weight, an item with a weight of 3 is 3x as likely to appear than an item with a weight of 1.");
writer.name("pools").beginObject();
for(Entry<String, ItemPool> entry : ItemPool.pools.entrySet()) {

View File

@ -0,0 +1,61 @@
package com.hbm.itempool;
import static com.hbm.lib.HbmChestContents.weighted;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems;
import net.minecraft.init.Items;
import net.minecraft.util.WeightedRandomChestContent;
public class ItemPoolSatellite {
public static final String POOL_SAT_MINER = "POOL_SAT_MINER";
public static final String POOL_SAT_LUNAR = "POOL_SAT_LUNAR"; //woona
public static void init() {
new ItemPool(POOL_SAT_MINER) {{
this.pool = new WeightedRandomChestContent[] {
weighted(ModItems.powder_aluminium, 0, 3, 3, 10),
weighted(ModItems.powder_iron, 0, 3, 3, 10),
weighted(ModItems.powder_titanium, 0, 2, 2, 8),
weighted(ModItems.crystal_tungsten, 0, 2, 2, 7),
weighted(ModItems.powder_coal, 0, 4, 4, 15),
weighted(ModItems.powder_uranium, 0, 2, 2, 5),
weighted(ModItems.powder_plutonium, 0, 1, 1, 5),
weighted(ModItems.powder_thorium, 0, 2, 2, 7),
weighted(ModItems.powder_desh_mix, 0, 3, 3, 5),
weighted(ModItems.powder_diamond, 0, 2, 2, 7),
weighted(Items.redstone, 0, 5, 5, 15),
weighted(ModItems.powder_nitan_mix, 0, 2, 2, 5),
weighted(ModItems.powder_power, 0, 2, 2, 5),
weighted(ModItems.powder_copper, 0, 5, 5, 15),
weighted(ModItems.powder_lead, 0, 3, 3, 10),
weighted(ModItems.fluorite, 0, 4, 4, 15),
weighted(ModItems.powder_lapis, 0, 4, 4, 10),
weighted(ModItems.crystal_aluminium, 0, 1, 1, 5),
weighted(ModItems.crystal_gold, 0, 1, 1, 5),
weighted(ModItems.crystal_phosphorus, 0, 1, 1, 10),
weighted(ModBlocks.gravel_diamond, 0, 1, 1, 3),
weighted(ModItems.crystal_uranium, 0, 1, 1, 3),
weighted(ModItems.crystal_plutonium, 0, 1, 1, 3),
weighted(ModItems.crystal_trixite, 0, 1, 1, 1),
weighted(ModItems.crystal_starmetal, 0, 1, 1, 1),
weighted(ModItems.crystal_lithium, 0, 2,1, 4)
};
}};
new ItemPool(POOL_SAT_LUNAR) {{
this.pool = new WeightedRandomChestContent[] {
weighted(ModBlocks.moon_turf, 0, 48, 48, 5),
weighted(ModBlocks.moon_turf, 0, 32, 32, 7),
weighted(ModBlocks.moon_turf, 0, 16, 16, 5),
weighted(ModItems.powder_lithium, 0, 3, 3, 5),
weighted(ModItems.powder_iron, 0, 3, 3, 5),
weighted(ModItems.crystal_iron, 0, 1, 1, 1),
weighted(ModItems.crystal_lithium, 0, 1, 1, 1)
};
}};
}
}

View File

@ -412,7 +412,6 @@ public class ClientProxy extends ServerProxy {
double[] rir = new double[] {0, 0, 0};
double[] tir = new double[] {0, 0, 0};
double[] sir = new double[] {1.1, 1.1, 1.1};
double[] sir_default = new double[] {1, 1, 1};
MinecraftForgeClient.registerItemRenderer(ModItems.titanium_sword, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir));
MinecraftForgeClient.registerItemRenderer(ModItems.alloy_sword, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir));
@ -424,14 +423,18 @@ public class ClientProxy extends ServerProxy {
MinecraftForgeClient.registerItemRenderer(ModItems.cmb_sword, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir));
MinecraftForgeClient.registerItemRenderer(ModItems.dnt_sword, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir));
MinecraftForgeClient.registerItemRenderer(ModItems.bismuth_pickaxe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.bismuth_axe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.volcanic_pickaxe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.volcanic_axe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.chlorophyte_pickaxe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.chlorophyte_axe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.mese_pickaxe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.mese_axe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir_default));
double[] sfp_default = new double[] {1, 1, 1};
double[] tfp_default = new double[] {0, 0, 0};
double[] sir_default = new double[] {1, 1, 1};
MinecraftForgeClient.registerItemRenderer(ModItems.bismuth_pickaxe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp_default, sfp_default, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.bismuth_axe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp_default, sfp_default, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.volcanic_pickaxe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp_default, sfp_default, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.volcanic_axe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp_default, sfp_default, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.chlorophyte_pickaxe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp_default, sfp_default, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.chlorophyte_axe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp_default, sfp_default, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.mese_pickaxe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp_default, sfp_default, rir, tir, sir_default));
MinecraftForgeClient.registerItemRenderer(ModItems.mese_axe, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp_default, sfp_default, rir, tir, sir_default));
ItemRenderMissileGeneric.init();
MinecraftForgeClient.registerItemRenderer(ModItems.missile_test, new ItemRenderMissileGeneric(RenderMissileType.TYPE_TIER0));

View File

@ -784,6 +784,7 @@ public class ResourceManager {
public static final ResourceLocation connector_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/connector.png");
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");
public static final ResourceLocation wire_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/wire.png");
//Radiolysis
public static final ResourceLocation radiolysis_tex = new ResourceLocation(RefStrings.MODID, "textures/models/radiolysis.png");

View File

@ -34,7 +34,7 @@ public class RenderConnector extends RenderPylonBase {
GL11.glPopMatrix();
GL11.glPushMatrix();
this.renderSingleLine(con, x, y, z);
this.renderLinesGeneric(con, x, y, z);
GL11.glPopMatrix();
}
}

View File

@ -33,7 +33,7 @@ public class RenderPylon extends RenderPylonBase {
GL11.glPopMatrix();
GL11.glPushMatrix();
this.renderSingleLine(pyl, x, y, z);
this.renderLinesGeneric(pyl, x, y, z);
GL11.glPopMatrix();
}
}

View File

@ -2,10 +2,10 @@ package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.network.TileEntityPylonBase;
import com.hbm.tileentity.network.TileEntityPylonBase.ConnectionType;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
@ -16,7 +16,7 @@ import net.minecraft.world.World;
public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
//TODO: adapt this into a more generic form for multi wire pylons
@Deprecated
/*@Deprecated
public void renderSingleLine(TileEntityPylonBase pyl, double x, double y, double z) {
for(int i = 0; i < pyl.connected.size(); i++) {
@ -70,7 +70,7 @@ public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
}
}
}
}
}*/
/**
* The closest we have to a does-all solution. It will figure out if it needs to draw multiple lines,
@ -82,6 +82,8 @@ public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
*/
public void renderLinesGeneric(TileEntityPylonBase pyl, double x, double y, double z) {
this.bindTexture(ResourceManager.wire_tex);
for(int i = 0; i < pyl.connected.size(); i++) {
int[] wire = pyl.connected.get(i);
@ -155,33 +157,46 @@ public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
float count = 10;
Tessellator tess = Tessellator.instance;
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
tess.startDrawingQuads();
Vec3 delta = Vec3.createVectorHelper(x0 - x1, y0 - y1, z0 - z1);
double hang = Math.min(delta.lengthVector() / 15D, 2.5D);
for(float j = 0; j < count; j++) {
float k = j + 1;
double sagJ = Math.sin(j / count * Math.PI * 0.5) * hang;
double sagK = Math.sin(k / count * Math.PI * 0.5) * hang;
double sagMean = (sagJ + sagK) / 2D;
double deltaX = x1 - x0;
double deltaY = y1 - y0;
double deltaZ = z1 - z0;
double ja = j + 0.5D;
double ix = pyl.xCoord + x0 + deltaX / (double)(count * 2) * ja;
double iy = pyl.yCoord + y0 + deltaY / (double)(count * 2) * ja - Math.sin(j / count * Math.PI * 0.5);
double iz = pyl.zCoord + z0 + deltaZ / (double)(count * 2) * ja;
double ix = pyl.xCoord + x0 + deltaX / (double)(count) * ja;
double iy = pyl.yCoord + y0 + deltaY / (double)(count) * ja - sagMean;
double iz = pyl.zCoord + z0 + deltaZ / (double)(count) * ja;
int brightness = world.getLightBrightnessForSkyBlocks(MathHelper.floor_double(ix), MathHelper.floor_double(iy), MathHelper.floor_double(iz), 0);
int lX = brightness % 65536;
int lY = brightness / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)lX / 1.0F, (float)lY / 1.0F);
tess.setBrightness(brightness);
drawLineSegment(
drawLineSegment(tess,
x0 + (deltaX * j / count),
y0 + (deltaY * j / count) - Math.sin(j / count * Math.PI * 0.5),
y0 + (deltaY * j / count) - sagJ,
z0 + (deltaZ * j / count),
x0 + (deltaX * k / count),
y0 + (deltaY * k / count) - Math.sin(k / count * Math.PI * 0.5),
y0 + (deltaY * k / count) - sagK,
z0 + (deltaZ * k / count));
}
tess.draw();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
}
@ -196,32 +211,31 @@ public abstract class RenderPylonBase extends TileEntitySpecialRenderer {
* @param b
* @param c
*/
public void drawLineSegment(double x, double y, double z, double a, double b, double c) {
public void drawLineSegment(Tessellator tessellator, double x, double y, double z, double a, double b, double c) {
double girth = 0.03125D;
double dX = x - a;
double dY = y - b;
double dZ = z - c;
double length = Math.sqrt(dX * dX + dY * dY + dZ * dZ);
int wrap = (int) Math.ceil(length * 8);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawing(5);
tessellator.setColorOpaque_I(LINE_COLOR);
tessellator.addVertex(x, y + girth, z);
tessellator.addVertex(x, y - girth, z);
tessellator.addVertex(a, b + girth, c);
tessellator.addVertex(a, b - girth, c);
tessellator.addVertex(x + girth, y, z);
if(dX + dZ < 0) wrap *= -1;
tessellator.setColorOpaque_I(0xffffff);
tessellator.addVertexWithUV(x, y + girth, z, 0, 0);
tessellator.addVertexWithUV(x, y - girth, z, 0, 1);
tessellator.addVertexWithUV(a, b - girth, c, wrap, 1);
tessellator.addVertexWithUV(a, b + girth, c, wrap, 0);
/*tessellator.addVertex(x + girth, y, z);
tessellator.addVertex(x - girth, y, z);
tessellator.addVertex(a + girth, b, c);
tessellator.addVertex(a - girth, b, c);
tessellator.addVertex(x, y, z + girth);
tessellator.addVertex(x, y, z - girth);
tessellator.addVertex(a, b, c + girth);
tessellator.addVertex(a, b, c - girth);
tessellator.draw();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_CULL_FACE);
tessellator.addVertex(a, b, c - girth);*/
}
public static final int LINE_COLOR = 0xBB3311;

View File

@ -1,20 +1,10 @@
package com.hbm.saveddata.satellites;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems;
import com.hbm.util.WeightedRandomObject;
import net.minecraft.item.ItemStack;
import com.hbm.itempool.ItemPoolSatellite;
public class SatelliteLunarMiner extends SatelliteMiner {
static {
registerCargo(SatelliteLunarMiner.class, new WeightedRandomObject[] {
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 48), 5),
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 32), 7),
new WeightedRandomObject(new ItemStack(ModBlocks.moon_turf, 16), 5),
new WeightedRandomObject(new ItemStack(ModItems.powder_lithium, 3), 5),
new WeightedRandomObject(new ItemStack(ModItems.powder_iron, 3), 5),
new WeightedRandomObject(new ItemStack(ModItems.crystal_iron, 1), 1),
new WeightedRandomObject(new ItemStack(ModItems.crystal_lithium, 1), 1)
});
}
static {
registerCargo(SatelliteLunarMiner.class, ItemPoolSatellite.POOL_SAT_LUNAR);
}
}

View File

@ -1,10 +1,7 @@
package com.hbm.saveddata.satellites;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems;
import com.hbm.itempool.ItemPoolSatellite;
import com.hbm.util.WeightedRandomObject;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import java.util.HashMap;
@ -13,7 +10,7 @@ public class SatelliteMiner extends Satellite {
/**
* {@link WeightedRandomObject} array with loot the satellite will deliver.
*/
private static final HashMap<Class<? extends SatelliteMiner>, WeightedRandomObject[]> CARGO = new HashMap<>();
private static final HashMap<Class<? extends SatelliteMiner>, String> CARGO = new HashMap<>();
public long lastOp;
@ -33,7 +30,7 @@ public class SatelliteMiner extends Satellite {
* Replaces cargo of the satellite.
* @param cargo - Array of {@link WeightedRandomObject} representing the loot that will be delivered.
*/
public static void registerCargo(Class<? extends SatelliteMiner> minerSatelliteClass, WeightedRandomObject[] cargo) {
public static void registerCargo(Class<? extends SatelliteMiner> minerSatelliteClass, String cargo) {
CARGO.put(minerSatelliteClass, cargo);
}
@ -41,39 +38,11 @@ public class SatelliteMiner extends Satellite {
* Gets items the satellite can deliver.
* @return - Array of {@link WeightedRandomObject} of satellite loot.
*/
public WeightedRandomObject[] getCargo() {
public String getCargo() {
return CARGO.get(getClass());
}
static {
registerCargo(SatelliteMiner.class, new WeightedRandomObject[] {
new WeightedRandomObject(new ItemStack(ModItems.powder_aluminium, 3), 10),
new WeightedRandomObject(new ItemStack(ModItems.powder_iron, 3), 10),
new WeightedRandomObject(new ItemStack(ModItems.powder_titanium, 2), 8),
new WeightedRandomObject(new ItemStack(ModItems.crystal_tungsten, 2), 7),
new WeightedRandomObject(new ItemStack(ModItems.powder_coal, 4), 15),
new WeightedRandomObject(new ItemStack(ModItems.powder_uranium, 2), 5),
new WeightedRandomObject(new ItemStack(ModItems.powder_plutonium, 1), 5),
new WeightedRandomObject(new ItemStack(ModItems.powder_thorium, 2), 7),
new WeightedRandomObject(new ItemStack(ModItems.powder_desh_mix, 3), 5),
new WeightedRandomObject(new ItemStack(ModItems.powder_diamond, 2), 7),
new WeightedRandomObject(new ItemStack(Items.redstone, 5), 15),
new WeightedRandomObject(new ItemStack(ModItems.powder_nitan_mix, 2), 5),
new WeightedRandomObject(new ItemStack(ModItems.powder_power, 2), 5),
new WeightedRandomObject(new ItemStack(ModItems.powder_copper, 5), 15),
new WeightedRandomObject(new ItemStack(ModItems.powder_lead, 3), 10),
new WeightedRandomObject(new ItemStack(ModItems.fluorite, 4), 15),
new WeightedRandomObject(new ItemStack(ModItems.powder_lapis, 4), 10),
new WeightedRandomObject(new ItemStack(ModItems.powder_combine_steel, 1), 1),
new WeightedRandomObject(new ItemStack(ModItems.crystal_aluminium, 1), 5),
new WeightedRandomObject(new ItemStack(ModItems.crystal_gold, 1), 5),
new WeightedRandomObject(new ItemStack(ModItems.crystal_phosphorus, 1), 10),
new WeightedRandomObject(new ItemStack(ModBlocks.gravel_diamond, 1), 3),
new WeightedRandomObject(new ItemStack(ModItems.crystal_uranium, 1), 3),
new WeightedRandomObject(new ItemStack(ModItems.crystal_plutonium, 1), 3),
new WeightedRandomObject(new ItemStack(ModItems.crystal_trixite, 1), 1),
new WeightedRandomObject(new ItemStack(ModItems.crystal_starmetal, 1), 1),
new WeightedRandomObject(new ItemStack(ModItems.crystal_lithium, 2), 4)
});
registerCargo(SatelliteMiner.class, ItemPoolSatellite.POOL_SAT_MINER);
}
}

View File

@ -4,12 +4,12 @@ import com.hbm.entity.missile.EntityMinerRocket;
import com.hbm.explosion.ExplosionNukeSmall;
import com.hbm.inventory.container.ContainerSatDock;
import com.hbm.inventory.gui.GUISatDock;
import com.hbm.itempool.ItemPool;
import com.hbm.items.ISatChip;
import com.hbm.saveddata.SatelliteSavedData;
import com.hbm.saveddata.satellites.Satellite;
import com.hbm.saveddata.satellites.SatelliteMiner;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.util.WeightedRandomObject;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.GuiScreen;
@ -23,6 +23,7 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.WeightedRandom;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraft.world.World;
import java.util.List;
@ -233,16 +234,18 @@ public class TileEntityMachineSatDock extends TileEntity implements ISidedInvent
}
}
private void unloadCargo(SatelliteMiner satellite) {
int itemAmount = worldObj.rand.nextInt(6) + 10;
private void unloadCargo(SatelliteMiner satellite) {
int itemAmount = worldObj.rand.nextInt(6) + 10;
WeightedRandomObject[] cargo = satellite.getCargo();
WeightedRandomChestContent[] cargo = ItemPool.getPool(satellite.getCargo());
for (int i = 0; i < itemAmount; i++) {
ItemStack stack = ((WeightedRandomObject) WeightedRandom.getRandomItem(worldObj.rand, cargo)).asStack();
addToInv(stack.copy());
}
}
for(int i = 0; i < itemAmount; i++) {
WeightedRandomChestContent weighted = (WeightedRandomChestContent) WeightedRandom.getRandomItem(worldObj.rand, cargo);
ItemStack stack = weighted.theItemId.copy();
stack.stackSize = weighted.theMinimumChanceToGenerateItem + worldObj.rand.nextInt(weighted.theMaximumChanceToGenerateItem - weighted.theMinimumChanceToGenerateItem + 1);
addToInv(stack);
}
}
private void addToInv(ItemStack stack) {
for (int i = 0; i < 15; i++) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B