Random cleanups to users of Level.OVERWORLD and reduce minecraft_server usage (#1697)
- Use `overworld()` instead of `getLevel(Level.OVERWORLD)` when convenient - Remove now unnecessary `// OW` comments, from when it had no mappings - Make spawn chunk size and light batches not depend on global server instance - Merge all spawn chunk size logic into SpawnChunks instead of methods in the validator - Remove unneeded `withWorld(OVERWORLD)` with just-created server `CommandSource`s - Use enhanced for in light batch application
This commit is contained in:
1 parent
17c2d601d2
commit
8cd60db5e4
6 files changed
+30
-46
No files matched your search
@@ -447,9 +447,7 @@ public class CarpetEventServer
|
||||
@Override
|
||||
public void onTick(MinecraftServer server)
|
||||
{
|
||||
handler.call(Collections::emptyList, () ->
|
||||
server.createCommandSourceStack().withLevel(server.getLevel(Level.OVERWORLD))
|
||||
);
|
||||
handler.call(Collections::emptyList, server::createCommandSourceStack);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -458,9 +456,7 @@ public class CarpetEventServer
|
||||
@Override
|
||||
public void onTick(MinecraftServer server)
|
||||
{
|
||||
handler.call(Collections::emptyList, () ->
|
||||
server.createCommandSourceStack().withLevel(server.getLevel(Level.OVERWORLD))
|
||||
);
|
||||
handler.call(Collections::emptyList,server::createCommandSourceStack);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -469,9 +465,7 @@ public class CarpetEventServer
|
||||
@Override
|
||||
public void onTick(MinecraftServer server)
|
||||
{
|
||||
handler.call(Collections::emptyList, () ->
|
||||
server.createCommandSourceStack().withLevel(server.getLevel(Level.OVERWORLD))
|
||||
);
|
||||
handler.call(Collections::emptyList,server::createCommandSourceStack);
|
||||
}
|
||||
};
|
||||
public static final Event NETHER_TICK = new Event("tick_nether", 0, true)
|
||||
|
||||
Reference in new issue
Block a user