Merge fixes

This commit is contained in:
Sebastian Hartte
2020-08-11 00:09:08 +02:00
121 changed files with 1684 additions and 1995 deletions
@@ -34,7 +34,6 @@ import alexiil.mc.lib.attributes.item.FixedItemInv;
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;
@@ -137,14 +136,18 @@ public class SpatialIOPortBlockEntity extends AENetworkInvBlockEntity implements
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.setInvStack(0, ItemStack.EMPTY, Simulation.ACTION);
this.inv.setInvStack(1, cell, Simulation.ACTION);