fix craftables not working when wireless terminal not being held
remove wrong imports add missing lang entries
This commit is contained in:
@@ -9,10 +9,10 @@ import static appeng.client.ClientHelper.KEY_CATEGORY;
|
||||
|
||||
|
||||
public enum KeyBindings {
|
||||
WT(new KeyBinding("open_wireless_terminal", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_T, KEY_CATEGORY)),
|
||||
WCT(new KeyBinding("open_wireless_crafting_terminal", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_E, KEY_CATEGORY)),
|
||||
WPT(new KeyBinding("open_wireless_pattern_terminal", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_R, KEY_CATEGORY)),
|
||||
WFT(new KeyBinding("open_wireless_fluid_terminal", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_F, KEY_CATEGORY));
|
||||
WT(new KeyBinding("key.open_wireless_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_T, KEY_CATEGORY)),
|
||||
WCT(new KeyBinding("key.open_wireless_crafting_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_E, KEY_CATEGORY)),
|
||||
WPT(new KeyBinding("key.open_wireless_pattern_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_R, KEY_CATEGORY)),
|
||||
WFT(new KeyBinding("key.open_wireless_fluid_terminal.desc", KeyConflictContext.UNIVERSAL, KeyModifier.SHIFT, Keyboard.KEY_F, KEY_CATEGORY));
|
||||
|
||||
private KeyBinding keyBinding;
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import appeng.fluids.items.FluidDummyItem;
|
||||
import appeng.fluids.util.AEFluidStack;
|
||||
import appeng.util.ReadableNumberConverter;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import li.cil.repack.org.luaj.vm2.ast.Str;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
|
||||
@@ -232,24 +232,14 @@ public enum GuiBridge implements IGuiHandler {
|
||||
public Object getServerGuiElement(final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z) {
|
||||
final AEPartLocation side = AEPartLocation.fromOrdinal(ordinal & 0x07);
|
||||
final GuiBridge ID = values()[ordinal >> 4];
|
||||
final boolean stem = ((ordinal >> 3) & 1) == 1;
|
||||
if (ID.type.isItem()) {
|
||||
ItemStack it = ItemStack.EMPTY;
|
||||
if (y == 0) {
|
||||
if (stem) {
|
||||
it = player.inventory.getCurrentItem();
|
||||
} else if (x >= 0 && x < player.inventory.mainInventory.size()) {
|
||||
if (x >= 0 && x < player.inventory.mainInventory.size()) {
|
||||
it = player.inventory.getStackInSlot(x);
|
||||
}
|
||||
} else if (y == 1 && z == Integer.MIN_VALUE) {
|
||||
if (stem) {
|
||||
if (player.openContainer instanceof IInventorySlotAware) {
|
||||
int slot = ((IInventorySlotAware) player.openContainer).getInventorySlot();
|
||||
it = BaublesApi.getBaublesHandler(player).getStackInSlot(slot);
|
||||
}
|
||||
} else {
|
||||
it = BaublesApi.getBaublesHandler(player).getStackInSlot(x);
|
||||
}
|
||||
it = BaublesApi.getBaublesHandler(player).getStackInSlot(x);
|
||||
}
|
||||
final Object myItem = this.getGuiObject(it, player, w, x, y, z);
|
||||
if (myItem != null && ID.CorrectTileOrPart(myItem)) {
|
||||
@@ -354,24 +344,15 @@ public enum GuiBridge implements IGuiHandler {
|
||||
public Object getClientGuiElement(final int ordinal, final EntityPlayer player, final World w, final int x, final int y, final int z) {
|
||||
final AEPartLocation side = AEPartLocation.fromOrdinal(ordinal & 0x07);
|
||||
final GuiBridge ID = values()[ordinal >> 4];
|
||||
final boolean stem = ((ordinal >> 3) & 1) == 1;
|
||||
if (ID.type.isItem()) {
|
||||
ItemStack it = ItemStack.EMPTY;
|
||||
if (y == 0) {
|
||||
if (stem) {
|
||||
it = player.inventory.getCurrentItem();
|
||||
} else if (x >= 0 && x < player.inventory.mainInventory.size()) {
|
||||
if (x >= 0 && x < player.inventory.mainInventory.size()) {
|
||||
it = player.inventory.getStackInSlot(x);
|
||||
}
|
||||
} else if (y == 1 && z == Integer.MIN_VALUE) {
|
||||
if (stem) {
|
||||
if (player.openContainer instanceof IInventorySlotAware) {
|
||||
int slot = ((IInventorySlotAware) player.openContainer).getInventorySlot();
|
||||
it = BaublesApi.getBaublesHandler(player).getStackInSlot(slot);
|
||||
}
|
||||
} else {
|
||||
it = BaublesApi.getBaublesHandler(player).getStackInSlot(x);
|
||||
}
|
||||
}
|
||||
if (y == 1 && z == Integer.MIN_VALUE) {
|
||||
it = BaublesApi.getBaublesHandler(player).getStackInSlot(x);
|
||||
}
|
||||
final Object myItem = this.getGuiObject(it, player, w, x, y, z);
|
||||
if (myItem != null && ID.CorrectTileOrPart(myItem)) {
|
||||
|
||||
@@ -331,13 +331,20 @@ public class Platform {
|
||||
x = tile.getPos().getX();
|
||||
y = tile.getPos().getY();
|
||||
z = tile.getPos().getZ();
|
||||
} else {
|
||||
if (p.openContainer instanceof IInventorySlotAware) {
|
||||
x = ((IInventorySlotAware) p.openContainer).getInventorySlot();
|
||||
y = ((IInventorySlotAware) p.openContainer).isBaubleSlot() ? 1 : 0;
|
||||
} else {
|
||||
x = p.inventory.currentItem;
|
||||
}
|
||||
}
|
||||
|
||||
if ((type.getType().isItem() && tile == null) || type.hasPermissions(tile, x, y, z, side, p)) {
|
||||
if (tile == null && type.getType() == GuiHostType.ITEM) {
|
||||
p.openGui(AppEng.instance(), type.ordinal() << 4, p.getEntityWorld(), p.inventory.currentItem, 0, 0);
|
||||
p.openGui(AppEng.instance(), type.ordinal() << 4, p.getEntityWorld(), x, 0, 0);
|
||||
} else if (tile == null || type.getType() == GuiHostType.ITEM) {
|
||||
p.openGui(AppEng.instance(), type.ordinal() << 4 | (1 << 3), p.getEntityWorld(), x, y, z);
|
||||
p.openGui(AppEng.instance(), type.ordinal() << 4, p.getEntityWorld(), x, y, z);
|
||||
} else {
|
||||
p.openGui(AppEng.instance(), type.ordinal() << 4 | (side.ordinal()), tile.getWorld(), x, y, z);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user