mirror of
https://github.com/GTNewHorizons/WirelessCraftingTerminal.git
synced 2026-11-26 06:42:55 +00:00
Compare commits
11
Commits
1.12.9-pre
...
1.12.14
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2918d2b5a6 | ||
|
|
133760ebda | ||
|
|
3d15a78bef | ||
|
|
0b55097ea0 | ||
|
|
a3b9b72065 | ||
|
|
81ab446772 | ||
|
|
b6c46b17d9 | ||
|
|
bde9445ea4 | ||
|
|
b86cc2eb68 | ||
|
|
5875aeefcc | ||
|
|
e3f344e5c2 |
No files matched your search
+5
-5
@@ -1,11 +1,11 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-658-GTNH:dev")
|
||||
api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-900-GTNH:dev")
|
||||
|
||||
implementation("com.github.GTNewHorizons:Baubles-Expanded:2.1.9-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.7.64-GTNH:dev")
|
||||
compileOnly("com.github.GTNewHorizons:MouseTweaks:2.4.20-GTNH:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:EnderIO:2.9.18:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.91-GTNH:dev")
|
||||
compileOnly("com.github.GTNewHorizons:MouseTweaks:2.5.0-GTNH:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:EnderIO:2.10.23:dev") { transitive = false }
|
||||
}
|
||||
+39
-4
@@ -39,9 +39,33 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
|
||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = true
|
||||
# Enables modern Java syntax support. Valid values:
|
||||
# - false: No modern syntax, Java 8 only
|
||||
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
|
||||
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
|
||||
# - modern: Native modern Java bytecode, no downgrading
|
||||
enableModernJavaSyntax = jabel
|
||||
|
||||
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||
# and should *not* be used in most situations. -1 disables this.
|
||||
# forceToolchainVersion = -1
|
||||
|
||||
# Target JVM version for JVM Downgrader bytecode downgrading.
|
||||
# Only used when enableModernJavaSyntax = jvmDowngrader
|
||||
# downgradeTargetVersion = 8
|
||||
|
||||
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
|
||||
# Classes will be available in META-INF/versions/N/ for each version N in this list.
|
||||
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
|
||||
# jvmDowngraderMultiReleaseVersions = 21,25
|
||||
|
||||
# Specifies how JVM Downgrader API stubs are provided. Options:
|
||||
# - shade: Shade minimized stubs into the jar
|
||||
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
|
||||
# - external: Another dependency provides stubs (no constraint, no warning)
|
||||
# - (empty): Warning reminding you to configure stubs
|
||||
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
|
||||
# jvmDowngraderStubsProvider =
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
@@ -96,7 +120,9 @@ usesMixinDebug = false
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
# Specify the package that contains all of your Mixins. The package must exist or
|
||||
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
|
||||
# it must match with this or the build will fail.
|
||||
mixinsPackage =
|
||||
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
@@ -172,6 +198,12 @@ curseForgeRelations =
|
||||
# projects. New projects should not use this parameter.
|
||||
customArchiveBaseName = WirelessCraftingTerminal
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
|
||||
# runClientWorkingDirectory = run/client
|
||||
|
||||
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
|
||||
# runServerWorkingDirectory = run/server
|
||||
|
||||
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||
# The check is ONLY performed if the version is a git tag.
|
||||
@@ -201,3 +233,6 @@ customArchiveBaseName = WirelessCraftingTerminal
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# ideaCheckSpotlessOnBuild = true
|
||||
|
||||
# Non-GTNH properties
|
||||
org.gradle.configuration-cache = true
|
||||
org.gradle.parallel = true
|
||||
@@ -0,0 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
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
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -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/.
|
||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -172,7 +171,6 @@ fi
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
@@ -212,8 +210,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
Vendored
+1
-2
@@ -70,11 +70,10 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Add any additional repositories for your dependencies here
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
}
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.41'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
|
||||
}
|
||||
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketSwitchGuis;
|
||||
import net.p455w0rd.wirelesscraftingterminal.helpers.WirelessTerminalGuiObject;
|
||||
import net.p455w0rd.wirelesscraftingterminal.items.ItemEnum;
|
||||
import net.p455w0rd.wirelesscraftingterminal.items.ItemWirelessCraftingTerminal;
|
||||
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerCraftAmount;
|
||||
import appeng.helpers.Reflected;
|
||||
|
||||
public class GuiCraftAmount extends appeng.client.gui.implementations.GuiCraftAmount {
|
||||
|
||||
private GuiTabButton originalGuiBtn;
|
||||
|
||||
private ItemStack myIcon;
|
||||
|
||||
private int originalGui;
|
||||
|
||||
@Reflected
|
||||
public GuiCraftAmount(final InventoryPlayer inventoryPlayer, final ITerminalHost te) {
|
||||
super(inventoryPlayer, te);
|
||||
ItemStack is = new ItemStack(ItemEnum.WIRELESS_CRAFTING_TERMINAL.getItem());
|
||||
((ItemWirelessCraftingTerminal) is.getItem()).injectAEPower(is, 6400001);
|
||||
myIcon = is;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "unused" })
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
// Remove the autogenerated button which takes you to the AE2 wireless terminal GUI
|
||||
if (this.buttonList.get(this.buttonList.size() - 1) instanceof GuiTabButton) {
|
||||
this.buttonList.remove(this.buttonList.size() - 1);
|
||||
}
|
||||
|
||||
final Object target = ((ContainerCraftAmount) this.inventorySlots).getTarget();
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
final IParts parts = definitions.parts();
|
||||
|
||||
if (target instanceof WirelessTerminalGuiObject) {
|
||||
this.originalGui = Reference.GUI_WCT;
|
||||
}
|
||||
|
||||
if (this.originalGui > 0 && myIcon != null) {
|
||||
this.buttonList.add(
|
||||
this.originalGuiBtn = new GuiTabButton(
|
||||
this.guiLeft + 154,
|
||||
this.guiTop - 4,
|
||||
myIcon,
|
||||
myIcon.getDisplayName(),
|
||||
itemRender));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
super.actionPerformed(btn);
|
||||
|
||||
if (btn == this.originalGuiBtn) {
|
||||
NetworkHandler.instance.sendToServer(new PacketSwitchGuis(this.originalGui));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.client.gui;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketSwitchGuis;
|
||||
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
|
||||
public class GuiCraftConfirm extends appeng.client.gui.implementations.GuiCraftConfirm {
|
||||
|
||||
public GuiCraftConfirm(final InventoryPlayer inventoryPlayer, final ITerminalHost te) {
|
||||
super(inventoryPlayer, te);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void switchToOriginalGUI() {
|
||||
NetworkHandler.instance.sendToServer(new PacketSwitchGuis(Reference.GUI_WCT));
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketSwitchGuis;
|
||||
import net.p455w0rd.wirelesscraftingterminal.helpers.WirelessTerminalGuiObject;
|
||||
import net.p455w0rd.wirelesscraftingterminal.items.ItemEnum;
|
||||
import net.p455w0rd.wirelesscraftingterminal.items.ItemWirelessCraftingTerminal;
|
||||
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.container.implementations.ContainerCraftingStatus;
|
||||
|
||||
public class GuiCraftingStatus extends appeng.client.gui.implementations.GuiCraftingStatus {
|
||||
|
||||
private GuiTabButton originalGuiBtn;
|
||||
private int originalGui;
|
||||
private ItemStack myIcon = null;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public GuiCraftingStatus(final InventoryPlayer inventoryPlayer, final ITerminalHost te) {
|
||||
super(inventoryPlayer, te);
|
||||
|
||||
ContainerCraftingStatus status = (ContainerCraftingStatus) this.inventorySlots;
|
||||
final Object target = status.getTarget();
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
final IParts parts = definitions.parts();
|
||||
|
||||
if (target instanceof WirelessTerminalGuiObject) {
|
||||
for (final ItemStack wirelessTerminalStack : definitions.items().wirelessTerminal().maybeStack(1).asSet()) {
|
||||
this.myIcon = wirelessTerminalStack;
|
||||
}
|
||||
|
||||
ItemStack is = new ItemStack(ItemEnum.WIRELESS_CRAFTING_TERMINAL.getItem());
|
||||
((ItemWirelessCraftingTerminal) is.getItem()).injectAEPower(is, 6400001);
|
||||
myIcon = is;
|
||||
|
||||
this.originalGui = Reference.GUI_WCT;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
super.actionPerformed(btn);
|
||||
|
||||
if (btn == this.originalGuiBtn) {
|
||||
NetworkHandler.instance.sendToServer(new PacketSwitchGuis(this.originalGui));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
if (this.myIcon != null) {
|
||||
this.buttonList.add(
|
||||
this.originalGuiBtn = new GuiTabButton(
|
||||
this.guiLeft + 213,
|
||||
this.guiTop - 4,
|
||||
this.myIcon,
|
||||
this.myIcon.getDisplayName(),
|
||||
itemRender));
|
||||
this.originalGuiBtn.setHideEdge(13);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public class GuiMagnet extends GuiContainer {
|
||||
public boolean ignoreNBT = false;
|
||||
public boolean ignoreMeta = false;
|
||||
public boolean useOreDict = false;
|
||||
private ItemStack magnetItem;
|
||||
private final ItemStack magnetItem;
|
||||
private WCTGuiCheckBox ignoreNBTBox;
|
||||
private WCTGuiCheckBox ignoreMetaBox;
|
||||
private WCTGuiCheckBox useOreDictBox;
|
||||
|
||||
+55
-716
@@ -1,342 +1,102 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.client.gui;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiInventory;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.p455w0rd.wirelesscraftingterminal.client.gui.widgets.GuiTrashButton;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerWirelessCraftingTerminal;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.container.slot.SlotTrash;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketEmptyTrash;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketInventoryAction;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketSwitchGuis;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketValueConfig;
|
||||
import net.p455w0rd.wirelesscraftingterminal.handlers.LocaleHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.TerminalFontSize;
|
||||
import appeng.api.config.TerminalStyle;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IDisplayRepo;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigurableObject;
|
||||
import appeng.client.ActionKey;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.api.parts.ICraftingTerminal;
|
||||
import appeng.client.gui.implementations.GuiMEMonitorable;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.client.gui.widgets.MEGuiTextField;
|
||||
import appeng.client.me.InternalSlotME;
|
||||
import appeng.client.me.ItemRepo;
|
||||
import appeng.client.me.SlotME;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
import appeng.container.slot.SlotFakeCraftingMatrix;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
import codechicken.nei.TextField;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import yalter.mousetweaks.api.IMTModGuiContainer;
|
||||
|
||||
@Optional.Interface(modid = "MouseTweaks", iface = "yalter.mousetweaks.api.IMTModGuiContainer")
|
||||
public class GuiWirelessCraftingTerminal extends AEBaseGui
|
||||
implements ISortSource, IConfigManagerHost, IMTModGuiContainer {
|
||||
public class GuiWirelessCraftingTerminal extends GuiMEMonitorable implements IMTModGuiContainer {
|
||||
|
||||
private float xSize_lo;
|
||||
private float ySize_lo;
|
||||
public static int tick = 0, GUI_HEIGHT = 240, GUI_WIDTH = 230, AE_ROW_HEIGHT = 18, AE_NUM_ROWS = 0,
|
||||
GUI_UPPER_HEIGHT = 35, GUI_SEARCH_ROW = 35, SEARCH_X = 80, SEARCH_Y = 4, SEARCH_WIDTH = 88,
|
||||
SEARCH_HEIGHT = 12, SEARCH_MAXCHARS = 15, GUI_LOWER_HEIGHT, AE_TOTAL_ROWS_HEIGHT,
|
||||
BUTTON_SEARCH_MODE_POS_X = -18, BUTTON_SEARCH_MODE_POS_Y = 68, BUTTON_SIZE = 16, NEI_EXTRA_SPACE = 30,
|
||||
slotYOffset;
|
||||
protected static final int BUTTON_SEARCH_MODE_ID = 5;
|
||||
protected static final long TOOLTIP_UPDATE_INTERVAL = 3000L;
|
||||
private int currScreenWidth, currScreenHeight;
|
||||
private static final String bgTexturePath = "gui/crafting_viewcell.png";
|
||||
|
||||
final ResourceLocation BackgroundTexture = new ResourceLocation(
|
||||
Reference.MODID,
|
||||
"textures/gui/crafting_viewcell.png");
|
||||
private final ContainerWirelessCraftingTerminal containerWCT;
|
||||
private boolean isFullScreen, init = true, reInit, wasResized = false;
|
||||
public static GuiWirelessCraftingTerminal INSTANCE;
|
||||
private static boolean switchingGuis;
|
||||
public static int craftingGridOffsetX = 80;
|
||||
public static int craftingGridOffsetY;
|
||||
private static String memoryText = "";
|
||||
private final IDisplayRepo repo;
|
||||
private final int offsetX = 8;
|
||||
private final IConfigManager configSrc;
|
||||
private GuiTabButton craftingStatusBtn;
|
||||
private MEGuiTextField searchField;
|
||||
private int perRow = 9;
|
||||
private boolean customSortOrder = true;
|
||||
private GuiImgButton ViewBox;
|
||||
private GuiImgButton SortByBox;
|
||||
private GuiImgButton SortDirBox;
|
||||
private GuiImgButton searchBoxSettings;
|
||||
|
||||
private GuiImgButton clearBtn;
|
||||
private GuiTrashButton trashBtn;
|
||||
private GuiImgButton terminalStyleBox;
|
||||
private GuiImgButton searchStringSave;
|
||||
private boolean isAutoFocus = false;
|
||||
|
||||
private int currentMouseX = 0;
|
||||
private int currentMouseY = 0;
|
||||
public boolean devicePowered = false;
|
||||
private boolean isNEIEnabled;
|
||||
private boolean wasTextboxFocused = false;
|
||||
private int screenResTicks = 0;
|
||||
private int reservedSpace = 0;
|
||||
private int maxRows = Integer.MAX_VALUE;
|
||||
private int standardSize;
|
||||
private final int lowerTextureOffset = 0;
|
||||
private int rows = 0;
|
||||
private final ItemStack[] myCurrentViewCells = new ItemStack[5];
|
||||
|
||||
public GuiWirelessCraftingTerminal(Container container) {
|
||||
super(container);
|
||||
GuiWirelessCraftingTerminal.INSTANCE = this;
|
||||
this.xSize = GUI_WIDTH;
|
||||
this.ySize = GUI_HEIGHT;
|
||||
this.standardSize = this.xSize;
|
||||
public GuiWirelessCraftingTerminal(final InventoryPlayer inventoryPlayer, ICraftingTerminal host) {
|
||||
super(inventoryPlayer, host, new ContainerWirelessCraftingTerminal(inventoryPlayer, host));
|
||||
this.setReservedSpace(73);
|
||||
this.containerWCT = (ContainerWirelessCraftingTerminal) container;
|
||||
this.setScrollBar(new GuiScrollbar());
|
||||
this.repo = new ItemRepo(getScrollBar(), this);
|
||||
this.configSrc = ((IConfigurableObject) this.inventorySlots).getConfigManager();
|
||||
this.devicePowered = containerWCT.isPowered();
|
||||
this.offsetRepoX -= 1;
|
||||
|
||||
this.containerWCT = (ContainerWirelessCraftingTerminal) this.inventorySlots;
|
||||
((ContainerWirelessCraftingTerminal) this.inventorySlots).setGui(this);
|
||||
}
|
||||
|
||||
public void postUpdate(final List<IAEItemStack> list) {
|
||||
for (final IAEItemStack is : list) {
|
||||
this.repo.postUpdate(is);
|
||||
}
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
}
|
||||
|
||||
private void setScrollBar() {
|
||||
this.getScrollBar().setTop(18).setLeft(174).setHeight(this.rows * 18 - 2);
|
||||
this.getScrollBar().setRange(
|
||||
0,
|
||||
(this.repo.size() + this.perRow - 1) / this.perRow - this.rows,
|
||||
Math.max(1, this.rows / 6));
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
if (btn == this.craftingStatusBtn) {
|
||||
NetworkHandler.instance.sendToServer(new PacketSwitchGuis(Reference.GUI_CRAFTING_STATUS));
|
||||
}
|
||||
|
||||
if (btn instanceof GuiImgButton) {
|
||||
final boolean backwards = Mouse.isButtonDown(1);
|
||||
|
||||
final GuiImgButton iBtn = (GuiImgButton) btn;
|
||||
if (iBtn.getSetting() != Settings.ACTIONS) {
|
||||
final Enum cv = iBtn.getCurrentValue();
|
||||
final Enum next = Platform.rotateEnum(cv, backwards, iBtn.getSetting().getPossibleValues());
|
||||
|
||||
if (btn == this.terminalStyleBox) {
|
||||
AEConfig.instance.settings.putSetting(iBtn.getSetting(), next);
|
||||
}
|
||||
if (btn == this.searchBoxSettings) {
|
||||
AEConfig.instance.settings.putSetting(iBtn.getSetting(), next);
|
||||
} else if (btn == this.searchStringSave) {
|
||||
AEConfig.instance.preserveSearchBar = next == YesNo.YES;
|
||||
} else {
|
||||
try {
|
||||
NetworkHandler.instance
|
||||
.sendToServer(new PacketValueConfig(iBtn.getSetting().name(), next.name()));
|
||||
} catch (final IOException e) {
|
||||
WCTLog.debug(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
iBtn.set(next);
|
||||
|
||||
if (next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class) {
|
||||
this.reinitalize();
|
||||
if (this.clearBtn == btn) {
|
||||
Slot s = null;
|
||||
final Container c = this.inventorySlots;
|
||||
for (final Object j : c.inventorySlots) {
|
||||
if (j instanceof SlotCraftingMatrix) {
|
||||
s = (Slot) j;
|
||||
}
|
||||
}
|
||||
if (this.clearBtn == btn) {
|
||||
Slot s = null;
|
||||
final Container c = this.inventorySlots;
|
||||
for (final Object j : c.inventorySlots) {
|
||||
if (j instanceof SlotCraftingMatrix) {
|
||||
s = (Slot) j;
|
||||
}
|
||||
}
|
||||
|
||||
if (s != null) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(
|
||||
InventoryAction.MOVE_REGION,
|
||||
s.slotNumber,
|
||||
0);
|
||||
NetworkHandler.instance.sendToServer(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (btn instanceof GuiTrashButton) {
|
||||
if (this.trashBtn == btn) {
|
||||
Slot s = null;
|
||||
final Container c = this.inventorySlots;
|
||||
for (final Object j : c.inventorySlots) {
|
||||
if (j instanceof SlotTrash) {
|
||||
s = (Slot) j;
|
||||
}
|
||||
}
|
||||
|
||||
if (s != null) {
|
||||
if (s.getHasStack()) {
|
||||
containerWCT.trashSlot.clearStack();
|
||||
NetworkHandler.instance.sendToServer(new PacketEmptyTrash());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleMouseClick(Slot slot, int slotIdx, int ctrlDown, int mouseButton) {
|
||||
// Handle autocraft requests ourselves to spawn the right GUI classes
|
||||
final EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
if (slot instanceof SlotME) {
|
||||
InventoryAction action = null;
|
||||
IAEItemStack stack = null;
|
||||
|
||||
switch (mouseButton) {
|
||||
case 0: // pickup / set-down.
|
||||
action = ctrlDown == 1 ? InventoryAction.SPLIT_OR_PLACE_SINGLE : InventoryAction.PICKUP_OR_SET_DOWN;
|
||||
stack = ((SlotME) slot).getAEStack();
|
||||
|
||||
if (stack != null && action == InventoryAction.PICKUP_OR_SET_DOWN
|
||||
&& stack.getStackSize() == 0
|
||||
&& player.inventory.getItemStack() == null) {
|
||||
action = InventoryAction.AUTO_CRAFT;
|
||||
}
|
||||
|
||||
break;
|
||||
case 3: // creative dupe:
|
||||
stack = ((SlotME) slot).getAEStack();
|
||||
if (stack != null && stack.isCraftable()) {
|
||||
action = InventoryAction.AUTO_CRAFT;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
if (action == InventoryAction.AUTO_CRAFT) {
|
||||
((AEBaseContainer) this.inventorySlots).setTargetStack(stack);
|
||||
final PacketInventoryAction p = new PacketInventoryAction(
|
||||
action,
|
||||
this.inventorySlots.inventorySlots.size(),
|
||||
0);
|
||||
if (s != null) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.MOVE_REGION, s.slotNumber, 0);
|
||||
NetworkHandler.instance.sendToServer(p);
|
||||
return;
|
||||
}
|
||||
} else if (this.trashBtn == btn) {
|
||||
Slot s = null;
|
||||
final Container c = this.inventorySlots;
|
||||
for (final Object j : c.inventorySlots) {
|
||||
if (j instanceof SlotTrash) {
|
||||
s = (Slot) j;
|
||||
}
|
||||
}
|
||||
|
||||
if (s != null) {
|
||||
if (s.getHasStack()) {
|
||||
containerWCT.trashSlot.clearStack();
|
||||
NetworkHandler.instance.sendToServer(new PacketEmptyTrash());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
super.actionPerformed(btn);
|
||||
}
|
||||
super.handleMouseClick(slot, slotIdx, ctrlDown, mouseButton);
|
||||
}
|
||||
|
||||
private void reinitalize() {
|
||||
this.buttonList.clear();
|
||||
this.initGui();
|
||||
}
|
||||
|
||||
int getReservedSpace() {
|
||||
return this.reservedSpace;
|
||||
}
|
||||
|
||||
void setReservedSpace(final int reservedSpace) {
|
||||
this.reservedSpace = reservedSpace;
|
||||
}
|
||||
|
||||
public int getStandardSize() {
|
||||
return this.standardSize;
|
||||
}
|
||||
|
||||
void setStandardSize(final int standardSize) {
|
||||
this.standardSize = standardSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the GUI
|
||||
*/
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
this.maxRows = this.getMaxRows();
|
||||
this.perRow = AEConfig.instance.getConfigManager().getSetting(Settings.TERMINAL_STYLE) != TerminalStyle.FULL ? 9
|
||||
: 9 + ((this.width - this.standardSize) / 18);
|
||||
this.isNEIEnabled = Loader.isModLoaded("NotEnoughItems");
|
||||
int top = isNEIEnabled ? 22 : 0;
|
||||
final int magicNumber = 114 + 1;
|
||||
final int extraSpace = this.height - magicNumber - top - this.reservedSpace;
|
||||
this.rows = (int) Math.floor(extraSpace / 18);
|
||||
if (this.rows > this.maxRows) {
|
||||
top += (this.rows - this.maxRows) * 18 / 2;
|
||||
this.rows = this.maxRows;
|
||||
}
|
||||
|
||||
if (isNEIEnabled) {
|
||||
this.rows--;
|
||||
}
|
||||
|
||||
if (this.rows < 3) {
|
||||
this.rows = 3;
|
||||
}
|
||||
|
||||
this.getMeSlots().clear();
|
||||
for (int y = 0; y < this.rows; y++) {
|
||||
for (int x = 0; x < this.perRow; x++) {
|
||||
this.getMeSlots()
|
||||
.add(new InternalSlotME(this.repo, x + y * this.perRow, this.offsetX + x * 18, 18 + y * 18));
|
||||
}
|
||||
}
|
||||
if (AEConfig.instance.getConfigManager().getSetting(Settings.TERMINAL_STYLE) != TerminalStyle.FULL) {
|
||||
this.xSize = this.standardSize + ((this.perRow - 9) * 18);
|
||||
} else {
|
||||
this.xSize = this.standardSize;
|
||||
}
|
||||
super.initGui();
|
||||
|
||||
this.ySize = magicNumber + this.rows * 18 + this.reservedSpace;
|
||||
final int unusedSpace = this.height - this.ySize;
|
||||
this.guiTop = (int) Math.floor(unusedSpace / (unusedSpace < 0 ? 3.8f : 2.0f));
|
||||
int offset = this.guiTop + 8;
|
||||
|
||||
this.buttonList.clear();
|
||||
this.buttonList.add(
|
||||
this.clearBtn = new GuiImgButton(
|
||||
this.guiLeft + 134,
|
||||
@@ -345,81 +105,6 @@ public class GuiWirelessCraftingTerminal extends AEBaseGui
|
||||
ActionItems.STASH));
|
||||
this.buttonList.add(this.trashBtn = new GuiTrashButton(this.guiLeft + 98, this.guiTop + this.ySize - 104));
|
||||
this.clearBtn.setHalfSize(true);
|
||||
if (this.customSortOrder) {
|
||||
this.buttonList.add(
|
||||
this.SortByBox = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
Settings.SORT_BY,
|
||||
this.configSrc.getSetting(Settings.SORT_BY)));
|
||||
offset += 20;
|
||||
}
|
||||
|
||||
this.buttonList.add(
|
||||
this.ViewBox = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
Settings.VIEW_MODE,
|
||||
this.configSrc.getSetting(Settings.VIEW_MODE)));
|
||||
offset += 20;
|
||||
|
||||
this.buttonList.add(
|
||||
this.SortDirBox = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
Settings.SORT_DIRECTION,
|
||||
this.configSrc.getSetting(Settings.SORT_DIRECTION)));
|
||||
offset += 20;
|
||||
|
||||
this.buttonList.add(
|
||||
this.searchBoxSettings = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
Settings.SEARCH_MODE,
|
||||
AEConfig.instance.settings.getSetting(Settings.SEARCH_MODE)));
|
||||
offset += 20;
|
||||
|
||||
this.buttonList.add(
|
||||
this.searchStringSave = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
Settings.SAVE_SEARCH,
|
||||
AEConfig.instance.preserveSearchBar ? YesNo.YES : YesNo.NO));
|
||||
offset += 20;
|
||||
|
||||
this.buttonList.add(
|
||||
this.terminalStyleBox = new GuiImgButton(
|
||||
this.guiLeft - 18,
|
||||
offset,
|
||||
Settings.TERMINAL_STYLE,
|
||||
AEConfig.instance.settings.getSetting(Settings.TERMINAL_STYLE)));
|
||||
|
||||
this.searchField = new MEGuiTextField(SEARCH_WIDTH, SEARCH_HEIGHT);
|
||||
this.searchField.x = SEARCH_X;
|
||||
this.searchField.y = SEARCH_Y;
|
||||
|
||||
this.buttonList.add(
|
||||
this.craftingStatusBtn = new GuiTabButton(
|
||||
this.guiLeft + 169,
|
||||
this.guiTop - 4,
|
||||
2 + 11 * 16,
|
||||
GuiText.CraftingStatus.getLocal(),
|
||||
itemRender));
|
||||
this.craftingStatusBtn.setHideEdge(13);
|
||||
|
||||
final Enum searchMode = AEConfig.instance.settings.getSetting(Settings.SEARCH_MODE);
|
||||
this.isAutoFocus = SearchBoxMode.AUTOSEARCH == searchMode || SearchBoxMode.NEI_AUTOSEARCH == searchMode;
|
||||
|
||||
this.searchField.setFocused(this.isAutoFocus);
|
||||
|
||||
if (AEConfig.instance.preserveSearchBar || this.isSubGui()) {
|
||||
this.searchField.setText(memoryText);
|
||||
this.repo.setSearchString(memoryText);
|
||||
}
|
||||
if (this.isSubGui()) {
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
}
|
||||
|
||||
craftingGridOffsetX = Integer.MAX_VALUE;
|
||||
craftingGridOffsetY = Integer.MAX_VALUE;
|
||||
@@ -441,81 +126,9 @@ public class GuiWirelessCraftingTerminal extends AEBaseGui
|
||||
}
|
||||
}
|
||||
|
||||
int getMaxRows() {
|
||||
return AEConfig.instance.getConfigManager().getSetting(Settings.TERMINAL_STYLE) == TerminalStyle.SMALL ? 6
|
||||
: Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
protected void repositionSlot(final AppEngSlot s) {
|
||||
s.yDisplayPosition = s.getY() + this.ySize - 78 - 5;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called every tick. It is used in this instance to detect screen size changes to automatically update the gui
|
||||
* height.
|
||||
* <p>
|
||||
* reInit variable is used to call initGui() on the next tick. It has to be called this way to update correctly.
|
||||
*
|
||||
* @author p455w0rd
|
||||
*/
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
this.devicePowered = containerWCT.isPowered();
|
||||
this.repo.setPowered(devicePowered);
|
||||
|
||||
super.updateScreen();
|
||||
if (this.init) {
|
||||
this.currScreenWidth = this.mc.displayWidth;
|
||||
this.currScreenHeight = this.mc.displayHeight;
|
||||
this.isFullScreen = this.mc.isFullScreen();
|
||||
this.reInit = true;
|
||||
this.init = false;
|
||||
}
|
||||
++screenResTicks;
|
||||
if (screenResTicks == 20) {
|
||||
this.wasTextboxFocused = this.searchField.isFocused();
|
||||
screenResTicks = 0;
|
||||
}
|
||||
if (this.reInit) {
|
||||
if (tick != 1) {
|
||||
tick++;
|
||||
} else {
|
||||
this.initGui();
|
||||
this.setScrollBar();
|
||||
if (this.wasResized) {
|
||||
this.searchField.setFocused(this.wasTextboxFocused);
|
||||
this.searchField.setText(this.repo.getSearchString());
|
||||
this.wasTextboxFocused = false;
|
||||
this.wasResized = false;
|
||||
}
|
||||
this.reInit = false;
|
||||
tick = 0;
|
||||
}
|
||||
}
|
||||
if (hasScreenResChanged()) {
|
||||
this.reInit = true;
|
||||
this.wasResized = true;
|
||||
}
|
||||
if (!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) {
|
||||
this.mc.thePlayer.closeScreen();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Detects if the window has been resized
|
||||
*
|
||||
* @return True if window has been resized
|
||||
* @author p455w0rd
|
||||
*/
|
||||
private boolean hasScreenResChanged() {
|
||||
if ((this.currScreenWidth != this.mc.displayWidth) || (this.currScreenHeight != this.mc.displayHeight)
|
||||
|| (this.isFullScreen != this.mc.isFullScreen())) {
|
||||
this.currScreenWidth = this.mc.displayWidth;
|
||||
this.currScreenHeight = this.mc.displayHeight;
|
||||
this.isFullScreen = this.mc.isFullScreen();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
protected int getPinButtonY() {
|
||||
return super.getPinButtonY() + 31;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -528,23 +141,16 @@ public class GuiWirelessCraftingTerminal extends AEBaseGui
|
||||
this.ySize_lo = (float) mouseY;
|
||||
}
|
||||
|
||||
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
String s = LocaleHandler.WirelessTermLabel.getLocal();
|
||||
this.mc.fontRenderer.drawString(s, 7, 5, 4210752);
|
||||
this.mc.fontRenderer.drawString(I18n.format("container.inventory"), 7, this.ySize - 172 + 3, 4210752);
|
||||
if (this.searchField != null) {
|
||||
this.searchField.drawTextBox();
|
||||
}
|
||||
|
||||
this.currentMouseX = mouseX;
|
||||
this.currentMouseY = mouseY;
|
||||
@Override
|
||||
protected String getGuiDisplayName(String in) {
|
||||
return in;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.bindMyTexture(bgTexturePath);
|
||||
final int x_width = 199;
|
||||
|
||||
// draw "over inventory area"
|
||||
this.mc.getTextureManager().bindTexture(BackgroundTexture);
|
||||
final int x_width = 199;
|
||||
this.drawTexturedModalRect(offsetX, offsetY, 0, 0, x_width, 18);
|
||||
|
||||
for (int x = 0; x < this.rows; x++) {
|
||||
@@ -554,13 +160,13 @@ public class GuiWirelessCraftingTerminal extends AEBaseGui
|
||||
// draw player inv
|
||||
this.drawTexturedModalRect(
|
||||
offsetX,
|
||||
offsetY + 16 + this.rows * 18 + this.lowerTextureOffset,
|
||||
offsetY + 16 + this.rows * 18,
|
||||
0,
|
||||
106 - 18 - 18,
|
||||
x_width,
|
||||
99 + this.reservedSpace - this.lowerTextureOffset);
|
||||
99 + this.getReservedSpace());
|
||||
|
||||
// draw view cells
|
||||
// draw view cells background
|
||||
this.drawTexturedModalRect(offsetX + x_width, offsetY, x_width, 0, 32, 104);
|
||||
|
||||
if (Reference.WCT_BOOSTER_ENABLED) {
|
||||
@@ -574,275 +180,9 @@ public class GuiWirelessCraftingTerminal extends AEBaseGui
|
||||
(float) ((this.guiTop + this.rows * 18) + 50) - this.ySize_lo,
|
||||
this.mc.thePlayer);
|
||||
|
||||
boolean update = false;
|
||||
for (int i = 0; i < 5; i++) {
|
||||
if (myCurrentViewCells[i] != containerWCT.getCellViewSlot(i).getStack()) {
|
||||
update = true;
|
||||
myCurrentViewCells[i] = containerWCT.getCellViewSlot(i).getStack();
|
||||
}
|
||||
}
|
||||
this.searchField.drawTextBox();
|
||||
|
||||
if (update) {
|
||||
repo.setViewCell(myCurrentViewCells);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
protected void mouseClicked(final int xCoord, final int yCoord, final int btn) {
|
||||
|
||||
if (!this.isAutoFocus) {
|
||||
this.searchField.mouseClicked(xCoord - this.guiLeft, yCoord - this.guiTop, btn);
|
||||
}
|
||||
|
||||
if (btn == 1 && this.searchField.isMouseIn(xCoord - this.guiLeft, yCoord - this.guiTop)) {
|
||||
this.searchField.setText("");
|
||||
this.repo.setSearchString("");
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
}
|
||||
|
||||
super.mouseClicked(xCoord, yCoord, btn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed() {
|
||||
super.onGuiClosed();
|
||||
Keyboard.enableRepeatEvents(false);
|
||||
if (this.searchField.getText() != null) {
|
||||
memoryText = this.searchField.getText();
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean enableSpaceClicking() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(final char character, final int key) {
|
||||
if (!this.checkHotbarKeys(key)) {
|
||||
if (isNEIFocused()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (CommonHelper.proxy.isActionKey(ActionKey.TOGGLE_FOCUS, key)) {
|
||||
this.searchField.setFocused(!this.searchField.isFocused());
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.searchField.isFocused() && key == Keyboard.KEY_RETURN) {
|
||||
this.searchField.setFocused(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (character == ' ' && this.searchField.getText().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean mouseInGui = this
|
||||
.isPointInRegion(0, 0, this.xSize, this.ySize, this.currentMouseX, this.currentMouseY);
|
||||
if (this.isAutoFocus && !this.searchField.isFocused() && mouseInGui) {
|
||||
this.searchField.setFocused(true);
|
||||
}
|
||||
|
||||
if (this.searchField.textboxKeyTyped(character, key)) {
|
||||
this.repo.setSearchString(this.searchField.getText());
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
} else {
|
||||
super.keyTyped(character, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleKeyboardInput() {
|
||||
super.handleKeyboardInput();
|
||||
|
||||
// Pause the terminal when holding shift
|
||||
this.repo.setPaused(hasShiftDown());
|
||||
}
|
||||
|
||||
private boolean hasShiftDown() {
|
||||
return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
|
||||
}
|
||||
|
||||
protected boolean isPowered() {
|
||||
return this.repo.hasPower();
|
||||
}
|
||||
|
||||
public void bindMyTexture(final String file) {
|
||||
final ResourceLocation loc = new ResourceLocation(Reference.MODID, "textures/" + file);
|
||||
this.mc.getTextureManager().bindTexture(loc);
|
||||
}
|
||||
|
||||
public List<String> handleItemTooltip(final ItemStack stack, final int mouseX, final int mouseY,
|
||||
final List<String> currentToolTip) {
|
||||
if (stack != null) {
|
||||
final Slot s = this.getSlot(mouseX, mouseY);
|
||||
if (s instanceof SlotME) {
|
||||
final int BigNumber = AEConfig.instance.getTerminalFontSize() == TerminalFontSize.SMALL ? 9999 : 999;
|
||||
|
||||
IAEItemStack myStack = null;
|
||||
|
||||
try {
|
||||
final SlotME theSlotField = (SlotME) s;
|
||||
myStack = theSlotField.getAEStack();
|
||||
} catch (final Throwable ignore) {}
|
||||
|
||||
if (myStack != null) {
|
||||
if (myStack.getStackSize() > BigNumber || (myStack.getStackSize() > 1 && stack.isItemDamaged())) {
|
||||
final String local = ButtonToolTips.ItemsStored.getLocal();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US)
|
||||
.format(myStack.getStackSize());
|
||||
final String format = String.format(local, formattedAmount);
|
||||
|
||||
currentToolTip.add("\u00a77" + format);
|
||||
}
|
||||
|
||||
if (myStack.getCountRequestable() > 0) {
|
||||
final String local = ButtonToolTips.ItemsRequestable.getLocal();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US)
|
||||
.format(myStack.getCountRequestable());
|
||||
final String format = String.format(local, formattedAmount);
|
||||
|
||||
currentToolTip.add("\u00a77" + format);
|
||||
}
|
||||
} else if (stack.stackSize > BigNumber || (stack.stackSize > 1 && stack.isItemDamaged())) {
|
||||
final String local = ButtonToolTips.ItemsStored.getLocal();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US).format(stack.stackSize);
|
||||
final String format = String.format(local, formattedAmount);
|
||||
|
||||
currentToolTip.add("\u00a77" + format);
|
||||
}
|
||||
}
|
||||
}
|
||||
return currentToolTip;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void renderToolTip(final ItemStack stack, final int x, final int y) {
|
||||
final Slot s = this.getSlot(x, y);
|
||||
if (s instanceof SlotME && stack != null) {
|
||||
final int BigNumber = AEConfig.instance.getTerminalFontSize() == TerminalFontSize.SMALL ? 9999 : 999;
|
||||
|
||||
IAEItemStack myStack = null;
|
||||
|
||||
try {
|
||||
final SlotME theSlotField = (SlotME) s;
|
||||
myStack = theSlotField.getAEStack();
|
||||
} catch (final Throwable ignore) {}
|
||||
|
||||
if (myStack != null) {
|
||||
final List<String> currentToolTip = stack
|
||||
.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips);
|
||||
|
||||
if (myStack.getStackSize() > BigNumber || (myStack.getStackSize() > 1 && stack.isItemDamaged())) {
|
||||
currentToolTip.add(
|
||||
"Items Stored: "
|
||||
+ NumberFormat.getNumberInstance(Locale.US).format(myStack.getStackSize()));
|
||||
}
|
||||
|
||||
if (myStack.getCountRequestable() > 0) {
|
||||
currentToolTip.add(
|
||||
"Items Requestable: "
|
||||
+ NumberFormat.getNumberInstance(Locale.US).format(myStack.getCountRequestable()));
|
||||
}
|
||||
|
||||
this.drawTooltip(x, y, 0, join(currentToolTip, "\n"));
|
||||
} else if (stack.stackSize > BigNumber) {
|
||||
final List var4 = stack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips);
|
||||
var4.add("Items Stored: " + NumberFormat.getNumberInstance(Locale.US).format(stack.stackSize));
|
||||
this.drawTooltip(x, y, 0, join(var4, "\n"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
super.renderToolTip(stack, x, y);
|
||||
// super.drawItemStackTooltip( stack, x, y );
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void updateSetting(final IConfigManager manager, final Enum settingName, final Enum newValue) {
|
||||
if (this.SortByBox != null) {
|
||||
this.SortByBox.set(this.configSrc.getSetting(Settings.SORT_BY));
|
||||
}
|
||||
|
||||
if (this.SortDirBox != null) {
|
||||
this.SortDirBox.set(this.configSrc.getSetting(Settings.SORT_DIRECTION));
|
||||
}
|
||||
|
||||
if (this.ViewBox != null) {
|
||||
this.ViewBox.set(this.configSrc.getSetting(Settings.VIEW_MODE));
|
||||
}
|
||||
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
}
|
||||
|
||||
public boolean isCustomSortOrder() {
|
||||
return this.customSortOrder;
|
||||
}
|
||||
|
||||
void setCustomSortOrder(final boolean customSortOrder) {
|
||||
this.customSortOrder = customSortOrder;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public Enum getSortBy() {
|
||||
return this.configSrc.getSetting(Settings.SORT_BY);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public Enum getSortDir() {
|
||||
return this.configSrc.getSetting(Settings.SORT_DIRECTION);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public Enum getSortDisplay() {
|
||||
return this.configSrc.getSetting(Settings.VIEW_MODE);
|
||||
}
|
||||
|
||||
public boolean isOverSearchField(int x, int y) {
|
||||
return searchField.isMouseIn(x - guiLeft, y - guiTop);
|
||||
}
|
||||
|
||||
public void setSearchString(String memoryText) {
|
||||
this.searchField.setText(memoryText);
|
||||
this.repo.setSearchString(memoryText);
|
||||
this.repo.updateView();
|
||||
this.setScrollBar();
|
||||
}
|
||||
|
||||
@SuppressWarnings("SameParameterValue")
|
||||
protected boolean isPointInRegion(int rectX, int rectY, int rectWidth, int rectHeight, int pointX, int pointY) {
|
||||
int i = this.guiLeft;
|
||||
int j = this.guiTop;
|
||||
pointX -= i;
|
||||
pointY -= j;
|
||||
return pointX >= rectX - 1 && pointX < rectX + rectWidth + 1
|
||||
&& pointY >= rectY - 1
|
||||
&& pointY < rectY + rectHeight + 1;
|
||||
}
|
||||
|
||||
private boolean isNEIFocused() {
|
||||
if (!Loader.isModLoaded("NotEnoughItems")) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
final Class<? super Object> c = ReflectionHelper
|
||||
.getClass(this.getClass().getClassLoader(), "codechicken.nei.LayoutManager");
|
||||
final Field fldSearchField = c.getField("searchField");
|
||||
final TextField searchField = (TextField) fldSearchField.get(c);
|
||||
return searchField.focused();
|
||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
this.updateViewCells();
|
||||
}
|
||||
|
||||
// MouseTweaks compat
|
||||
@@ -898,8 +238,7 @@ public class GuiWirelessCraftingTerminal extends AEBaseGui
|
||||
@Override
|
||||
@Optional.Method(modid = "MouseTweaks")
|
||||
public Object getModSelectedSlot(Object modContainer, int slotCount) {
|
||||
Slot s = getSlot(currentMouseX, currentMouseY);
|
||||
return s;
|
||||
return getSlot(currentMouseX, currentMouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.client.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
|
||||
|
||||
import appeng.container.PrimaryGui;
|
||||
|
||||
public class WCTPrimaryGui extends PrimaryGui {
|
||||
|
||||
public WCTPrimaryGui(Object gui, ItemStack guiIcon, TileEntity te, ForgeDirection side) {
|
||||
super(gui, guiIcon, te, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open(EntityPlayer player) {
|
||||
WCTGuiHandler.launchGui(
|
||||
(int) this.gui,
|
||||
player,
|
||||
player.worldObj,
|
||||
(int) player.posX,
|
||||
(int) player.posY,
|
||||
(int) player.posZ);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,23 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.common;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.p455w0rd.wirelesscraftingterminal.api.IWirelessCraftingTermHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiCraftAmount;
|
||||
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiCraftConfirm;
|
||||
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiCraftingStatus;
|
||||
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiMagnet;
|
||||
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiWirelessCraftingTerminal;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerCraftAmount;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerCraftConfirm;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerMagnet;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerWirelessCraftingTerminal;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
|
||||
import net.p455w0rd.wirelesscraftingterminal.helpers.WirelessTerminalGuiObject;
|
||||
import net.p455w0rd.wirelesscraftingterminal.helpers.WTCGuiObject;
|
||||
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerOpenContext;
|
||||
import appeng.container.implementations.ContainerCraftingStatus;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import it.unimi.dsi.fastutil.ints.IntObjectPair;
|
||||
|
||||
public class WCTGuiHandler implements IGuiHandler {
|
||||
|
||||
@@ -40,43 +35,12 @@ public class WCTGuiHandler implements IGuiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
final WirelessTerminalGuiObject term = new WirelessTerminalGuiObject(
|
||||
wh,
|
||||
RandomUtils.getWirelessTerm(player.inventory),
|
||||
player,
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z);
|
||||
final IntObjectPair<ItemStack> termItem = RandomUtils.getWirelessTermWithSlot(player.inventory);
|
||||
final WTCGuiObject term = new WTCGuiObject(wh, termItem.second(), player, world, x, y, z, termItem.firstInt());
|
||||
|
||||
return switch (guiId) {
|
||||
case Reference.GUI_WCT -> updateGui(
|
||||
new ContainerWirelessCraftingTerminal(player, player.inventory),
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
ForgeDirection.UNKNOWN,
|
||||
term);
|
||||
case Reference.GUI_CRAFTING_STATUS -> updateGui(
|
||||
new ContainerCraftingStatus(player.inventory, term),
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
ForgeDirection.UNKNOWN,
|
||||
term);
|
||||
|
||||
case Reference.GUI_CRAFT_AMOUNT -> updateGui(
|
||||
new ContainerCraftAmount(player, term),
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
ForgeDirection.UNKNOWN,
|
||||
term);
|
||||
case Reference.GUI_CRAFT_CONFIRM -> updateGui(
|
||||
new ContainerCraftConfirm(player, term),
|
||||
new ContainerWirelessCraftingTerminal(player.inventory, term),
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
@@ -91,35 +55,18 @@ public class WCTGuiHandler implements IGuiHandler {
|
||||
public Object getClientGuiElement(int guiId, EntityPlayer player, World world, int x, int y, int z) {
|
||||
final IWirelessCraftingTermHandler wh = (IWirelessCraftingTermHandler) AEApi.instance().registries().wireless()
|
||||
.getWirelessTerminalHandler(RandomUtils.getWirelessTerm(player.inventory));
|
||||
if (wh != null) {
|
||||
final WirelessTerminalGuiObject obj = new WirelessTerminalGuiObject(
|
||||
if (wh != null && guiId == Reference.GUI_WCT) {
|
||||
final IntObjectPair<ItemStack> termItem = RandomUtils.getWirelessTermWithSlot(player.inventory);
|
||||
final WTCGuiObject obj = new WTCGuiObject(
|
||||
wh,
|
||||
RandomUtils.getWirelessTerm(player.inventory),
|
||||
termItem.second(),
|
||||
player,
|
||||
world,
|
||||
x,
|
||||
y,
|
||||
z);
|
||||
if (obj != null) {
|
||||
final IPortableCell terminal = obj;
|
||||
|
||||
if (guiId == Reference.GUI_WCT) {
|
||||
return new GuiWirelessCraftingTerminal(
|
||||
new ContainerWirelessCraftingTerminal(player, player.inventory));
|
||||
}
|
||||
|
||||
if (guiId == Reference.GUI_CRAFTING_STATUS) {
|
||||
return new GuiCraftingStatus(player.inventory, terminal);
|
||||
}
|
||||
|
||||
if (guiId == Reference.GUI_CRAFT_AMOUNT) {
|
||||
return new GuiCraftAmount(player.inventory, terminal);
|
||||
}
|
||||
|
||||
if (guiId == Reference.GUI_CRAFT_CONFIRM) {
|
||||
return new GuiCraftConfirm(player.inventory, terminal);
|
||||
}
|
||||
}
|
||||
z,
|
||||
termItem.firstInt());
|
||||
return new GuiWirelessCraftingTerminal(player.inventory, obj);
|
||||
}
|
||||
if (guiId == Reference.GUI_MAGNET) {
|
||||
return new GuiMagnet(new ContainerMagnet(player, player.inventory));
|
||||
|
||||
+3
-1
@@ -42,7 +42,9 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
+ '.' // revisionVersion
|
||||
+ net.minecraftforge.common.ForgeVersion.buildVersion
|
||||
+ ",);"
|
||||
+ "required-after:appliedenergistics2@[rv3-beta-328,);after:NotEnoughItems;")
|
||||
+ "required-after:"
|
||||
+ "appliedenergistics2@[rv3-beta-754,);after:"
|
||||
+ "NotEnoughItems;")
|
||||
public class WirelessCraftingTerminal {
|
||||
|
||||
private static LoaderState WCTState = LoaderState.NOINIT;
|
||||
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.common.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
|
||||
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
|
||||
public class ContainerCraftAmount extends appeng.container.implementations.ContainerCraftAmount {
|
||||
|
||||
public ContainerCraftAmount(EntityPlayer player, IPortableCell terminal) {
|
||||
super(player.inventory, terminal);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openConfirmationGUI(EntityPlayer player, TileEntity te) {
|
||||
int x = (int) player.posX;
|
||||
int y = (int) player.posY;
|
||||
int z = (int) player.posZ;
|
||||
WCTGuiHandler.launchGui(Reference.GUI_CRAFT_CONFIRM, player, player.worldObj, x, y, z);
|
||||
setupConfirmationGUI(player);
|
||||
}
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.common.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
|
||||
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
|
||||
public class ContainerCraftConfirm extends appeng.container.implementations.ContainerCraftConfirm {
|
||||
|
||||
private final EntityPlayer player;
|
||||
|
||||
public ContainerCraftConfirm(EntityPlayer player, IPortableCell terminal) {
|
||||
super(player.inventory, terminal);
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void switchToOriginalGUI() {
|
||||
int x = (int) player.posX;
|
||||
int y = (int) player.posY;
|
||||
int z = (int) player.posZ;
|
||||
WCTGuiHandler.launchGui(Reference.GUI_WCT, player, player.worldObj, x, y, z);
|
||||
}
|
||||
}
|
||||
+49
-920
File diff suppressed because it is too large.
Load diff
+5
@@ -25,6 +25,11 @@ public class SlotTrash extends appeng.container.slot.AppEngSlot {
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getDisplayStack() {
|
||||
return this.getStack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getHasStack() {
|
||||
return itemStack != null;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.common.utils;
|
||||
|
||||
import static appeng.util.Platform.baublesSlotsOffset;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -13,6 +15,8 @@ import baubles.api.BaublesApi;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import it.unimi.dsi.fastutil.ints.IntObjectImmutablePair;
|
||||
import it.unimi.dsi.fastutil.ints.IntObjectPair;
|
||||
|
||||
public class RandomUtils {
|
||||
|
||||
@@ -86,6 +90,48 @@ public class RandomUtils {
|
||||
return wirelessTerm;
|
||||
}
|
||||
|
||||
public static IntObjectPair<ItemStack> getWirelessTermWithSlot(InventoryPlayer playerInv) {
|
||||
if (playerInv.player.getHeldItem() != null
|
||||
&& playerInv.player.getHeldItem().getItem() instanceof IWirelessCraftingTerminalItem) {
|
||||
return new IntObjectImmutablePair<>(playerInv.player.inventory.currentItem, playerInv.player.getHeldItem());
|
||||
}
|
||||
IntObjectPair<ItemStack> wirelessTerm = null;
|
||||
|
||||
int invSize = playerInv.getSizeInventory();
|
||||
if (invSize <= 0) {
|
||||
return null;
|
||||
}
|
||||
for (int i = 0; i < invSize; ++i) {
|
||||
ItemStack item = playerInv.getStackInSlot(i);
|
||||
if (item == null) {
|
||||
continue;
|
||||
}
|
||||
if (item.getItem() instanceof IWirelessCraftingTerminalItem) {
|
||||
wirelessTerm = new IntObjectImmutablePair<>(i, item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isBaublesLoaded) {
|
||||
IInventory handler = BaublesApi.getBaubles(playerInv.player);
|
||||
if (handler != null) {
|
||||
invSize = handler.getSizeInventory();
|
||||
for (int i = 0; i < invSize; ++i) {
|
||||
ItemStack item = handler.getStackInSlot(i);
|
||||
if (item == null) {
|
||||
continue;
|
||||
}
|
||||
if (item.getItem() instanceof IWirelessCraftingTerminalItem) {
|
||||
wirelessTerm = new IntObjectImmutablePair<>(i + baublesSlotsOffset, item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return wirelessTerm;
|
||||
}
|
||||
|
||||
public static ItemStack getMagnet(InventoryPlayer playerInv) {
|
||||
// Is player holding a Magnet Card?
|
||||
if (playerInv.player.getHeldItem() != null && playerInv.player.getHeldItem().getItem() instanceof ItemMagnet) {
|
||||
|
||||
-12
@@ -6,16 +6,12 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketConfigSync;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketCraftRequest;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketEmptyTrash;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketInventoryAction;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketMEInventoryUpdate;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketMagnetFilter;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketNEIRecipe;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketOpenGui;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketSetMagnet;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketSwitchGuis;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketValueConfig;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.handler.codec.DecoderException;
|
||||
@@ -28,16 +24,8 @@ public class WCTPacketHandlerBase {
|
||||
|
||||
PACKET_INVENTORY_ACTION(PacketInventoryAction.class),
|
||||
|
||||
PACKET_ME_INVENTORY_UPDATE(PacketMEInventoryUpdate.class),
|
||||
|
||||
PACKET_VALUE_CONFIG(PacketValueConfig.class),
|
||||
|
||||
PACKET_SWITCH_GUIS(PacketSwitchGuis.class),
|
||||
|
||||
PACKET_RECIPE_NEI(PacketNEIRecipe.class),
|
||||
|
||||
PACKET_CRAFTING_REQUEST(PacketCraftRequest.class),
|
||||
|
||||
PACKET_MAGNETFILTER_MODE(PacketMagnetFilter.class),
|
||||
|
||||
PACKET_OPENWIRELESSTERM(PacketOpenGui.class),
|
||||
|
||||
-88
@@ -1,88 +0,0 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.core.sync.packets;
|
||||
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.INetworkInfo;
|
||||
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
|
||||
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.crafting.ICraftingGrid;
|
||||
import appeng.api.networking.crafting.ICraftingJob;
|
||||
import appeng.container.implementations.ContainerCraftAmount;
|
||||
import appeng.container.implementations.ContainerCraftConfirm;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
public class PacketCraftRequest extends WCTPacket {
|
||||
|
||||
private final long amount;
|
||||
private final boolean heldShift;
|
||||
|
||||
public PacketCraftRequest(final ByteBuf stream) {
|
||||
this.heldShift = stream.readBoolean();
|
||||
this.amount = stream.readLong();
|
||||
}
|
||||
|
||||
public PacketCraftRequest(final int craftAmt, final boolean shift) {
|
||||
this.amount = craftAmt;
|
||||
this.heldShift = shift;
|
||||
|
||||
final ByteBuf data = Unpooled.buffer();
|
||||
|
||||
data.writeInt(this.getPacketID());
|
||||
data.writeBoolean(shift);
|
||||
data.writeLong(this.amount);
|
||||
|
||||
this.configureWrite(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverPacketData(final INetworkInfo manager, final WCTPacket packet, final EntityPlayer player) {
|
||||
if (player.openContainer instanceof ContainerCraftAmount) {
|
||||
final ContainerCraftAmount cca = (ContainerCraftAmount) player.openContainer;
|
||||
final Object target = cca.getTarget();
|
||||
if (target instanceof IGridHost) {
|
||||
final IGrid g = cca.getGrid();
|
||||
if (g == null || cca.getItemToCraft() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
cca.getItemToCraft().setStackSize(this.amount);
|
||||
|
||||
Future<ICraftingJob> futureJob = null;
|
||||
try {
|
||||
final ICraftingGrid cg = g.getCache(ICraftingGrid.class);
|
||||
futureJob = cg.beginCraftingJob(
|
||||
cca.getWorld(),
|
||||
cca.getGrid(),
|
||||
cca.getActionSrc(),
|
||||
cca.getItemToCraft(),
|
||||
null);
|
||||
|
||||
int x = (int) player.posX;
|
||||
int y = (int) player.posY;
|
||||
int z = (int) player.posZ;
|
||||
|
||||
WCTGuiHandler.launchGui(Reference.GUI_CRAFT_CONFIRM, player, player.worldObj, x, y, z);
|
||||
|
||||
if (player.openContainer instanceof ContainerCraftConfirm) {
|
||||
final ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer;
|
||||
ccc.setItemToCraft(cca.getItemToCraft());
|
||||
ccc.setAutoStart(this.heldShift);
|
||||
ccc.setJob(futureJob);
|
||||
cca.detectAndSendChanges();
|
||||
}
|
||||
} catch (final Throwable e) {
|
||||
if (futureJob != null) {
|
||||
futureJob.cancel(true);
|
||||
}
|
||||
// WCTLog.debug(e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
-50
@@ -5,18 +5,14 @@ import java.io.IOException;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerWirelessCraftingTerminal;
|
||||
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.reference.Reference;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.ClientHelper;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerOpenContext;
|
||||
import appeng.container.implementations.ContainerCraftAmount;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
@@ -96,55 +92,16 @@ public class PacketInventoryAction extends WCTPacket {
|
||||
public void serverPacketData(final INetworkInfo manager, final WCTPacket packet, final EntityPlayer player) {
|
||||
final EntityPlayerMP sender = (EntityPlayerMP) player;
|
||||
Container baseContainer = sender.openContainer;
|
||||
ContainerOpenContext context = null;
|
||||
|
||||
if (baseContainer instanceof ContainerWirelessCraftingTerminal) {
|
||||
if (RandomUtils.getWirelessTerm(player.inventory) == null)
|
||||
((ContainerWirelessCraftingTerminal) baseContainer).setValidContainer(false);
|
||||
else((ContainerWirelessCraftingTerminal) baseContainer).doAction(sender, this.action, this.slot, this.id);
|
||||
}
|
||||
if (baseContainer instanceof AEBaseContainer) {
|
||||
context = ((AEBaseContainer) baseContainer).getOpenContext();
|
||||
((AEBaseContainer) baseContainer).doAction(sender, this.action, this.slot, this.id);
|
||||
}
|
||||
|
||||
if (this.action == InventoryAction.AUTO_CRAFT) {
|
||||
// if( context != null )
|
||||
// {
|
||||
// final TileEntity te = context.getTile();
|
||||
|
||||
int x = (int) player.posX;
|
||||
int y = (int) player.posY;
|
||||
int z = (int) player.posZ;
|
||||
|
||||
WCTGuiHandler.launchGui(Reference.GUI_CRAFT_AMOUNT, player, player.worldObj, x, y, z);
|
||||
|
||||
if (sender.openContainer instanceof ContainerCraftAmount) {
|
||||
final ContainerCraftAmount cca = (ContainerCraftAmount) sender.openContainer;
|
||||
|
||||
if (baseContainer instanceof ContainerWirelessCraftingTerminal) {
|
||||
if (((ContainerWirelessCraftingTerminal) baseContainer).getTargetStack() != null) {
|
||||
cca.getCraftingItem().putStack(
|
||||
((ContainerWirelessCraftingTerminal) baseContainer).getTargetStack().getItemStack());
|
||||
cca.setItemToCraft(((ContainerWirelessCraftingTerminal) baseContainer).getTargetStack());
|
||||
}
|
||||
}
|
||||
|
||||
if (baseContainer instanceof AEBaseContainer) {
|
||||
if (((AEBaseContainer) baseContainer).getTargetStack() != null) {
|
||||
cca.getCraftingItem()
|
||||
.putStack(((AEBaseContainer) baseContainer).getTargetStack().getItemStack());
|
||||
cca.setItemToCraft(((AEBaseContainer) baseContainer).getTargetStack());
|
||||
}
|
||||
}
|
||||
|
||||
cca.detectAndSendChanges();
|
||||
}
|
||||
// }
|
||||
} else {
|
||||
if (baseContainer instanceof ContainerWirelessCraftingTerminal) {
|
||||
if (RandomUtils.getWirelessTerm(player.inventory) == null)
|
||||
((ContainerWirelessCraftingTerminal) baseContainer).setValidContainer(false);
|
||||
else((ContainerWirelessCraftingTerminal) baseContainer)
|
||||
.doAction(sender, this.action, this.slot, this.id);
|
||||
}
|
||||
if (baseContainer instanceof AEBaseContainer) {
|
||||
((AEBaseContainer) baseContainer).doAction(sender, this.action, this.slot, this.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
-162
@@ -1,162 +0,0 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.core.sync.packets;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.BufferOverflowException;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiCraftConfirm;
|
||||
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiWirelessCraftingTerminal;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.utils.WCTLog;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.INetworkInfo;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
public class PacketMEInventoryUpdate extends WCTPacket {
|
||||
|
||||
private static final int UNCOMPRESSED_PACKET_BYTE_LIMIT = 16 * 1024 * 1024;
|
||||
private static final int OPERATION_BYTE_LIMIT = 2 * 1024;
|
||||
private static final int TEMP_BUFFER_SIZE = 1024;
|
||||
private static final int STREAM_MASK = 0xff;
|
||||
|
||||
// input.
|
||||
@Nullable
|
||||
private final List<IAEItemStack> list;
|
||||
// output...
|
||||
private final byte ref;
|
||||
|
||||
@Nullable
|
||||
private final ByteBuf data;
|
||||
|
||||
@Nullable
|
||||
private final GZIPOutputStream compressFrame;
|
||||
|
||||
private int writtenBytes = 0;
|
||||
private boolean empty = true;
|
||||
|
||||
// automatic.
|
||||
public PacketMEInventoryUpdate(final ByteBuf stream) throws IOException {
|
||||
this.data = null;
|
||||
this.compressFrame = null;
|
||||
this.list = new LinkedList<IAEItemStack>();
|
||||
this.ref = stream.readByte();
|
||||
|
||||
final GZIPInputStream gzReader = new GZIPInputStream(new InputStream() {
|
||||
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
if (stream.readableBytes() <= 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return stream.readByte() & STREAM_MASK;
|
||||
}
|
||||
});
|
||||
|
||||
final ByteBuf uncompressed = Unpooled.buffer(stream.readableBytes());
|
||||
final byte[] tmp = new byte[TEMP_BUFFER_SIZE];
|
||||
while (gzReader.available() != 0) {
|
||||
final int bytes = gzReader.read(tmp);
|
||||
if (bytes > 0) {
|
||||
uncompressed.writeBytes(tmp, 0, bytes);
|
||||
}
|
||||
}
|
||||
gzReader.close();
|
||||
|
||||
while (uncompressed.readableBytes() > 0) {
|
||||
this.list.add(AEItemStack.loadItemStackFromPacket(uncompressed));
|
||||
}
|
||||
|
||||
this.empty = this.list.isEmpty();
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketMEInventoryUpdate() throws IOException {
|
||||
this((byte) 0);
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketMEInventoryUpdate(final byte ref) throws IOException {
|
||||
this.ref = ref;
|
||||
this.data = Unpooled.buffer(OPERATION_BYTE_LIMIT);
|
||||
this.data.writeInt(this.getPacketID());
|
||||
this.data.writeByte(this.ref);
|
||||
|
||||
this.compressFrame = new GZIPOutputStream(new OutputStream() {
|
||||
|
||||
@Override
|
||||
public void write(final int value) throws IOException {
|
||||
PacketMEInventoryUpdate.this.data.writeByte(value);
|
||||
}
|
||||
});
|
||||
|
||||
this.list = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void clientPacketData(final INetworkInfo network, final WCTPacket packet, final EntityPlayer player) {
|
||||
final GuiScreen gs = Minecraft.getMinecraft().currentScreen;
|
||||
|
||||
if (gs instanceof GuiCraftConfirm) {
|
||||
((GuiCraftConfirm) gs).postUpdate(this.list, this.ref);
|
||||
}
|
||||
|
||||
if (gs instanceof GuiWirelessCraftingTerminal) {
|
||||
((GuiWirelessCraftingTerminal) gs).postUpdate(this.list);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public FMLProxyPacket getProxy() {
|
||||
try {
|
||||
this.compressFrame.close();
|
||||
|
||||
this.configureWrite(this.data);
|
||||
return super.getProxy();
|
||||
} catch (final IOException e) {
|
||||
WCTLog.debug(e.getMessage());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void appendItem(final IAEItemStack is) throws IOException, BufferOverflowException {
|
||||
final ByteBuf tmp = Unpooled.buffer(OPERATION_BYTE_LIMIT);
|
||||
is.writeToPacket(tmp);
|
||||
|
||||
this.compressFrame.flush();
|
||||
if (this.writtenBytes + tmp.readableBytes() > UNCOMPRESSED_PACKET_BYTE_LIMIT) {
|
||||
throw new BufferOverflowException();
|
||||
} else {
|
||||
this.writtenBytes += tmp.readableBytes();
|
||||
this.compressFrame.write(tmp.array(), 0, tmp.readableBytes());
|
||||
this.empty = false;
|
||||
}
|
||||
}
|
||||
|
||||
public int getLength() {
|
||||
return this.data.readableBytes();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return this.empty;
|
||||
}
|
||||
}
|
||||
+7
-4
@@ -21,7 +21,7 @@ import net.p455w0rd.wirelesscraftingterminal.common.container.ContainerWirelessC
|
||||
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.helpers.WirelessTerminalGuiObject;
|
||||
import net.p455w0rd.wirelesscraftingterminal.helpers.WTCGuiObject;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
@@ -43,6 +43,7 @@ import appeng.util.item.AEItemStack;
|
||||
import appeng.util.prioitylist.IPartitionList;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import it.unimi.dsi.fastutil.ints.IntObjectPair;
|
||||
|
||||
public class PacketNEIRecipe extends WCTPacket {
|
||||
|
||||
@@ -93,13 +94,15 @@ public class PacketNEIRecipe extends WCTPacket {
|
||||
IGridNode node = cct.getNetworkNode();
|
||||
|
||||
if (node == null) {
|
||||
WirelessTerminalGuiObject obj = ContainerWirelessCraftingTerminal.getGuiObject(
|
||||
RandomUtils.getWirelessTerm(player.inventory),
|
||||
IntObjectPair<ItemStack> termItem = RandomUtils.getWirelessTermWithSlot(player.inventory);
|
||||
WTCGuiObject obj = ContainerWirelessCraftingTerminal.getGuiObject(
|
||||
termItem.second(),
|
||||
player,
|
||||
player.worldObj,
|
||||
(int) player.posX,
|
||||
(int) player.posY,
|
||||
(int) player.posZ);
|
||||
(int) player.posZ,
|
||||
termItem.firstInt());
|
||||
node = obj.getActionableNode(true);
|
||||
}
|
||||
if (node != null) {
|
||||
|
||||
+4
-5
@@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-52
@@ -1,52 +0,0 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.core.sync.packets;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiWirelessCraftingTerminal;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.INetworkInfo;
|
||||
|
||||
import appeng.util.Platform;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
public class PacketSwitchGuis extends WCTPacket {
|
||||
|
||||
private final int newGui;
|
||||
|
||||
// automatic.
|
||||
public PacketSwitchGuis(final ByteBuf stream) {
|
||||
this.newGui = stream.readInt();
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketSwitchGuis(final int newGui) {
|
||||
this.newGui = newGui;
|
||||
|
||||
if (Platform.isClient()) {
|
||||
GuiWirelessCraftingTerminal.setSwitchingGuis(true);
|
||||
}
|
||||
|
||||
final ByteBuf data = Unpooled.buffer();
|
||||
|
||||
data.writeInt(this.getPacketID());
|
||||
data.writeInt(newGui);
|
||||
|
||||
this.configureWrite(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverPacketData(final INetworkInfo manager, final WCTPacket packet, final EntityPlayer player) {
|
||||
World world = player.worldObj;
|
||||
int x = (int) player.posX;
|
||||
int y = (int) player.posY;
|
||||
int z = (int) player.posZ;
|
||||
WCTGuiHandler.launchGui(newGui, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clientPacketData(final INetworkInfo network, final WCTPacket packet, final EntityPlayer player) {
|
||||
GuiWirelessCraftingTerminal.setSwitchingGuis(true);
|
||||
}
|
||||
}
|
||||
-112
@@ -1,112 +0,0 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.core.sync.packets;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.WCTPacket;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.network.INetworkInfo;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigurableObject;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.helpers.IMouseWheelItem;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
public class PacketValueConfig extends WCTPacket {
|
||||
|
||||
private final String Name;
|
||||
private final String Value;
|
||||
|
||||
// automatic.
|
||||
public PacketValueConfig(final ByteBuf stream) throws IOException {
|
||||
final DataInputStream dis = new DataInputStream(
|
||||
new ByteArrayInputStream(stream.array(), stream.readerIndex(), stream.readableBytes()));
|
||||
this.Name = dis.readUTF();
|
||||
this.Value = dis.readUTF();
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketValueConfig(final String name, final String value) throws IOException {
|
||||
this.Name = name;
|
||||
this.Value = value;
|
||||
|
||||
final ByteBuf data = Unpooled.buffer();
|
||||
|
||||
data.writeInt(this.getPacketID());
|
||||
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
final DataOutputStream dos = new DataOutputStream(bos);
|
||||
dos.writeUTF(name);
|
||||
dos.writeUTF(value);
|
||||
data.writeBytes(bos.toByteArray());
|
||||
this.configureWrite(data);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void serverPacketData(final INetworkInfo manager, final WCTPacket packet, final EntityPlayer player) {
|
||||
final Container c = player.openContainer;
|
||||
|
||||
if (this.Name.equals("Item") && RandomUtils.getWirelessTerm(player.inventory) != null
|
||||
&& RandomUtils.getWirelessTerm(player.inventory).getItem() instanceof IMouseWheelItem) {
|
||||
final ItemStack is = RandomUtils.getWirelessTerm(player.inventory);
|
||||
final IMouseWheelItem si = (IMouseWheelItem) is.getItem();
|
||||
si.onWheel(is, this.Value.equals("WheelUp"));
|
||||
} else if (c instanceof IConfigurableObject) {
|
||||
final IConfigManager cm = ((IConfigurableObject) c).getConfigManager();
|
||||
|
||||
for (final Settings e : cm.getSettings()) {
|
||||
if (e.name().equals(this.Name)) {
|
||||
final Enum<?> def = cm.getSetting(e);
|
||||
|
||||
try {
|
||||
cm.putSetting(e, Enum.valueOf(def.getClass(), this.Value));
|
||||
} catch (final IllegalArgumentException err) {
|
||||
// :P
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void clientPacketData(final INetworkInfo network, final WCTPacket packet, final EntityPlayer player) {
|
||||
final Container c = player.openContainer;
|
||||
|
||||
if (this.Name.equals("CustomName")) {
|
||||
if (c instanceof AEBaseContainer) {
|
||||
((AEBaseContainer) c).setCustomName(this.Value);
|
||||
}
|
||||
} else if (this.Name.startsWith("SyncDat.")) {
|
||||
if (c instanceof AEBaseContainer) {
|
||||
((AEBaseContainer) c).stringSync(Integer.parseInt(this.Name.substring(8)), this.Value);
|
||||
}
|
||||
} else if (c instanceof IConfigurableObject) {
|
||||
final IConfigManager cm = ((IConfigurableObject) c).getConfigManager();
|
||||
|
||||
for (final Settings e : cm.getSettings()) {
|
||||
if (e.name().equals(this.Name)) {
|
||||
final Enum<?> def = cm.getSetting(e);
|
||||
|
||||
try {
|
||||
cm.putSetting(e, Enum.valueOf(def.getClass(), this.Value));
|
||||
} catch (final IllegalArgumentException err) {
|
||||
// :P
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.helpers;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.p455w0rd.wirelesscraftingterminal.api.networking.security.WCTIActionHost;
|
||||
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.items.contents.WirelessCraftingTerminalGuiObject;
|
||||
|
||||
public class WTCGuiObject extends WirelessCraftingTerminalGuiObject implements WCTIActionHost {
|
||||
|
||||
private final int slotIndex;
|
||||
|
||||
public WTCGuiObject(IWirelessTermHandler wh, ItemStack is, EntityPlayer ep, World w, int x, int y, int z,
|
||||
final int slotIndex) {
|
||||
super(wh, is, ep, w, x, y, z);
|
||||
this.slotIndex = slotIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getActionableNode(boolean ignoreRange) {
|
||||
IGridNode node = this.getActionableNode();
|
||||
if (node != null) return node;
|
||||
if (ignoreRange && this.getGrid() != null) {
|
||||
return this.getGrid().getPivot();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventorySlot() {
|
||||
return this.slotIndex;
|
||||
}
|
||||
}
|
||||
-339
@@ -1,339 +0,0 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.helpers;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.p455w0rd.wirelesscraftingterminal.api.IWirelessCraftingTerminalItem;
|
||||
import net.p455w0rd.wirelesscraftingterminal.api.networking.security.WCTIActionHost;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.features.ILocatable;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
import appeng.api.implementations.guiobjects.IGuiItemObject;
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
import appeng.api.implementations.tiles.IWirelessAccessPoint;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.IMachineSet;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.security.IActionHost;
|
||||
import appeng.api.networking.storage.IStorageGrid;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.IMEMonitorHandlerReceiver;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.container.interfaces.IInventorySlotAware;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
|
||||
public class WirelessTerminalGuiObject
|
||||
implements IActionHost, IPortableCell, IInventorySlotAware, WCTIActionHost, IGuiItemObject {
|
||||
|
||||
private final ItemStack effectiveItem;
|
||||
private final IWirelessTermHandler wth;
|
||||
private final String encryptionKey;
|
||||
private final EntityPlayer myPlayer;
|
||||
private IGrid targetGrid;
|
||||
private IStorageGrid sg;
|
||||
private IMEMonitor<IAEItemStack> itemStorage;
|
||||
private IWirelessAccessPoint myWap;
|
||||
private double sqRange = Double.MAX_VALUE;
|
||||
private double myRange = Double.MAX_VALUE;
|
||||
private final int inventorySlot;
|
||||
|
||||
public WirelessTerminalGuiObject(final IWirelessTermHandler wh, final ItemStack is, final EntityPlayer ep,
|
||||
final World w, final int x, final int y, final int z) {
|
||||
this.encryptionKey = wh.getEncryptionKey(is);
|
||||
this.effectiveItem = is;
|
||||
this.myPlayer = ep;
|
||||
this.wth = wh;
|
||||
this.inventorySlot = x;
|
||||
ILocatable obj = null;
|
||||
try {
|
||||
final long encKey = Long.parseLong(this.encryptionKey);
|
||||
obj = AEApi.instance().registries().locatable().getLocatableBy(encKey);
|
||||
} catch (final NumberFormatException err) {
|
||||
// :P
|
||||
}
|
||||
|
||||
if (obj instanceof IGridHost) {
|
||||
final IGridNode n = ((IGridHost) obj).getGridNode(ForgeDirection.UNKNOWN);
|
||||
if (n != null) {
|
||||
this.targetGrid = n.getGrid();
|
||||
if (this.targetGrid != null) {
|
||||
this.sg = this.targetGrid.getCache(IStorageGrid.class);
|
||||
if (this.sg != null) {
|
||||
this.itemStorage = this.sg.getItemInventory();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Whether an infinity booster card is installed on the WCT.
|
||||
*/
|
||||
private boolean checkForBooster() {
|
||||
if (effectiveItem != null && effectiveItem.getItem() instanceof IWirelessCraftingTerminalItem) {
|
||||
IWirelessCraftingTerminalItem wct = (IWirelessCraftingTerminalItem) effectiveItem.getItem();
|
||||
return wct.checkForBooster(effectiveItem);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public IGrid getTargetGrid() {
|
||||
return this.targetGrid;
|
||||
}
|
||||
|
||||
public double getRange() {
|
||||
return this.myRange;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEMonitor<IAEItemStack> getItemInventory() {
|
||||
if (this.sg == null) {
|
||||
return null;
|
||||
}
|
||||
return this.sg.getItemInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEMonitor<IAEFluidStack> getFluidInventory() {
|
||||
if (this.sg == null) {
|
||||
return null;
|
||||
}
|
||||
return this.sg.getFluidInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(final IMEMonitorHandlerReceiver<IAEItemStack> l, final Object verificationToken) {
|
||||
if (this.itemStorage != null) {
|
||||
this.itemStorage.addListener(l, verificationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeListener(final IMEMonitorHandlerReceiver<IAEItemStack> l) {
|
||||
if (this.itemStorage != null) {
|
||||
this.itemStorage.removeListener(l);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public IItemList<IAEItemStack> getAvailableItems(final IItemList out, int iteration) {
|
||||
if (this.itemStorage != null) {
|
||||
return this.itemStorage.getAvailableItems(out, iteration);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList<IAEItemStack> getStorageList() {
|
||||
if (this.itemStorage != null) {
|
||||
return this.itemStorage.getStorageList();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccessRestriction getAccess() {
|
||||
if (this.itemStorage != null) {
|
||||
return this.itemStorage.getAccess();
|
||||
}
|
||||
return AccessRestriction.NO_ACCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPrioritized(final IAEItemStack input) {
|
||||
if (this.itemStorage != null) {
|
||||
return this.itemStorage.isPrioritized(input);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAccept(final IAEItemStack input) {
|
||||
if (this.itemStorage != null) {
|
||||
return this.itemStorage.canAccept(input);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority() {
|
||||
if (this.itemStorage != null) {
|
||||
return this.itemStorage.getPriority();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlot() {
|
||||
if (this.itemStorage != null) {
|
||||
return this.itemStorage.getSlot();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validForPass(final int i) {
|
||||
return this.itemStorage.validForPass(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(final IAEItemStack input, final Actionable type, final BaseActionSource src) {
|
||||
if (this.itemStorage != null) {
|
||||
return this.itemStorage.injectItems(input, type, src);
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(final IAEItemStack request, final Actionable mode, final BaseActionSource src) {
|
||||
if (this.itemStorage != null) {
|
||||
return this.itemStorage.extractItems(request, mode, src);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageChannel getChannel() {
|
||||
if (this.itemStorage != null) {
|
||||
return this.itemStorage.getChannel();
|
||||
}
|
||||
return StorageChannel.ITEMS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower(final double amt, final Actionable mode, final PowerMultiplier usePowerMultiplier) {
|
||||
if (this.wth != null && this.effectiveItem != null) {
|
||||
if (mode == Actionable.SIMULATE) {
|
||||
return this.wth.hasPower(this.myPlayer, amt, this.effectiveItem) ? amt : 0;
|
||||
}
|
||||
return this.wth.usePower(this.myPlayer, amt, this.effectiveItem) ? amt : 0;
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return this.effectiveItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConfigManager getConfigManager() {
|
||||
return this.wth.getConfigManager(this.effectiveItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getGridNode(final ForgeDirection dir) {
|
||||
return this.getActionableNode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType(final ForgeDirection dir) {
|
||||
return AECableType.NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void securityBreak() {}
|
||||
|
||||
@Override
|
||||
public IGridNode getActionableNode() {
|
||||
return getActionableNode(checkForBooster());
|
||||
}
|
||||
|
||||
public IGridNode getActionableNode(boolean ignoreRange) {
|
||||
this.rangeCheck(ignoreRange);
|
||||
if (this.myWap != null) {
|
||||
// return this.getTargetGrid().getPivot();
|
||||
return this.myWap.getActionableNode();
|
||||
} else {
|
||||
if (ignoreRange && this.getTargetGrid() != null) {
|
||||
return this.getTargetGrid().getPivot();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean rangeCheck() {
|
||||
return rangeCheck(checkForBooster());
|
||||
}
|
||||
|
||||
public boolean rangeCheck(boolean ignoreRange) {
|
||||
this.sqRange = this.myRange = Double.MAX_VALUE;
|
||||
|
||||
if (this.targetGrid != null && this.itemStorage != null) {
|
||||
if (this.myWap != null) {
|
||||
if (this.myWap.getGrid() == this.targetGrid) {
|
||||
if (this.testWap(this.myWap)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
final IMachineSet tw = this.targetGrid.getMachines(TileWireless.class);
|
||||
|
||||
this.myWap = null;
|
||||
|
||||
for (final IGridNode n : tw) {
|
||||
final IWirelessAccessPoint wap = (IWirelessAccessPoint) n.getMachine();
|
||||
if (this.testWap(wap, ignoreRange)) {
|
||||
this.myWap = wap;
|
||||
}
|
||||
}
|
||||
|
||||
return this.myWap != null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean testWap(final IWirelessAccessPoint wap) {
|
||||
return testWap(wap, checkForBooster());
|
||||
}
|
||||
|
||||
private boolean testWap(final IWirelessAccessPoint wap, boolean ignoreRange) {
|
||||
double rangeLimit = wap.getRange();
|
||||
rangeLimit *= rangeLimit;
|
||||
|
||||
final DimensionalCoord dc = wap.getLocation();
|
||||
|
||||
if (dc.getWorld() == this.myPlayer.worldObj) {
|
||||
final double offX = dc.x - this.myPlayer.posX;
|
||||
final double offY = dc.y - this.myPlayer.posY;
|
||||
final double offZ = dc.z - this.myPlayer.posZ;
|
||||
|
||||
final double r = offX * offX + offY * offY + offZ * offZ;
|
||||
if (r < rangeLimit && this.sqRange > r && !ignoreRange) {
|
||||
if (wap.isActive()) {
|
||||
this.sqRange = r;
|
||||
this.myRange = Math.sqrt(r);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (wap.isActive() && ignoreRange) {
|
||||
this.sqRange = r;
|
||||
this.myRange = Math.sqrt(r);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventorySlot() {
|
||||
return this.inventorySlot;
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -3,7 +3,6 @@ package net.p455w0rd.wirelesscraftingterminal.implementation;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.p455w0rd.wirelesscraftingterminal.api.IWCTInteractionHelper;
|
||||
import net.p455w0rd.wirelesscraftingterminal.api.IWirelessCraftingTermHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
|
||||
@@ -19,8 +18,7 @@ public class WCTInteractionHelper implements IWCTInteractionHelper {
|
||||
|
||||
@Override
|
||||
public void openWirelessCraftingTerminalGui(final EntityPlayer player) {
|
||||
if ((player == null) || (player instanceof FakePlayer)
|
||||
|| (player instanceof EntityPlayerMP)
|
||||
if (player == null || player instanceof EntityPlayerMP
|
||||
|| FMLCommonHandler.instance().getSide() == Side.SERVER) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -21,10 +21,7 @@ import net.p455w0rd.wirelesscraftingterminal.integration.IIntegrationModule;
|
||||
import net.p455w0rd.wirelesscraftingterminal.integration.IntegrationHelper;
|
||||
import net.p455w0rd.wirelesscraftingterminal.integration.abstraction.INEI;
|
||||
import net.p455w0rd.wirelesscraftingterminal.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.integration.modules.NEIHelpers.NEIGUIHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
import appeng.container.slot.SlotFakeCraftingMatrix;
|
||||
import appeng.integration.modules.NEIHelpers.NEIAEShapelessRecipeHandler;
|
||||
@@ -72,7 +69,6 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule {
|
||||
"crafting");
|
||||
API.registerRecipeHandler(new NEIAEShapedRecipeHandler());
|
||||
API.registerRecipeHandler(new NEIAEShapelessRecipeHandler());
|
||||
API.registerNEIGuiHandler(new NEIGUIHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,28 +112,6 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(final GuiContainer arg0, final int arg1, final int arg2,
|
||||
final List<String> current) {
|
||||
return current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleItemDisplayName(final GuiContainer arg0, final ItemStack arg1,
|
||||
final List<String> current) {
|
||||
return current;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleItemTooltip(final GuiContainer guiScreen, final ItemStack stack, final int mouseX,
|
||||
final int mouseY, final List<String> currentToolTip) {
|
||||
if (guiScreen instanceof GuiWirelessCraftingTerminal) {
|
||||
return ((GuiWirelessCraftingTerminal) guiScreen).handleItemTooltip(stack, mouseX, mouseY, currentToolTip);
|
||||
}
|
||||
|
||||
return currentToolTip;
|
||||
}
|
||||
|
||||
static final int NEI_REGULAR_SLOT_OFFSET_X = 25;
|
||||
static final int NEI_REGULAR_SLOT_OFFSET_Y = 6;
|
||||
|
||||
@@ -162,42 +136,6 @@ public class NEI implements INEI, IContainerTooltipHandler, IIntegrationModule {
|
||||
|
||||
public class WCTOverlayHandler implements IOverlayHandler {
|
||||
|
||||
/**
|
||||
* Reduces regular slot offsets to 0, 1, or 2
|
||||
*/
|
||||
private static final int REGULAR_SLOT_INDEX_DIVISOR = 18;
|
||||
|
||||
/**
|
||||
* Adds NEI ingredients to the WCT crafting grid.
|
||||
*
|
||||
* @param ingredient
|
||||
* @param overlayItems
|
||||
* @return
|
||||
*/
|
||||
private boolean addCraftingItems(final PositionedStack ingredient, final IAEItemStack[] overlayItems) {
|
||||
// Calculate the slot positions
|
||||
int slotX = (ingredient.relx - NEI.NEI_REGULAR_SLOT_OFFSET_X)
|
||||
/ WCTOverlayHandler.REGULAR_SLOT_INDEX_DIVISOR;
|
||||
int slotY = (ingredient.rely - NEI.NEI_REGULAR_SLOT_OFFSET_Y)
|
||||
/ WCTOverlayHandler.REGULAR_SLOT_INDEX_DIVISOR;
|
||||
// Calculate the slot index
|
||||
int slotIndex = slotX + (slotY * 3);
|
||||
// Add the item to the list
|
||||
overlayItems[slotIndex] = AEApi.instance().storage().createItemStack(ingredient.item);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean addIngredientToItems(final PositionedStack ingredient, final IAEItemStack[] overlayItems) {
|
||||
// Pass to regular handler
|
||||
return this.addCraftingItems(ingredient, overlayItems);
|
||||
}
|
||||
|
||||
protected void addItemsToGUI(final IAEItemStack[] overlayItems) {
|
||||
// Send the list to the server
|
||||
// Packet_S_WCT.sendSetCrafting_NEI(Minecraft.getMinecraft().thePlayer,
|
||||
// overlayItems);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void overlayRecipe(final GuiContainer gui, final IRecipeHandler recipe, final int recipeIndex,
|
||||
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package net.p455w0rd.wirelesscraftingterminal.integration.modules.NEIHelpers;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiWirelessCraftingTerminal;
|
||||
|
||||
import codechicken.nei.api.INEIGuiAdapter;
|
||||
|
||||
public class NEIGUIHandler extends INEIGuiAdapter {
|
||||
|
||||
protected Pattern SPECIAL_REGEX_CHARS = Pattern.compile("[{}()\\[\\].+*?^$\\\\|]");
|
||||
|
||||
@Override
|
||||
public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button) {
|
||||
if (gui instanceof GuiWirelessCraftingTerminal && draggedStack != null && draggedStack.getItem() != null) {
|
||||
GuiWirelessCraftingTerminal gmm = (GuiWirelessCraftingTerminal) gui;
|
||||
if (gmm.isOverSearchField(mousex, mousey)) {
|
||||
gmm.setSearchString(SPECIAL_REGEX_CHARS.matcher(draggedStack.getDisplayName()).replaceAll("\\\\$0"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.handleDragNDrop(gui, mousex, mousey, draggedStack, button);
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ import net.p455w0rd.wirelesscraftingterminal.core.sync.network.NetworkHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.core.sync.packets.PacketMagnetFilter;
|
||||
import net.p455w0rd.wirelesscraftingterminal.handlers.KeybindHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.handlers.LocaleHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.helpers.WirelessTerminalGuiObject;
|
||||
import net.p455w0rd.wirelesscraftingterminal.helpers.WTCGuiObject;
|
||||
import net.p455w0rd.wirelesscraftingterminal.reference.Reference;
|
||||
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
@@ -54,7 +54,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class ItemMagnet extends Item {
|
||||
|
||||
private int distanceFromPlayer;
|
||||
public WirelessTerminalGuiObject obj;
|
||||
public WTCGuiObject obj;
|
||||
public IPortableCell civ;
|
||||
public IEnergySource powerSrc;
|
||||
public IMEMonitor<IAEItemStack> monitor;
|
||||
@@ -392,7 +392,7 @@ public class ItemMagnet extends Item {
|
||||
if (player.capabilities.isCreativeMode) {
|
||||
return true;
|
||||
}
|
||||
final IGrid g = obj.getTargetGrid();
|
||||
final IGrid g = obj.getGrid();
|
||||
if (g != null) {
|
||||
if (requirePower) {
|
||||
final IEnergyGrid eg = g.getCache(IEnergyGrid.class);
|
||||
|
||||
+36
-38
@@ -14,7 +14,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.p455w0rd.wirelesscraftingterminal.api.IWirelessCraftingTerminalItem;
|
||||
import net.p455w0rd.wirelesscraftingterminal.api.WCTApi;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.WCTGuiHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.common.utils.RandomUtils;
|
||||
import net.p455w0rd.wirelesscraftingterminal.handlers.LocaleHandler;
|
||||
import net.p455w0rd.wirelesscraftingterminal.integration.EnderIO;
|
||||
@@ -25,7 +25,6 @@ import org.lwjgl.input.Keyboard;
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortDir;
|
||||
@@ -40,7 +39,6 @@ import appeng.util.IConfigManagerHost;
|
||||
import appeng.util.Platform;
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.expanded.IBaubleExpanded;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -49,14 +47,13 @@ public class ItemWirelessCraftingTerminal extends AERootPoweredItem
|
||||
implements IWirelessCraftingTerminalItem, IWirelessTermHandler, IBaubleExpanded {
|
||||
|
||||
public static final String LINK_KEY_STRING = "key";
|
||||
public static double GLOBAL_POWER_MULTIPLIER = PowerMultiplier.CONFIG.multiplier;
|
||||
private static final String POWER_NBT_KEY = "internalCurrentPower";
|
||||
private static final String BOOSTER_SLOT_NBT = "BoosterSlot";
|
||||
private static final String MAGNET_SLOT_NBT = "MagnetSlot";
|
||||
private EntityPlayer entityPlayer;
|
||||
|
||||
public ItemWirelessCraftingTerminal() {
|
||||
super(Reference.WCT_MAX_POWER, Optional.<String>absent());
|
||||
super(Reference.WCT_MAX_POWER, Optional.absent());
|
||||
setUnlocalizedName("wirelessCraftingTerminal");
|
||||
setTextureName(Reference.MODID + ":wirelessCraftingTerminal");
|
||||
setMaxStackSize(1);
|
||||
@@ -149,16 +146,16 @@ public class ItemWirelessCraftingTerminal extends AERootPoweredItem
|
||||
|
||||
@Override
|
||||
public void onUpdate(final ItemStack is, final World w, final Entity e, int i, boolean f) {
|
||||
if (!(e instanceof EntityPlayer)) {
|
||||
if (!(e instanceof EntityPlayer p)) {
|
||||
return;
|
||||
}
|
||||
EntityPlayer p = (EntityPlayer) e;
|
||||
|
||||
if (entityPlayer == null) {
|
||||
entityPlayer = p;
|
||||
}
|
||||
ItemStack wirelessTerminal = null;
|
||||
|
||||
InventoryPlayer inv = p.inventory;
|
||||
wirelessTerminal = RandomUtils.getWirelessTerm(inv);
|
||||
ItemStack wirelessTerminal = RandomUtils.getWirelessTerm(inv);
|
||||
if (wirelessTerminal == null || !(wirelessTerminal.getItem() instanceof IWirelessCraftingTerminalItem)) {
|
||||
return;
|
||||
}
|
||||
@@ -167,10 +164,16 @@ public class ItemWirelessCraftingTerminal extends AERootPoweredItem
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(final ItemStack itemStack, final World world, final EntityPlayer player) {
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
|
||||
// Open the gui
|
||||
WCTApi.instance().interact().openWirelessCraftingTerminalGui(player);
|
||||
if (!world.isRemote) {
|
||||
WCTGuiHandler.launchGui(
|
||||
Reference.GUI_WCT,
|
||||
player,
|
||||
player.worldObj,
|
||||
(int) player.posX,
|
||||
(int) player.posY,
|
||||
(int) player.posZ);
|
||||
}
|
||||
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@@ -216,14 +219,17 @@ public class ItemWirelessCraftingTerminal extends AERootPoweredItem
|
||||
return getAECurrentPower(is) >= amt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasInfinityRange(ItemStack is) {
|
||||
return this.checkForBooster(is);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConfigManager getConfigManager(final ItemStack target) {
|
||||
final ConfigManager out = new ConfigManager(new IConfigManagerHost() {
|
||||
|
||||
@Override
|
||||
public void updateSetting(final IConfigManager manager,
|
||||
@SuppressWarnings("rawtypes") final Enum settingName,
|
||||
@SuppressWarnings("rawtypes") final Enum newValue) {
|
||||
public void updateSetting(final IConfigManager manager, final Enum settingName, final Enum newValue) {
|
||||
final NBTTagCompound data = Platform.openNbtData(target);
|
||||
manager.writeToNBT(data);
|
||||
}
|
||||
@@ -237,44 +243,39 @@ public class ItemWirelessCraftingTerminal extends AERootPoweredItem
|
||||
return out;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
@Override
|
||||
public void getCheckedSubItems(Item item, CreativeTabs creativeTab, List itemList) {
|
||||
List itemList2 = itemList;
|
||||
itemList2.add(new ItemStack(item));
|
||||
itemList.add(new ItemStack(item));
|
||||
ItemStack is = new ItemStack(item);
|
||||
injectAEPower(is, Reference.WCT_MAX_POWER);
|
||||
itemList2.add(is);
|
||||
itemList.add(is);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack is) {
|
||||
double aeCurrPower = getAECurrentPower(is);
|
||||
double aeMaxPower = getAEMaxPower(is);
|
||||
if ((int) aeCurrPower >= (int) aeMaxPower) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return (int) aeCurrPower < (int) aeMaxPower;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addCheckedInformation(ItemStack is, EntityPlayer player, List list, boolean displayMore) {
|
||||
String shift = LocaleHandler.PressShift.getLocal().replace(
|
||||
"Shift",
|
||||
color("yellow") + "" + color("bold") + "" + color("italics") + "Shift" + color("gray"));
|
||||
String shift = LocaleHandler.PressShift.getLocal()
|
||||
.replace("Shift", color("yellow") + color("bold") + color("italics") + "Shift" + color("gray"));
|
||||
final NBTTagCompound tag = ensureTagCompound(is);
|
||||
|
||||
String encKey = tag.getString("key");
|
||||
String pctTxtColor = color("white") + "";
|
||||
String pctTxtColor = color("white");
|
||||
double aeCurrPower = getAECurrentPower(is);
|
||||
double aeCurrPowerPct = (int) Math.floor(aeCurrPower / Reference.WCT_MAX_POWER * 1e4) / 1e2;
|
||||
if ((int) aeCurrPowerPct >= 75) {
|
||||
pctTxtColor = color("green") + "";
|
||||
pctTxtColor = color("green");
|
||||
}
|
||||
if ((int) aeCurrPowerPct <= 5) {
|
||||
pctTxtColor = color("red") + "";
|
||||
pctTxtColor = color("red");
|
||||
}
|
||||
list.add(color("aqua") + "==============================");
|
||||
list.add(
|
||||
@@ -290,10 +291,10 @@ public class ItemWirelessCraftingTerminal extends AERootPoweredItem
|
||||
linked = color("blue") + StatCollector.translateToLocal("gui.appliedenergistics2.Linked");
|
||||
}
|
||||
list.add(LocaleHandler.LinkStatus.getLocal() + ": " + linked);
|
||||
String boosterStatus = (checkForBooster(is) ? color("green") + "" + LocaleHandler.Installed.getLocal()
|
||||
: color("red") + "" + LocaleHandler.NotInstalled.getLocal());
|
||||
String magnetStatus = (isMagnetInstalled(is) ? color("green") + "" + LocaleHandler.Installed.getLocal()
|
||||
: color("red") + "" + LocaleHandler.NotInstalled.getLocal());
|
||||
String boosterStatus = (checkForBooster(is) ? color("green") + LocaleHandler.Installed.getLocal()
|
||||
: color("red") + LocaleHandler.NotInstalled.getLocal());
|
||||
String magnetStatus = (isMagnetInstalled(is) ? color("green") + LocaleHandler.Installed.getLocal()
|
||||
: color("red") + LocaleHandler.NotInstalled.getLocal());
|
||||
if (Reference.WCT_BOOSTER_ENABLED) {
|
||||
list.add(getItemName("infinityBoosterCard") + ": " + boosterStatus);
|
||||
}
|
||||
@@ -355,10 +356,7 @@ public class ItemWirelessCraftingTerminal extends AERootPoweredItem
|
||||
}
|
||||
|
||||
private NBTTagCompound ensureTagCompound(ItemStack is) {
|
||||
if (!is.hasTagCompound()) {
|
||||
is.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
return is.getTagCompound();
|
||||
return RandomUtils.getTag(is);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,6 +45,7 @@ import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import it.unimi.dsi.fastutil.ints.IntObjectPair;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
@@ -204,7 +205,8 @@ public class CommonProxy {
|
||||
}
|
||||
}
|
||||
if (RandomUtils.getWirelessTerm(playerInv) != null) {
|
||||
ItemStack WCTStack = RandomUtils.getWirelessTerm(playerInv);
|
||||
IntObjectPair<ItemStack> termItemPair = RandomUtils.getWirelessTermWithSlot(playerInv);
|
||||
ItemStack WCTStack = termItemPair.second();
|
||||
if (RandomUtils.isMagnetInstalled(playerInv)) {
|
||||
ItemStack magnetStack = RandomUtils.getMagnet(playerInv);
|
||||
if (magnetStack.getItem() instanceof ItemMagnet) {
|
||||
@@ -216,7 +218,8 @@ public class CommonProxy {
|
||||
world,
|
||||
(int) player.posX,
|
||||
(int) player.posY,
|
||||
(int) player.posZ);
|
||||
(int) player.posZ,
|
||||
termItemPair.firstInt());
|
||||
magnet.civ = magnet.obj;
|
||||
magnet.powerSrc = magnet.civ;
|
||||
magnet.monitor = magnet.civ.getItemInventory();
|
||||
@@ -225,7 +228,7 @@ public class CommonProxy {
|
||||
|
||||
boolean ignoreRange = (magnet.isBoosterInstalled(WCTStack) && Reference.WCT_BOOSTER_ENABLED);
|
||||
boolean hasAxxess = magnet.hasNetworkAccess(SecurityPermissions.INJECT, true, player, WCTStack);
|
||||
if ((ignoreRange && hasAxxess) || (magnet.obj.rangeCheck(false) && hasAxxess)) {
|
||||
if ((ignoreRange && hasAxxess) || (magnet.obj.rangeCheck() && hasAxxess)) {
|
||||
if (magnet.isActivated(magnetStack)) {
|
||||
List<ItemStack> filteredList = magnet.getFilteredItems(magnetStack);
|
||||
IAEItemStack ais = AEApi.instance().storage().createItemStack(stack);
|
||||
|
||||
@@ -23,8 +23,5 @@ public class Reference {
|
||||
|
||||
// Gui IDs
|
||||
public static final int GUI_WCT = 0;
|
||||
public static final int GUI_CRAFTING_STATUS = 1;
|
||||
public static final int GUI_CRAFT_AMOUNT = 2;
|
||||
public static final int GUI_CRAFT_CONFIRM = 3;
|
||||
public static final int GUI_MAGNET = 4;
|
||||
}
|
||||
@@ -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
|
||||
Reference in new issue
Block a user