commit
b99f14d72a
|
@ -7,15 +7,15 @@ public class EntityTrackerInfo
|
||||||
public final NetworkMod Mod;
|
public final NetworkMod Mod;
|
||||||
public final int ID;
|
public final int ID;
|
||||||
public final int Range;
|
public final int Range;
|
||||||
public final int UpdateFrequancy;
|
public final int UpdateFrequency;
|
||||||
public final boolean SendVelocityInfo;
|
public final boolean SendVelocityInfo;
|
||||||
|
|
||||||
public EntityTrackerInfo(NetworkMod mod, int ID, int range, int updateFrequancy, boolean sendVelocityInfo)
|
public EntityTrackerInfo(NetworkMod mod, int ID, int range, int updateFrequency, boolean sendVelocityInfo)
|
||||||
{
|
{
|
||||||
Mod = mod;
|
Mod = mod;
|
||||||
this.ID = ID;
|
this.ID = ID;
|
||||||
Range = range;
|
Range = range;
|
||||||
UpdateFrequancy = updateFrequancy;
|
UpdateFrequancy = updateFrequency;
|
||||||
SendVelocityInfo = sendVelocityInfo;
|
SendVelocityInfo = sendVelocityInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -850,17 +850,17 @@ public class MinecraftForge
|
||||||
* @param mod The BaseMod that provides this Entity.
|
* @param mod The BaseMod that provides this Entity.
|
||||||
* @param ID The ID for the Entity. Needs to be unique combination of Mod and ID.
|
* @param ID The ID for the Entity. Needs to be unique combination of Mod and ID.
|
||||||
* @param range How close a player has to be to be informed this Entity exists.
|
* @param range How close a player has to be to be informed this Entity exists.
|
||||||
* @param updateFrequancy How many ticks between checking and sending information updates for this Entity.
|
* @param updateFrequency How many ticks between checking and sending information updates for this Entity.
|
||||||
* @param sendVelocityInfo If velocity information should be included in the update information.
|
* @param sendVelocityInfo If velocity information should be included in the update information.
|
||||||
* @return True, if successfully registered. False if the class is already registered.
|
* @return True, if successfully registered. False if the class is already registered.
|
||||||
*/
|
*/
|
||||||
public static boolean registerEntity(Class entityClass, NetworkMod mod, int ID, int range, int updateFrequancy, boolean sendVelocityInfo)
|
public static boolean registerEntity(Class entityClass, NetworkMod mod, int ID, int range, int updateFrequency, boolean sendVelocityInfo)
|
||||||
{
|
{
|
||||||
if (ForgeHooks.entityTrackerMap.containsKey(entityClass))
|
if (ForgeHooks.entityTrackerMap.containsKey(entityClass))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ForgeHooks.entityTrackerMap.put(entityClass, new EntityTrackerInfo(mod, ID, range, updateFrequancy, sendVelocityInfo));
|
ForgeHooks.entityTrackerMap.put(entityClass, new EntityTrackerInfo(mod, ID, range, updateFrequency, sendVelocityInfo));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class ForgeHooksServer
|
||||||
EntityTrackerInfo info = MinecraftForge.getEntityTrackerInfo(entity, true);
|
EntityTrackerInfo info = MinecraftForge.getEntityTrackerInfo(entity, true);
|
||||||
if (info != null)
|
if (info != null)
|
||||||
{
|
{
|
||||||
tracker.trackEntity(entity, info.Range, info.UpdateFrequancy, info.SendVelocityInfo);
|
tracker.trackEntity(entity, info.Range, info.UpdateFrequency, info.SendVelocityInfo);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue