Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a79995a419 | ||
|
|
a53915c373 | ||
|
|
2918d2b5a6 | ||
|
|
133760ebda |
No files matched your search
@@ -0,0 +1,17 @@
|
||||
name: Optimize images
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
push:
|
||||
branches: [ master, main, release/** ]
|
||||
paths:
|
||||
- "**/*.png"
|
||||
|
||||
jobs:
|
||||
optimize-images:
|
||||
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
|
||||
secrets: inherit
|
||||
@@ -1,11 +1,11 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-847-GTNH:dev")
|
||||
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-900-GTNH:dev")
|
||||
|
||||
implementation("com.github.GTNewHorizons:Baubles-Expanded:2.2.6-GTNH:dev")
|
||||
implementation("com.github.GTNewHorizons:Baubles-Expanded:2.2.11-GTNH:dev")
|
||||
implementation("com.github.GTNewHorizons:Baubles-Expanded:2.2.11-GTNH:dev")
|
||||
compileOnly("curse.maven:cofh-core-69162:2388751")
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.71-GTNH:dev")
|
||||
compileOnly("com.github.GTNewHorizons:MouseTweaks:2.5.0-GTNH:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:EnderIO:2.10.20:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.91-GTNH:dev")
|
||||
compileOnly("com.github.GTNewHorizons:EnderIO:2.10.23:dev") { transitive = false }
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/4945f00643ec68e7c7a6b66f90124f89/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/4945f00643ec68e7c7a6b66f90124f89/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/46949723aaa20c7b64d7ecfed7207034/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/f636c800fdb3f9ae33f019dfa048ba72/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/4945f00643ec68e7c7a6b66f90124f89/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1e91f45234d88a64dafb961c93ddc75a/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/0ef34dd9312b12d61ba1b8e66126d140/redirect
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/d4fd992c9557644e637ebe98263e0ae7/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/faa12903720d410b387cc69ccafb1a74/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a4c09dd2e2d7079373d30e524bbc2829/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
|
||||
toolchainVersion=25
|
||||
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.20'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
|
||||
}
|
||||
|
||||
|
||||
@@ -23,11 +23,8 @@ import appeng.container.slot.AppEngSlot;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
import appeng.container.slot.SlotFakeCraftingMatrix;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import yalter.mousetweaks.api.IMTModGuiContainer;
|
||||
|
||||
@Optional.Interface(modid = "MouseTweaks", iface = "yalter.mousetweaks.api.IMTModGuiContainer")
|
||||
public class GuiWirelessCraftingTerminal extends GuiMEMonitorable implements IMTModGuiContainer {
|
||||
public class GuiWirelessCraftingTerminal extends GuiMEMonitorable {
|
||||
|
||||
private float xSize_lo;
|
||||
private float ySize_lo;
|
||||
@@ -184,68 +181,4 @@ public class GuiWirelessCraftingTerminal extends GuiMEMonitorable implements IMT
|
||||
|
||||
this.updateViewCells();
|
||||
}
|
||||
|
||||
// MouseTweaks compat
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "MouseTweaks")
|
||||
public int getAPIVersion() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "MouseTweaks")
|
||||
public String getModName() {
|
||||
return Reference.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "MouseTweaks")
|
||||
public boolean isMouseTweaksDisabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "MouseTweaks")
|
||||
public boolean isWheelTweakDisabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "MouseTweaks")
|
||||
public boolean isCraftingOutputSlot(Object modContainer, Object slot) {
|
||||
return slot == containerWCT.getSlot(ContainerWirelessCraftingTerminal.CRAFT_RESULT);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "MouseTweaks")
|
||||
public Object getModContainer() {
|
||||
return containerWCT;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "MouseTweaks")
|
||||
public int getModSlotCount(Object modContainer) {
|
||||
return containerWCT.inventorySlots.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "MouseTweaks")
|
||||
public Object getModSlot(Object modContainer, int slotNumber) {
|
||||
return slotNumber < containerWCT.inventorySlots.size() ? containerWCT.inventorySlots.get(slotNumber) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "MouseTweaks")
|
||||
public Object getModSelectedSlot(Object modContainer, int slotCount) {
|
||||
return getSlot(currentMouseX, currentMouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "MouseTweaks")
|
||||
public void clickModSlot(Object modContainer, Object slotO, int mouseButton, boolean shiftPressed) {}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "MouseTweaks")
|
||||
public void disableRMBDragIfRequired(Object modContainer, Object firstSlot, boolean shouldClick) {}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.common.container;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -7,7 +9,6 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
@@ -28,8 +29,6 @@ import net.p455w0rd.wirelesscraftingterminal.common.inventory.WCTInventoryTrash;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.inventory.WCTInventoryViewCell;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
|
||||
import net.p455w0rd.wirelesscraftingterminal.helpers.WTCGuiObject;
|
||||
import net.p455w0rd.wirelesscraftingterminal.items.ItemInfinityBooster;
|
||||
import net.p455w0rd.wirelesscraftingterminal.items.ItemMagnet;
|
||||
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -55,6 +54,9 @@ import appeng.tile.inventory.InvOperation;
|
||||
public class ContainerWirelessCraftingTerminal extends ContainerMEMonitorable
|
||||
implements IAEAppEngInventory, IContainerCraftingPacket, IViewCellStorage {
|
||||
|
||||
public static final int CRAFTING_SLOT_X_POS = 80;
|
||||
public static final int CRAFTING_SLOT_Y_POS = 83;
|
||||
|
||||
private final ItemStack containerstack;
|
||||
public final WCTInventoryCrafting craftingGrid;
|
||||
public final WCTInventoryViewCell viewCellInventory;
|
||||
@@ -64,24 +66,13 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEMonitorable
|
||||
public final InventoryPlayer inventoryPlayer;
|
||||
public ItemStack[] craftMatrixInventory;
|
||||
private final EntityPlayer player;
|
||||
public static final int HOTBAR_START = 2, HOTBAR_END = HOTBAR_START + 8, INV_START = HOTBAR_END + 1,
|
||||
INV_END = INV_START + 26, ARMOR_START = INV_END + 1, ARMOR_END = ARMOR_START + 3,
|
||||
CRAFT_GRID_START = ARMOR_END + 1, CRAFT_GRID_END = CRAFT_GRID_START + 8, CRAFT_RESULT = CRAFT_GRID_END + 1,
|
||||
VIEW_CELL_START = CRAFT_RESULT + 1, VIEW_CELL_END = VIEW_CELL_START + 4, BOOSTER_INDEX = 1,
|
||||
MAGNET_INDEX = VIEW_CELL_END + 1;
|
||||
public static int CRAFTING_SLOT_X_POS = 80, CRAFTING_SLOT_Y_POS = 83;
|
||||
private SlotBooster boosterSlot;
|
||||
private final SlotMagnet magnetSlot;
|
||||
private final Slot[] hotbarSlot;
|
||||
private final Slot[] inventorySlot;
|
||||
private final SlotArmor[] armorSlot;
|
||||
|
||||
private final SlotCraftingMatrix[] craftMatrixSlot;
|
||||
private final SlotCraftingTerm craftingSlot;
|
||||
public SlotTrash trashSlot;
|
||||
|
||||
private final ICraftingTerminal ct;
|
||||
|
||||
private final AppEngInternalInventory output = new AppEngInternalInventory(this, 1);
|
||||
private final IWirelessCraftingTerminalItem thisItem;
|
||||
private IRecipe currentRecipe;
|
||||
|
||||
@@ -108,17 +99,14 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEMonitorable
|
||||
this.viewCellInventory = new WCTInventoryViewCell(wirelessTerminal);
|
||||
this.inventoryPlayer = inventoryPlayer;
|
||||
this.player = player;
|
||||
craftMatrixInventory = new ItemStack[9];
|
||||
hotbarSlot = new Slot[9];
|
||||
inventorySlot = new Slot[27];
|
||||
armorSlot = new SlotArmor[4];
|
||||
craftMatrixSlot = new SlotCraftingMatrix[9];
|
||||
this.craftMatrixInventory = new ItemStack[9];
|
||||
this.craftMatrixSlot = new SlotCraftingMatrix[9];
|
||||
|
||||
// Dummy slot at index 0 to work around ME slots all having their slot number set to 0.
|
||||
this.addSlotToContainer(new SlotInaccessible(new AppEngInternalInventory(null, 1), 0, -1000, -1000));
|
||||
|
||||
if (Reference.WCT_BOOSTER_ENABLED) {
|
||||
boosterSlot = new SlotBooster(this.boosterInventory, 0, 134, -20);
|
||||
SlotBooster boosterSlot = new SlotBooster(this.boosterInventory, 0, 134, -20);
|
||||
this.addSlotToContainer(boosterSlot);
|
||||
} else {
|
||||
this.addSlotToContainer(new SlotInaccessible(new AppEngInternalInventory(null, 1), 0, -1000, -1000));
|
||||
@@ -126,57 +114,58 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEMonitorable
|
||||
|
||||
// Add hotbar slots
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
if (player.inventory.getStackInSlot(i) != null
|
||||
&& player.inventory.getStackInSlot(i).getItem() == this.thisItem) {
|
||||
hotbarSlot[i] = new SlotDisabled(this.inventoryPlayer, i, i * 18 + 8, 58);
|
||||
ItemStack stack = this.player.inventory.getStackInSlot(i);
|
||||
Slot slot;
|
||||
if (stack != null && stack.getItem() == this.thisItem) {
|
||||
slot = new SlotDisabled(this.inventoryPlayer, i, i * 18 + 8, 58);
|
||||
} else {
|
||||
hotbarSlot[i] = new SlotPlayerHotBar(this.inventoryPlayer, i, i * 18 + 8, 58);
|
||||
slot = new SlotPlayerHotBar(this.inventoryPlayer, i, i * 18 + 8, 58);
|
||||
}
|
||||
this.addSlotToContainer(hotbarSlot[i]);
|
||||
this.addSlotToContainer(slot);
|
||||
}
|
||||
|
||||
int k = 0;
|
||||
|
||||
// Add player inventory slots
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
if (player.inventory.getStackInSlot(j + i * 9 + 9) != null
|
||||
&& player.inventory.getStackInSlot(j + i * 9 + 9).getItem() == this.thisItem) {
|
||||
inventorySlot[k] = new SlotDisabled(this.inventoryPlayer, j + i * 9 + 9, j * 18 + 8, i * 18);
|
||||
int slotIndex = j + i * 9 + 9;
|
||||
ItemStack stack = this.player.inventory.getStackInSlot(slotIndex);
|
||||
Slot slot;
|
||||
if (stack != null && stack.getItem() == this.thisItem) {
|
||||
slot = new SlotDisabled(this.inventoryPlayer, slotIndex, j * 18 + 8, i * 18);
|
||||
} else {
|
||||
inventorySlot[k] = new SlotPlayerInv(this.inventoryPlayer, j + i * 9 + 9, j * 18 + 8, i * 18);
|
||||
slot = new SlotPlayerInv(this.inventoryPlayer, slotIndex, j * 18 + 8, i * 18);
|
||||
}
|
||||
this.addSlotToContainer(inventorySlot[k]);
|
||||
k++;
|
||||
this.addSlotToContainer(slot);
|
||||
}
|
||||
}
|
||||
|
||||
// Add armor slots
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
armorSlot[i] = new SlotArmor(
|
||||
this.player,
|
||||
this.inventoryPlayer,
|
||||
this.inventoryPlayer.getSizeInventory() - 1 - i,
|
||||
(int) 8.5,
|
||||
(i * 18) - 76,
|
||||
i);
|
||||
this.addSlotToContainer(armorSlot[i]);
|
||||
this.addSlotToContainer(
|
||||
new SlotArmor(
|
||||
this.player,
|
||||
this.inventoryPlayer,
|
||||
this.inventoryPlayer.getSizeInventory() - 1 - i,
|
||||
(int) 8.5,
|
||||
(i * 18) - 76,
|
||||
i));
|
||||
}
|
||||
k = 0;
|
||||
int matrixIndex = 0;
|
||||
// Add crafting grid slots
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
craftMatrixSlot[k] = new SlotCraftingMatrix(
|
||||
craftMatrixSlot[matrixIndex] = new SlotCraftingMatrix(
|
||||
this,
|
||||
this.craftingGrid,
|
||||
j + i * 3,
|
||||
80 + j * 18,
|
||||
(i * 18) - 76);
|
||||
this.addSlotToContainer(craftMatrixSlot[k]);
|
||||
k++;
|
||||
this.addSlotToContainer(craftMatrixSlot[matrixIndex]);
|
||||
matrixIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
AppEngInternalInventory output = new AppEngInternalInventory(this, 1);
|
||||
craftingSlot = new SlotCraftingTerm(
|
||||
this.getPlayerInv().player,
|
||||
this.getActionSource(),
|
||||
@@ -184,14 +173,14 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEMonitorable
|
||||
this.ct,
|
||||
this.craftingGrid,
|
||||
this.craftingGrid,
|
||||
this.output,
|
||||
output,
|
||||
174,
|
||||
-58,
|
||||
this);
|
||||
// Add crafting result slot
|
||||
this.addSlotToContainer(craftingSlot);
|
||||
|
||||
magnetSlot = new SlotMagnet(this.magnetInventory, 152, -20);
|
||||
SlotMagnet magnetSlot = new SlotMagnet(this.magnetInventory, 152, -20);
|
||||
this.addSlotToContainer(magnetSlot);
|
||||
|
||||
trashSlot = new SlotTrash(this.trashInventory, 80, -20, player);
|
||||
@@ -209,23 +198,6 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEMonitorable
|
||||
thisItem.checkForBooster(containerstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Slot addSlotToContainer(final Slot newSlot) {
|
||||
if (newSlot instanceof AppEngSlot) {
|
||||
final AppEngSlot s = (AppEngSlot) newSlot;
|
||||
s.setContainer(this);
|
||||
return super.addSlotToContainer(newSlot);
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
"Invalid Slot [" + newSlot + "] for WCT Container instead of AppEngSlot.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDragIntoSlot(final Slot s) {
|
||||
return ((AppEngSlot) s).isDraggable();
|
||||
}
|
||||
|
||||
private IRecipe findMatchingRecipe(InventoryCrafting craftMatrix, World worldIn) {
|
||||
for (Object recipe : CraftingManager.getInstance().getRecipeList()) {
|
||||
if (((IRecipe) recipe).matches(craftMatrix, worldIn)) {
|
||||
@@ -371,76 +343,11 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEMonitorable
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(final EntityPlayer p, final int idx) {
|
||||
final AppEngSlot clickSlot = (AppEngSlot) this.inventorySlots.get(idx); // require AE SLots!
|
||||
ItemStack tis = clickSlot.getStack();
|
||||
if (tis == null || tis == containerstack) {
|
||||
return null;
|
||||
}
|
||||
// Try to place armor in armor slot/booster in booster slot first
|
||||
if (isInInventory(idx) || isInHotbar(idx)) {
|
||||
if (tis.getItem() instanceof ItemArmor) {
|
||||
int type = ((ItemArmor) tis.getItem()).armorType;
|
||||
if (this.mergeItemStack(tis, ARMOR_START + type, ARMOR_START + type + 1, false)) {
|
||||
clickSlot.clearStack();
|
||||
return null;
|
||||
}
|
||||
} else if (tis.getItem() instanceof ItemInfinityBooster) {
|
||||
if (this.mergeItemStack(tis, BOOSTER_INDEX, BOOSTER_INDEX + 1, false)) {
|
||||
clickSlot.clearStack();
|
||||
return null;
|
||||
}
|
||||
} else if (tis.getItem() instanceof ItemMagnet) {
|
||||
if (this.mergeItemStack(tis, MAGNET_INDEX, MAGNET_INDEX + 1, false)) {
|
||||
clickSlot.clearStack();
|
||||
return null;
|
||||
}
|
||||
} else if (AEApi.instance().definitions().items().viewCell().isSameAs(tis)) {
|
||||
if (mergeItemStack(tis.copy(), VIEW_CELL_START, VIEW_CELL_END + 1, false)) {
|
||||
if (tis.stackSize > 1) {
|
||||
tis.stackSize--;
|
||||
} else {
|
||||
clickSlot.clearStack();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.transferStackInSlot(p, idx);
|
||||
}
|
||||
|
||||
private boolean isInHotbar(@Nonnull int index) {
|
||||
return (index >= HOTBAR_START && index <= HOTBAR_END);
|
||||
}
|
||||
|
||||
private boolean isInInventory(@Nonnull int index) {
|
||||
return (index >= INV_START && index <= INV_END);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private boolean isInArmorSlot(@Nonnull int index) {
|
||||
return (index >= ARMOR_START && index <= ARMOR_END);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private boolean isInBoosterSlot(@Nonnull int index) {
|
||||
return (index == BOOSTER_INDEX);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private boolean isCraftResult(@Nonnull int index) {
|
||||
return (index == CRAFT_RESULT);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private boolean isInCraftMatrix(@Nonnull int index) {
|
||||
return (index >= CRAFT_GRID_START && index <= CRAFT_GRID_END);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private boolean notArmorOrBooster(ItemStack is) {
|
||||
return (!(is.getItem() instanceof ItemInfinityBooster)) && (!(is.getItem() instanceof ItemArmor));
|
||||
@Nonnull
|
||||
public List<AppEngSlot> getValidDestinationSlots(boolean isPlayerSideSlot, @Nonnull ItemStack stackInSlot) {
|
||||
List<AppEngSlot> list = super.getValidDestinationSlots(isPlayerSideSlot, stackInSlot);
|
||||
list.removeIf(slot -> slot instanceof SlotTrash);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -457,83 +364,6 @@ public class ContainerWirelessCraftingTerminal extends ContainerMEMonitorable
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles shift-clicking of items whose maxStackSize is 1
|
||||
*/
|
||||
@Override
|
||||
protected boolean mergeItemStack(ItemStack stack, int start, int end, boolean backwards) {
|
||||
boolean flag1 = false;
|
||||
int k = (backwards ? end - 1 : start);
|
||||
Slot slot;
|
||||
ItemStack itemstack1;
|
||||
|
||||
if (stack.isStackable()) {
|
||||
while (stack.stackSize > 0 && (!backwards && k < end || backwards && k >= start)) {
|
||||
slot = (Slot) inventorySlots.get(k);
|
||||
itemstack1 = slot.getStack();
|
||||
|
||||
if (!slot.isItemValid(stack)) {
|
||||
k += (backwards ? -1 : 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (itemstack1 != null && itemstack1.getItem() == stack.getItem()
|
||||
&& (!stack.getHasSubtypes() || stack.getItemDamage() == itemstack1.getItemDamage())
|
||||
&& ItemStack.areItemStackTagsEqual(stack, itemstack1)) {
|
||||
int l = itemstack1.stackSize + stack.stackSize;
|
||||
|
||||
if (l <= stack.getMaxStackSize() && l <= slot.getSlotStackLimit()) {
|
||||
stack.stackSize = 0;
|
||||
itemstack1.stackSize = l;
|
||||
boosterInventory.markDirty();
|
||||
flag1 = true;
|
||||
} else if (itemstack1.stackSize < stack.getMaxStackSize() && l < slot.getSlotStackLimit()) {
|
||||
stack.stackSize -= stack.getMaxStackSize() - itemstack1.stackSize;
|
||||
itemstack1.stackSize = stack.getMaxStackSize();
|
||||
boosterInventory.markDirty();
|
||||
flag1 = true;
|
||||
}
|
||||
}
|
||||
|
||||
k += (backwards ? -1 : 1);
|
||||
}
|
||||
}
|
||||
if (stack.stackSize > 0) {
|
||||
k = (backwards ? end - 1 : start);
|
||||
while (!backwards && k < end || backwards && k >= start) {
|
||||
slot = (Slot) inventorySlots.get(k);
|
||||
itemstack1 = slot.getStack();
|
||||
|
||||
if (!slot.isItemValid(stack)) {
|
||||
k += (backwards ? -1 : 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (itemstack1 == null) {
|
||||
int l = stack.stackSize;
|
||||
if (l <= slot.getSlotStackLimit()) {
|
||||
slot.putStack(stack.copy());
|
||||
stack.stackSize = 0;
|
||||
boosterInventory.markDirty();
|
||||
flag1 = true;
|
||||
break;
|
||||
} else {
|
||||
putStackInSlot(
|
||||
k,
|
||||
new ItemStack(stack.getItem(), slot.getSlotStackLimit(), stack.getItemDamage()));
|
||||
stack.stackSize -= slot.getSlotStackLimit();
|
||||
boosterInventory.markDirty();
|
||||
flag1 = true;
|
||||
}
|
||||
}
|
||||
|
||||
k += (backwards ? -1 : 1);
|
||||
}
|
||||
}
|
||||
|
||||
return flag1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrimaryGui createPrimaryGui() {
|
||||
ContainerOpenContext context = getOpenContext();
|
||||
|
||||
@@ -2,11 +2,10 @@ package net.p455w0rd.wirelesscraftingterminal.core.sync.packets;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.INetworkInfo;
|
||||
import net.p455w0rd.wirelesscraftingterminal.handlers.LocaleHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.items.ItemMagnet;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
@@ -41,14 +40,14 @@ public class PacketSetMagnet extends WCTPacket {
|
||||
if (magnetItem.getItemDamage() == 2) {
|
||||
RandomUtils.getWirelessTerm(player.inventory).getTagCompound().getTagList("MagnetSlot", 10)
|
||||
.getCompoundTagAt(0).setShort("Damage", (short) 0);
|
||||
player.addChatMessage(new ChatComponentText(LocaleHandler.MagnetMode1.getLocal()));
|
||||
player.addChatMessage(new ChatComponentTranslation("chatmessages.ae2wct.MagnetMode1"));
|
||||
} else {
|
||||
RandomUtils.getWirelessTerm(player.inventory).getTagCompound().getTagList("MagnetSlot", 10)
|
||||
.getCompoundTagAt(0).setShort("Damage", (short) (magnetItem.getItemDamage() + 1));
|
||||
if (magnetItem.getItemDamage() == 0) {
|
||||
player.addChatMessage(new ChatComponentText(LocaleHandler.MagnetMode2.getLocal()));
|
||||
player.addChatMessage(new ChatComponentTranslation("chatmessages.ae2wct.MagnetMode2"));
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText(LocaleHandler.MagnetMode3.getLocal()));
|
||||
player.addChatMessage(new ChatComponentTranslation("chatmessages.ae2wct.MagnetMode3"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
#Items
|
||||
item.wirelessCraftingTerminal.name=Беспроводной терминал создания
|
||||
item.infinityBoosterCard.name=Бесконечная карта усиления
|
||||
item.magnetCard.name=Магнитная карта
|
||||
itemGroup.ae2wct=§9AE2 Wireless Crafting Terminal
|
||||
|
||||
#Tooltips
|
||||
gui.tooltips.ae2wct.PressShift=Удерживайте Shift для информации
|
||||
gui.tooltips.ae2wct.OnlyWorks=Работает только, когда в слоте беспроводного терминала создания!
|
||||
gui.tooltips.ae2wct.TitleDesc=Описание
|
||||
gui.tooltips.ae2wct.InfinityBoosterDesc=Позволяет использовать привязанный беспроводной терминал создания на любом растоянии и через разные измерения.
|
||||
gui.tooltips.ae2wct.MagnetDesc=Магнит, который автомагически вставляет предметы в АЕ систему.
|
||||
gui.tooltips.ae2wct.MagnetDesc2=ПКМ, чтобы установить фильтр
|
||||
gui.tooltips.ae2wct.LinkStatus=Статус привязки
|
||||
gui.tooltips.ae2wct.Installed=Установлено
|
||||
gui.tooltips.ae2wct.NotInstalled=Не установлено
|
||||
gui.tooltips.ae2wct.Active=Активен
|
||||
gui.tooltips.ae2wct.Inactive=Неактивен
|
||||
gui.tooltips.ae2wct.Status=Статус
|
||||
gui.tooltips.ae2wct.EmptyTrash=Опустошить мусорку
|
||||
gui.tooltips.ae2wct.EmptyTrashDesc=Удалить содержимое слота для мусора
|
||||
gui.tooltips.ae2wct.MagnetFilterTitle=Фильтр магнита
|
||||
gui.tooltips.ae2wct.FilterMode=Режим фильтра
|
||||
gui.tooltips.ae2wct.Whitelisting=Белый список
|
||||
gui.tooltips.ae2wct.Blacklisting=Чёрный список
|
||||
gui.tooltips.ae2wct.MagnetActiveDesc1=Лишние предметы добавлены в инвентарь
|
||||
gui.tooltips.ae2wct.MagnetActiveDesc2=Лишние предметы оставлены на земле
|
||||
gui.tooltips.ae2wct.Not=Нет
|
||||
gui.tooltips.ae2wct.Using=Используя
|
||||
gui.tooltips.ae2wct.Ignore=Игнорировать
|
||||
gui.tooltips.ae2wct.Ignoring=Игнорируя
|
||||
gui.tooltips.ae2wct.NBTData=NBT данные
|
||||
gui.tooltips.ae2wct.MetaData=Метаданные
|
||||
gui.tooltips.ae2wct.OreDict=Словарь руд
|
||||
gui.tooltips.ae2wct.FilteredItems=Отфильтрованные предметы
|
||||
gui.tooltips.ae2wct.OrPress=или нажмите
|
||||
gui.tooltips.ae2wct.Press=Нажмите
|
||||
gui.tooltips.ae2wct.ToSwitchMode=чтобы переключить режим магнита
|
||||
|
||||
#Labels
|
||||
gui.labels.ae2wct.WirelessTermLabel=Беспроводной терминал
|
||||
|
||||
#Config Descriptions
|
||||
config.ae2wct.MaxPowerDesc=Максимальное количество энергии в единицах AE, которое может хранить беспроводной терминал
|
||||
config.ae2wct.InfinityBoosterCfgDesc=Включить улучшение бесконечного усилителя дальности
|
||||
config.ae2wct.EasyModeDesc=Включить лёгкий режим (легче рецепты+рецепт бесконечного усилителя)
|
||||
config.ae2wct.BoosterDropChance=Шанс, что из визера выпадет бесконечная карта усиления (в %-100=всегда выпадет)
|
||||
config.ae2wct.DisableBoosterDrop=Включить выпадение карты усиления в сложном режиме (true=включено)
|
||||
config.ae2wct.MineTweakerOverride=Включить переопределение MineTweaker (true=отключает все рецепты)
|
||||
config.ae2wct.DoVersionCheck=Проверка обновлений
|
||||
config.ae2wct.NewVersionAvailable=Доступна новая версия Wireless Crafting Terminal!
|
||||
config.ae2wct.ClickString=["Нажмите здесь, чтобы перейти на страницу загрузки [",{"text":"Скачать","color":"green","hoverEvent":{"action":"show_text","value":{"text":"Нажмите это, чтобы скачать последнюю версию","color":"green"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/projects/wireless-crafting-terminal"}},"]"]
|
||||
config.ae2wct.SaveSearchString=Сохранять строку поиска терминала между сеансами
|
||||
|
||||
#Achievements
|
||||
achievement.wctAchievement=Цифровое создание через WiFi
|
||||
achievement.wctAchievement.desc=Создать беспроводной терминал создания
|
||||
achievement.boosterAchievement=Межпространственный мешок создания
|
||||
achievement.boosterAchievement.desc=Получите бесконечную карту усиления
|
||||
achievement.magnetAchievement=Цифровой пылесос
|
||||
achievement.magnetAchievement.desc=Создать магнитную карту
|
||||
|
||||
#Chat Messages
|
||||
chatmessages.ae2wct.NoNetworkPower=В системе нет энергии!
|
||||
chatmessages.ae2wct.MagnetMode1=Магнитная карта деактивирована
|
||||
chatmessages.ae2wct.MagnetMode2=Магнитная карта активирована - предметы, не хранящиеся в АЕ системе, будут помещены в инвентарь
|
||||
chatmessages.ae2wct.MagnetMode3=Магнитная карта активирована - предметы, не хранящиеся в АЕ системе, останутся на земле
|
||||
chatmessages.ae2wct.InitializeMagnet=Прежде чем использовать привязанную клавишу, вы должны сначала щелкнуть ПКМ, держа магнитную карту в руке!
|
||||
|
||||
#Keybindings
|
||||
ae2wct.OpenTerminal=Открыть беспроводной терминал создания
|
||||
ae2wct.OpenMagnetFilter=Открыть интерфейс фильтра магнитной карты
|
||||
ae2wct.SwitchMagnetMode=Активировать/деактивировать магнитную карту
|
||||
key.categories.ae2wct=Wireless Crafting Terminal
|
||||
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |