This commit is contained in:
asiekierka 2015-09-04 14:45:29 +02:00
parent 8700cd41ef
commit 260aea2950
4 changed files with 53 additions and 1 deletions

View file

@ -119,6 +119,7 @@ import buildcraft.core.lib.commands.RootCommand;
import buildcraft.core.lib.engines.ItemEngine;
import buildcraft.core.lib.engines.TileEngineBase;
import buildcraft.core.lib.network.ChannelHandler;
import buildcraft.core.lib.render.FluidRenderer;
import buildcraft.core.lib.utils.ColorUtils;
import buildcraft.core.lib.utils.NBTUtils;
import buildcraft.core.lib.utils.Utils;
@ -140,6 +141,7 @@ import buildcraft.core.recipes.ProgrammingRecipeManager;
import buildcraft.core.recipes.RefineryRecipeManager;
import buildcraft.core.render.BlockHighlightHandler;
import buildcraft.core.render.RenderLEDTile;
import buildcraft.core.render.RenderLaser;
import buildcraft.core.statements.ActionMachineControl;
import buildcraft.core.statements.ActionRedstoneOutput;
import buildcraft.core.statements.DefaultActionProvider;
@ -548,6 +550,13 @@ public class BuildCraftCore extends BuildCraftMod {
}
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Post event) {
FluidRenderer.onTextureReload();
RenderLaser.onTextureReload();
}
public void reloadConfig(ConfigManager.RestartRequirement restartType) {
if (restartType == ConfigManager.RestartRequirement.GAME) {
modifyWorld = mainConfigManager.get("worldgen.enable").getBoolean();

View file

@ -40,6 +40,22 @@ public final class FluidRenderer {
}
public static void onTextureReload() {
for (int[] ia : flowingRenderCache.values()) {
for (int i : ia) {
GL11.glDeleteLists(i, 1);
}
}
flowingRenderCache.clear();
for (int[] ia : stillRenderCache.values()) {
for (int i : ia) {
GL11.glDeleteLists(i, 1);
}
}
stillRenderCache.clear();
}
public static IIcon getFluidTexture(FluidStack fluidStack, boolean flowing) {
if (fluidStack == null) {
return null;

View file

@ -38,6 +38,10 @@ public class RenderLaser extends Render {
public RenderLaser() {
}
public static void onTextureReload() {
scaledBoxes = null;
}
private static ModelRenderer getBox(int index) {
if (box == null) {
box = new ModelRenderer[40];

View file

@ -2,6 +2,7 @@ package buildcraft.silicon;
import java.lang.ref.WeakReference;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
@ -142,7 +143,29 @@ public class TileStampingTable extends TileLaserTableBase implements IHasWork, I
handleLeftoverItems(crafting);
handleLeftoverItems(internalPlayer.inventory);
outputStack(result, this, 1, false);
for (int i = 1; i <= 4; i++) {
ItemStack inside = inv.getStackInSlot(i);
if (inside == null || inside.stackSize <= 0) {
inv.setInventorySlotContents(i, result.copy());
result.stackSize = 0;
break;
} else if (StackHelper.canStacksMerge(inside, result)) {
result.stackSize -= StackHelper.mergeStacks(result, inside, true);
if (result.stackSize == 0) {
break;
}
}
}
if (result.stackSize > 0) {
EntityItem entityitem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 0.7, zCoord + 0.5,
result.copy());
worldObj.spawnEntityInWorld(entityitem);
result.stackSize = 0;
}
decrStackSize(0, 1);
} else {
ItemStack outputSlot = getStackInSlot(1);