Jump to content

Dongle12

Members
  • Posts

    7
  • Joined

  • Last visited

Dongle12's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Alright thanks, I suspected as much.
  2. The EntityMinecart class has this function: public float getMaxCartSpeedOnRail() { return 1.2f; } That does return a static value, and that function is used here: public final void setCurrentCartSpeedCapOnRail(float value) { value = Math.min(value, getMaxCartSpeedOnRail()); currentSpeedRail = value; } in order to limit the actual speed. I have looked at reflection for both these functions, but I can't find the SRG name for either function, and all the tutorials for ReflectionHelper use the SRG names. I'm not sure if that has changed with newer versions of MC, or if ReflectionHelper does in fact still need the SRG when I use it. I have gone through all the MCP names with no luck of finding the names. Is there some debug I can do manually in eclipse to get the SRG name of the functions?
  3. I am looking at increasing the maximum speed of a minecart, but EntityMinecart class doesn't have a way to set the max speed, only get. Would there be an easier way to simply change the max speed of the cart, or do I have to create a new Entity class, override the function, and then spawn in the custom cart in place of the default one? If the latter is true, can anyone point me to a good tutorial on registering entity's and spawning them in? I have seen other tutorials on the registering entities, but they all deal with mobs and I don't think mobs and carts are the same entities.
  4. Alright thank you for the link to the code changes. I seem to have it working, although my solution seems a bit hacked together to me. I fixed it by removing the setRegistryName() call from the super and subclasses, and then in my CommonProxy(), I create new objects, and then set their appropriate names there. Is this a correct approach to fixing this issue?
  5. Alright thanks, turns out my problem wasn't solved. I have tried limiting changing the code around to ensure that it doesn't register the same thing twice, but I think I do not fully grasp registering or am missing something and registering the block twice by accident. The crash log starts with this: java.lang.IllegalStateException: Attempted to set registry name with existing registry name! New: BlockCompressedTorcherino Old: torcherino:blocktorcherino, and then points to line #9 of the BlockCompressedTorcherino class which has the following. public final class BlockCompressedTorcherino extends BlockTorcherino { public BlockCompressedTorcherino() { setRegistryName("BlockCompressedTorcherino"); setUnlocalizedName("torcherino.compressed_torcherino"); } @Override public TileEntity createNewTileEntity(final World world, final int i) { return new TileCompressedTorcherino(); } } Line # 9 is the setRegistryName() function call. From there I do the block registering in the CommonProxy(). The block registration code looks like the following: @SubscribeEvent public static void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().register(new BlockTorcherino()); GameRegistry.registerTileEntity(TileTorcherino.class, "torcherino_tile"); event.getRegistry().register(new BlockCompressedTorcherino()); GameRegistry.registerTileEntity(TileCompressedTorcherino.class, "compressed_torcherino_tile"); event.getRegistry().register(new BlockDoubleCompresedTorcherino()); GameRegistry.registerTileEntity(TileDoubleCompressedTorcherino.class, "double_compressed_torcherino_tile"); } It runs into trouble at the line event.getRegistry().register(new BlockCompressedTorcherino()); I think this issue may stem from the BlockCompressedTorcherino extending the BlockTorcherino class which has code for setting registry name already in its constructor: setRegistryName("blocktorcherino");
  6. I solve the problem, but I just want to make sure I have my answer straight. When I register a Tile Entity, it is the same thing as registering a block correct? I.E. I do not need to register both a block and a tile entity for the same object.
  7. I am having an issue with porting a mod from 1.11 to 1.12.2. I think I have all the block and item registration setup correctly, but when I go to launch the game, it crashes right away and gives an error about existing registry names. I am not sure what I have to change to move past this. Crash log is here: https://pastebin.com/pujTMbfa I am not even sure what code I would need to provide to be more helpful on my end, so please let me know. Thank you so much
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.