Skip 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. ItemStack doesn't override the hashCode method, so two instances are treated as different keys even if they share the same contents. To use an ItemStack as a key, you'll need a wrapper class that overrides hashCode to return the hash code of the ItemStack 's contents; com.google.common.base.Objects#hashCode will combine the hash codes of multiple objects for you. Exactly which parts of the ItemStack you use in the hash code depends on your requirements: Do you only care about the Item , stack size and metadata; or do you include the NBT as well? NBTTagCompound overrides hashCode to return the hash of its contents, so you don't need to calculate that yourself.
  2. You can use as many annotations as you want. You should always use @Override when overriding a method and @SideOnly when overriding a method with @SideOnly .
  3. Look at the log file, then. It should be in the logs folder of your Minecraft directory.
  4. Well what's the actual error that's thrown? Is it a StackOverflowError ?
  5. Post the full stack trace. This method is called recursively, so it's possible you'll get a StackOverflowError if a model has a cyclic inheritance graph (e.g. A has parent B, B has parent A).
  6. You need to think about how each property's value will be stored in the metadata and then convert to and from the metadata appropriately. For a single boolean, you can just use metadata values 0 and 1.
  7. Why add them as dependencies in the buildscript block? Isn't that only for the build script's dependencies?
  8. There's no need to run Gradle for the MDK download, just copy the ForgeGradle plugin declaration and Forge version from the build.gradle file into yours and run the Gradle commands I mentioned for your project.
  9. Yes, the server is the authority on pretty much any calculation; including damage. As long as the potion is active on the server, its effects should work.
  10. For Eclipse, run gradlew setupDecompWorkspace cleanEclipse eclipse . For IDEA, run the setupDecompWorkspace task and then refresh it in the Gradle tab. Download and extract the version 1506 MDK (the new name for the src download), open its build.gradle file in a text editor and compare it to your current one. You'll want to replace the buildscript block and apply plugin line of your build.gradle with the plugins block of the new build.gradle.
  11. Most things should either be done only on the server (if a packet is automatically sent to the clients) or on both sides (if a packet isn't automatically sent). In this case, the server will automatically send a packet to the clients when you add, change or remove a potion effect; so you only need to do it on the server.
  12. It's the same for any version of Forge that uses ForgeGradle: change the minecraft.version field in your build.gradle script to the appropriate version from files.minecraftforge.net and refresh or regenerate your IDE project. Recent versions of 1.8 have changed the way that the ForgeGradle plugin is applied (since there's now a stable version rather than a snapshot), so if you're updating to version 1503 or newer you should copy the changes to your build.gradle script.
  13. You've added a recipe for an ItemStack with a null Item . You should instantiate and register your Block s and Item s in preInit and then add your recipes in init.
  14. PlayerEvent.ItemCraftedEvent is fired on the FML event bus when a player crafts something.
  15. Ah, you need to register your IGuiHandler in the init phase with NetworkRegistry#registerGuiHandler .
  16. Add a static field of type tutmod to your tutmod class and give it the @Instance annotation.
  17. You haven't added an @Instance field to your tutmod class.
  18. Spawn eggs only work with global IDs in 1.7.10. For spawn eggs without global IDs, either make your own item or upgrade to 1.8 (where Forge allows spawn eggs to work without global IDs).
  19. Post your main mod class, your IGuiHandler class and the class where you call player.openGUI on Gist (use the .java file extension so syntax highlighting works) and link them here.
  20. That's the instance of your main mod class (the class with the @Mod ) annotation. If you have a static field in the mod class of the same type, you can add the @Instance annotation to it and FML will fill it with your mod's instance.
  21. This is possible with some limitations and hacks, but it's not all that simple since IRecipe has no direct access to the player crafting it. Do you really a need a dev-only item? Is creative-only not enough?
  22. The debug text is assembled in GuiOverlayDebug#call (for the text on the left) and GuiOverlayDebug#getDebugInfoRight (for the text on the right).
  23. In single player, the integrated server will fire all server-side events (including BreakEvent and ServerChatEvent ).
  24. If you want a ticking TileEntity in 1.8, implement IUpdatePlayerListBox . Block#randomDisplayTick is client-only, so it's not really suitable for processes that need to run on the server (like energy transfers).
  25. You need to override Item#requiresMultipleRenderPasses to return true and Item#getIcon(ItemStack stack, int pass) to return the particle icon on pass 0 and the book icon on pass 1. Look at the vanilla overrides of Item#getIconFromDamageForRenderPass for examples of multi-layer items.

Important Information

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

Account

Navigation

Search

Search

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.