Test getLightOpacity(world,pos) in World as well as the chunk.

This commit is contained in:
AlgorithmX2 2016-02-18 20:43:24 -06:00
parent ad69f0f447
commit 9eb22c3154

View file

@ -82,7 +82,7 @@
}
public boolean func_175667_e(BlockPos p_175667_1_)
@@ -284,39 +301,61 @@
@@ -284,39 +301,63 @@
{
Chunk chunk = this.func_175726_f(p_180501_1_);
Block block = p_180501_2_.func_177230_c();
@ -93,7 +93,9 @@
+ blockSnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(this, p_180501_1_, p_180501_3_);
+ this.capturedBlockSnapshots.add(blockSnapshot);
+ }
+ int oldLight = func_180495_p(p_180501_1_).func_177230_c().getLightValue(this, p_180501_1_);
+ Block oldBlock = func_180495_p(p_180501_1_).func_177230_c();
+ int oldLight = oldBlock.getLightValue(this, p_180501_1_);
+ int oldOpacity = oldBlock.getLightOpacity(this, p_180501_1_);
+
IBlockState iblockstate = chunk.func_177436_a(p_180501_1_, p_180501_2_);
@ -107,7 +109,7 @@
Block block1 = iblockstate.func_177230_c();
- if (block.func_149717_k() != block1.func_149717_k() || block.func_149750_m() != block1.func_149750_m())
+ if (block.func_149717_k() != block1.func_149717_k() || block.getLightValue(this, p_180501_1_) != oldLight)
+ if (block.getLightOpacity(this, p_180501_1_) != oldOpacity || block.getLightValue(this, p_180501_1_) != oldLight)
{
this.field_72984_F.func_76320_a("checkLight");
this.func_175664_x(p_180501_1_);
@ -153,7 +155,7 @@
}
}
}
@@ -404,6 +443,9 @@
@@ -404,6 +445,9 @@
public void func_175685_c(BlockPos p_175685_1_, Block p_175685_2_)
{
@ -163,7 +165,7 @@
this.func_180496_d(p_175685_1_.func_177976_e(), p_175685_2_);
this.func_180496_d(p_175685_1_.func_177974_f(), p_175685_2_);
this.func_180496_d(p_175685_1_.func_177977_b(), p_175685_2_);
@@ -414,6 +456,11 @@
@@ -414,6 +458,11 @@
public void func_175695_a(BlockPos p_175695_1_, Block p_175695_2_, EnumFacing p_175695_3_)
{
@ -175,7 +177,7 @@
if (p_175695_3_ != EnumFacing.WEST)
{
this.func_180496_d(p_175695_1_.func_177976_e(), p_175695_2_);
@@ -777,7 +824,7 @@
@@ -777,7 +826,7 @@
public boolean func_72935_r()
{
@ -184,7 +186,7 @@
}
public MovingObjectPosition func_72933_a(Vec3 p_72933_1_, Vec3 p_72933_2_)
@@ -972,6 +1019,12 @@
@@ -972,6 +1021,12 @@
public void func_72956_a(Entity p_72956_1_, String p_72956_2_, float p_72956_3_, float p_72956_4_)
{
@ -197,7 +199,7 @@
for (int i = 0; i < this.field_73021_x.size(); ++i)
{
((IWorldAccess)this.field_73021_x.get(i)).func_72704_a(p_72956_2_, p_72956_1_.field_70165_t, p_72956_1_.field_70163_u, p_72956_1_.field_70161_v, p_72956_3_, p_72956_4_);
@@ -980,6 +1033,12 @@
@@ -980,6 +1035,12 @@
public void func_85173_a(EntityPlayer p_85173_1_, String p_85173_2_, float p_85173_3_, float p_85173_4_)
{
@ -210,7 +212,7 @@
for (int i = 0; i < this.field_73021_x.size(); ++i)
{
((IWorldAccess)this.field_73021_x.get(i)).func_85102_a(p_85173_1_, p_85173_2_, p_85173_1_.field_70165_t, p_85173_1_.field_70163_u, p_85173_1_.field_70161_v, p_85173_3_, p_85173_4_);
@@ -1033,6 +1092,9 @@
@@ -1033,6 +1094,9 @@
public boolean func_72838_d(Entity p_72838_1_)
{
@ -220,7 +222,7 @@
int i = MathHelper.func_76128_c(p_72838_1_.field_70165_t / 16.0D);
int j = MathHelper.func_76128_c(p_72838_1_.field_70161_v / 16.0D);
boolean flag = p_72838_1_.field_98038_p;
@@ -1055,6 +1117,8 @@
@@ -1055,6 +1119,8 @@
this.func_72854_c();
}
@ -229,7 +231,7 @@
this.func_72964_e(i, j).func_76612_a(p_72838_1_);
this.field_72996_f.add(p_72838_1_);
this.func_72923_a(p_72838_1_);
@@ -1267,17 +1331,29 @@
@@ -1267,17 +1333,29 @@
public int func_72967_a(float p_72967_1_)
{
@ -262,7 +264,7 @@
public void func_72848_b(IWorldAccess p_72848_1_)
{
this.field_73021_x.remove(p_72848_1_);
@@ -1286,6 +1362,12 @@
@@ -1286,6 +1364,12 @@
@SideOnly(Side.CLIENT)
public float func_72971_b(float p_72971_1_)
{
@ -275,7 +277,7 @@
float f = this.func_72826_c(p_72971_1_);
float f1 = 1.0F - (MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.2F);
f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
@@ -1298,6 +1380,12 @@
@@ -1298,6 +1382,12 @@
@SideOnly(Side.CLIENT)
public Vec3 func_72833_a(Entity p_72833_1_, float p_72833_2_)
{
@ -288,7 +290,7 @@
float f = this.func_72826_c(p_72833_2_);
float f1 = MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
@@ -1305,9 +1393,7 @@
@@ -1305,9 +1395,7 @@
int j = MathHelper.func_76128_c(p_72833_1_.field_70163_u);
int k = MathHelper.func_76128_c(p_72833_1_.field_70161_v);
BlockPos blockpos = new BlockPos(i, j, k);
@ -299,7 +301,7 @@
float f3 = (float)(l >> 16 & 255) / 255.0F;
float f4 = (float)(l >> 8 & 255) / 255.0F;
float f5 = (float)(l & 255) / 255.0F;
@@ -1367,6 +1453,11 @@
@@ -1367,6 +1455,11 @@
public float func_130001_d()
{
@ -311,7 +313,7 @@
return WorldProvider.field_111203_a[this.field_73011_w.func_76559_b(this.field_72986_A.func_76073_f())];
}
@@ -1379,6 +1470,12 @@
@@ -1379,6 +1472,12 @@
@SideOnly(Side.CLIENT)
public Vec3 func_72824_f(float p_72824_1_)
{
@ -324,7 +326,7 @@
float f = this.func_72826_c(p_72824_1_);
float f1 = MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
@@ -1434,9 +1531,9 @@
@@ -1434,9 +1533,9 @@
for (blockpos = new BlockPos(p_175672_1_.func_177958_n(), chunk.func_76625_h() + 16, p_175672_1_.func_177952_p()); blockpos.func_177956_o() >= 0; blockpos = blockpos1)
{
blockpos1 = blockpos.func_177977_b();
@ -336,7 +338,7 @@
{
break;
}
@@ -1448,6 +1545,12 @@
@@ -1448,6 +1547,12 @@
@SideOnly(Side.CLIENT)
public float func_72880_h(float p_72880_1_)
{
@ -349,7 +351,7 @@
float f = this.func_72826_c(p_72880_1_);
float f1 = 1.0F - (MathHelper.func_76134_b(f * (float)Math.PI * 2.0F) * 2.0F + 0.25F);
f1 = MathHelper.func_76131_a(f1, 0.0F, 1.0F);
@@ -1494,7 +1597,15 @@
@@ -1494,7 +1599,15 @@
entity.func_85029_a(crashreportcategory);
}
@ -366,7 +368,7 @@
}
if (entity.field_70128_L)
@@ -1554,7 +1665,15 @@
@@ -1554,7 +1667,15 @@
CrashReport crashreport1 = CrashReport.func_85055_a(throwable1, "Ticking entity");
CrashReportCategory crashreportcategory2 = crashreport1.func_85058_a("Entity being ticked");
entity2.func_85029_a(crashreportcategory2);
@ -383,7 +385,7 @@
}
}
@@ -1601,7 +1720,16 @@
@@ -1601,7 +1722,16 @@
CrashReport crashreport2 = CrashReport.func_85055_a(throwable, "Ticking block entity");
CrashReportCategory crashreportcategory1 = crashreport2.func_85058_a("Block entity being ticked");
tileentity.func_145828_a(crashreportcategory1);
@ -401,7 +403,7 @@
}
}
}
@@ -1618,15 +1746,20 @@
@@ -1618,15 +1748,20 @@
}
}
@ -424,7 +426,7 @@
this.field_72984_F.func_76318_c("pendingBlockEntities");
if (!this.field_147484_a.isEmpty())
@@ -1660,7 +1793,8 @@
@@ -1660,7 +1795,8 @@
public boolean func_175700_a(TileEntity p_175700_1_)
{
@ -434,7 +436,7 @@
if (flag && p_175700_1_ instanceof ITickable)
{
@@ -1699,9 +1833,13 @@
@@ -1699,9 +1835,13 @@
{
int i = MathHelper.func_76128_c(p_72866_1_.field_70165_t);
int j = MathHelper.func_76128_c(p_72866_1_.field_70161_v);
@ -450,7 +452,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;
@@ -1829,7 +1967,7 @@
@@ -1829,7 +1969,7 @@
{
Block block = this.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).func_177230_c();
@ -459,7 +461,7 @@
{
return true;
}
@@ -1894,6 +2032,10 @@
@@ -1894,6 +2034,10 @@
{
return true;
}
@ -470,7 +472,7 @@
}
}
}
@@ -1930,6 +2072,16 @@
@@ -1930,6 +2074,16 @@
blockpos$mutableblockpos.func_181079_c(k1, l1, i2);
IBlockState iblockstate = this.func_180495_p(blockpos$mutableblockpos);
Block block = iblockstate.func_177230_c();
@ -487,7 +489,7 @@
if (block.func_149688_o() == p_72918_2_)
{
@@ -2004,6 +2156,9 @@
@@ -2004,6 +2158,9 @@
IBlockState iblockstate = this.func_180495_p(blockpos$mutableblockpos.func_181079_c(k1, l1, i2));
Block block = iblockstate.func_177230_c();
@ -497,7 +499,7 @@
if (block.func_149688_o() == p_72830_2_)
{
int j2 = ((Integer)iblockstate.func_177229_b(BlockLiquid.field_176367_b)).intValue();
@@ -2034,6 +2189,7 @@
@@ -2034,6 +2191,7 @@
public Explosion func_72885_a(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_);
@ -505,7 +507,7 @@
explosion.func_77278_a();
explosion.func_77279_a(true);
return explosion;
@@ -2180,19 +2336,27 @@
@@ -2180,19 +2338,27 @@
else
{
this.func_175700_a(p_175690_2_);
@ -534,7 +536,7 @@
}
else
{
@@ -2205,6 +2369,7 @@
@@ -2205,6 +2371,7 @@
this.func_175726_f(p_175713_1_).func_177425_e(p_175713_1_);
}
@ -542,7 +544,7 @@
}
public void func_147457_a(TileEntity p_147457_1_)
@@ -2223,7 +2388,7 @@
@@ -2223,7 +2390,7 @@
{
IBlockState iblockstate = p_175683_0_.func_180495_p(p_175683_1_);
Block block = iblockstate.func_177230_c();
@ -551,7 +553,7 @@
}
public boolean func_175677_d(BlockPos p_175677_1_, boolean p_175677_2_)
@@ -2243,7 +2408,7 @@
@@ -2243,7 +2410,7 @@
else
{
Block block = this.func_180495_p(p_175677_1_).func_177230_c();
@ -560,7 +562,7 @@
}
}
}
@@ -2262,6 +2427,7 @@
@@ -2262,6 +2429,7 @@
{
this.field_72985_G = p_72891_1_;
this.field_72992_H = p_72891_2_;
@ -568,7 +570,7 @@
}
public void func_72835_b()
@@ -2271,6 +2437,11 @@
@@ -2271,6 +2439,11 @@
protected void func_72947_a()
{
@ -580,7 +582,7 @@
if (this.field_72986_A.func_76059_o())
{
this.field_73004_o = 1.0F;
@@ -2284,6 +2455,11 @@
@@ -2284,6 +2457,11 @@
protected void func_72979_l()
{
@ -592,7 +594,7 @@
if (!this.field_73011_w.func_177495_o())
{
if (!this.field_72995_K)
@@ -2378,6 +2554,7 @@
@@ -2378,6 +2556,7 @@
{
this.field_72993_I.clear();
this.field_72984_F.func_76320_a("buildList");
@ -600,7 +602,7 @@
for (int i = 0; i < this.field_73010_i.size(); ++i)
{
@@ -2434,8 +2611,9 @@
@@ -2434,8 +2613,9 @@
Block block = p_147467_3_.func_177428_a(blockpos);
j = j + p_147467_1_;
k = k + p_147467_2_;
@ -611,7 +613,7 @@
{
EntityPlayer entityplayer = this.func_72977_a((double)j + 0.5D, (double)l + 0.5D, (double)k + 0.5D, 8.0D);
@@ -2475,6 +2653,11 @@
@@ -2475,6 +2655,11 @@
public boolean func_175670_e(BlockPos p_175670_1_, boolean p_175670_2_)
{
@ -623,7 +625,7 @@
BiomeGenBase biomegenbase = this.func_180494_b(p_175670_1_);
float f = biomegenbase.func_180626_a(p_175670_1_);
@@ -2516,6 +2699,11 @@
@@ -2516,6 +2701,11 @@
public boolean func_175708_f(BlockPos p_175708_1_, boolean p_175708_2_)
{
@ -635,7 +637,7 @@
BiomeGenBase biomegenbase = this.func_180494_b(p_175708_1_);
float f = biomegenbase.func_180626_a(p_175708_1_);
@@ -2533,7 +2721,7 @@
@@ -2533,7 +2723,7 @@
{
Block block = this.func_180495_p(p_175708_1_).func_177230_c();
@ -644,7 +646,7 @@
{
return true;
}
@@ -2565,10 +2753,11 @@
@@ -2565,10 +2755,11 @@
else
{
Block block = this.func_180495_p(p_175638_1_).func_177230_c();
@ -659,7 +661,7 @@
{
j = 1;
}
@@ -2768,10 +2957,10 @@
@@ -2768,10 +2959,10 @@
public List<Entity> func_175674_a(Entity p_175674_1_, AxisAlignedBB p_175674_2_, Predicate <? super Entity > p_175674_3_)
{
List<Entity> list = Lists.<Entity>newArrayList();
@ -674,7 +676,7 @@
for (int i1 = i; i1 <= j; ++i1)
{
@@ -2824,10 +3013,10 @@
@@ -2824,10 +3015,10 @@
public <T extends Entity> List<T> func_175647_a(Class <? extends T > p_175647_1_, AxisAlignedBB p_175647_2_, Predicate <? super T > p_175647_3_)
{
@ -689,7 +691,7 @@
List<T> list = Lists.<T>newArrayList();
for (int i1 = i; i1 <= j; ++i1)
@@ -2905,11 +3094,13 @@
@@ -2905,11 +3096,13 @@
public void func_175650_b(Collection<Entity> p_175650_1_)
{
@ -706,7 +708,7 @@
}
}
@@ -2922,7 +3113,9 @@
@@ -2922,7 +3115,9 @@
{
Block block = this.func_180495_p(p_175716_2_).func_177230_c();
AxisAlignedBB axisalignedbb = p_175716_3_ ? null : p_175716_1_.func_180640_a(this, p_175716_2_, p_175716_1_.func_176223_P());
@ -717,7 +719,7 @@
}
public int func_181545_F()
@@ -3007,7 +3200,7 @@
@@ -3007,7 +3202,7 @@
{
IBlockState iblockstate = this.func_180495_p(p_175651_1_);
Block block = iblockstate.func_177230_c();
@ -726,7 +728,7 @@
}
public boolean func_175640_z(BlockPos p_175640_1_)
@@ -3134,7 +3327,7 @@
@@ -3134,7 +3329,7 @@
public long func_72905_C()
{
@ -735,7 +737,7 @@
}
public long func_82737_E()
@@ -3144,17 +3337,17 @@
@@ -3144,17 +3339,17 @@
public long func_72820_D()
{
@ -756,7 +758,7 @@
if (!this.func_175723_af().func_177746_a(blockpos))
{
@@ -3166,7 +3359,7 @@
@@ -3166,7 +3361,7 @@
public void func_175652_B(BlockPos p_175652_1_)
{
@ -765,7 +767,7 @@
}
@SideOnly(Side.CLIENT)
@@ -3186,12 +3379,18 @@
@@ -3186,12 +3381,18 @@
if (!this.field_72996_f.contains(p_72897_1_))
{
@ -784,7 +786,7 @@
return true;
}
@@ -3285,8 +3484,7 @@
@@ -3285,8 +3486,7 @@
public boolean func_180502_D(BlockPos p_180502_1_)
{
@ -794,7 +796,7 @@
}
public MapStorage func_175693_T()
@@ -3345,12 +3543,12 @@
@@ -3345,12 +3545,12 @@
public int func_72800_K()
{
@ -809,7 +811,7 @@
}
public Random func_72843_D(int p_72843_1_, int p_72843_2_, int p_72843_3_)
@@ -3405,7 +3603,7 @@
@@ -3405,7 +3605,7 @@
@SideOnly(Side.CLIENT)
public double func_72919_O()
{
@ -818,7 +820,7 @@
}
public void func_175715_c(int p_175715_1_, BlockPos p_175715_2_, int p_175715_3_)
@@ -3439,7 +3637,7 @@
@@ -3439,7 +3639,7 @@
public void func_175666_e(BlockPos p_175666_1_, Block p_175666_2_)
{
@ -827,7 +829,7 @@
{
BlockPos blockpos = p_175666_1_.func_177972_a(enumfacing);
@@ -3447,18 +3645,14 @@
@@ -3447,18 +3647,14 @@
{
IBlockState iblockstate = this.func_180495_p(blockpos);
@ -852,7 +854,7 @@
}
}
}
@@ -3528,4 +3722,81 @@
@@ -3528,4 +3724,81 @@
int k = 128;
return i >= -k && i <= k && j >= -k && j <= k;
}