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. The 1.13.2 update of TestMod3 is still very much a work in progress, there are lots of parts that haven't been fully updated to the new version and the mod as a whole doesn't compile yet. @V0idWa1k3r is correct that the ItemPigSpawner class is still referencing the 1.12.2 version of CapabilityPigSpawner.getPigSpawner. The CapabilityX and command classes are probably the best place to look for updated examples of capability use. LazyOptional#ifPresent is probably the most common method you'll be using to interact with capabilities, but there are other methods in LazyOptional depending on what you're trying to achieve.
  2. PlayerInteractEvent is a base class for the more specific interaction events, so it doesn't have all of the information itself. PlayerInteractEvent.EntityInteract is fired when a player right clicks an entity (including another player). getEntityPlayer() will return the player that did the clicking, getTarget() will return the entity that was clicked.
  3. I believe that Cadiboo was suggesting you look at the implementations of those GUIs (i.e. GuiModList and GuiConfig) for examples. It looks like GuiModList uses GuiScrollingList and some of the children of GuiConfig extend GuiListExtended, so these are probably the places to start looking.
  4. If you're extending an Entity class without an EntityType constructor parameter, you need to override Entity#getType to return your EntityType. The same applies to TileEntity classes with TileEntityType.
  5. You need to sync the capability values to all players watching the player entity, not just the player themselves. You can use SimpleNetworkWrapper#sendToAllTracking(IMessage, Entity) to send an IMessage to all players tracking an entity.
  6. All of the Forge and Vanilla tag JSON files should be visible in the Forge JAR in your IDE. You can see exactly which tags exist and which items they contain.
  7. Forge for 1.12.2 requires Java 8, so update to the latest version of that. Currently that's 8u201/8u202.
  8. Tags are the replacement for the Ore Dictionary. To my knowledge, every Ore Dictionary entry that was provided by Forge itself has been replaced with a corresponding item tag.
  9. It looks like TileEntity#type is set before the TileEntity constructor calls CapabilityProvider#gatherCapabilities (which fires AttachCapabilitiesEvent); so it should be possible to call TileEntity#getType and get a valid return in your AttachCapabilitiesEvent handler. Have you tried this?
  10. DaemonUmbra wasn't asking whether or not you were running it in the command prompt, they were telling you to run it in the command prompt to see if there's any error messages.
  11. You could try looking at Botania's animated Mana Pump model: blockstates, base model, head model, armatures, animations.
  12. I don't think you need an entity model (ModelBase). I don't have much experience with the animation system myself, so I can't tell you all that much about it. I have the Forge Modder title on this forum, but that just indicates that I make mods with Forge; I don't develop Forge itself.
  13. There's no need to use Sponge for this, you can use ClientChatEvent (on the client) or ServerChatEvent (on the server) to intercept and change/cancel chat messages.
  14. The OP is using Forge's model animation system, which requires specifying the animations in JSON files. Unfortunately, I can't really provide any further help on this topic.
  15. Do you mean changing the lambda passed to LazyOptional#map to return Optional<IItemHandler> instead of just IItemHandler? I suppose that could work, though it seems a bit weird to nest the two different optional classes like that.
  16. I have this method that gets a LazyOptional of a player's inventory IItemHandler and searches for the first slot with an item that matches a predicate. If it finds a valid item, it returns a LazyOptional of a single-slot IItemHandler that wraps that slot. If it doesn't, it returns an empty LazyOptional. Currently there's no direct way for LazyOptional#map to transform a non-empty LazyOptional into an empty one, so I've had to use EmptyHandler.INSTANCE as a sentinel value and call LazyOptional#filter to transform that value into an empty LazyOptional. My main concern is that LazyOptional#filter has a comment inside saying "Should we allow this function at all?" due to it being a non-lazy operation, so I'm somewhat reluctant to use it. Java's Optional#map allows the function to return null to create an empty Optional, but Forge's LazyOptional#map uses a NonNullFunction so returning null isn't an option. Is there a better way to map a non-empty LazyOptional into an empty one?
  17. Yes, but you need to do this before you try to add any remapping. Essentially, yes. When it finds your_mod:old_variant_block_with_subtypes in the save, it converts it to the new block based on the metadata: If the metadata corresponds to the variant foobar, it's converted into your_mod:foobar_variant_block If the metadata corresponds to the variant barbaz, it's converted into your_mod:barbaz_variant_block your_mod:foobar_variant_block and your_mod:barbaz_variant_block would be two separate instances of the same Block class.
  18. ItemBlock uses the Block's creative tab, so calling Item#setCreativeTab on an ItemBlock won't do anything.
  19. I have a DataFixer designed to flatten blocks in preparation for 1.13 here (the flattening definitions are initialised here). You should be able to use it to achieve this remapping. If you decide to use it, make sure you understand how it works first.
  20. setupDecompWorkspace doesn't exist any more. Import build.gradle into your IDE as a Gradle project, then run the genIntellijRuns or genEclipseRuns task as appropriate.
  21. It's the thread stickied at the top of this forum called "Rules and EAQ - READ FIRST OR YOU WILL GET BANNED!!!".
  22. The BlockFlattening.create method creates an instance and initialises it with the blocks to be flattened. The instance is registered with the mod's ModFixes instance here, this is called in init.
  23. I've written a block flattening DataFixer in 1.12.2 for my mod's variant blocks here. If you use this code, make sure you understand what it's doing.
  24. Use Entity#getType to get its EntityType, which is an IForgeRegistryEntry.
  25. Instead of constructing the PacketBuffer, writing to it and then calling openGui, simply call openGui with a lambda function that writes to the supplied PacketBuffer. Forge constructs the PacketBuffer for you.

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.