Skip to content

Commit

Permalink
Allow blocks to affect the beacon color (MinecraftForge#3205)
Browse files Browse the repository at this point in the history
  • Loading branch information
williewillus authored and LexManos committed Aug 17, 2016
1 parent f3d0d99 commit b25a925
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
17 changes: 15 additions & 2 deletions patches/minecraft/net/minecraft/block/Block.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
public SoundType func_185467_w()
{
return this.field_149762_H;
@@ -893,6 +913,1155 @@
@@ -893,6 +913,1168 @@
return "Block{" + field_149771_c.func_177774_c(this) + "}";
}

Expand Down Expand Up @@ -1354,12 +1354,25 @@
+ 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 ======================================*/
+
public static void func_149671_p()
{
func_176215_a(0, field_176230_a, (new BlockAir()).func_149663_c("air"));
@@ -1169,11 +2338,7 @@
@@ -1169,11 +2351,7 @@
}
else
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- ../src-base/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)
{
Expand All @@ -9,7 +9,23 @@
{
this.field_146015_k = false;
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();

Expand All @@ -18,7 +34,7 @@
{
flag1 = false;
break;
@@ -382,7 +382,7 @@
@@ -382,7 +388,7 @@

public boolean func_94041_b(int p_94041_1_, ItemStack p_94041_2_)
{
Expand Down

0 comments on commit b25a925

Please sign in to comment.