mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 18:44:42 +00:00
Allows the use of the middle mouse button to modify the number of items in the pattern.
This commit is contained in:
1 parent
1998750489
commit
dbbaea9235
33 files changed
+539
-38
No files matched your search
@@ -5,8 +5,6 @@ import appeng.core.AELog;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import com.glodblock.github.util.Util;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
@@ -14,8 +12,6 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class AEFluidInventory implements IAEFluidTank
|
||||
{
|
||||
private final IAEFluidStack[] fluids;
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.glodblock.github.inventory;
|
||||
|
||||
import appeng.core.AELog;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.IAEAppEngInventory;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
/**
|
||||
* Since there is no ae2 available now for compiling, we copied it over, and it will need to be removed in the future.
|
||||
*/
|
||||
@Deprecated
|
||||
public class BiggerAppEngInventory extends AppEngInternalInventory {
|
||||
|
||||
private final ItemStack[] inv;
|
||||
|
||||
public BiggerAppEngInventory(IAEAppEngInventory inventory, int size) {
|
||||
super(inventory, size);
|
||||
inv = ObfuscationReflectionHelper.getPrivateValue(AppEngInternalInventory.class, this, "inv");
|
||||
}
|
||||
|
||||
protected void writeToNBT(final NBTTagCompound target) {
|
||||
for (int x = 0; x < this.getSizeInventory(); x++) {
|
||||
try {
|
||||
final NBTTagCompound c = new NBTTagCompound();
|
||||
|
||||
if (this.inv[x] != null) {
|
||||
this.inv[x].writeToNBT(c);
|
||||
c.setInteger("Count", this.inv[x].stackSize);
|
||||
}
|
||||
|
||||
target.setTag("#" + x, c);
|
||||
} catch (final Exception ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void readFromNBT(final NBTTagCompound target) {
|
||||
for (int x = 0; x < this.getSizeInventory(); x++) {
|
||||
try {
|
||||
final NBTTagCompound c = target.getCompoundTag("#" + x);
|
||||
|
||||
if (c != null) {
|
||||
ItemStack stack = ItemStack.loadItemStackFromNBT(c);
|
||||
if (stack != null) {
|
||||
stack.stackSize = c.getInteger("Count");
|
||||
}
|
||||
this.inv[x] = stack;
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
AELog.debug(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import com.glodblock.github.common.parts.PartFluidInterface;
|
||||
import com.glodblock.github.common.tile.TileFluidInterface;
|
||||
import com.glodblock.github.util.Ae2Reflect;
|
||||
import com.glodblock.github.util.Util;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
@@ -222,6 +222,18 @@ public enum GuiType {
|
||||
protected Object createClientGui(EntityPlayer player, TileFluidPacketDecoder inv) {
|
||||
return new GuiFluidPacketDecoder(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
|
||||
PATTERN_VALUE_SET(new PartGuiFactory<FCBasePart>(FCBasePart.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, FCBasePart inv) {
|
||||
return new ContainerPatternValueAmount(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, FCBasePart inv) {
|
||||
return new GuiPatternValueAmount(player.inventory, inv);
|
||||
}
|
||||
});
|
||||
|
||||
public static final List<GuiType> VALUES = ImmutableList.copyOf(values());
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.glodblock.github.inventory.gui;
|
||||
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
Reference in new issue
Block a user