MCPcopy Create free account
hub / github.com/boxbeam/RedLib / get

Method get

src/redempt/redlib/misc/EntityPersistor.java:94–113  ·  view source on GitHub ↗

Gets the Entity held in this EntityPersistor. If the reference is invalid, the EntityPersistor will attempt to refresh it. @return The wrapped Entity

()

Source from the content-addressed store, hash-verified

92 * @return The wrapped Entity
93 */
94 public T get() {
95 refresh:
96 if (!entity.isValid()) {
97 for (Entity entity : this.entity.getLocation().getChunk().getEntities()) {
98 if (entity.getUniqueId().equals(this.entity.getUniqueId())) {
99 this.entity = (T) entity;
100 break refresh;
101 }
102 }
103 for (World world : Bukkit.getWorlds()) {
104 for (Entity entity : world.getEntities()) {
105 if (this.entity.getUniqueId().equals(entity.getUniqueId())) {
106 this.entity = (T) entity;
107 break;
108 }
109 }
110 }
111 }
112 return entity;
113 }
114
115}

Callers

nothing calls this directly

Calls 4

getEntitiesMethod · 0.80
getChunkMethod · 0.80
getLocationMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected