Posted October 3, 20169 yr Hey guys. So I'm trying to basically check the registry for blocks by mod ID and item name and store them in a small list so that my mod has access to all blocks available in the game at a given time for use with my Tile Entities. The old method of findBlock is deprecated and I don't understand what findRegistry is actually asking for so I'm wary to mess with it. Cheers in advance!
October 3, 20169 yr What types is findRegistry looking for? VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 3, 20169 yr Author GameRegistry.findRegistry(); This asks for an array list called Class<IForgeRegistryEntry>
October 3, 20169 yr Author Oh and before I get told off for not showing why I'm using it, here's my code as it stands: public class GameRegHelper { public static Block findBlock(String id) { String[] names = id.split(":"); /*DEPRECATED! Placeholder until I figure something better out!!! */ Block block = GameRegistry.findBlock(names[0], names[1]); return block; } public static Item findItem(String id) { String[] names = id.split(":"); /*DEPRECATED! Placeholder until I figure something better out!!! */ Item item = GameRegistry.findItem(names[0], names[1]); return item; } }
October 3, 20169 yr Author Actually I accidentally found it by myself! Block block = Block.REGISTRY.getObject(new ResourceLocation(recipe.getID())); Item item - Item.REGISTRY.getObject(new ResourceLocation(recipe.getID()));
October 4, 20169 yr Why are you doing this? I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.