mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-23 05:19:49 +00:00
Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88875ab99b | ||
|
|
e311705327 | ||
|
|
086e46dc46 | ||
|
|
6da8cdf831 | ||
|
|
7def78aa90 | ||
|
|
ccd3a5da98 | ||
|
|
ceee7ad85f | ||
|
|
b576e4b178 | ||
|
|
c1c1aef1f5 |
No files matched your search
+1
-1
@@ -34,7 +34,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7'
|
||||
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.11'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,10 @@ import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.network.CPacketInventoryAction;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
@@ -52,8 +54,6 @@ import org.lwjgl.input.Mouse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.glodblock.github.common.item.ItemFluidDrop.newStack1;
|
||||
|
||||
public class GuiFCBaseFluidMonitor extends AEBaseMEGui implements ISortSource, IConfigManagerHost {
|
||||
|
||||
public static int craftingGridOffsetX;
|
||||
@@ -105,7 +105,7 @@ public class GuiFCBaseFluidMonitor extends AEBaseMEGui implements ISortSource, I
|
||||
|
||||
public void postUpdate(final List<IAEFluidStack> list) {
|
||||
for (final IAEFluidStack is : list) {
|
||||
IAEItemStack stack = AEItemStack.create(newStack1(is.getFluidStack()));
|
||||
IAEItemStack stack = AEItemStack.create(ItemFluidDrop.newDisplayStack(is.getFluidStack()));
|
||||
stack.setStackSize(is.getStackSize());
|
||||
this.repo.postUpdate(stack);
|
||||
}
|
||||
@@ -302,7 +302,7 @@ public class GuiFCBaseFluidMonitor extends AEBaseMEGui implements ISortSource, I
|
||||
|
||||
@Override
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.fontRendererObj.drawString(this.getGuiDisplayName(GuiText.Terminal.getLocal()), 8, 6, 4210752);
|
||||
this.fontRendererObj.drawString(this.getGuiDisplayName(I18n.format(NameConst.GUI_FLUID_TERMINAL)), 8, 6, 4210752);
|
||||
this.fontRendererObj.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
}
|
||||
|
||||
|
||||
+16
@@ -7,6 +7,7 @@ import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.container.slot.SlotFakeCraftingMatrix;
|
||||
import appeng.container.slot.SlotPatternOutputs;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.items.misc.ItemEncodedPattern;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidEncodedPattern;
|
||||
@@ -15,6 +16,7 @@ import com.glodblock.github.inventory.PatternConsumer;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.FluidPatternDetails;
|
||||
import com.glodblock.github.util.Util;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
@@ -197,4 +199,18 @@ public class ContainerFluidPatternTerminal extends FCBasePartContainer implement
|
||||
super.doAction(player, action, slotId, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p, int idx) {
|
||||
Slot clickSlot = (Slot) this.inventorySlots.get(idx);
|
||||
ItemStack is = clickSlot.getStack();
|
||||
if (is != null && !patternSlotOUT.getHasStack() && is.stackSize == 1 && (is.getItem() instanceof ItemFluidEncodedPattern || is.getItem() instanceof ItemEncodedPattern)) {
|
||||
ItemStack output = is.copy();
|
||||
patternSlotOUT.putStack(output);
|
||||
p.inventory.setInventorySlotContents(clickSlot.getSlotIndex(), null);
|
||||
this.detectAndSendChanges();
|
||||
return null;
|
||||
} else {
|
||||
return super.transferStackInSlot(p, idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
@@ -6,6 +6,7 @@ import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.container.slot.OptionalSlotFake;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.items.misc.ItemEncodedPattern;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidEncodedPattern;
|
||||
@@ -14,6 +15,7 @@ import com.glodblock.github.inventory.PatternConsumer;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.FluidPatternDetails;
|
||||
import com.glodblock.github.util.Util;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
@@ -195,4 +197,18 @@ public class ContainerFluidPatternTerminalEx extends FCBasePartContainerEx imple
|
||||
super.doAction(player, action, slotId, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p, int idx) {
|
||||
Slot clickSlot = (Slot) this.inventorySlots.get(idx);
|
||||
ItemStack is = clickSlot.getStack();
|
||||
if (is != null && !patternSlotOUT.getHasStack() && is.stackSize == 1 && (is.getItem() instanceof ItemFluidEncodedPattern || is.getItem() instanceof ItemEncodedPattern)) {
|
||||
ItemStack output = is.copy();
|
||||
patternSlotOUT.putStack(output);
|
||||
p.inventory.setInventorySlotContents(clickSlot.getSlotIndex(), null);
|
||||
this.detectAndSendChanges();
|
||||
return null;
|
||||
} else {
|
||||
return super.transferStackInSlot(p, idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,15 +89,12 @@ public class FluidRepo extends ItemRepo {
|
||||
}
|
||||
|
||||
public void postUpdate(final IAEItemStack is) {
|
||||
IAEFluidStack fluid = ItemFluidDrop.getAeFluidStack(is);
|
||||
IAEItemStack i = AEItemStack.create(is.getItemStack().setStackDisplayName(fluid.getFluid().getLocalizedName()));
|
||||
i.setStackSize(is.getStackSize());
|
||||
final IAEItemStack st = this.list.findPrecise(i);
|
||||
final IAEItemStack st = this.list.findPrecise(is);
|
||||
if (st != null) {
|
||||
st.reset();
|
||||
st.add(i);
|
||||
st.add(is);
|
||||
} else {
|
||||
this.list.add(i);
|
||||
this.list.add(is);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ public class ItemFluidDrop extends Item {
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
FluidStack fluid = getFluidStack(stack);
|
||||
if (ItemFluidPacket.isDisplay(stack)) {
|
||||
return fluid != null ? fluid.getLocalizedName() : StatCollector.translateToLocalFormatted("error.unknown");
|
||||
}
|
||||
return StatCollector.translateToLocalFormatted("item.fluid_drop.name", fluid == null ? "???" : fluid.getLocalizedName());
|
||||
}
|
||||
|
||||
@@ -54,6 +57,7 @@ public class ItemFluidDrop extends Item {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean flag) {
|
||||
FluidStack fluid = getFluidStack(stack);
|
||||
if (ItemFluidPacket.isDisplay(stack)) return;
|
||||
if (fluid != null) {
|
||||
tooltip.add(String.format(EnumChatFormatting.GRAY + "%s, 1 mB", fluid.getLocalizedName()));
|
||||
} else {
|
||||
@@ -79,13 +83,14 @@ public class ItemFluidDrop extends Item {
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static ItemStack newStack1(FluidStack fluid) {
|
||||
public static ItemStack newDisplayStack(FluidStack fluid) {
|
||||
if (fluid == null) {
|
||||
return null;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ItemAndBlockHolder.DROP, fluid.amount);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("Fluid", fluid.getFluid().getName());
|
||||
tag.setBoolean("DisplayOnly", true);
|
||||
stack.setTagCompound(tag);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ import java.util.Objects;
|
||||
|
||||
public class PartFluidTerminal extends FCBasePart {
|
||||
private static final FCPartsTexture FRONT_BRIGHT_ICON = FCPartsTexture.PartFluidTerminal_Bright;
|
||||
private static final FCPartsTexture FRONT_DARK_ICON = FCPartsTexture.PartFluidTerminal_Dark;
|
||||
private static final FCPartsTexture FRONT_COLORED_ICON = FCPartsTexture.PartFluidTerminal_Colored;
|
||||
private static final FCPartsTexture FRONT_DARK_ICON = FCPartsTexture.PartFluidTerminal_Colored;
|
||||
private static final FCPartsTexture FRONT_COLORED_ICON = FCPartsTexture.PartFluidTerminal_Dark;
|
||||
|
||||
public PartFluidTerminal(ItemStack is) {
|
||||
super(is, true);
|
||||
|
||||
@@ -201,7 +201,10 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
|
||||
}
|
||||
if (p2p == invFluidsP2P || p2p == null)
|
||||
continue;
|
||||
tankInfos.add(Ae2Reflect.getP2PLiquidTarget(p2p).getTankInfo(p2p.getSide().getOpposite()));
|
||||
IFluidHandler target = Ae2Reflect.getP2PLiquidTarget(p2p);
|
||||
if (target == null)
|
||||
continue;
|
||||
tankInfos.add(target.getTankInfo(p2p.getSide().getOpposite()));
|
||||
}
|
||||
} catch (GridAccessException e) {
|
||||
// ignore
|
||||
|
||||
@@ -70,7 +70,22 @@ public class RecipeLoader implements Runnable {
|
||||
};
|
||||
|
||||
for (ItemBasicFluidStorageCell cell : cells) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(cell, "GDG", "DCD", "III", 'D', "dustRedstone", 'G', AE2_QUARTZ_GLASS, 'C', cell.getComponent(), 'I', "ingotIron"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(cell, "hCW", "SKS", "WAs",
|
||||
'h', "craftingToolHardHammer",
|
||||
'C', "plateCertusQuartz",
|
||||
'W', "screwCertusQuartz",
|
||||
'S', "plateStainlessSteel",
|
||||
'K', cell.getComponent(),
|
||||
'A', "plateAluminium",
|
||||
's', "craftingToolScrewdriver"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(cell, "sCW", "SKS", "WAh",
|
||||
'h', "craftingToolHardHammer",
|
||||
'C', "plateCertusQuartz",
|
||||
'W', "screwCertusQuartz",
|
||||
'S', "plateStainlessSteel",
|
||||
'K', cell.getComponent(),
|
||||
'A', "plateAluminium",
|
||||
's', "craftingToolScrewdriver"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(cell, AE2_CELL_HOUSING, cell.getComponent()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
public final class Util {
|
||||
|
||||
public static EnumFacing from(ForgeDirection direction) {
|
||||
|
||||
@@ -5,3 +5,5 @@ public net.minecraft.client.gui.inventory.GuiContainer field_147003_i # guiLeft
|
||||
public net.minecraft.client.gui.inventory.GuiContainer field_147009_r # guiTop
|
||||
#Pattern Value Setting
|
||||
public net.minecraft.client.gui.inventory.GuiContainer field_147006_u #theSlot
|
||||
|
||||
public net.minecraft.client.renderer.texture.TextureMap field_110574_e # mapRegisteredSprites
|
||||
@@ -64,4 +64,8 @@ ae2fc.gui.oc_pattern_editor=OC Pattern Editor
|
||||
ae2fc.gui.button.set=Set
|
||||
ae2fc.gui.part_fluid_import=ME Fluid Import Bus
|
||||
ae2fc.gui.part_fluid_export=ME Fluid Export Bus
|
||||
ae2fc.gui.part_fluid_terminal=Fluid Terminal
|
||||
|
||||
error.unknown=Unknown
|
||||
|
||||
itemGroup.ae2fc=Fluid Craft For AE2
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 244 B |
Reference in new issue
Block a user