mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 15:57:55 +00:00
Merge branch 'bookmark'
This commit is contained in:
commit
2a249bf5a4
4 files changed
+22
-68
No files matched your search
@@ -8,6 +8,7 @@ import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.integration.modules.NEI;
|
||||
import appeng.util.Platform;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidCraftConfirm;
|
||||
@@ -483,6 +484,7 @@ public class GuiFluidCraftConfirm extends AEBaseGui {
|
||||
}
|
||||
|
||||
if (btn == this.cancel) {
|
||||
this.addMissingItemsToBookMark();
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketSwitchGuis(this.OriginalGui));
|
||||
}
|
||||
|
||||
@@ -509,4 +511,24 @@ public class GuiFluidCraftConfirm extends AEBaseGui {
|
||||
public ItemStack getHoveredStack() {
|
||||
return hoveredStack;
|
||||
}
|
||||
|
||||
protected void addMissingItemsToBookMark() {
|
||||
if (!this.missing.isEmpty() && isShiftKeyDown()) {
|
||||
for (IAEItemStack iaeItemStack : this.missing) {
|
||||
NEI.instance.addItemToBookMark(iaeItemStack.getItemStack());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IItemList<IAEItemStack> getStorage() {
|
||||
return this.storage;
|
||||
}
|
||||
|
||||
public IItemList<IAEItemStack> getPending() {
|
||||
return this.pending;
|
||||
}
|
||||
|
||||
public IItemList<IAEItemStack> getMissing() {
|
||||
return this.missing;
|
||||
}
|
||||
}
|
||||
@@ -32,9 +32,6 @@ public class FCClassTransformer implements IClassTransformer {
|
||||
case "appeng.integration.modules.NEI":
|
||||
tform = NEITransfermer.INSTANCE;
|
||||
break;
|
||||
case "appeng.tile.storage.TileIOPort":
|
||||
tform = TitleIOPortTransformer.INSTANCE;
|
||||
break;
|
||||
case "appeng.core.features.registries.ExternalStorageRegistry":
|
||||
tform = ExternalStorageRegistryTransformer.INSTANCE;
|
||||
break;
|
||||
|
||||
@@ -7,7 +7,6 @@ import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.IMachineSet;
|
||||
import appeng.api.networking.storage.IStorageGrid;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.crafting.MECraftingInventory;
|
||||
@@ -20,7 +19,6 @@ import com.glodblock.github.client.gui.GuiFluidCraftConfirm;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.common.parts.PartFluidInterface;
|
||||
import com.glodblock.github.common.storage.FluidCellInventory;
|
||||
import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
import com.glodblock.github.inventory.FluidConvertingInventoryAdaptor;
|
||||
import com.glodblock.github.inventory.FluidConvertingInventoryCrafting;
|
||||
@@ -185,10 +183,4 @@ public class CoreModHooks {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static long IOPortMinSpeed(long possible, long itemsToMove, final StorageChannel chan) {
|
||||
return chan == StorageChannel.FLUIDS
|
||||
? Math.min(possible, itemsToMove * FluidCellInventory.singleByteAmount)
|
||||
: Math.min(possible, itemsToMove);
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.glodblock.github.coremod.transform;
|
||||
|
||||
import com.glodblock.github.coremod.FCClassTransformer;
|
||||
import org.objectweb.asm.ClassVisitor;
|
||||
import org.objectweb.asm.MethodVisitor;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
public class TitleIOPortTransformer extends FCClassTransformer.ClassMapper {
|
||||
public static final TitleIOPortTransformer INSTANCE = new TitleIOPortTransformer();
|
||||
|
||||
private TitleIOPortTransformer() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassVisitor getClassMapper(ClassVisitor downstream) {
|
||||
return new TitleIOPortTransformer.TransformTitleIOPort(Opcodes.ASM5, downstream);
|
||||
}
|
||||
|
||||
private static class TransformTitleIOPort extends ClassVisitor {
|
||||
|
||||
TransformTitleIOPort(int api, ClassVisitor cv) {
|
||||
super(api, cv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
|
||||
if (name.equals("transferContents")) {
|
||||
return new TitleIOPortTransformer.TransformTransferContents(
|
||||
api, super.visitMethod(access, name, desc, signature, exceptions));
|
||||
}
|
||||
return super.visitMethod(access, name, desc, signature, exceptions);
|
||||
}
|
||||
}
|
||||
|
||||
private static class TransformTransferContents extends MethodVisitor {
|
||||
|
||||
TransformTransferContents(int api, MethodVisitor mv) {
|
||||
super(api, mv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
|
||||
if (opcode == Opcodes.INVOKESTATIC && owner.equals("java/lang/Math") && name.equals("min")) {
|
||||
super.visitVarInsn(Opcodes.ALOAD, 6);
|
||||
super.visitMethodInsn(
|
||||
Opcodes.INVOKESTATIC,
|
||||
"com/glodblock/github/coremod/hooker/CoreModHooks",
|
||||
"IOPortMinSpeed",
|
||||
"(JJLappeng/api/storage/StorageChannel;)J",
|
||||
false);
|
||||
} else {
|
||||
super.visitMethodInsn(opcode, owner, name, desc, itf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user