mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 11:59:25 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec93fcbc4c |
No files matched your search
+2
-3
@@ -1,12 +1,11 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityRendererDispatcher.java
|
||||
@@ -112,12 +112,15 @@
|
||||
{
|
||||
@@ -113,11 +113,14 @@
|
||||
if (p_180546_1_.func_145835_a(this.field_147560_j, this.field_147561_k, this.field_147558_l) < p_180546_1_.func_145833_n())
|
||||
{
|
||||
RenderHelper.func_74519_b();
|
||||
+ if(!drawingBatch || !p_180546_1_.hasFastRenderer())
|
||||
+ {
|
||||
RenderHelper.func_74519_b();
|
||||
int i = this.field_147550_f.func_175626_b(p_180546_1_.func_174877_v(), 0);
|
||||
int j = i % 65536;
|
||||
int k = i / 65536;
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src-base/minecraft/net/minecraft/entity/SharedMonsterAttributes.java
|
||||
+++ ../src-work/minecraft/net/minecraft/entity/SharedMonsterAttributes.java
|
||||
@@ -16,7 +16,7 @@
|
||||
public class SharedMonsterAttributes
|
||||
{
|
||||
private static final Logger field_151476_f = LogManager.getLogger();
|
||||
- public static final IAttribute field_111267_a = (new RangedAttribute((IAttribute)null, "generic.maxHealth", 20.0D, 0.0D, 1024.0D)).func_111117_a("Max Health").func_111112_a(true);
|
||||
+ public static final IAttribute field_111267_a = (new RangedAttribute((IAttribute)null, "generic.maxHealth", 20.0D, Float.MIN_VALUE, 1024.0D)).func_111117_a("Max Health").func_111112_a(true); // Forge: set smallest max-health value to fix MC-119183. This gets rounded to float so we use the smallest positive float value.
|
||||
public static final IAttribute field_111265_b = (new RangedAttribute((IAttribute)null, "generic.followRange", 32.0D, 0.0D, 2048.0D)).func_111117_a("Follow Range");
|
||||
public static final IAttribute field_111266_c = (new RangedAttribute((IAttribute)null, "generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).func_111117_a("Knockback Resistance");
|
||||
public static final IAttribute field_111263_d = (new RangedAttribute((IAttribute)null, "generic.movementSpeed", 0.699999988079071D, 0.0D, 1024.0D)).func_111117_a("Movement Speed").func_111112_a(true);
|
||||
@@ -34,15 +34,7 @@
|
||||
this.field_77994_a = p_i1881_2_;
|
||||
this.field_77991_e = p_i1881_3_;
|
||||
|
||||
@@ -99,6 +105,7 @@
|
||||
|
||||
public static ItemStack func_77949_a(NBTTagCompound p_77949_0_)
|
||||
{
|
||||
+ if (p_77949_0_.func_82582_d()) return null; // Deserialized inventories can have empty ItemStack compounds. Fixes tons of NumberFormatExceptions
|
||||
ItemStack itemstack = new ItemStack();
|
||||
itemstack.func_77963_c(p_77949_0_);
|
||||
return itemstack.func_77973_b() != null ? itemstack : null;
|
||||
@@ -117,7 +124,7 @@
|
||||
@@ -117,7 +123,7 @@
|
||||
public ItemStack func_77979_a(int p_77979_1_)
|
||||
{
|
||||
p_77979_1_ = Math.min(p_77979_1_, this.field_77994_a);
|
||||
@@ -51,7 +43,7 @@
|
||||
|
||||
if (this.field_77990_d != null)
|
||||
{
|
||||
@@ -130,11 +137,12 @@
|
||||
@@ -130,11 +136,12 @@
|
||||
|
||||
public Item func_77973_b()
|
||||
{
|
||||
@@ -65,7 +57,7 @@
|
||||
EnumActionResult enumactionresult = this.func_77973_b().func_180614_a(this, p_179546_1_, p_179546_2_, p_179546_3_, p_179546_4_, p_179546_5_, p_179546_6_, p_179546_7_, p_179546_8_);
|
||||
|
||||
if (enumactionresult == EnumActionResult.SUCCESS)
|
||||
@@ -173,12 +181,20 @@
|
||||
@@ -173,12 +180,20 @@
|
||||
p_77955_1_.func_74782_a("tag", this.field_77990_d);
|
||||
}
|
||||
|
||||
@@ -87,7 +79,7 @@
|
||||
this.field_77994_a = p_77963_1_.func_74771_c("Count");
|
||||
this.field_77991_e = p_77963_1_.func_74765_d("Damage");
|
||||
|
||||
@@ -196,11 +212,12 @@
|
||||
@@ -196,11 +211,12 @@
|
||||
this.field_151002_e.func_179215_a(this.field_77990_d);
|
||||
}
|
||||
}
|
||||
@@ -101,7 +93,7 @@
|
||||
}
|
||||
|
||||
public boolean func_77985_e()
|
||||
@@ -210,7 +227,7 @@
|
||||
@@ -210,7 +226,7 @@
|
||||
|
||||
public boolean func_77984_f()
|
||||
{
|
||||
@@ -110,7 +102,7 @@
|
||||
}
|
||||
|
||||
public boolean func_77981_g()
|
||||
@@ -220,32 +237,27 @@
|
||||
@@ -220,32 +236,27 @@
|
||||
|
||||
public boolean func_77951_h()
|
||||
{
|
||||
@@ -148,7 +140,7 @@
|
||||
}
|
||||
|
||||
public boolean func_96631_a(int p_96631_1_, Random p_96631_2_)
|
||||
@@ -277,8 +289,8 @@
|
||||
@@ -277,8 +288,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +151,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,7 +344,7 @@
|
||||
@@ -332,7 +343,7 @@
|
||||
|
||||
public boolean func_150998_b(IBlockState p_150998_1_)
|
||||
{
|
||||
@@ -168,7 +160,7 @@
|
||||
}
|
||||
|
||||
public boolean func_111282_a(EntityPlayer p_111282_1_, EntityLivingBase p_111282_2_, EnumHand p_111282_3_)
|
||||
@@ -342,7 +354,7 @@
|
||||
@@ -342,7 +353,7 @@
|
||||
|
||||
public ItemStack func_77946_l()
|
||||
{
|
||||
@@ -177,7 +169,7 @@
|
||||
|
||||
if (this.field_77990_d != null)
|
||||
{
|
||||
@@ -354,7 +366,19 @@
|
||||
@@ -354,7 +365,19 @@
|
||||
|
||||
public static boolean func_77970_a(@Nullable ItemStack p_77970_0_, @Nullable ItemStack p_77970_1_)
|
||||
{
|
||||
@@ -198,7 +190,7 @@
|
||||
}
|
||||
|
||||
public static boolean func_77989_b(@Nullable ItemStack p_77989_0_, @Nullable ItemStack p_77989_1_)
|
||||
@@ -364,7 +388,11 @@
|
||||
@@ -364,7 +387,11 @@
|
||||
|
||||
private boolean func_77959_d(ItemStack p_77959_1_)
|
||||
{
|
||||
@@ -211,7 +203,7 @@
|
||||
}
|
||||
|
||||
public static boolean func_179545_c(@Nullable ItemStack p_179545_0_, @Nullable ItemStack p_179545_1_)
|
||||
@@ -764,6 +792,7 @@
|
||||
@@ -764,6 +791,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +211,7 @@
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -875,7 +904,7 @@
|
||||
@@ -875,7 +903,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -228,7 +220,7 @@
|
||||
}
|
||||
|
||||
return multimap;
|
||||
@@ -908,6 +937,18 @@
|
||||
@@ -908,6 +936,18 @@
|
||||
@Deprecated
|
||||
public void func_150996_a(Item p_150996_1_)
|
||||
{
|
||||
@@ -247,7 +239,7 @@
|
||||
this.field_151002_e = p_150996_1_;
|
||||
}
|
||||
|
||||
@@ -993,4 +1034,45 @@
|
||||
@@ -993,4 +1033,45 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@
|
||||
throw new ReportedException(crashreport1);
|
||||
}
|
||||
}
|
||||
@@ -1682,11 +1796,11 @@
|
||||
@@ -1682,7 +1796,7 @@
|
||||
{
|
||||
BlockPos blockpos = tileentity.func_174877_v();
|
||||
|
||||
@@ -373,11 +373,6 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
- this.field_72984_F.func_76320_a(tileentity.getClass().getSimpleName());
|
||||
+ this.field_72984_F.func_76320_a(this.field_72984_F.field_76327_a ? tileentity.getClass().getSimpleName() : ""); // Fix for MC-117087
|
||||
((ITickable)tileentity).func_73660_a();
|
||||
this.field_72984_F.func_76319_b();
|
||||
}
|
||||
@@ -1695,6 +1809,13 @@
|
||||
CrashReport crashreport2 = CrashReport.func_85055_a(throwable, "Ticking block entity");
|
||||
CrashReportCategory crashreportcategory2 = crashreport2.func_85058_a("Block entity being ticked");
|
||||
@@ -392,7 +387,7 @@
|
||||
throw new ReportedException(crashreport2);
|
||||
}
|
||||
}
|
||||
@@ -1707,20 +1828,31 @@
|
||||
@@ -1707,20 +1828,28 @@
|
||||
|
||||
if (this.func_175667_e(tileentity.func_174877_v()))
|
||||
{
|
||||
@@ -409,18 +404,13 @@
|
||||
-
|
||||
if (!this.field_147483_b.isEmpty())
|
||||
{
|
||||
- this.field_175730_i.removeAll(this.field_147483_b);
|
||||
- this.field_147482_g.removeAll(this.field_147483_b);
|
||||
+ for (Object tile : field_147483_b)
|
||||
+ {
|
||||
+ ((TileEntity)tile).onChunkUnload();
|
||||
+ }
|
||||
+
|
||||
+ // forge: faster "contains" makes this removal much more efficient (MC-117075)
|
||||
+ java.util.Set<TileEntity> remove = java.util.Collections.newSetFromMap(new java.util.IdentityHashMap<TileEntity, Boolean>());
|
||||
+ remove.addAll(field_147483_b);
|
||||
+ this.field_175730_i.removeAll(remove);
|
||||
+ this.field_147482_g.removeAll(remove);
|
||||
this.field_175730_i.removeAll(this.field_147483_b);
|
||||
this.field_147482_g.removeAll(this.field_147483_b);
|
||||
this.field_147483_b.clear();
|
||||
}
|
||||
|
||||
@@ -429,7 +419,7 @@
|
||||
this.field_72984_F.func_76318_c("pendingBlockEntities");
|
||||
|
||||
if (!this.field_147484_a.isEmpty())
|
||||
@@ -1759,8 +1891,12 @@
|
||||
@@ -1759,8 +1888,12 @@
|
||||
|
||||
public boolean func_175700_a(TileEntity p_175700_1_)
|
||||
{
|
||||
@@ -443,7 +433,7 @@
|
||||
if (flag && p_175700_1_ instanceof ITickable)
|
||||
{
|
||||
this.field_175730_i.add(p_175700_1_);
|
||||
@@ -1780,6 +1916,11 @@
|
||||
@@ -1780,6 +1913,11 @@
|
||||
{
|
||||
if (this.field_147481_N)
|
||||
{
|
||||
@@ -455,7 +445,7 @@
|
||||
this.field_147484_a.addAll(p_147448_1_);
|
||||
}
|
||||
else
|
||||
@@ -1800,9 +1941,12 @@
|
||||
@@ -1800,9 +1938,12 @@
|
||||
{
|
||||
int i = MathHelper.func_76128_c(p_72866_1_.field_70165_t);
|
||||
int j = MathHelper.func_76128_c(p_72866_1_.field_70161_v);
|
||||
@@ -470,7 +460,7 @@
|
||||
{
|
||||
p_72866_1_.field_70142_S = p_72866_1_.field_70165_t;
|
||||
p_72866_1_.field_70137_T = p_72866_1_.field_70163_u;
|
||||
@@ -2001,6 +2145,10 @@
|
||||
@@ -2001,6 +2142,10 @@
|
||||
blockpos$pooledmutableblockpos.func_185344_t();
|
||||
return true;
|
||||
}
|
||||
@@ -481,7 +471,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2040,6 +2188,16 @@
|
||||
@@ -2040,6 +2185,16 @@
|
||||
IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos);
|
||||
Block block = iblockstate.func_177230_c();
|
||||
|
||||
@@ -498,7 +488,7 @@
|
||||
if (iblockstate.func_185904_a() == p_72918_2_)
|
||||
{
|
||||
double d0 = (double)((float)(l1 + 1) - BlockLiquid.func_149801_b(((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue()));
|
||||
@@ -2116,6 +2274,9 @@
|
||||
@@ -2116,6 +2271,9 @@
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(blockpos$pooledmutableblockpos.func_181079_c(k1, l1, i2));
|
||||
|
||||
@@ -508,7 +498,7 @@
|
||||
if (iblockstate.func_185904_a() == p_72830_2_)
|
||||
{
|
||||
int j2 = ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue();
|
||||
@@ -2148,6 +2309,7 @@
|
||||
@@ -2148,6 +2306,7 @@
|
||||
public Explosion func_72885_a(@Nullable Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_)
|
||||
{
|
||||
Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_, p_72885_9_, p_72885_10_);
|
||||
@@ -516,7 +506,7 @@
|
||||
explosion.func_77278_a();
|
||||
explosion.func_77279_a(true);
|
||||
return explosion;
|
||||
@@ -2270,6 +2432,7 @@
|
||||
@@ -2270,6 +2429,7 @@
|
||||
|
||||
public void func_175690_a(BlockPos p_175690_1_, @Nullable TileEntity p_175690_2_)
|
||||
{
|
||||
@@ -524,7 +514,7 @@
|
||||
if (!this.func_189509_E(p_175690_1_))
|
||||
{
|
||||
if (p_175690_2_ != null && !p_175690_2_.func_145837_r())
|
||||
@@ -2277,6 +2440,8 @@
|
||||
@@ -2277,6 +2437,8 @@
|
||||
if (this.field_147481_N)
|
||||
{
|
||||
p_175690_2_.func_174878_a(p_175690_1_);
|
||||
@@ -533,7 +523,7 @@
|
||||
Iterator<TileEntity> iterator = this.field_147484_a.iterator();
|
||||
|
||||
while (iterator.hasNext())
|
||||
@@ -2295,8 +2460,10 @@
|
||||
@@ -2295,8 +2457,10 @@
|
||||
else
|
||||
{
|
||||
this.func_175700_a(p_175690_2_);
|
||||
@@ -545,7 +535,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2309,6 +2476,8 @@
|
||||
@@ -2309,6 +2473,8 @@
|
||||
{
|
||||
tileentity.func_145843_s();
|
||||
this.field_147484_a.remove(tileentity);
|
||||
@@ -554,7 +544,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2321,6 +2490,7 @@
|
||||
@@ -2321,6 +2487,7 @@
|
||||
|
||||
this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_);
|
||||
}
|
||||
@@ -562,7 +552,7 @@
|
||||
}
|
||||
|
||||
public void func_147457_a(TileEntity p_147457_1_)
|
||||
@@ -2347,7 +2517,7 @@
|
||||
@@ -2347,7 +2514,7 @@
|
||||
if (chunk != null && !chunk.func_76621_g())
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(p_175677_1_);
|
||||
@@ -571,7 +561,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2370,6 +2540,7 @@
|
||||
@@ -2370,6 +2537,7 @@
|
||||
{
|
||||
this.field_72985_G = p_72891_1_;
|
||||
this.field_72992_H = p_72891_2_;
|
||||
@@ -579,7 +569,7 @@
|
||||
}
|
||||
|
||||
public void func_72835_b()
|
||||
@@ -2379,6 +2550,11 @@
|
||||
@@ -2379,6 +2547,11 @@
|
||||
|
||||
protected void func_72947_a()
|
||||
{
|
||||
@@ -591,7 +581,7 @@
|
||||
if (this.field_72986_A.func_76059_o())
|
||||
{
|
||||
this.field_73004_o = 1.0F;
|
||||
@@ -2392,6 +2568,11 @@
|
||||
@@ -2392,6 +2565,11 @@
|
||||
|
||||
protected void func_72979_l()
|
||||
{
|
||||
@@ -603,7 +593,7 @@
|
||||
if (!this.field_73011_w.func_177495_o())
|
||||
{
|
||||
if (!this.field_72995_K)
|
||||
@@ -2511,6 +2692,11 @@
|
||||
@@ -2511,6 +2689,11 @@
|
||||
|
||||
public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_)
|
||||
{
|
||||
@@ -615,7 +605,7 @@
|
||||
Biome biome = this.func_180494_b(p_175670_1_);
|
||||
float f = biome.func_180626_a(p_175670_1_);
|
||||
|
||||
@@ -2552,6 +2738,11 @@
|
||||
@@ -2552,6 +2735,11 @@
|
||||
|
||||
public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_)
|
||||
{
|
||||
@@ -627,7 +617,7 @@
|
||||
Biome biome = this.func_180494_b(p_175708_1_);
|
||||
float f = biome.func_180626_a(p_175708_1_);
|
||||
|
||||
@@ -2569,7 +2760,7 @@
|
||||
@@ -2569,7 +2757,7 @@
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(p_175708_1_);
|
||||
|
||||
@@ -636,7 +626,7 @@
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -2601,10 +2792,11 @@
|
||||
@@ -2601,10 +2789,11 @@
|
||||
else
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(p_175638_1_);
|
||||
@@ -651,15 +641,7 @@
|
||||
{
|
||||
j = 1;
|
||||
}
|
||||
@@ -2638,6 +2830,7 @@
|
||||
|
||||
if (i >= 14)
|
||||
{
|
||||
+ blockpos$pooledmutableblockpos.func_185344_t();
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -2703,7 +2896,7 @@
|
||||
@@ -2703,7 +2892,7 @@
|
||||
int j4 = j2 + enumfacing.func_96559_d();
|
||||
int k4 = k2 + enumfacing.func_82599_e();
|
||||
blockpos$pooledmutableblockpos.func_181079_c(i4, j4, k4);
|
||||
@@ -668,7 +650,7 @@
|
||||
i3 = this.func_175642_b(p_180500_1_, blockpos$pooledmutableblockpos);
|
||||
|
||||
if (i3 == l2 - l4 && j < this.field_72994_J.length)
|
||||
@@ -2811,10 +3004,10 @@
|
||||
@@ -2811,10 +3000,10 @@
|
||||
public List<Entity> func_175674_a(@Nullable Entity p_175674_1_, AxisAlignedBB p_175674_2_, @Nullable Predicate <? super Entity > p_175674_3_)
|
||||
{
|
||||
List<Entity> list = Lists.<Entity>newArrayList();
|
||||
@@ -683,7 +665,7 @@
|
||||
|
||||
for (int i1 = i; i1 <= j; ++i1)
|
||||
{
|
||||
@@ -2867,10 +3060,10 @@
|
||||
@@ -2867,10 +3056,10 @@
|
||||
|
||||
public <T extends Entity> List<T> func_175647_a(Class <? extends T > p_175647_1_, AxisAlignedBB p_175647_2_, @Nullable Predicate <? super T > p_175647_3_)
|
||||
{
|
||||
@@ -698,7 +680,7 @@
|
||||
List<T> list = Lists.<T>newArrayList();
|
||||
|
||||
for (int i1 = i; i1 < j; ++i1)
|
||||
@@ -2950,11 +3143,13 @@
|
||||
@@ -2950,11 +3139,13 @@
|
||||
|
||||
public void func_175650_b(Collection<Entity> p_175650_1_)
|
||||
{
|
||||
@@ -715,7 +697,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2967,7 +3162,7 @@
|
||||
@@ -2967,7 +3158,7 @@
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(p_175716_2_);
|
||||
AxisAlignedBB axisalignedbb = p_175716_3_ ? null : p_175716_1_.func_176223_P().func_185890_d(this, p_175716_2_);
|
||||
@@ -724,7 +706,7 @@
|
||||
}
|
||||
|
||||
public int func_181545_F()
|
||||
@@ -3050,7 +3245,7 @@
|
||||
@@ -3050,7 +3241,7 @@
|
||||
public int func_175651_c(BlockPos p_175651_1_, EnumFacing p_175651_2_)
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(p_175651_1_);
|
||||
@@ -733,7 +715,7 @@
|
||||
}
|
||||
|
||||
public boolean func_175640_z(BlockPos p_175640_1_)
|
||||
@@ -3185,7 +3380,7 @@
|
||||
@@ -3185,7 +3376,7 @@
|
||||
{
|
||||
d2 *= ((Double)Objects.firstNonNull(p_184150_11_.apply(entityplayer1), Double.valueOf(1.0D))).doubleValue();
|
||||
}
|
||||
@@ -742,7 +724,7 @@
|
||||
if ((p_184150_9_ < 0.0D || Math.abs(entityplayer1.field_70163_u - p_184150_3_) < p_184150_9_ * p_184150_9_) && (p_184150_7_ < 0.0D || d1 < d2 * d2) && (d0 == -1.0D || d1 < d0))
|
||||
{
|
||||
d0 = d1;
|
||||
@@ -3247,7 +3442,7 @@
|
||||
@@ -3247,7 +3438,7 @@
|
||||
|
||||
public long func_72905_C()
|
||||
{
|
||||
@@ -751,7 +733,7 @@
|
||||
}
|
||||
|
||||
public long func_82737_E()
|
||||
@@ -3257,17 +3452,17 @@
|
||||
@@ -3257,17 +3448,17 @@
|
||||
|
||||
public long func_72820_D()
|
||||
{
|
||||
@@ -772,7 +754,7 @@
|
||||
|
||||
if (!this.func_175723_af().func_177746_a(blockpos))
|
||||
{
|
||||
@@ -3279,7 +3474,7 @@
|
||||
@@ -3279,7 +3470,7 @@
|
||||
|
||||
public void func_175652_B(BlockPos p_175652_1_)
|
||||
{
|
||||
@@ -781,7 +763,7 @@
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -3299,12 +3494,18 @@
|
||||
@@ -3299,12 +3490,18 @@
|
||||
|
||||
if (!this.field_72996_f.contains(p_72897_1_))
|
||||
{
|
||||
@@ -800,7 +782,7 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3398,8 +3599,7 @@
|
||||
@@ -3398,8 +3595,7 @@
|
||||
|
||||
public boolean func_180502_D(BlockPos p_180502_1_)
|
||||
{
|
||||
@@ -810,7 +792,7 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -3460,12 +3660,12 @@
|
||||
@@ -3460,12 +3656,12 @@
|
||||
|
||||
public int func_72800_K()
|
||||
{
|
||||
@@ -825,7 +807,7 @@
|
||||
}
|
||||
|
||||
public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_)
|
||||
@@ -3509,7 +3709,7 @@
|
||||
@@ -3509,7 +3705,7 @@
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double func_72919_O()
|
||||
{
|
||||
@@ -834,7 +816,7 @@
|
||||
}
|
||||
|
||||
public void func_175715_c(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_)
|
||||
@@ -3543,7 +3743,7 @@
|
||||
@@ -3543,7 +3739,7 @@
|
||||
|
||||
public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_)
|
||||
{
|
||||
@@ -843,7 +825,7 @@
|
||||
{
|
||||
BlockPos blockpos = p_175666_1_.func_177972_a(enumfacing);
|
||||
|
||||
@@ -3551,18 +3751,14 @@
|
||||
@@ -3551,18 +3747,14 @@
|
||||
{
|
||||
IBlockState iblockstate = this.func_180495_p(blockpos);
|
||||
|
||||
@@ -866,7 +848,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3628,6 +3824,112 @@
|
||||
@@ -3628,6 +3820,112 @@
|
||||
return i >= -128 && i <= 128 && j >= -128 && j <= 128;
|
||||
}
|
||||
|
||||
|
||||
+3
-5
@@ -529,12 +529,10 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet<?>> im
|
||||
else
|
||||
{
|
||||
List<Packet<INetHandlerPlayClient>> parts = ((FMLProxyPacket)msg).toS3FPackets();
|
||||
int sizeMinusOne = parts.size() - 1;
|
||||
for (int i = 0; i < sizeMinusOne; i++)
|
||||
for (Packet<INetHandlerPlayClient> pkt : parts)
|
||||
{
|
||||
ctx.write(parts.get(i), ctx.voidPromise());
|
||||
ctx.write(pkt, promise);
|
||||
}
|
||||
ctx.write(parts.get(sizeMinusOne), promise);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -647,7 +645,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet<?>> im
|
||||
{
|
||||
throw new IOException("Received FML MultiPart packet out of order, Expected " + part_expected + " Got " + part);
|
||||
}
|
||||
int len = input.readableBytes();
|
||||
int len = input.readableBytes() - 1;
|
||||
input.readBytes(data, offset, len);
|
||||
part_expected++;
|
||||
offset += len;
|
||||
|
||||
@@ -143,7 +143,7 @@ public class FMLProxyPacket implements Packet<INetHandler> {
|
||||
return new CPacketCustomPayload(channel, payload);
|
||||
}
|
||||
|
||||
static final int PART_SIZE = 0x100000 - 0x50; // Make it a constant so that it gets inlined below.
|
||||
static final int PART_SIZE = 0x1000000 - 0x50; // Make it a constant so that it gets inlined below.
|
||||
// FIXME int overflow
|
||||
public static final int MAX_LENGTH = PART_SIZE * 255;
|
||||
public List<Packet<INetHandlerPlayClient>> toS3FPackets() throws IOException
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<Console name="SysOut" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
|
||||
</Console>
|
||||
<Queue name="ServerGuiConsole" ignoreExceptions="true">
|
||||
<Queue name="ServerGuiConsole">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %msg%n" />
|
||||
</Queue>
|
||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</TerminalConsole>
|
||||
<!-- Keep a console appender open so log4j2 doesn't close our main out stream if we redirect System.out to the logger -->
|
||||
<Console name="SysOut" target="SYSTEM_OUT"/>
|
||||
<Queue name="ServerGuiConsole" ignoreExceptions="true">
|
||||
<Queue name="ServerGuiConsole">
|
||||
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %replace{%msg}{(?i)\u00A7[0-9A-FK-OR]}{}%n" />
|
||||
</Queue>
|
||||
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
package net.minecraftforge.debug;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraftforge.fml.common.FMLLog;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@Mod(modid = BigNetworkMessageTest.MOD_ID, name = "Big network message test mod", version = "1.0", acceptableRemoteVersions = "*")
|
||||
@Mod.EventBusSubscriber
|
||||
public class BigNetworkMessageTest
|
||||
{
|
||||
static final boolean ENABLED = true;
|
||||
static final String MOD_ID = "big_packet_test";
|
||||
public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(MOD_ID);
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent e)
|
||||
{
|
||||
if (ENABLED)
|
||||
{
|
||||
IMessageHandler<BigMessage, IMessage> handler = new IMessageHandler<BigMessage, IMessage>()
|
||||
{
|
||||
@Override public IMessage onMessage(BigMessage message, MessageContext ctx)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
};
|
||||
INSTANCE.registerMessage(handler, BigMessage.class, 0, Side.SERVER);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onPlayerJoin(PlayerEvent.PlayerLoggedInEvent evt)
|
||||
{
|
||||
if (ENABLED)
|
||||
{
|
||||
INSTANCE.sendTo(new BigMessage(), (EntityPlayerMP) evt.player);
|
||||
}
|
||||
}
|
||||
|
||||
public static class BigMessage implements IMessage
|
||||
{
|
||||
private static final int BYTE_COUNT = 0x200000;// 2MB
|
||||
|
||||
@Override public void toBytes(ByteBuf buf)
|
||||
{
|
||||
// write consecutive bytes, overflowing back to zero as necessary
|
||||
for (int i = 0; i < BYTE_COUNT; i++)
|
||||
{
|
||||
buf.writeByte(i & 0xFF);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void fromBytes(ByteBuf buf)
|
||||
{
|
||||
for (int i = 0; i < BYTE_COUNT; i++)
|
||||
{
|
||||
int read = buf.readUnsignedByte();
|
||||
int expected = i & 0xFF;
|
||||
if (read != expected)
|
||||
{
|
||||
throw new RuntimeException("Found incorrect byte at " + (i + 1) + " expected " + expected + " but found " + read);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user