Fixing bugs introduced in previous commit
- Fixed AbstractContextRO.isSubcontexting() - Fixed push(...) overrides in FilterServerContext - Fixed DefaultChunkLogic.tmp_generateTickLists() - Debug screen now also lists visible and loaded chunks - AbstractContextRO.Frame now has a toString()
This commit is contained in:
parent
0a45613e45
commit
a03c783fc9
@ -40,6 +40,12 @@ public abstract class AbstractContextRO<
|
|||||||
public RelFace face;
|
public RelFace face;
|
||||||
public int layer;
|
public int layer;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Frame [x=" + location.x + ", y=" + location.y + ", z=" + location.z + ", face=" + face + ", layer="
|
||||||
|
+ layer + "]";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Frame frame = null;
|
protected Frame frame = null;
|
||||||
@ -89,7 +95,7 @@ public abstract class AbstractContextRO<
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSubcontexting() {
|
public boolean isSubcontexting() {
|
||||||
return frameStack.isEmpty();
|
return !frameStack.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ public class Server {
|
|||||||
*/
|
*/
|
||||||
public ServerWorldContext createContext() {
|
public ServerWorldContext createContext() {
|
||||||
|
|
||||||
return new ReportingServerContext(DefaultServerContext.empty().inRealWorldOf(this).build()).withListener(worldAccessor);
|
return new ReportingServerContext(DefaultServerContext.empty().inRealWorldOf(this).build()).withListener(worldAccessor).setPassToParent(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,8 +235,10 @@ public class DefaultChunkLogic implements ChunkLogic {
|
|||||||
BlockLogic block = blockContext.logic().getBlock();
|
BlockLogic block = blockContext.logic().getBlock();
|
||||||
Coordinates.convertInWorldToInChunk(location, blockInChunk);
|
Coordinates.convertInWorldToInChunk(location, blockInChunk);
|
||||||
|
|
||||||
if (!(block instanceof TickableBlock))
|
if (!(block instanceof TickableBlock)) {
|
||||||
|
blockContext.pop();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (((TickableBlock) block).getTickingPolicy(blockContext) == TickingPolicy.REGULAR) {
|
if (((TickableBlock) block).getTickingPolicy(blockContext) == TickingPolicy.REGULAR) {
|
||||||
tickingBlocks.add(blockInChunk);
|
tickingBlocks.add(blockInChunk);
|
||||||
@ -248,11 +250,12 @@ public class DefaultChunkLogic implements ChunkLogic {
|
|||||||
|
|
||||||
for (int i = 0; i < stack.size(); ++i) {
|
for (int i = 0; i < stack.size(); ++i) {
|
||||||
ServerTileContextRO tileContext = blockContext.push(face, i);
|
ServerTileContextRO tileContext = blockContext.push(face, i);
|
||||||
|
|
||||||
TileLogic tile = stack.get(i);
|
TileLogic tile = stack.get(i);
|
||||||
|
|
||||||
if (!(tile instanceof TickableTile))
|
if (!(tile instanceof TickableTile)) {
|
||||||
return;
|
tileContext.pop();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (((TickableTile) tile).getTickingPolicy(tileContext) == TickingPolicy.REGULAR) {
|
if (((TickableTile) tile).getTickingPolicy(tileContext) == TickingPolicy.REGULAR) {
|
||||||
tickingTiles.add(stack.getData().getReference(i));
|
tickingTiles.add(stack.getData().getReference(i));
|
||||||
|
@ -109,7 +109,7 @@ class DefaultServerContextImpl extends DefaultServerContext
|
|||||||
*/
|
*/
|
||||||
public boolean requireContextRole(Role role) throws IllegalStateException {
|
public boolean requireContextRole(Role role) throws IllegalStateException {
|
||||||
|
|
||||||
boolean ok = !isBuilder && getRole().compareTo(role) <= 0;
|
boolean ok = !isBuilder && getRole().compareTo(role) >= 0;
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
complainAboutIllegalState(role, false);
|
complainAboutIllegalState(role, false);
|
||||||
}
|
}
|
||||||
|
@ -179,17 +179,20 @@ public abstract class FilterServerContext implements ServerTileContext {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServerBlockContext push(Vec3i location) {
|
public ServerBlockContext push(Vec3i location) {
|
||||||
return parent.push(location);
|
parent.push(location);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServerTileStackContext push(Vec3i location, RelFace face) {
|
public ServerTileStackContext push(Vec3i location, RelFace face) {
|
||||||
return parent.push(location, face);
|
parent.push(location, face);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServerTileContext push(Vec3i location, RelFace face, int layer) {
|
public ServerTileContext push(Vec3i location, RelFace face, int layer) {
|
||||||
return parent.push(location, face, layer);
|
parent.push(location, face, layer);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -35,6 +35,7 @@ import ru.windcorp.progressia.client.graphics.gui.layout.LayoutVertical;
|
|||||||
import ru.windcorp.progressia.client.localization.Localizer;
|
import ru.windcorp.progressia.client.localization.Localizer;
|
||||||
import ru.windcorp.progressia.client.localization.MutableString;
|
import ru.windcorp.progressia.client.localization.MutableString;
|
||||||
import ru.windcorp.progressia.client.localization.MutableStringLocalized;
|
import ru.windcorp.progressia.client.localization.MutableStringLocalized;
|
||||||
|
import ru.windcorp.progressia.client.world.WorldRender;
|
||||||
import ru.windcorp.progressia.common.Units;
|
import ru.windcorp.progressia.common.Units;
|
||||||
import ru.windcorp.progressia.common.util.dynstr.DynamicStrings;
|
import ru.windcorp.progressia.common.util.dynstr.DynamicStrings;
|
||||||
import ru.windcorp.progressia.server.Server;
|
import ru.windcorp.progressia.server.Server;
|
||||||
@ -131,11 +132,34 @@ public class LayerTestGUI extends GUILayer {
|
|||||||
|
|
||||||
group.addChild(
|
group.addChild(
|
||||||
new DynamicLabel(
|
new DynamicLabel(
|
||||||
"ChunkUpdatesDisplay",
|
"ChunkStatsDisplay",
|
||||||
font,
|
font,
|
||||||
DynamicStrings.builder()
|
DynamicStrings.builder()
|
||||||
.addDyn(new MutableStringLocalized("LayerTestGUI.ChunkUpdatesDisplay"))
|
.addDyn(new MutableStringLocalized("LayerTestGUI.ChunkStatsDisplay"))
|
||||||
.addDyn(ClientState.getInstance().getWorld()::getPendingChunkUpdates)
|
.addDyn(() -> {
|
||||||
|
if (ClientState.getInstance() == null) {
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
WorldRender world = ClientState.getInstance().getWorld();
|
||||||
|
return world.getChunks().size() - world.getPendingChunkUpdates();
|
||||||
|
}
|
||||||
|
}, 4)
|
||||||
|
.add('/')
|
||||||
|
.addDyn(() -> {
|
||||||
|
if (ClientState.getInstance() == null) {
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
return ClientState.getInstance().getWorld().getPendingChunkUpdates();
|
||||||
|
}
|
||||||
|
}, 4)
|
||||||
|
.add('/')
|
||||||
|
.addDyn(() -> {
|
||||||
|
if (ServerState.getInstance() == null) {
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
return ServerState.getInstance().getWorld().getChunks().size();
|
||||||
|
}
|
||||||
|
}, 4)
|
||||||
.buildSupplier(),
|
.buildSupplier(),
|
||||||
128
|
128
|
||||||
)
|
)
|
||||||
|
@ -11,7 +11,7 @@ LayerTestGUI.LanguageDisplay = Language: %5s (L)
|
|||||||
LayerTestGUI.FPSDisplay = FPS:
|
LayerTestGUI.FPSDisplay = FPS:
|
||||||
LayerTestGUI.TPSDisplay = TPS:
|
LayerTestGUI.TPSDisplay = TPS:
|
||||||
LayerTestGUI.TPSDisplay.NA = TPS: n/a
|
LayerTestGUI.TPSDisplay.NA = TPS: n/a
|
||||||
LayerTestGUI.ChunkUpdatesDisplay = Pending updates:
|
LayerTestGUI.ChunkStatsDisplay = Chunks vis/pnd/load:
|
||||||
LayerTestGUI.PosDisplay = Pos:
|
LayerTestGUI.PosDisplay = Pos:
|
||||||
LayerTestGUI.PosDisplay.NA.Client = Pos: client n/a
|
LayerTestGUI.PosDisplay.NA.Client = Pos: client n/a
|
||||||
LayerTestGUI.PosDisplay.NA.Entity = Pos: entity n/a
|
LayerTestGUI.PosDisplay.NA.Entity = Pos: entity n/a
|
||||||
|
@ -11,7 +11,7 @@ LayerTestGUI.LanguageDisplay = Язык: %5s (L)
|
|||||||
LayerTestGUI.FPSDisplay = FPS:
|
LayerTestGUI.FPSDisplay = FPS:
|
||||||
LayerTestGUI.TPSDisplay = TPS:
|
LayerTestGUI.TPSDisplay = TPS:
|
||||||
LayerTestGUI.TPSDisplay.NA = TPS: н/д
|
LayerTestGUI.TPSDisplay.NA = TPS: н/д
|
||||||
LayerTestGUI.ChunkUpdatesDisplay = Обновления в очереди:
|
LayerTestGUI.ChunkStatsDisplay = Чанки вид/очр/загр:
|
||||||
LayerTestGUI.PosDisplay = Поз:
|
LayerTestGUI.PosDisplay = Поз:
|
||||||
LayerTestGUI.PosDisplay.NA.Client = Поз: клиент н/д
|
LayerTestGUI.PosDisplay.NA.Client = Поз: клиент н/д
|
||||||
LayerTestGUI.PosDisplay.NA.Entity = Поз: сущность н/д
|
LayerTestGUI.PosDisplay.NA.Entity = Поз: сущность н/д
|
||||||
|
Reference in New Issue
Block a user