Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/16/18 in all areas

  1. NotEnoughIDs has issues in the back end, sadly it looks like you need to have it though. Try copying the configs from your client to the server.
    1 point
  2. Regarding the "pull request" you can start by just filing an "issue" against the MinecraftForge project on GitHub. The "pull request" is where you actually offer a solution, but honestly it can be a bit tricky to set up properly to contribute to Forge (because Forge is actually a set of patches and because other people are modifying patches as well at the same time you're trying to contribute). However, it is really good if people are able to contribute because ultimately Forge is a community open source project. So I actually responded to someone who had posted this as an issue previously. See https://github.com/MinecraftForge/MinecraftForge/issues/4485 In that I looked at the code and here is I summarized the functionality then: Definitely I think the logic could be clearer, but I think the idea is that you can prevent despawning with the event easily because every 32 ticks you get a chance to reset the idleTimer to 0 whereas if you let it get to 600 then there is a chance that closer entities might be despawned. Interestingly though I think the logic is that entities that are very far cannot be prevented from despawning by the event. Now, although the event cannot prevent despawning, the EntityLiving#persistenceRequired field can. That can be set with the EntityLiving#setPersistence() method. So I think that if you want to take total control of despawning you could theoretically set the persistence of any entity you're interested in and then run your own despawning algorithm in the LivingUpdateEvent. Note I do think the despawn event would be better if it was either fired in both code paths or if it was just fired once at the beginning of the method to allow denial of any sort of despawn. I suppose that the original implementers felt that maybe allowing modders to prevent despawn generally would be "dangerous" as there is a real performance impact.
    1 point
  3. Looks like you were using InventoryPlayer#hasItemStack. That method calls ItemStack#isItemEqual, which compares the item's damage and requires it to be the same. I recently needed to do something very similar to you and ended up with a similar solution (iterating over the inventory to find the item in question). For what it's worth, hasItemStack iterates over the inventory anyway, so the main difference is you're now doing it yourself.
    1 point
×
×
  • Create New...

Important Information

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