mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-15 17:44:46 +00:00
refactor 2
This commit is contained in:
1 parent
a70ace4742
commit
018d488bee
27 files changed
+829
-1780
No files matched your search
@@ -1,56 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@ package com.glodblock.github.inventory;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
|
||||
public interface PatternConsumer {
|
||||
public interface IPatternConsumer {
|
||||
|
||||
void acceptPattern(IAEItemStack[] inputs, IAEItemStack[] outputs);
|
||||
}
|
||||
@@ -8,10 +8,10 @@ import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.helpers.IPriorityHost;
|
||||
import com.glodblock.github.client.gui.*;
|
||||
import com.glodblock.github.client.gui.container.*;
|
||||
import com.glodblock.github.common.parts.FCBasePart;
|
||||
import com.glodblock.github.common.parts.PartFluidInterface;
|
||||
import com.glodblock.github.common.parts.PartFluidStorageBus;
|
||||
import com.glodblock.github.common.parts.PartSharedFluidBus;
|
||||
import com.glodblock.github.common.parts.base.FCPart;
|
||||
import com.glodblock.github.common.parts.base.FCSharedFluidBus;
|
||||
import com.glodblock.github.common.tile.*;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.util.List;
|
||||
@@ -126,14 +126,14 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_BUS_IO(new PartGuiFactory<PartSharedFluidBus>(PartSharedFluidBus.class) {
|
||||
FLUID_BUS_IO(new PartGuiFactory<FCSharedFluidBus>(FCSharedFluidBus.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, PartSharedFluidBus inv) {
|
||||
protected Object createServerGui(EntityPlayer player, FCSharedFluidBus inv) {
|
||||
return new ContainerFluidIO(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, PartSharedFluidBus inv) {
|
||||
protected Object createClientGui(EntityPlayer player, FCSharedFluidBus inv) {
|
||||
return new GuiFluidIO(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
@@ -174,14 +174,14 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_PAT_TERM_CRAFTING_STATUS(new PartGuiFactory<FCBasePart>(FCBasePart.class) {
|
||||
FLUID_PAT_TERM_CRAFTING_STATUS(new PartGuiFactory<FCPart>(FCPart.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, FCBasePart inv) {
|
||||
protected Object createServerGui(EntityPlayer player, FCPart inv) {
|
||||
return new ContainerCraftingStatus(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, FCBasePart inv) {
|
||||
protected Object createClientGui(EntityPlayer player, FCPart inv) {
|
||||
return new GuiFluidPatternTerminalCraftingStatus(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
@@ -234,26 +234,26 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_CRAFTING_CONFIRM(new PartGuiFactory<FCBasePart>(FCBasePart.class) {
|
||||
FLUID_CRAFTING_CONFIRM(new PartGuiFactory<FCPart>(FCPart.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, FCBasePart inv) {
|
||||
protected Object createServerGui(EntityPlayer player, FCPart inv) {
|
||||
return new ContainerFluidCraftConfirm(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, FCBasePart inv) {
|
||||
protected Object createClientGui(EntityPlayer player, FCPart inv) {
|
||||
return new GuiFluidCraftConfirm(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_CRAFTING_AMOUNT(new PartGuiFactory<FCBasePart>(FCBasePart.class) {
|
||||
FLUID_CRAFTING_AMOUNT(new PartGuiFactory<FCPart>(FCPart.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, FCBasePart inv) {
|
||||
protected Object createServerGui(EntityPlayer player, FCPart inv) {
|
||||
return new ContainerCraftAmount(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, FCBasePart inv) {
|
||||
protected Object createClientGui(EntityPlayer player, FCPart inv) {
|
||||
return new GuiFluidCraftAmount(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
@@ -270,14 +270,14 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
PATTERN_VALUE_SET(new PartGuiFactory<FCBasePart>(FCBasePart.class) {
|
||||
PATTERN_VALUE_SET(new PartGuiFactory<FCPart>(FCPart.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, FCBasePart inv) {
|
||||
protected Object createServerGui(EntityPlayer player, FCPart inv) {
|
||||
return new ContainerPatternValueAmount(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, FCBasePart inv) {
|
||||
protected Object createClientGui(EntityPlayer player, FCPart inv) {
|
||||
return new GuiPatternValueAmount(player.inventory, inv);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user