Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. The model file you've told Minecraft to use doesn't exist.
  2. Override TileEntity#shouldRefresh to return true only when the Block changes. This will allow the TileEntity to remain intact when the state changes but the Block is still the same.
  3. You need to pass the entity's ID (Entity#getEntityId) as one of the int arguments of EntityPlayer#openGUI. In your GUI handler, use World#getEntityByID to get the entity from its ID.
  4. Everything is in the source code. World generation isn't handled by the Block class, it's handled by dedicated world generation classes. If you look for usages of Blocks.DIAMOND_ORE, you'll see that it's used in BiomeDecorator#decorate to create a WorldGenMinable instance. This is later used in BiomeDecorator#generateOres to generate veins of Diamond Ore.
  5. EntityRegistry.registerModEntity has nothing to do with rendering/textures. It belongs in common code, not client-only code. The registryName argument is a registry name, not a texture path. The entityName argument should include your mod ID. The mod argument is the instance of your @Mod class, but you're passing the RenderManager instance (which is still null in preInit) instead. This isn't a mod instance, so the game crashes with a NullPointerException when Forge tries to get the mod ID to write to the log.
  6. Do you actually know Java? You can't just type an arbitrary name like that, you need to pass the method a ResourceLocation and a String. The ResourceLocation must have your mod ID as the domain. If you don't specify a domain, it defaults to minecraft. Entity registration must happen on both physical sides, so it should be done in your @Mod class or a class called from it. Render registration must be done by calling RenderingRegistry.registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) in preInit. This must happen only on the physical client, so it should be done in your client proxy or a client-only class called from it.
  7. Create a class that extends the IRecipe class you're currently using and then override IRecipe#getRemainingItems to return the remaining item for each slot. Use ForgeHooks.defaultRecipeGetRemainingItems to get the default remaining items for every slot or ForgeHooks.getContainerItem to get the default remaining item for a single slot. Create a class that implements IRecipeFactory and parses your recipe from the provided JSON object. Specify this class in recipes/_factories.json. You can see the IRecipeFactory implementations for the Vanilla and Forge recipe classes in CraftingHelper.init. In your recipe file, set the type property to "<modid>:<recipe_name>", where <modid> is your mod ID and <recipe_name> is the name you specified in recipes/_factories.json.
  8. Passing null as an argument that isn't explicitly documented or annotated as nullable is a bad idea. You need to pass actual values for the registryName and entityName arguments. The registryName argument of EntityRegistry.registerModEntity is the registry name of the entity, which must be a unique name with your mod ID as the domain of the ResourceLocation and the entity's name as the path. The registry name is used as your entity's ID when it's being read from/written to NBT. The entityName argument of EntityRegistry.registerModEntity is a separate name for the entity, which should also be unique (i.e. you should include your mod ID in it). This is sometimes called the "old" name and is mainly used for translation/display purposes. I recommend using the registry name for this name, but it's not required to do so.
  9. You need to use a class that extends ItemBlock for the Item form of a Block. Where are you registering your item models? There should be some errors in the FML log telling you why the models aren't working, please post this using Gist or Pastebin.
  10. Have you tried looking at how Ender Pearls do this?
  11. If you must register recipes in code (which I recommend against doing), use the registry events.
  12. Use World#getCollisionBoxes(Entity, AxisAlignedBB) to get all Block and Entity collision bounding boxes that intersect with the specified AABB. Use World#collidesWithAnyBlock to check if the AABB intersects any Block collision bounding boxes.
  13. Use RenderLivingEvent#getEntity to get the entity being rendered, check if it's the client player (Minecraft#player) and then cast it to AbstractClientPlayer before rendering the ears. Since you're only rendering this for a player, it's probably best to subscribe to RenderPlayerEvent.Post instead of RenderLivingEvent.Post. This is only fired for players rather than every living entity.
  14. You need to save the BURNING property to the metadata in DualFurance#getMetaFromState and then load it from the metadata in DualFurance#getStateFromMeta. You shouldn't be manually changing the TileEntity like you do in DualFurance.setState, just set the state to currentState.withProperty(BURNING, isBurning). Since you've overridden TileEntity#shouldRefresh to return true only when the Block changes, the TileEntity will automatically be preserved when the burning state changes. Vanilla only does this because it uses separate Blocks for the two burning states instead of one Block with a boolean property.
  15. You don't. That code uses registry events, which Forge fires when each registry is ready to receive registrations.
  16. As jeffryfisher said, you need to read up on how Java and IDEs work. Oracle have a set of official Java tutorials here that might help. Your IDE should have some documentation on how its debugger works. When you set a breakpoint on a line, you're telling the IDE to pause execution of the code once it reaches that line (and optionally meets some arbitrary conditions, but you don't need them here). This allows you to inspect things like arguments, local variables and fields and execute code in the context of the line it's paused at. Breakpoints are only hit when the program (Minecraft) is running in debug mode. When the breakpoint is hit, you should be able to hover over the Throwable argument of the method in the anonymous class (the one you set the breakpoint in) and look at its value. Alternatively, there should be a window that shows you the values of various arguments, local variables and fields in the current context. In this case, it's probably easier to change the breakpoint so it doesn't suspend (pause) execution and instead tell it to log the Throwable using FML's Logger when it's hit (i.e. call Logger#error(String, Throwable) on FMLLog.log) , this will print the full stacktrace to the log.
  17. I didn't ask you to post the new log, since setting the breakpoint won't actually change fix the problem; it will merely allow you to identify it. This new log has the same errors as the previous one. Please do this:
  18. You can only use an array as a fully-defined variant, you can't use it as one of the values of a property. It might be best to register an IStateMapper that uses a different blockstates file for each value of the type property, this way you can define the textures in the defaults section of each file and avoid repeating them for the variants with multiple possible models.
  19. To open a class by name, use Navigate > Class (Ctrl-N) in IDEA or Navigate > Go To > Type... in Eclipse.
  20. I think the only option is an array of variants, you can't just have an array of models.
  21. I'm not too sure what's going on, please post the full output from running the build task.
  22. In my first post, I was talking about an ore name that never had any items registered for it. This will always return a zero-length array from Ingredient#getMatchingStacks. If a mod were to register an item for that ore name at any point (i.e. even in init, postInit or when there's a world loaded), the OreIngredient would now match that item and include it in the array returned from Ingredient#getMatchingStacks. This is because OreIngredient stores a read-only view of the Ore Dictionary's item list for the specified ore name rather than creating a snapshot of the list at construction time.
  23. OreIngredients will match items registered for the ore name at any time, they don't take a snapshot of the Ore Dictionary when they're created.
  24. Where are you calling this from? Which player are you trying to render the ears for?
  25. Indeed, I saw that some time after posting in this thread. That was news to me, since I'd previously thought that init was the de-facto standard phase for Ore Dictionary registration. Even with this recommendation, I suspect a lot of mods are still doing things the old way (i.e. registering Ore Dictionary entries in init).
×
×
  • Create New...

Important Information

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