Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Choonster

Moderators
  • Joined

  • Last visited

Everything posted by Choonster

  1. 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.
  2. 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.
  3. 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).
  4. 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.
  5. 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.
  6. Choonster replied to a post in a topic in Site News (non-forge)
    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.
  7. Choonster replied to a post in a topic in Site News (non-forge)
    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?
  8. 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.
  9. Could you give me an example of that? Look at the ItemColors class.
  10. 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 .
  11. If nbt is null , calling a method on it will throw a NullPointerException .
  12. 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.
  13. So do it for each recipe. I'm not entirely sure what you're asking here.
  14. 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 .
  15. 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 ).
  16. 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.
  17. EntityRegistry.registerModEntity isn't really related to rendering, but it is required to register your entity class using it. If you don't explicitly register a Render for your entity class, Minecraft will use the one for the super class.
  18. That's not at all what I told you to do. You need to override Item#addInformation and add tooltip lines to the List<String> argument, not create a List<String> field and add tooltip lines to it in a completely different method.
  19. Like I said in your previous thread, look at MultiLayerModel . It uses ModelLoaderRegistry.getModelOrLogError to get the IModel from a ResourceLocation and then bakes it into an IBakedModel using IModel#bake (in MultiLayerModel.buildModels ).
  20. I suggest you look at MultiLayerModel , which combines multiple models that render on different layers.
  21. Properties.toUnlisted creates a new IUnlistedProperty object every time you call it, so the unlisted version of the STATE_0 property that you pass to the ExtendedBlockState constructor in BlockRipeningRack#createBlockState isn't the same as the one you pass to IExtendedBlockState#withProperty in BlockRipeningRack#getExtendedState . You need to store the IUnlistedProperty objects instead of re-creating them each time.
  22. You can't create an NBTTagString with a null value, so you can't call NBTTagCompound#setString with a null value. Only call NBTTagCompound#setString if the name value isn't null .
  23. No, that wouldn't work. In writeNBT , you create an NBTTagCompound and store the data in it; but you then return a completely unrelated NBTTagString and do nothing with the NBTTagCompound . You need to return the NBTTagCompound . In readNBT , you assume that the NBTBase argument is an instance of NBTPrimitive (it won't be if writeNBT returns an NBTTagCompound ) that somehow contains both the name and the gender at the same time. You need to cast the argument to NBTTagCompound and retrieve the individual values from it using NBTTagCompound#getString and NBTTagCompound#getInteger .
  24. Override Item#addInformation to add the desired tooltip lines to the List<String> argument.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.