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. Store the player in a field of the Money class.
  2. I don't think there's any other way than checking every tick, but doing it per-player may be less expensive than using World#getEntitiesWithinAABB.
  3. One alternative would be subscribing to PlayerTickEvent and checking if the player is in the region before teleporting them back. This probably has fairly minimal overhead, but you should profile it to check.
  4. ItemLayerModel is the class that generates item models, either use this or look at how it generates quads from textures. You may not actually need a TESR, you may be able to achieve what you want with a baked model generated at runtime.
  5. "Ticking entity" is just a generic message used for any crash report that happens when an entity is being ticked. It doesn't say anything about what caused the crash report. If your code is crashing, post the crash report (or read it yourself and figure out why it's happening).
  6. Call Capability#getStorage on the IEnergyStorage Capability instance to get its IStorage instance, then call IStorage#writeNBT and IStorage#readNBT to write an IEnergyStorage to/read it from NBT. You can get the Capability instance from the CapabilityEnergy.ENERGY field or create your own static field and annotate it with @CapabilityInject(IEnergyStorage.class).
  7. Because IStorage is an unrelated interface for reading capabilities from and writing them to NBT. Use Capability#getStorage to get the IStorage of a Capability.
  8. The first search result for "System editor can only open file base resources" was this thread, where diesieben07 explains how to fix this.
  9. The IStorage for the IEnergyStorage capability simply saves the stored energy as an NBTTagInt. Either use the IStorage or do the same thing yourself. You can still use IContainerListener#sendProgressBarUpdate and Container#updateProgressBar to synchronise numeric data like stored energy and progress, you just can't use IContainerListener#sendAllWindowProperties. Alternatively, you can use your own packets.
  10. Use World Capabilities or World Saved Data, either per-map or per-dimension as needed. You can see how RFTools stores its telerporter destinations here.
  11. Don't. If you solved your problem, post the solution so other people can find it when they have a similar problem.
  12. I think you're translating to the wrong position. AnimationTESR sets the translation to the coordinate arguments minus the TileEntity's coordinates, you're setting the translation to the TileEntity's coordinates.
  13. Use a custom IRecipe implementation.
  14. Create your own copy of the ItemStack#damageItem method without the creative mode check.
  15. You mentioned an ore recipe, but you didn't mention that the ingredient was an ore dictionary entry. In that case, you need to use OreDictionary.WILDCARD_VALUE when adding your item to the ore dictionary.
  16. You're probably using 0 as the ingredient's metadata when adding the recipe, so only metadata 0 is accepted. Use OreDictionary.WILDCARD_VALUE to accept any metadata value.
  17. That's not what Draco told you to do. You damage the ItemStack, but then you return the result of the super method (a completely separate ItemStack). The original ItemStack that you damaged is ignored. You need to return the ItemStack that you damaged.
  18. You can cancel WorldEvent.PotentialSpawns to prevent any entities from being spawned passively, but structures spawn their entities directly and don't fire any events apart from EntityJoinWorldEvent. PopulateChunkEvent.Pre is fired before a chunk is populated (i.e. before most structures are generated) and PopulateChunkEvent.Post is fired after a chunk has been populated (i.e. after most structures are generated), so you can use these to set a per-chunk boolean value and use this in conjunction with EntityJoinWorldEvent to prevent any entities from being spawned during structure generation. Unfortunately mod world generators all run after PopulateChunkEvent.Post, as do structures generated in IChunkGenerator#generateStructures rather than IChunkGenerator#populate. The only vanilla structure to do this is the Ocean Monument. You could suggest that entities spawned by structures fire a unique event (either on the forums or on GitHub), but there's no guarantee that it will be accepted (and very little chance it will be added to 1.10.2).
  19. The ID of the tag type that the list will contain. Use the values from the Constants.NBT class.
  20. EntityLiving#inventoryHandsDropChances and EntityLiving#inventoryArmorDropChances store the drop chances for the entity's held items and armour respectively. These fields are both protected, so you'll need to use reflection to access them.
  21. You're also using the wrong annotation for your ClientConnectedToServerEvent handler: @Mod.EventHandler is only for FML lifecycle events (classes that extend net.minecraftforge.fml.common.event.FMLEvent) and only works in your @Mod class. @SubscribeEvent is for gameplay events (classes that extend net.minecraftforge.fml.common.eventhandler.Event) and only works in a class that's had the Class object or an instance registered with the appropriate EventBus.
  22. The TileEntity shouldn't know or care about that, the TileEntitySpecialRenderer should initialise its stored TileEntity instance with any data required to render it in the inventory.
  23. The Minecraft class implements the IThreadListener interface, so you can use an instance of it as an IThreadListener.
  24. You probably should implement it so that your model isn't rendered at a weird scale or rotation in GUIs, on entities, etc. If you're wrapping an existing model that implements IPerspectiveAwareModel, you can likely delegate to that.

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.