Allow blocks to affect the beacon color (#3205)

This commit is contained in:
Vincent Lee 2016-08-17 18:06:35 -05:00 committed by LexManos
parent f3d0d99404
commit b25a9256d3
2 changed files with 34 additions and 5 deletions

View file

@ -203,7 +203,7 @@
public SoundType func_185467_w() public SoundType func_185467_w()
{ {
return this.field_149762_H; return this.field_149762_H;
@@ -893,6 +913,1155 @@ @@ -893,6 +913,1168 @@
return "Block{" + field_149771_c.func_177774_c(this) + "}"; return "Block{" + field_149771_c.func_177774_c(this) + "}";
} }
@ -1354,12 +1354,25 @@
+ return func_185467_w(); + return func_185467_w();
+ } + }
+ +
+ /**
+ * @param state The state
+ * @param world The world
+ * @param pos The position of this state
+ * @param beaconPos The position of the beacon
+ * @return A float RGB [0.0, 1.0] array to be averaged with a beacon's existing beam color, or null to do nothing to the beam
+ */
+ @Nullable
+ public float[] getBeaconColorMultiplier(IBlockState state, World world, BlockPos pos, BlockPos beaconPos)
+ {
+ return null;
+ }
+
+ /* ========================================= FORGE END ======================================*/ + /* ========================================= FORGE END ======================================*/
+ +
public static void func_149671_p() public static void func_149671_p()
{ {
func_176215_a(0, field_176230_a, (new BlockAir()).func_149663_c("air")); func_176215_a(0, field_176230_a, (new BlockAir()).func_149663_c("air"));
@@ -1169,11 +2338,7 @@ @@ -1169,11 +2351,7 @@
} }
else else
{ {

View file

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java --- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java
@@ -130,7 +130,7 @@ @@ -130,17 +130,23 @@
{ {
if (iblockstate.func_177230_c() != Blocks.field_150397_co) if (iblockstate.func_177230_c() != Blocks.field_150397_co)
{ {
@ -9,7 +9,23 @@
{ {
this.field_146015_k = false; this.field_146015_k = false;
this.field_174909_f.clear(); this.field_174909_f.clear();
@@ -181,7 +181,7 @@ break;
}
+ float[] customColor = iblockstate.func_177230_c().getBeaconColorMultiplier(iblockstate, this.field_145850_b, blockpos$mutableblockpos, func_174877_v());
+ if (customColor != null)
+ afloat = customColor;
+ else {
tileentitybeacon$beamsegment.func_177262_a();
continue;
+ }
}
+ else
afloat = EntitySheep.func_175513_a((EnumDyeColor)iblockstate.func_177229_b(BlockStainedGlassPane.field_176245_a));
}
@@ -181,7 +187,7 @@
{ {
Block block = this.field_145850_b.func_180495_p(new BlockPos(j1, i2, k1)).func_177230_c(); Block block = this.field_145850_b.func_180495_p(new BlockPos(j1, i2, k1)).func_177230_c();
@ -18,7 +34,7 @@
{ {
flag1 = false; flag1 = false;
break; break;
@@ -382,7 +382,7 @@ @@ -382,7 +388,7 @@
public boolean func_94041_b(int p_94041_1_, ItemStack p_94041_2_) public boolean func_94041_b(int p_94041_1_, ItemStack p_94041_2_)
{ {