cards
This commit is contained in:
@@ -108,9 +108,9 @@ public class ContainerMEPortableCell extends ContainerMEMonitorable implements I
|
||||
public void setupUpgrades() {
|
||||
if (wirelessTerminalGUIObject != null) {
|
||||
final IItemHandler upgrades = wirelessTerminalGUIObject.getInventoryByName("upgrades");
|
||||
for (int a = 0; a < availableUpgrades(); a++) {
|
||||
for (int upgradeSlot = 0; upgradeSlot < availableUpgrades(); upgradeSlot++) {
|
||||
this.addSlotToContainer(
|
||||
(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, a * 18, this.getInventoryPlayer()))
|
||||
(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, upgradeSlot, 187, upgradeSlot * 18, this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -114,7 +114,7 @@ public class ContainerWirelessPatternTerminal extends ContainerPatternEncoder im
|
||||
|
||||
if (this.wirelessTerminalGUIObject == null || currentItem.isEmpty()) {
|
||||
this.setValidContainer(false);
|
||||
} else if (this.wirelessTerminalGUIObject != null && !this.wirelessTerminalGUIObject.getItemStack().isEmpty() && currentItem != this.wirelessTerminalGUIObject.getItemStack()) {
|
||||
} else if (!this.wirelessTerminalGUIObject.getItemStack().isEmpty() && currentItem != this.wirelessTerminalGUIObject.getItemStack()) {
|
||||
if (ItemStack.areItemsEqual(this.wirelessTerminalGUIObject.getItemStack(), currentItem)) {
|
||||
this.getPlayerInv().setInventorySlotContents(this.getPlayerInv().currentItem, this.wirelessTerminalGUIObject.getItemStack());
|
||||
} else {
|
||||
@@ -239,9 +239,9 @@ public class ContainerWirelessPatternTerminal extends ContainerPatternEncoder im
|
||||
public void setupUpgrades() {
|
||||
if (wirelessTerminalGUIObject != null) {
|
||||
final IItemHandler upgrades = wirelessTerminalGUIObject.getInventoryByName("upgrades");
|
||||
for (int a = 0; a < availableUpgrades(); a++) {
|
||||
for (int upgradeSlot = 0; upgradeSlot < availableUpgrades(); upgradeSlot++) {
|
||||
this.addSlotToContainer(
|
||||
(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, -2 + a * 18, this.getInventoryPlayer()))
|
||||
(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, upgradeSlot, 187, upgradeSlot * 18 - 2, this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ package appeng.core;
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.api.definitions.IItems;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.api.features.IRecipeHandlerRegistry;
|
||||
@@ -105,7 +106,9 @@ import javax.annotation.Nonnull;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
@@ -403,11 +406,19 @@ final class Registration {
|
||||
Upgrades.SPEED.registerItem(blocks.inscriber(), 3);
|
||||
|
||||
// Wireless Terminal Handler
|
||||
items.wirelessTerminal().maybeItem().ifPresent(terminal -> registries.wireless().registerWirelessHandler((IWirelessTermHandler) terminal));
|
||||
items.wirelessCraftingTerminal().maybeItem().ifPresent(terminal -> registries.wireless().registerWirelessHandler((IWirelessTermHandler) terminal));
|
||||
items.wirelessPatternTerminal().maybeItem().ifPresent(terminal -> registries.wireless().registerWirelessHandler((IWirelessTermHandler) terminal));
|
||||
items.wirelessFluidTerminal().maybeItem().ifPresent(terminal -> registries.wireless().registerWirelessHandler((IWirelessTermHandler) terminal));
|
||||
|
||||
ArrayList<IItemDefinition> iids = new ArrayList<>();
|
||||
iids.add(items.wirelessTerminal());
|
||||
iids.add(items.wirelessCraftingTerminal());
|
||||
iids.add(items.wirelessPatternTerminal());
|
||||
iids.add(items.wirelessFluidTerminal());
|
||||
|
||||
for (IItemDefinition id : iids) {
|
||||
id.maybeItem().ifPresent(terminal -> {
|
||||
registries.wireless().registerWirelessHandler((IWirelessTermHandler) terminal);
|
||||
Upgrades.QUANTUM_LINK.registerItem(id, 1);
|
||||
Upgrades.MAGNET.registerItem(id, 1);
|
||||
});
|
||||
}
|
||||
|
||||
// Charge Rates
|
||||
items.chargedStaff().maybeItem().ifPresent(chargedStaff -> registries.charger().addChargeRate(chargedStaff, 320d));
|
||||
|
||||
@@ -85,6 +85,8 @@ public final class ApiMaterials implements IMaterials {
|
||||
private final IItemDefinition cardSpeed;
|
||||
private final IItemDefinition cardCapacity;
|
||||
private final IItemDefinition cardPatternExpansion;
|
||||
private final IItemDefinition cardQuantumLink;
|
||||
private final IItemDefinition cardMagnet;
|
||||
private final IItemDefinition cardFuzzy;
|
||||
private final IItemDefinition cardInverter;
|
||||
private final IItemDefinition cardCrafting;
|
||||
@@ -201,6 +203,8 @@ public final class ApiMaterials implements IMaterials {
|
||||
this.cardSpeed = new DamagedItemDefinition("material.card.acceleration", materials.createMaterial(MaterialType.CARD_SPEED));
|
||||
this.cardCapacity = new DamagedItemDefinition("material.card.capacity", materials.createMaterial(MaterialType.CARD_CAPACITY));
|
||||
this.cardPatternExpansion = new DamagedItemDefinition("material.card.pattern.expansion", materials.createMaterial(MaterialType.CARD_PATTERN_EXPANSION));
|
||||
this.cardQuantumLink = new DamagedItemDefinition("material.card.quantum.link", materials.createMaterial(MaterialType.CARD_QUANTUM_LINK));
|
||||
this.cardMagnet = new DamagedItemDefinition("material.card.magnet", materials.createMaterial(MaterialType.CARD_MAGNET));
|
||||
this.cardFuzzy = new DamagedItemDefinition("material.card.fuzzy", materials.createMaterial(MaterialType.CARD_FUZZY));
|
||||
this.cardInverter = new DamagedItemDefinition("material.card.inverter", materials.createMaterial(MaterialType.CARD_INVERTER));
|
||||
this.cardCrafting = new DamagedItemDefinition("material.card.crafting", materials.createMaterial(MaterialType.CARD_CRAFTING));
|
||||
@@ -396,6 +400,16 @@ public final class ApiMaterials implements IMaterials {
|
||||
return this.cardPatternExpansion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemDefinition cardQuantumLink() {
|
||||
return this.cardQuantumLink;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemDefinition cardMagnet() {
|
||||
return this.cardMagnet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemDefinition cardFuzzy() {
|
||||
return this.cardFuzzy;
|
||||
|
||||
@@ -39,6 +39,8 @@ import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import appeng.util.ConfigManager;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.inv.IAEAppEngInventory;
|
||||
import appeng.util.inv.InvOperation;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@@ -53,7 +55,7 @@ import javax.annotation.Nonnull;
|
||||
import java.io.IOException;
|
||||
import java.nio.BufferOverflowException;
|
||||
|
||||
public class ContainerMEPortableFluidCell extends AEBaseContainer implements IConfigManagerHost, IConfigurableObject, IMEMonitorHandlerReceiver<IAEFluidStack>, IUpgradeableCellContainer {
|
||||
public class ContainerMEPortableFluidCell extends AEBaseContainer implements IAEAppEngInventory, IConfigManagerHost, IConfigurableObject, IMEMonitorHandlerReceiver<IAEFluidStack>, IUpgradeableCellContainer {
|
||||
|
||||
private final WirelessTerminalGuiObject wirelessTerminalGUIObject;
|
||||
|
||||
@@ -138,7 +140,7 @@ public class ContainerMEPortableFluidCell extends AEBaseContainer implements ICo
|
||||
|
||||
if (this.wirelessTerminalGUIObject == null || currentItem.isEmpty()) {
|
||||
this.setValidContainer(false);
|
||||
} else if (this.wirelessTerminalGUIObject != null && !this.wirelessTerminalGUIObject.getItemStack().isEmpty() && currentItem != this.wirelessTerminalGUIObject.getItemStack()) {
|
||||
} else if (!this.wirelessTerminalGUIObject.getItemStack().isEmpty() && currentItem != this.wirelessTerminalGUIObject.getItemStack()) {
|
||||
if (ItemStack.areItemsEqual(this.wirelessTerminalGUIObject.getItemStack(), currentItem)) {
|
||||
this.getPlayerInv().setInventorySlotContents(this.getPlayerInv().currentItem, this.wirelessTerminalGUIObject.getItemStack());
|
||||
} else {
|
||||
@@ -524,13 +526,24 @@ public class ContainerMEPortableFluidCell extends AEBaseContainer implements ICo
|
||||
|
||||
@Override
|
||||
public void setupUpgrades() {
|
||||
if (wirelessTerminalGUIObject instanceof WirelessTerminalGuiObject) {
|
||||
final IItemHandler upgrades = ((WirelessTerminalGuiObject) wirelessTerminalGUIObject).getInventoryByName("upgrades");
|
||||
for (int a = 0; a < availableUpgrades(); a++) {
|
||||
if (wirelessTerminalGUIObject != null) {
|
||||
final IItemHandler upgrades = wirelessTerminalGUIObject.getInventoryByName("upgrades");
|
||||
for (int upgradeSlot = 0; upgradeSlot < availableUpgrades(); upgradeSlot++) {
|
||||
this.addSlotToContainer(
|
||||
(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 139 + a * 18, this.getInventoryPlayer()))
|
||||
(new SlotRestrictedInput(SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, upgradeSlot, 187, 139 + upgradeSlot * 18, this.getInventoryPlayer()))
|
||||
.setNotDraggable());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void saveChanges() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(IItemHandler inv, int slot, InvOperation mc, ItemStack removedStack, ItemStack newStack) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II
|
||||
}
|
||||
}
|
||||
|
||||
upgrades = new StackUpgradeInventory(effectiveItem, this, 4);
|
||||
upgrades = new StackUpgradeInventory(effectiveItem, this, 2);
|
||||
|
||||
this.loadFromNBT();
|
||||
}
|
||||
@@ -319,6 +319,7 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II
|
||||
data = new NBTTagCompound();
|
||||
}
|
||||
viewCell.writeToNBT(data, "viewCell");
|
||||
upgrades.writeToNBT(data, "upgrades");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -347,6 +348,8 @@ public class WirelessTerminalGuiObject implements IPortableCell, IActionHost, II
|
||||
public IItemHandler getInventoryByName(String name) {
|
||||
if (name.equals("upgrades")) {
|
||||
return upgrades;
|
||||
} else if (name.equals("viewCell")) {
|
||||
return viewCell;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -144,6 +144,10 @@ public final class ItemMaterial extends AEBaseItem implements IStorageComponent,
|
||||
return Upgrades.CRAFTING;
|
||||
case CARD_PATTERN_EXPANSION:
|
||||
return Upgrades.PATTERN_EXPANSION;
|
||||
case CARD_MAGNET:
|
||||
return Upgrades.MAGNET;
|
||||
case CARD_QUANTUM_LINK:
|
||||
return Upgrades.QUANTUM_LINK;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,9 @@ public enum MaterialType {
|
||||
FLUID_CELL16K_PART(56, "material_fluid_cell16k_part", EnumSet.of(AEFeature.STORAGE_CELLS)),
|
||||
FLUID_CELL64K_PART(57, "material_fluid_cell64k_part", EnumSet.of(AEFeature.STORAGE_CELLS)),
|
||||
|
||||
CARD_PATTERN_EXPANSION(58, "material_card_pattern_expansion", EnumSet.of(AEFeature.ADVANCED_CARDS));
|
||||
CARD_PATTERN_EXPANSION(58, "material_card_pattern_expansion", EnumSet.of(AEFeature.ADVANCED_CARDS)),
|
||||
CARD_QUANTUM_LINK(59, "material_card_quantum_link", EnumSet.of(AEFeature.ADVANCED_CARDS)),
|
||||
CARD_MAGNET(60, "material_card_quantum_link", EnumSet.of(AEFeature.BASIC_CARDS));
|
||||
|
||||
|
||||
private final Set<AEFeature> features;
|
||||
|
||||
@@ -46,6 +46,8 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
|
||||
private int inverterUpgrades = 0;
|
||||
private int craftingUpgrades = 0;
|
||||
private int patternExpansionUpgrades = 0;
|
||||
private int magnetUpgrades = 0;
|
||||
private int quantumUpgrades = 0;
|
||||
|
||||
public UpgradeInventory(final IAEAppEngInventory parent, final int s) {
|
||||
super(null, s, 1);
|
||||
@@ -79,6 +81,10 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
|
||||
return this.craftingUpgrades;
|
||||
case PATTERN_EXPANSION:
|
||||
return this.patternExpansionUpgrades;
|
||||
case MAGNET:
|
||||
return this.magnetUpgrades;
|
||||
case QUANTUM_LINK:
|
||||
return this.quantumUpgrades;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@@ -88,7 +94,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
|
||||
|
||||
private void updateUpgradeInfo() {
|
||||
this.cached = true;
|
||||
this.patternExpansionUpgrades = this.inverterUpgrades = this.capacityUpgrades = this.redstoneUpgrades = this.speedUpgrades = this.fuzzyUpgrades = this.craftingUpgrades = 0;
|
||||
this.patternExpansionUpgrades = this.inverterUpgrades = this.capacityUpgrades = this.redstoneUpgrades = this.speedUpgrades = this.fuzzyUpgrades = this.craftingUpgrades = magnetUpgrades = quantumUpgrades = 0;
|
||||
|
||||
for (final ItemStack is : this) {
|
||||
if (is == null || is.getItem() == Items.AIR || !(is.getItem() instanceof IUpgradeModule)) {
|
||||
@@ -118,6 +124,11 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
|
||||
case PATTERN_EXPANSION:
|
||||
this.patternExpansionUpgrades++;
|
||||
break;
|
||||
case MAGNET:
|
||||
this.magnetUpgrades++;
|
||||
break;
|
||||
case QUANTUM_LINK:
|
||||
this.quantumUpgrades++;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -130,6 +141,8 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
|
||||
this.inverterUpgrades = Math.min(this.inverterUpgrades, this.getMaxInstalled(Upgrades.INVERTER));
|
||||
this.craftingUpgrades = Math.min(this.craftingUpgrades, this.getMaxInstalled(Upgrades.CRAFTING));
|
||||
this.patternExpansionUpgrades = Math.min(this.patternExpansionUpgrades, this.getMaxInstalled(Upgrades.PATTERN_EXPANSION));
|
||||
this.magnetUpgrades = Math.min(this.magnetUpgrades, this.getMaxInstalled(Upgrades.MAGNET));
|
||||
this.quantumUpgrades = Math.min(this.quantumUpgrades, this.getMaxInstalled(Upgrades.QUANTUM_LINK));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user