diff --git a/src/main/java/net/minecraftforge/fml/common/network/handshake/FMLHandshakeClientState.java b/src/main/java/net/minecraftforge/fml/common/network/handshake/FMLHandshakeClientState.java index c653bbf5f..f65bf1c06 100644 --- a/src/main/java/net/minecraftforge/fml/common/network/handshake/FMLHandshakeClientState.java +++ b/src/main/java/net/minecraftforge/fml/common/network/handshake/FMLHandshakeClientState.java @@ -130,6 +130,7 @@ enum FMLHandshakeClientState implements IHandshakeState ForgeRegistry.Snapshot entry = new ForgeRegistry.Snapshot(); entry.ids.putAll(pkt.getIdMap()); entry.dummied.addAll(pkt.getDummied()); + entry.overrides.putAll(pkt.getOverrides()); snap.put(pkt.getName(), entry); if (pkt.hasMore()) diff --git a/src/main/java/net/minecraftforge/fml/common/network/handshake/FMLHandshakeMessage.java b/src/main/java/net/minecraftforge/fml/common/network/handshake/FMLHandshakeMessage.java index b6abc3eea..62e96d4f0 100644 --- a/src/main/java/net/minecraftforge/fml/common/network/handshake/FMLHandshakeMessage.java +++ b/src/main/java/net/minecraftforge/fml/common/network/handshake/FMLHandshakeMessage.java @@ -261,6 +261,11 @@ public abstract class FMLHandshakeMessage { return dummied; } + public Map getOverrides() + { + return overrides; + } + public ResourceLocation getName() { return this.name; diff --git a/src/test/java/net/minecraftforge/debug/RegistryOverrideTest.java b/src/test/java/net/minecraftforge/debug/RegistryOverrideTest.java index 98d449bb0..eaa231697 100644 --- a/src/test/java/net/minecraftforge/debug/RegistryOverrideTest.java +++ b/src/test/java/net/minecraftforge/debug/RegistryOverrideTest.java @@ -21,8 +21,11 @@ package net.minecraftforge.debug; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextComponentString; @@ -40,12 +43,13 @@ public class RegistryOverrideTest @SubscribeEvent public static void registerBlocks(RegistryEvent.Register event) { - event.getRegistry().register(new BlockReplacement() ); + event.getRegistry().register(new BlockReplacement()); } private static class BlockReplacement extends Block { AxisAlignedBB BB = FULL_BLOCK_AABB.contract(0.1, 0, 0.1); + private BlockReplacement() { super(Material.ROCK); @@ -62,9 +66,13 @@ public class RegistryOverrideTest } @Override - public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn) + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { - playerIn.sendMessage(new TextComponentString("Debug Override Click!")); + if (hand == EnumHand.MAIN_HAND) + { + playerIn.sendMessage(new TextComponentString(worldIn.isRemote ? "Client" : "Server")); + } + return false; } } }