43 lines
2.2 KiB
Diff
43 lines
2.2 KiB
Diff
--- a/net/minecraft/client/renderer/color/BlockColors.java
|
|
+++ b/net/minecraft/client/renderer/color/BlockColors.java
|
|
@@ -27,7 +27,8 @@
|
|
|
|
@OnlyIn(Dist.CLIENT)
|
|
public class BlockColors {
|
|
- private final ObjectIntIdentityMap<IBlockColor> field_186725_a = new ObjectIntIdentityMap<>(32);
|
|
+ // FORGE: Use RegistryDelegates as non-Vanilla block ids are not constant
|
|
+ private final java.util.Map<net.minecraftforge.registries.IRegistryDelegate<Block>, IBlockColor> field_186725_a = new java.util.HashMap<>();
|
|
private final Map<Block, Set<Property<?>>> field_225311_b = Maps.newHashMap();
|
|
|
|
public static BlockColors func_186723_a() {
|
|
@@ -72,11 +73,12 @@
|
|
blockcolors.func_186722_a((p_228055_0_, p_228055_1_, p_228055_2_, p_228055_3_) -> {
|
|
return p_228055_1_ != null && p_228055_2_ != null ? 2129968 : 7455580;
|
|
}, Blocks.field_196651_dG);
|
|
+ net.minecraftforge.client.ForgeHooksClient.onBlockColorsInit(blockcolors);
|
|
return blockcolors;
|
|
}
|
|
|
|
public int func_189991_a(BlockState p_189991_1_, World p_189991_2_, BlockPos p_189991_3_) {
|
|
- IBlockColor iblockcolor = this.field_186725_a.func_148745_a(Registry.field_212618_g.func_148757_b(p_189991_1_.func_177230_c()));
|
|
+ IBlockColor iblockcolor = this.field_186725_a.get(p_189991_1_.func_177230_c().delegate);
|
|
if (iblockcolor != null) {
|
|
return iblockcolor.getColor(p_189991_1_, (IBlockDisplayReader)null, (BlockPos)null, 0);
|
|
} else {
|
|
@@ -86,13 +88,13 @@
|
|
}
|
|
|
|
public int func_228054_a_(BlockState p_228054_1_, @Nullable IBlockDisplayReader p_228054_2_, @Nullable BlockPos p_228054_3_, int p_228054_4_) {
|
|
- IBlockColor iblockcolor = this.field_186725_a.func_148745_a(Registry.field_212618_g.func_148757_b(p_228054_1_.func_177230_c()));
|
|
+ IBlockColor iblockcolor = this.field_186725_a.get(p_228054_1_.func_177230_c().delegate);
|
|
return iblockcolor == null ? -1 : iblockcolor.getColor(p_228054_1_, p_228054_2_, p_228054_3_, p_228054_4_);
|
|
}
|
|
|
|
public void func_186722_a(IBlockColor p_186722_1_, Block... p_186722_2_) {
|
|
for(Block block : p_186722_2_) {
|
|
- this.field_186725_a.func_148746_a(p_186722_1_, Registry.field_212618_g.func_148757_b(block));
|
|
+ this.field_186725_a.put(block.delegate, p_186722_1_);
|
|
}
|
|
|
|
}
|