ForgePatch/patches/minecraft/net/minecraft/entity/EntityTracker.java.patch
LexManos f1cca475ea Initial patch update to 1.12.
Some things to note:
Netty is screwy so currently can't join single player. @cpw
Crafting has been MAJORY reworked. The current GameRegistry functions are nooped, this is IN THE WORKS.
  Just need to move the recipe list to a full class registry, and then re implement the in-code recipe registration.
  Also, it IS advised that modders move to JSON, because ideally we'll see a S->C recipe syncing system in 1.13
  which would allow servers to have custom recipes.
  OreDictionary currently 1/2 works, need to write a better algorithm for replacing ingredients.
  Please be patient
Rendering:
  A lot of functions got a new float parameter, this is similar to partial ticks, needs more research
2017-06-10 22:22:02 -04:00

37 lines
1.6 KiB
Diff

--- ../src-base/minecraft/net/minecraft/entity/EntityTracker.java
+++ ../src-work/minecraft/net/minecraft/entity/EntityTracker.java
@@ -77,6 +77,8 @@
public void func_72786_a(Entity p_72786_1_)
{
+ if (net.minecraftforge.fml.common.registry.EntityRegistry.instance().tryTrackingEntity(this, p_72786_1_)) return;
+
if (p_72786_1_ instanceof EntityPlayerMP)
{
this.func_72791_a(p_72786_1_, 512, 2);
@@ -339,6 +341,25 @@
}
}
+ /* ======================================== FORGE START =====================================*/
+
+ // don't expose the EntityTrackerEntry directly so mods can't mess with the data in there as easily
+ /**
+ * Get all players tracking the given Entity. The Entity must be part of the World that this Tracker belongs to.
+ * @param entity the Entity
+ * @return all players tracking the Entity
+ */
+ public Set<? extends net.minecraft.entity.player.EntityPlayer> getTrackingPlayers(Entity entity)
+ {
+ EntityTrackerEntry entry = (EntityTrackerEntry) field_72794_c.func_76041_a(entity.func_145782_y());
+ if (entry == null)
+ return java.util.Collections.emptySet();
+ else
+ return java.util.Collections.unmodifiableSet(entry.field_73134_o);
+ }
+
+ /* ======================================== FORGE END =====================================*/
+
public void func_151248_b(Entity p_151248_1_, Packet<?> p_151248_2_)
{
EntityTrackerEntry entitytrackerentry = this.field_72794_c.func_76041_a(p_151248_1_.func_145782_y());