mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 20:36:42 +00:00
API Breaking
Removed LoggingChangeSet since it wasn't functional and the majority of it was commented out. Migrated a lot of RunnableVal implementations to Suppliers for improved readability and a very small speed improvement.
This commit is contained in:
@ -66,22 +66,12 @@ public class AsyncPlayer extends PlayerProxy {
|
||||
|
||||
@Override
|
||||
public boolean ascendLevel() {
|
||||
return TaskManager.IMP.sync(new RunnableVal<Boolean>() {
|
||||
@Override
|
||||
public void run(Boolean value) {
|
||||
this.value = getBasePlayer().ascendLevel();
|
||||
}
|
||||
});
|
||||
return TaskManager.IMP.sync(() -> getBasePlayer().ascendLevel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean descendLevel() {
|
||||
return TaskManager.IMP.sync(new RunnableVal<Boolean>() {
|
||||
@Override
|
||||
public void run(Boolean value) {
|
||||
this.value = getBasePlayer().descendLevel();
|
||||
}
|
||||
});
|
||||
return TaskManager.IMP.sync(() -> getBasePlayer().descendLevel());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -175,34 +165,25 @@ public class AsyncPlayer extends PlayerProxy {
|
||||
|
||||
@Override
|
||||
public Location getBlockTrace(int range, boolean useLastBlock) {
|
||||
return TaskManager.IMP.sync(new RunnableVal<Location>() {
|
||||
@Override
|
||||
public void run(Location value) {
|
||||
return TaskManager.IMP.sync(() -> {
|
||||
TargetBlock tb = new TargetBlock(AsyncPlayer.this, range, 0.2D);
|
||||
this.value = useLastBlock ? tb.getAnyTargetBlock() : tb.getTargetBlock();
|
||||
}
|
||||
});
|
||||
return useLastBlock ? tb.getAnyTargetBlock() : tb.getTargetBlock();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getBlockTraceFace(int range, boolean useLastBlock) {
|
||||
return TaskManager.IMP.sync(new RunnableVal<Location>() {
|
||||
@Override
|
||||
public void run(Location value) {
|
||||
return TaskManager.IMP.sync(() -> {
|
||||
TargetBlock tb = new TargetBlock(AsyncPlayer.this, range, 0.2D);
|
||||
this.value = useLastBlock ? tb.getAnyTargetBlockFace() : tb.getTargetBlockFace();
|
||||
}
|
||||
});
|
||||
return useLastBlock ? tb.getAnyTargetBlockFace() : tb.getTargetBlockFace();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getSolidBlockTrace(int range) {
|
||||
return TaskManager.IMP.sync(new RunnableVal<Location>() {
|
||||
@Override
|
||||
public void run(Location value) {
|
||||
TargetBlock tb = new TargetBlock(AsyncPlayer.this, range, 0.2D);
|
||||
this.value = tb.getSolidTargetBlock();
|
||||
}
|
||||
return TaskManager.IMP.sync(() -> {
|
||||
TargetBlock tb = new TargetBlock(AsyncPlayer.this, range, 0.2D);
|
||||
return tb.getSolidTargetBlock();
|
||||
});
|
||||
}
|
||||
|
||||
@ -256,4 +237,4 @@ public class AsyncPlayer extends PlayerProxy {
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -243,22 +243,12 @@ public class WorldWrapper extends AbstractWorld {
|
||||
|
||||
@Override
|
||||
public List<? extends Entity> getEntities(Region region) {
|
||||
return TaskManager.IMP.sync(new RunnableVal<List<? extends Entity>>() {
|
||||
@Override
|
||||
public void run(List<? extends Entity> value) {
|
||||
this.value = parent.getEntities(region);
|
||||
}
|
||||
});
|
||||
return TaskManager.IMP.sync(() -> parent.getEntities(region));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Entity> getEntities() {
|
||||
return TaskManager.IMP.sync(new RunnableVal<List<? extends Entity>>() {
|
||||
@Override
|
||||
public void run(List<? extends Entity> value) {
|
||||
this.value = parent.getEntities();
|
||||
}
|
||||
});
|
||||
return TaskManager.IMP.sync(parent::getEntities);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user