Jump to content

Choonster

Moderators
  • Posts

    5161
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. Use log4j, the logging library used by Minecraft. To get a log4j Logger instance, you can either use the methods from LogManager or use FMLPreInitializationEvent#getModLog, which returns a Logger with your mod ID as its name. Call ICommandSender#sendMessage on an EntityPlayer (or any other ICommandSender) to send them a message. The most commonly used ITextComponent implementations are TextComponentTranslation (a translation key and format arguments translated and formatted on the client) and TextComponentString (a simple string). You can use any folder structure you want inside src/main/java as long as your packages match it.
  2. Use IBakedModel#getQuads to get the model's BakedQuads and use BakedQuad#getSprite to get the texture of a BakedQuad. You can also use IBakedModel#getParticleTexture to get a model's particle texture.
  3. The registry name is the object's unique identifier, it's not directly related to rendering (though it's used as the default location for blockstates files [for Blocks] and item models [for Items]). Blocks don't have textures, they have models. Models do have textures, though. What exactly are you trying to do? You can use BlockRendererDispatcher#getModelForState to get the IBakedModel for an IBlockState. If you need the model's location rather than the model itself, use BlockStateMapper#getVariants to get a Map<IBlockState, ModelResourceLocation> for a Block and use it to look up the ModelResourceLocation for an IBlockState.
  4. You can like posts by clicking the "Like this" button in the bottom right of the post. I think that's the only thanking mechanism available now.
  5. Your question is a bit vague, it's equivalent to asking about getting the int from a Block. Which ResourceLocation do you want? The registry name? The model location? Something else?
  6. Call Item#setNoRepair to stop an Item from being repaired.
  7. I'm not really following you. Please do what I told you to in this post (if you haven't already) and post the code and FML log (using Gist) for that version. Posting one version of the code and a crash report for a different version doesn't help much.
  8. It was renamed to LivingEntityUseItemEvent because the corresponding Item methods now use EntityLivingBase instead of EntityPlayer.
  9. You call ModelBakery.registerItemVariants with the registry name of ModItems.stonetongs (which is presumably <modid>:stonetongs) and <modid>:stonetongs, but your ItemMeshDefinition returns the registry name with the _default suffix (<modid>:stonetongs_default which you haven't registered).
  10. You can't reference client-only classes like Minecraft from common code, otherwise you'll crash the dedicated server. Capabilities and most event handlers need to be registered on both physical sides, so this should be done from your @Mod class. The class you specify in the serverSide property of the @SidedProxy annotation will only be loaded by the dedicated server.
  11. The ItemEternalCrystal constructor is calling ItemEternalCrystal#preInit, which is calling the ItemEternalCrystal constructor, which is calling ItemEternalCrystal#preInit. This is infinite recursion, which causes a StackOverflowError to be thrown. Post the latest version of ItemEternalCrystal.
  12. The forgeSrc library referenced by your IDE project already contains both the Minecraft and Forge source code (assuming you used setupDecompWorkspace when setting it up).
  13. You first need to register each possible model location using ModelBakery.registerItemVariants. This tells Minecraft to load the models. Your implementation of ItemMeshDefinition#getModelLocation receives the ItemStack being rendered and needs to return a ModelResourceLocation pointing to the desired model. You can use any aspect of the ItemStack (or none) to determine the model location, including NBT. I have an explanation of how ModelResourceLocations are mapped to model files here.
  14. Don't implement IItemColor on your Item. It's a client-only interface that doesn't exist on the dedicated server, so you can only reference it in client-only classes. Once you've extracted the IItemColor implementation (I recommend using an anonymous class or lambda), post the code where you register it with the ItemColors instance.
  15. I can confirm that using a PNG avatar works, though using a JPEG one should either work or result in a better error message. It looks like there's a time limit on edits, since I can't edit my previous post in this thread. This is a bit annoying, I'd prefer not to have the time limit. Contrary to my previous post, there is a distinction between read and unread threads, I just didn't have any unread ones.
  16. Some issues I've noticed: Almost all avatars appear to be missing (TheDarkPreacher's is the only one I've seen so far) Attempting to upload an avatar fails, with the message "There is no profile photo available to crop Error code: 2C138/C". The URL is http://www.minecraftforge.net/forum/index.php?/profile/70776-choonster/&do=cropPhoto. The [tt] tag was previously used for inline code, now it's being displayed as a code block on a new line. I can't edit any of my posts made before the migration. I'm not sure if this is a bug or a time limit. There doesn't appear to be any distinction between read and unread threads. It's not really a migration issue, but is there any way to disable the popup and/or sound for new replies while viewing a thread?
  17. IItemColor#getColorFromItemstack receives two arguments: the ItemStack being rendered and the tint index, which specifies the model part being rendered. You can use both of these to determine which colour should be returned. The tint index is similar to the render pass arguments of colour-related methods in previous versions. For models that extend builtin/generated , each layerN texture has a tint index of N . For other models, you can specify the tint index for each face in the model file (see the wiki for a full specification of the model format). For the singularity, you'd use the ItemStack 's metadata to determine which index of the colour arrays to use and the tint index to determine which of the two arrays to look up the colour in ( colors2 if it's 0, colors if it's 1). Look at the IItemColor of Items.SPAWN_EGG for an example of the colour being chosen based on the ItemStack and the tint index.
  18. Could you give me an example of that? Look at the ItemColors class.
  19. You need to register an IItemColor implementation for your Item by calling ItemColors#registerItemColorHandler in init from your client proxy. You can get the ItemColors instance by calling Minecraft#getItemColors .
  20. If nbt is null , calling a method on it will throw a NullPointerException .
  21. The item's NBT is accessed all over the place, look for usages of the ItemStack#stackTagCompound field or the ItemStack#getTagCompound method using your IDE. Your values won't be accessed or modified by the game. Edit: Fixed the formatting.
  22. So do it for each recipe. I'm not entirely sure what you're asking here.
  23. You can set NBT data almost anywhere you have an ItemStack . You can do this for the output of a single crafting recipe by setting the NBT data before you add the recipe or in IRecipe#getCraftingResult . You can do this for an item crafted, smelted or bought by a player by overriding Item#onCreated .
  24. ItemStack#getTagCompund returns the stack's compound tag, which is null by default. If it's null , create a new NBTTagCompound and use ItemStack#setTagCompound to set it as the stack's compound tag. You can then use the NBTTagCompound#getX / setX to get/set values in the compound tag. You can also use capabilities to store data on an ItemStack (or any other ICapabilityProvider ).
  25. You installed a coremod built for 1.7.10 or earlier, but you're running 1.11. Mods (especially coremods) usually only work for the version of Minecraft that they were built for. The download page and file name will usually tell you this version. Side note: The log you posted was completely unreadable, I had to quote it and copy it into an external editor to read it. In future, please upload the full FML log (the logs/fml-client-latest.log file in the game directory, not the console output from the launcher) to Gist and link it here.
×
×
  • Create New...

Important Information

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