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. Set the tint index for each model face you want to be coloured at runtime and register an IBlockColor for the Block that returns the appropriate colour for each tint index depending on the location. Look at BlockColors for vanilla examples.
  2. Use ReflectionHelper.findField or ReflectionHelper.findMethod to get a Field/Method object for the field/method and store it in a private static final field. You'll need to provide both the MCP and SRG names of the field/method. Use Field#get or Field#set to get or set the value of a field. If it's an instance field, pass the instance as the first argument. If it's a static field, pass null as the first argument instead. Use Method#invoke to call a method. If it's an instance method, pass the instance as the first argument. If it's a static method, pass null as the first argument instead. Pass the method's arguments as the vararg argument.
  3. That's the correct way to create a ResourceLocation, assuming your shuriken texture is located at assets/<modid>/textures/items/shuriken.png. It's not directly related to your issue, but I noticed that you're extending the raw Render type instead of specifying its generic type argument. If you specify the type argument as EntityShuriken, you can delete the getEntityTexture(Entity) and doRender(Entity, ...) methods, since the getEntityTexture(EntityShuriken) and doRender(EntityShuriken, ...) methods will override the corresponding super methods. If you want your entity to render as an item model (like snowballs, ender pearls, eggs, etc.), you can use or extend RenderSnowball.
  4. IRenderFactory#createRenderFor is called from the RenderManager constructor, before the RenderManager instance is stored in the Minecraft#renderManager field (used by Minecraft#getRenderManager). This means you're passing null as the RenderManager argument of your RenderShuriken constructor, so Render#bindTexture throws a NullPointerException when it tries to get the RenderManager#renderEngine field from it. You need to use the RenderManager instance passed as an argument to IRenderFactory#createRenderFor instead of trying to get it from Minecraft. This is also a general guideline you should follow: Use the data you've been given rather than trying to get the data yourself (unless you have a specific reason not to).
  5. Even if they only run on older versions of Minecraft, the models produced by them should work in 1.11.2.
  6. You can try Tabula or Qubble.
  7. You need to handle the random chance and random amounts yourself: generate a random number for the amount of soil and add a stack of that much soil to the list (or that many stacks of 1 soil), then generate a random number for the rock drop chance and add a rock to the drops list if it's within the 10% range.
  8. You can do exactly the same thing as you would in BreakEvent, just add drops to the list instead of manually spawning them as entities.
  9. PlayerTickEvent is fired for all players (even on the client side), not just the client player. If you want to do something every tick on the client, use ClientTickEvent.
  10. I'm not too sure, sorry. I don't know all that much about rendering.
  11. You should be able to use FontRenderer#drawSplitString or FontRenderer#listFormattedStringToWidth for this.
  12. If you're developing a mod and you have a class that extends ItemAxe, you need to use the ItemAxe(ToolMaterial, float, float) constructor for non-vanilla ToolMaterials. The ItemAxe(ToolMaterial) constructor only works for vanilla ToolMaterials because it uses the ordinal as an array index.
  13. 1.6.4 is no longer supported by Forge, you won't get any help with it here.
  14. A task that was scheduled with IThreadListener#addScheduledTask is throwing an ArrayIndexOutOfBoundsException, but I can't tell you where it's being thrown from because you didn't post the full stack trace. Either post the full stack trace/crash report in a code block (the <> button) or post the full FML log (logs/fml-client-latest.log) using Gist or Pastebin. Alternatively, read it yourself and figure out why the exception is being thrown and what you can do to stop it.
  15. If you click "Show all downloads" on the Forge download page, you'll see a full list of downloads with an i icon next to each download link. Hover over this and there'll be a "Direct Download" link that bypasses AdFocus (if the regular link uses AdFocus) and downloads the file directly.
  16. Like the error message says, Forestry requires Forge 13.20.0.2230 or above, but you're using an older version. You need to update Forge.
  17. I don't think this is true. Looking at ModelLoader#loadItemModels, Forge tries to load the item model first and only tries to load the model from the blockstates file if that throws an exception.
  18. You can read more about capabilities here.
  19. It's possible that you'd want to create a sound event that consists of a combination of vanilla files not present in any existing sound event. For example, a sound event consisting of minecraft:block/chorus_flower/grow1, minecraft:dig/cloth1 and youmod:foo/bar. There's no existing sound event with this combination of sound files.
  20. By default, the same model is used for an item regardless of where it's being rendered (e.g. in the hand or in the inventory). You'll need to create an IPerspectiveAwareModel wrapper that uses either the full OBJ model or the simple JSON model based on where it's being rendered (the TransformType). diesieben07 helped someone else with something similar here.
  21. The sound events in your sounds.json file have their resource domain set automatically from the file's resource domain, but the individual sound files used by the sound events don't, they need to be specified manually. Replace special/levelup with dynamicswordskills:special/levelup in your sounds.json file.
  22. IRenderFactory is an interface with a single method, you shouldn't need an example. All your implementation needs to do is create and return the Render instance using the provided RenderManager instance. You can implement it with a lambda/constructor method reference (requires Java 8), an anonymous class or a regular class.
  23. Use the non-deprecated overload with an IRenderFactory argument.
  24. AnimationModelBase is a ModelBase that renders an animated baked model. If the model isn't animated, you can create your own Render/ModelBase and cache the IBakedModel instead of re-baking it each frame.

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.