fix copy-pasting interfaces with memory cards between interfaces with differing amount of expansion cards
This commit is contained in:
@@ -305,6 +305,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
|||||||
PlayerMainInvWrapper playerInv = new PlayerMainInvWrapper(player.inventory);
|
PlayerMainInvWrapper playerInv = new PlayerMainInvWrapper(player.inventory);
|
||||||
final IMaterials materials = AEApi.instance().definitions().materials();
|
final IMaterials materials = AEApi.instance().definitions().materials();
|
||||||
int missingPatternsToEncode = 0;
|
int missingPatternsToEncode = 0;
|
||||||
|
int amountPatternSlots = 8 + this.getInstalledUpgrades(Upgrades.PATTERN_EXPANSION) * 9;
|
||||||
|
|
||||||
for (int i = 0; i < inv.getSlots(); i++) {
|
for (int i = 0; i < inv.getSlots(); i++) {
|
||||||
if (target.getStackInSlot(i).getItem() instanceof ItemEncodedPattern) {
|
if (target.getStackInSlot(i).getItem() instanceof ItemEncodedPattern) {
|
||||||
@@ -316,7 +317,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int x = 0; x < tmp.getSlots(); x++) {
|
for (int x = 0; x < amountPatternSlots; x++) {
|
||||||
if (!tmp.getStackInSlot(x).isEmpty()) {
|
if (!tmp.getStackInSlot(x).isEmpty()) {
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for (int i = 0; i < playerInv.getSlots(); i++) {
|
for (int i = 0; i < playerInv.getSlots(); i++) {
|
||||||
|
|||||||
@@ -343,6 +343,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
|
|||||||
PlayerMainInvWrapper playerInv = new PlayerMainInvWrapper(player.inventory);
|
PlayerMainInvWrapper playerInv = new PlayerMainInvWrapper(player.inventory);
|
||||||
final IMaterials materials = AEApi.instance().definitions().materials();
|
final IMaterials materials = AEApi.instance().definitions().materials();
|
||||||
int missingPatternsToEncode = 0;
|
int missingPatternsToEncode = 0;
|
||||||
|
int amountPatternSlots = 8 + this.getInstalledUpgrades(Upgrades.PATTERN_EXPANSION) * 9;
|
||||||
|
|
||||||
for (int i = 0; i < inv.getSlots(); i++) {
|
for (int i = 0; i < inv.getSlots(); i++) {
|
||||||
if (target.getStackInSlot(i).getItem() instanceof ItemEncodedPattern) {
|
if (target.getStackInSlot(i).getItem() instanceof ItemEncodedPattern) {
|
||||||
@@ -354,8 +355,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int x = 0; x < amountPatternSlots; x++) {
|
||||||
for (int x = 0; x < tmp.getSlots(); x++) {
|
|
||||||
if (!tmp.getStackInSlot(x).isEmpty()) {
|
if (!tmp.getStackInSlot(x).isEmpty()) {
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for (int i = 0; i < playerInv.getSlots(); i++) {
|
for (int i = 0; i < playerInv.getSlots(); i++) {
|
||||||
@@ -371,6 +371,7 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Platform.isServer() && missingPatternsToEncode > 0) {
|
if (Platform.isServer() && missingPatternsToEncode > 0) {
|
||||||
player.sendMessage(PlayerMessages.MissingPatternsToEncode.get());
|
player.sendMessage(PlayerMessages.MissingPatternsToEncode.get());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user