TileEntity and TileEntityHopper rejects fixed, GuiOverlayDebug patch fixed.

This commit is contained in:
RainWarrior 2015-11-12 19:27:14 +03:00
parent 8000e22830
commit c976ec494e
5 changed files with 56 additions and 61 deletions

View File

@ -1,12 +1,12 @@
--- ../src-base/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java
+++ ../src-work/minecraft/net/minecraft/client/gui/GuiOverlayDebug.java
@@ -107,6 +107,9 @@
{
BlockPos blockpos = new BlockPos(this.mc.getRenderViewEntity().posX, this.mc.getRenderViewEntity().getEntityBoundingBox().minY, this.mc.getRenderViewEntity().posZ);
@@ -177,6 +177,9 @@
long l = j - k;
List<String> list = Lists.newArrayList(new String[] {String.format("Java: %s %dbit", new Object[]{System.getProperty("java.version"), Integer.valueOf(this.mc.isJava64bit() ? 64 : 32)}), String.format("Mem: % 2d%% %03d/%03dMB", new Object[]{Long.valueOf(l * 100L / i), Long.valueOf(bytesToMb(l)), Long.valueOf(bytesToMb(i))}), String.format("Allocated: % 2d%% %03dMB", new Object[]{Long.valueOf(j * 100L / i), Long.valueOf(bytesToMb(j))}), "", String.format("CPU: %s", new Object[]{OpenGlHelper.func_183029_j()}), "", String.format("Display: %dx%d (%s)", new Object[]{Integer.valueOf(Display.getWidth()), Integer.valueOf(Display.getHeight()), GL11.glGetString(GL11.GL_VENDOR)}), GL11.glGetString(GL11.GL_RENDERER), GL11.glGetString(GL11.GL_VERSION)});
+ arraylist.add("");
+ arraylist.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false));
+ list.add("");
+ list.addAll(net.minecraftforge.fml.common.FMLCommonHandler.instance().getBrandings(false));
+
if (this.isReducedDebug())
{
return Lists.newArrayList(new String[] {"Minecraft 1.8.8 (" + this.mc.getVersion() + "/" + ClientBrandRetriever.getClientModName() + ")", this.mc.debug, this.mc.renderGlobal.getDebugInfoRenders(), this.mc.renderGlobal.getDebugInfoEntities(), "P: " + this.mc.effectRenderer.getStatistics() + ". T: " + this.mc.theWorld.getDebugLoadedEntities(), this.mc.theWorld.getProviderName(), "", String.format("Chunk-relative: %d %d %d", new Object[]{Integer.valueOf(blockpos.getX() & 15), Integer.valueOf(blockpos.getY() & 15), Integer.valueOf(blockpos.getZ() & 15)})});
return list;

View File

@ -16,7 +16,19 @@
}
}
@@ -103,7 +105,17 @@
@@ -83,9 +85,10 @@
{
TileEntity tileentity = null;
+ Class <? extends TileEntity > oclass = null;
try
{
- Class <? extends TileEntity > oclass = (Class)nameToClassMap.get(nbt.getString("id"));
+ oclass = (Class)nameToClassMap.get(nbt.getString("id"));
if (oclass != null)
{
@@ -103,7 +106,17 @@
}
else
{
@ -34,7 +46,7 @@
}
return tileentity;
@@ -135,7 +147,6 @@
@@ -135,7 +148,6 @@
}
}
@ -42,7 +54,7 @@
public double getDistanceSq(double x, double y, double z)
{
double d0 = (double)this.pos.getX() + 0.5D - x;
@@ -283,4 +294,135 @@
@@ -283,4 +295,135 @@
addMapping(TileEntityFlowerPot.class, "FlowerPot");
addMapping(TileEntityBanner.class, "Banner");
}

View File

@ -0,0 +1,35 @@
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityHopper.java
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityHopper.java
@@ -516,17 +516,31 @@
if (itemstack == null)
{
+ //Forge: BUGFIX: Again, make things respect max stack sizes.
+ int max = Math.min(p_174916_1_.getMaxStackSize(), p_174916_0_.getInventoryStackLimit());
+ if (max >= p_174916_1_.stackSize)
+ {
p_174916_0_.setInventorySlotContents(p_174916_2_, p_174916_1_);
p_174916_1_ = null;
+ }
+ else
+ {
+ p_174916_0_.setInventorySlotContents(p_174916_2_, p_174916_1_.splitStack(max));
+ }
flag = true;
}
else if (canCombine(itemstack, p_174916_1_))
{
- int i = p_174916_1_.getMaxStackSize() - itemstack.stackSize;
+ //Forge: BUGFIX: Again, make things respect max stack sizes.
+ int max = Math.min(p_174916_1_.getMaxStackSize(), p_174916_0_.getInventoryStackLimit());
+ if (max > itemstack.stackSize)
+ {
+ int i = max - itemstack.stackSize;
int j = Math.min(p_174916_1_.stackSize, i);
p_174916_1_.stackSize -= j;
itemstack.stackSize += j;
flag = j > 0;
+ }
}
if (flag)

View File

@ -1,13 +0,0 @@
++++ REJECTED PATCH 3
{
TileEntity tileentity = null;
+ Class oclass = null;
try
{
- Class oclass = (Class)nameToClassMap.get(nbt.getString("id"));
+ oclass = (Class)nameToClassMap.get(nbt.getString("id"));
if (oclass != null)
{
++++ END PATCH

View File

@ -1,39 +0,0 @@
++++ REJECTED PATCH 1
if (itemstack1 == null)
{
- p_174916_0_.setInventorySlotContents(p_174916_2_, p_174916_1_);
- p_174916_1_ = null;
+ //Forge: BUGFIX: Again, make things respect max stack sizes.
+ int max = Math.min(p_174916_1_.getMaxStackSize(), p_174916_0_.getInventoryStackLimit());
+ if (max >= p_174916_1_.stackSize)
+ {
+ p_174916_0_.setInventorySlotContents(p_174916_2_, p_174916_1_);
+ p_174916_1_ = null;
+ }
+ else
+ {
+ p_174916_0_.setInventorySlotContents(p_174916_2_, p_174916_1_.splitStack(max));
+ }
flag = true;
}
else if (canCombine(itemstack1, p_174916_1_))
{
- int j = p_174916_1_.getMaxStackSize() - itemstack1.stackSize;
- int k = Math.min(p_174916_1_.stackSize, j);
- p_174916_1_.stackSize -= k;
- itemstack1.stackSize += k;
- flag = k > 0;
+ //Forge: BUGFIX: Again, make things respect max stack sizes.
+ int max = Math.min(p_174916_1_.getMaxStackSize(), p_174916_0_.getInventoryStackLimit());
+ if (max > itemstack1.stackSize)
+ {
+ int size = Math.min(p_174916_1_.stackSize, max - itemstack1.stackSize);
+ p_174916_1_.stackSize -= size;
+ itemstack1.stackSize += size;
+ flag = size > 0;
+ }
}
if (flag)
++++ END PATCH