ForgePatch/patches/minecraft/net/minecraft/world/chunk/ChunkHolder.java.patch

48 lines
2.7 KiB
Diff
Raw Normal View History

2019-05-23 23:02:15 +00:00
--- a/net/minecraft/world/chunk/ChunkHolder.java
+++ b/net/minecraft/world/chunk/ChunkHolder.java
@@ -123,7 +123,7 @@
Chunk chunk = this.func_219298_c();
if (chunk != null) {
this.field_219322_q |= 1 << (p_219279_2_ >> 4);
- if (this.field_219321_p < 64) {
+ { //Forge; Cache everything, so always run
short short1 = (short)(p_219279_1_ << 12 | p_219279_3_ << 8 | p_219279_2_);
for(int i = 0; i < this.field_219321_p; ++i) {
@@ -132,6 +132,8 @@
}
}
+ if (this.field_219321_p == this.field_219320_o.length)
+ this.field_219320_o = java.util.Arrays.copyOf(this.field_219320_o, this.field_219320_o.length << 1);
this.field_219320_o[this.field_219321_p++] = short1;
}
@@ -177,20 +179,22 @@
int k = (this.field_219320_o[0] >> 8 & 15) + this.field_219319_n.field_77275_b * 16;
BlockPos blockpos = new BlockPos(l, j1, k);
this.func_219293_a(new SChangeBlockPacket(world, blockpos), false);
- if (world.func_180495_p(blockpos).func_177230_c().func_149716_u()) {
+ if (world.func_180495_p(blockpos).hasTileEntity()) {
this.func_219305_a(world, blockpos);
}
- } else if (this.field_219321_p == 64) {
+ } else if (this.field_219321_p >= net.minecraftforge.common.ForgeConfig.SERVER.clumpingThreshold.get()) {
this.func_219293_a(new SChunkDataPacket(p_219274_1_, this.field_219322_q), false);
+ //TODO: Fix Mojang's fuckup to modded by combining all TE data into the chunk data packet... seriously... packet size explosion!
} else if (this.field_219321_p != 0) {
this.func_219293_a(new SMultiBlockChangePacket(this.field_219321_p, this.field_219320_o, p_219274_1_), false);
-
+ //} Keep this in the else until we figure out a fix for mojang's derpitude on the data packet so we don't double send crap.
+ //{// Forge: Send only the tile entities that are updated, Adding this brace lets us keep the indent and the patch small
for(int i1 = 0; i1 < this.field_219321_p; ++i1) {
int k1 = (this.field_219320_o[i1] >> 12 & 15) + this.field_219319_n.field_77276_a * 16;
int l1 = this.field_219320_o[i1] & 255;
int i2 = (this.field_219320_o[i1] >> 8 & 15) + this.field_219319_n.field_77275_b * 16;
BlockPos blockpos1 = new BlockPos(k1, l1, i2);
- if (world.func_180495_p(blockpos1).func_177230_c().func_149716_u()) {
+ if (world.func_180495_p(blockpos1).hasTileEntity()) {
this.func_219305_a(world, blockpos1);
}
}