mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 01:54:59 +00:00
6 files changed
+52
-16
No files matched your search
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
dependencies {
|
||||
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.10-GTNH:dev')
|
||||
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-133-GTNH:dev')
|
||||
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-137-GTNH:dev')
|
||||
compile('curse.maven:cofh-core-69162:2388751')
|
||||
compile('com.github.GTNewHorizons:waila:1.5.22:dev')
|
||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.25:dev') { transitive = false }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.ITooltip;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
@@ -55,6 +56,27 @@ public class FCGuiTextField extends GuiTextField {
|
||||
}
|
||||
}
|
||||
|
||||
public void handleTooltip(int mouseX, int mouseY, AEBaseGui gui) {
|
||||
this.handleTooltip(mouseX, mouseY, gui, 0);
|
||||
}
|
||||
|
||||
public void handleTooltip(int mouseX, int mouseY, AEBaseGui gui, int offsetY) {
|
||||
if (isMouseIn(mouseX, mouseY) && this.tooltip != null && !"".equals(this.tooltip)) {
|
||||
int length = 0;
|
||||
for (String s : this.getMessage().split("\n")) {
|
||||
length = Math.max(this._fontRender.getStringWidth(s), length);
|
||||
}
|
||||
if (mouseY < 15) {
|
||||
mouseY = 15;
|
||||
}
|
||||
if (mouseX + length + 20 >= gui.width) {
|
||||
gui.drawTooltip(mouseX - length - 20, mouseY + 4 + offsetY, 0, this.getMessage());
|
||||
} else {
|
||||
gui.drawTooltip(mouseX, mouseY + 4 + offsetY, 0, this.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getBorder() {
|
||||
return this._border;
|
||||
}
|
||||
|
||||
@@ -106,9 +106,9 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
public void drawScreen(final int mouseX, final int mouseY, final float btn) {
|
||||
super.drawScreen(mouseX, mouseY, btn);
|
||||
for (Component com : this.component) {
|
||||
handleTooltip(mouseX, mouseY, com.getQty().textField.new TooltipProvider());
|
||||
handleTooltip(mouseX, mouseY, com.getBatch().textField.new TooltipProvider());
|
||||
handleTooltip(mouseX, mouseY, com.getLine().new TooltipProvider());
|
||||
com.getQty().textField.handleTooltip(mouseX, mouseY, this);
|
||||
com.getBatch().textField.handleTooltip(mouseX, mouseY, this);
|
||||
com.getLine().handleTooltip(mouseX, mouseY, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_LINK));
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_LINK_DESC) + "\n");
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT));
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT_DESC) + "\n");
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT_DESC));
|
||||
} else {
|
||||
message.add(NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE));
|
||||
}
|
||||
|
||||
+6
-8
@@ -342,7 +342,7 @@ public class FCBaseFluidMonitorContain extends AEBaseContainer
|
||||
}
|
||||
|
||||
private void dropItem(ItemStack is) {
|
||||
if (is.stackSize <= 0) return;
|
||||
if (is == null || is.stackSize <= 0) return;
|
||||
ItemStack itemStack = is.copy();
|
||||
int i = itemStack.getMaxStackSize();
|
||||
while (itemStack.stackSize > 0) {
|
||||
@@ -363,7 +363,7 @@ public class FCBaseFluidMonitorContain extends AEBaseContainer
|
||||
}
|
||||
|
||||
private void dropItem(ItemStack itemStack, int stackSize) {
|
||||
if (itemStack.stackSize <= 0) return;
|
||||
if (itemStack == null || itemStack.stackSize <= 0) return;
|
||||
ItemStack is = itemStack.copy();
|
||||
is.stackSize = stackSize;
|
||||
this.dropItem(is);
|
||||
@@ -392,12 +392,10 @@ public class FCBaseFluidMonitorContain extends AEBaseContainer
|
||||
if (fillStack.right.getItem() instanceof IFluidContainerItem) {
|
||||
this.host.getFluidInventory().extractItems(toExtract, Actionable.MODULATE, this.getActionSource());
|
||||
if ((int) (tmp.getStackSize() % fillStack.left) > 0) {
|
||||
((IFluidContainerItem) fillStack.right.getItem())
|
||||
.drain(
|
||||
fillStack.right,
|
||||
fillStack.left - (int) (tmp.getStackSize() % fillStack.left),
|
||||
true);
|
||||
this.dropItem(fillStack.right, 1);
|
||||
this.dropItem(
|
||||
Util.FluidUtil.setFluidContainerAmount(
|
||||
fillStack.right, (int) (tmp.getStackSize() % fillStack.left)),
|
||||
1);
|
||||
out.stackSize++;
|
||||
}
|
||||
} else if (FluidContainerRegistry.isContainer(fillStack.right)) {
|
||||
|
||||
@@ -279,6 +279,22 @@ public final class Util {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ItemStack setFluidContainerAmount(ItemStack itemStack, int amount) {
|
||||
FluidStack fs = getFluidFromContainer(itemStack);
|
||||
if (fs == null) return null;
|
||||
fs.amount = amount;
|
||||
ItemStack is = itemStack.copy();
|
||||
is.stackSize = 1;
|
||||
ItemStack emptyContainer = clearFluid(is);
|
||||
if (emptyContainer == null) return null;
|
||||
MutablePair<Integer, ItemStack> result = fillStack(emptyContainer, fs);
|
||||
if (result != null) {
|
||||
result.right.stackSize = itemStack.stackSize;
|
||||
return result.right;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static MutablePair<Integer, ItemStack> drainStack(ItemStack itemStack, FluidStack fluid) {
|
||||
if (itemStack == null) return null;
|
||||
Item item = itemStack.getItem();
|
||||
|
||||
@@ -51,9 +51,9 @@ ae2fc.tooltip.level_maintainer.link=§e合成中§r
|
||||
ae2fc.tooltip.level_maintainer.link_desc=系统当前正在制作请求的物品或流体。
|
||||
ae2fc.tooltip.level_maintainer.export=§5输出中§r
|
||||
ae2fc.tooltip.level_maintainer.export_desc=请求器正在尝试将制作结果导出到ME系统。如果请求器长期处于此状态,则说明没有可用的存储空间。
|
||||
ae2fc.tooltip.level_maintainer.batch_size=§6请求次数§r
|
||||
ae2fc.tooltip.level_maintainer.batch_size.hint=当发出合成请求时,请求器发送合成请求次数的多少。更多的请求次数将提高储存物品的速度,但需要更多的合成存储空间。
|
||||
ae2fc.tooltip.level_maintainer.request_size=§6请求数量§r
|
||||
ae2fc.tooltip.level_maintainer.batch_size=§6单次合成数量§r
|
||||
ae2fc.tooltip.level_maintainer.batch_size.hint=当发出合成请求时,请求器发送单次合成数量的多少。更多的单次合成数量将提高储存物品的速度,但需要更多的合成存储空间。
|
||||
ae2fc.tooltip.level_maintainer.request_size=§6缓存量§r
|
||||
ae2fc.tooltip.level_maintainer.request_size.hint=数量定义了在请求器开始请求新合成之前应该保留多少物品。
|
||||
|
||||
ae2fc.tooltip.cell_contents=内含流体:
|
||||
|
||||
Reference in new issue
Block a user