Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Animefan8888

  1. Depends on what you mean by efficient. You essentially need a bunch of booleans right. So it makes sense to just have a Map<SOMEID, Boolean> which will map some ID of any type to your boolean. Or you could go with the raw array style. boolean[] where the ID is an integer so indexing just works. Or if you want to be memory efficient you could use bit logic(bitmasks, or simply using the bits of an int as a boolean).
  2. Yes it should. because it would be less function calls and less stack manipulation. It's kinda applicable. All the Tickable TE's would be considered a master and all the non Tickable TE's would be considered slaves. Mind that you do not even need a TE for slaves if there is nothing to store there. Sure it could require a tickable TileEntity. Or you could abstract another layer out. This is my preferred method for implementing pipes. Having many Tickable TEs would require them all containing a connection network. Or running a pathfinding algorithm every time you want to send something from A to B. However if you instead take away their autonomy just a little and instead store a "Network" of pipes in the world via a Capability and interact with it every tick with a World Tick event. You then save memory by only storing the connections once and you can cache the shortest/determined path between point A and B.
  3. Looks like you are using Java 9+ you need to use Java 8.
  4. You create one. A Supplier is just a functional interface that returns an instance of type T. In this case I believe it would be an instance of your WorldSavedData class. It's the only forge provided way of doing it yes. There's three ways to do this. WorldSavedData(which has apparently changed a little bit), Capabilities(which to my knowledge are still the same as when they were first introduced), and of course you can write the file to disk yourself(not really the best option because the first two already exist).
  5. The WorldEvent.Load and WorldEvent.Save do not fire on the mod event bus. They instead fire on the MinecraftForge.EVENT_BUS. The mod event bus is only for life-cycle events such as FMLCommonSetupEvent. It seems to have been renamed to World::getMapData or ServerWorld::getSavedData()::getOrCreate At the moment I'm not fully aware of how the WorldSavedData system has changed, however you can use a Capability that is attached to the World. instanceof and cast.
  6. The thing about LightningBoltEntities is they have to be spawned with ServerWorld::addLightningBolt
  7. Why not just install forge 1.15 and take the version.json from there?
  8. Here is the forge documentation on Capabilities they are somewhat tricky to learn, but once you know what you need to do you'll be kicking yourself later.
  9. 1.12.2 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support. For more information read the LTS at the top of the page.
  10. That will work if the Entity is guaranteed to have been given your equipment. However, that is not the case. What if another mod changes the equipment or your method determines that it doesn't get an item. You should instead attach a capability to the Entity to check if you have already tried to add your equipment.
  11. Probably. Another problem with using EntityJoinWorldEvent is the equipment on an Entity loaded from disk will have it's equipment changed.
  12. The equipment for entities is put on the Entity after LivingSpawnEvent.SpecialSpawn is called. Therefore it overrides yours. You should use EntityJoinWorldEvent instead.
  13. You can't Item's are singletons. But there is something that stores Items which is not a singleton. It's called an ItemStack. You'll notice a lot of methods take ItemStack as a parameter you can use ItemStack::setTag and ItemStack::getTag to store stack based information.
  14. It's hard to see what's wrong when one can't see the thing that is going wrong. Post your code.
  15. Yes you can. However you fire the event and your event only sets the events new height. It doesn't actually set the eye height. When the event is normally fired you'll notice that after it has fired forge takes the new eye height from the event and uses that.
  16. I'd love to see a list of these so i can share them with people who try to learn Java by learning how to mod.
  17. Have you downloaded/played the vanilla version of Minecraft 1.15.2?
  18. Make a computer that has infinite accuracy. Your problem lies with the precision of floating point notation.
  19. You should really learn Java before trying to make a mod. You should call the method in the FMLClientSetupEvent
  20. 1.12.2 is no longer supported on this forum. Please update to a modern Minecraft version to receive support. For more information read the LTS at the top of the page.
  21. 1.12.2 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support. For more information read the LTS at the top of the page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.