Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. You can still use OreDictionary.WILDCARD_VALUE (32767) as the metadata of an ingredient to match any metadata value. You can create custom IRecipe and Ingredient implementations by creating an IRecipeFactory or IIngredientFactory and specifying them in your _factories.json file. You can see some examples here and here.
  2. I don't fully understand your code, but could it be that the IBlockState at that position is changing, triggering a refresh of the TileEntity (as determined by FruityTileEntity#shouldRefresh)?
  3. In future, you can use Gist or Pastebin to post large log files.
  4. Upload the FML log (logs/fml-client-latest.log in the game directory) to Gist or Pastebin and link it here.
  5. You must set the registry name of an IForgeRegistryEntry with IForgeRegistryEntry#setRegistryName before registering it. For ItemBlocks, use the Block's registry name.
  6. I feel like there may have been a misunderstanding here, since TileEntities seem like the ideal tool for this job. Could you link this reaction? I'd like to see the reasoning behind it. I don't really get what nested Maps have to do with packet size. You need to send all three coordinates in the packet regardless of how the position is stored. There shouldn't be any major difference in memory consumption between an array of ints and an array of objects, if anything you're probably increasing the memory overhead by storing arrays of primitive wrapper classes (Integers). I'm not an expert on this, you should profile it if you want actual numbers. Storing object references rather than IDs shouldn't affect CraftTweaker, just convert from the ID to the Material object.
  7. You should be using IItemHandler, Forge's replacement for IInventory. You can use or extend ItemStackHandler, the standard IItemHandler implementation. ItemStackHandler implements INBTSerializable, you should use those methods to read it from/write it to NBT. Alternatively, use the IItemHandler capability's IStorage instance. I'm not sure exactly why your code isn't working, but I noticed that you're comparing the ItemStack to ItemStack.EMPTY directly; don't do this. Use ItemStack#isEmpty to check if an ItemStack is empty, ItemStack.EMPTY is just one possible empty ItemStack.
  8. Sorry, I missed that. This is very odd, including your mod ID in the sounds.json event name should result in a Sound being registered for the ResourceLocation with <modid> as the domain and <modid>:<name> as the path. Could you post a Git repository of your mod? I'd like to see if I can reproduce and debug this locally.
  9. You're calling Item.getItemFromBlock before you actually create and register the ItemBlocks, so it returns Items.AIR. You need to create and register the ItemBlocks in the RegistryEvent.Register<Item> handler method.
  10. Switching to registry events won't actually fix either problem itself, it's just something you should do to prepare for updating to newer versions. Moving model registration to a client-only class will fix the first problem. The issue here is that BlockOre references the client-only class Minecraft. You use it in two places (getDrops and getExtendedState) for the same purpose (getting a World when you only have an IBlockAccess), but the replacement will be slightly different in each method due to where they're called from. Since getDrops will usually be called with a World as its IBlockAccess argument, cast it to World (after checking that it is a World) and use that to get the ore data. Since getExtendedState will usually be called with a ChunkCache as its IBlockAccess argument, you can't just cast it to World. Instead, create a method in your proxy classes to get the client World and use this to get the ore data. It's probably best to check if the IBlockAccess is a World first and use that directly, just in case someone calls the method with a World. This would be a lot easier if you just used a TileEntity to store per-position block data. If you're going to stick with the current system, OreSavedData should use a Map with BlockPos keys instead of using nested Maps for each coordinate. Is there a reason you're storing everything as integers rather than storing the Material instances directly?
  11. Minecraft automatically uses your mod ID as the domain for the top-level sound event names in sounds.json, don't specify it yourself. Change redplusplus:item.redstone_sandwich.eat to item.redstone_sandwich.eat in your sounds.json file.
  12. The documentation page I linked explains them. You can see some examples of them in my mod's init classes.
  13. Did you read the thread? You need to use registry events.
  14. That line references ModFluids, which references the client-only classes StateMapperBase (which references IStateMapper) and ModelLoader, causing this error. All model registration must be done in client-only classes. I recommend switching to registry events now so you can more easily update your code to 1.12.
  15. I looked at where they were called in the old version and looked for the same code in the new version. I then looked at the methods called in that section in the new version to see which ones did roughly the same thing as the old ones. Other resources include this issue tracker, which documents most renames in 1.8+ and MCPBot, which you can use to find the new name of a field/method/parameter from the old one. I explain how to use MCPBot in more detail here. NetHandlerPlayClient#sendPacket can be used to send vanilla client-to-server packets. You can get the NetHandlerPlayClient instance from Minecraft#getConnection or EntityPlayerSP#connection.
  16. The FML log is the file called fml-client-latest.log in the logs directory of the Minecraft game directory. When asking for help in future, please upload it to Gist or Pastebin and link it in your post. That said, 1.7.10 is no longer supported on this forum. Update if you want help.
  17. Post the FML log (logs/fml-client-latest.log) using Gist or Pastebin.
  18. No, you should post the FML log like I asked.
  19. Post the FML log (logs/fml-client-latest.log) using Gist or Pastebin.
  20. You have two lang files, but neither is correct. You have one with the right name in the wrong location and one with the wrong name in the right location. The correct location and name is assets/<modid>/lang/en_us.lang (when you have a pack.mcmeta file with pack_format set to 3).
  21. Where do you call ModRenderers.register from? Where do you register your item models? Post a screenshot of the item.
  22. There aren't any model errors in the log. What does the item render as? Where are you registering the model? Post your code.
  23. The FML log (logs/fml-client-latest.log) should tell you why the models failed to load. Upload it to Gist or Pastebin and link it here.
  24. Which Minecraft version are you using? 1.11+ requires all resource file names to be lowercase. If you don't have a pack.mcmeta file or you do and it sets pack_format to 2, lang files will be loaded with the old mixed-case names (e.g. en_US.lang) because Forge wraps your mod's IResourcePack in a LegacyV2Adapter. If you have a pack.mcmeta file that sets pack_format to 3 (the current resource pack version), lang files will be loaded with the new lower-case names (e.g. en_us.lang). It's best to convert to pack_format 3 and lowercase names now in case Forge stops special-casingpack_format 2 resource packs in a future version.
×
×
  • Create New...

Important Information

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