One Spatial Dimension (#4570)

* Ported the "one spatial dimension" concept from pre-1.15

* Apply lighting updates after moving chunks.
Mark world data as dirty when changing it.

* Consolidated naming of spatial storage world/dimension.
Use server light manager to update lighting info in chunk.

* Save last transition information,
and add ae2 spatial command to interact with spatial storage.

* Formatting fixes.

* Improved docs for the origin generation.

Inverted condition on when the x/z axis are flipped.
Also added a helper to map a plot to a region file

* Remove TransitionResult since it's only used in lieu of a boolean.
Rework transition to make the checks BEFORE allocating a new cell.

* Removed unused imports.

Co-authored-by: yueh <yueh@users.noreply.github.com>
This commit is contained in:
shartte
2020-08-10 11:29:07 +02:00
committed by GitHub
parent 8733c2c11f
commit d1ba26311b
36 changed files with 1073 additions and 610 deletions
@@ -32,7 +32,6 @@ import net.minecraftforge.items.IItemHandler;
import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier;
import appeng.api.config.YesNo;
import appeng.api.implementations.TransitionResult;
import appeng.api.implementations.items.ISpatialStorageCell;
import appeng.api.networking.GridFlags;
import appeng.api.networking.IGrid;
@@ -135,14 +134,18 @@ public class SpatialIOPortTileEntity extends AENetworkInvTileEntity implements I
if (Math.abs(pr - req) < req * 0.001) {
final MENetworkEvent res = gi.postEvent(new MENetworkSpatialEvent(this, req));
if (!res.isCanceled()) {
int playerId = -1;
// Prefer player id from security system, but if unavailable, use the
// player who placed the grid node (if any)
int playerId;
if (this.getProxy().getSecurity().isAvailable()) {
playerId = this.getProxy().getSecurity().getOwner();
} else {
playerId = this.getProxy().getNode().getPlayerID();
}
final TransitionResult tr = sc.doSpatialTransition(cell, serverWorld, spc.getMin(),
spc.getMax(), playerId);
if (tr.success) {
boolean success = sc.doSpatialTransition(cell, serverWorld, spc.getMin(), spc.getMax(),
playerId);
if (success) {
energy.extractAEPower(req, Actionable.MODULATE, PowerMultiplier.CONFIG);
this.inv.setStackInSlot(0, ItemStack.EMPTY);
this.inv.setStackInSlot(1, cell);