Ported to 1.16.2-pre

This commit is contained in:
Sebastian Hartte
2020-08-01 17:14:12 +02:00
parent 3d1a919e69
commit 1b31185cdb
90 changed files with 356 additions and 258 deletions
@@ -64,10 +64,10 @@ public class FluidInterfaceScreen extends UpgradeableScreen<FluidInterfaceContai
@Override
public void drawFG(MatrixStack matrices, int offsetX, int offsetY, int mouseX, int mouseY) {
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.FluidInterface.text()), 8, 6, 4210752);
this.textRenderer.draw(matrices, GuiText.Config.getLocal(), 35, 6 + 11 + 7, 4210752);
this.textRenderer.draw(matrices, GuiText.StoredFluids.getLocal(), 35, 6 + 112 + 7, 4210752);
this.textRenderer.draw(matrices, GuiText.inventory.getLocal(), 8, this.backgroundHeight - 96 + 3, 4210752);
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.FluidInterface.text()), 8, 6, 4210752);
this.textRenderer.method_30883(matrices, GuiText.Config.text(), 35, 6 + 11 + 7, 4210752);
this.textRenderer.method_30883(matrices, GuiText.StoredFluids.text(), 35, 6 + 112 + 7, 4210752);
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
}
@Override
@@ -60,7 +60,7 @@ public class FluidLevelEmitterScreen extends UpgradeableScreen<FluidLevelEmitter
public void drawFG(MatrixStack matrices, int offsetX, int offsetY, int mouseX, int mouseY) {
super.drawFG(matrices, offsetX, offsetY, mouseX, mouseY);
this.textRenderer.draw(matrices, GuiText.FluidLevelEmitterUnit.getLocal(), 110, 44, COLOR_DARK_GRAY);
this.textRenderer.method_30883(matrices, GuiText.FluidLevelEmitterUnit.text(), 110, 44, COLOR_DARK_GRAY);
}
@Override
@@ -98,8 +98,8 @@ public class FluidStorageBusScreen extends UpgradeableScreen<FluidStorageBusCont
@Override
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.textRenderer.draw(matrices, this.getGuiDisplayName(this.getName().text()), 8, 6, 4210752);
this.textRenderer.draw(matrices, GuiText.inventory.getLocal(), 8, this.backgroundHeight - 96 + 3, 4210752);
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(this.getName().text()), 8, 6, 4210752);
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
if (this.fuzzyMode != null) {
this.fuzzyMode.set(this.cvb.getFuzzyMode());
@@ -125,8 +125,8 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
@Override
public void drawFG(MatrixStack matrices, int offsetX, int offsetY, int mouseX, int mouseY) {
this.textRenderer.draw(matrices, this.getGuiDisplayName(new LiteralText("Fluid Terminal")), 8, 6, 4210752);
this.textRenderer.draw(matrices, GuiText.inventory.getLocal(), 8, this.backgroundHeight - 96 + 3, 4210752);
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(new LiteralText("Fluid Terminal")), 8, 6, 4210752);
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
}
@Override
@@ -171,7 +171,7 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
list.add(new LiteralText(formattedAmount));
list.add(new LiteralText(modName));
this.renderTooltip(matrices, list, mouseX, mouseY);
this.method_30901(matrices, list, mouseX, mouseY);
return;
}
@@ -30,6 +30,9 @@ import appeng.core.AEConfig;
import appeng.util.ISlimReadableNumberConverter;
import appeng.util.IWideReadableNumberConverter;
import appeng.util.ReadableNumberConverter;
import net.minecraft.text.LiteralText;
import net.minecraft.text.StringRenderable;
import net.minecraft.text.Text;
/**
* @author AlgorithmX2
@@ -47,12 +50,12 @@ public class FluidStackSizeRenderer {
public void renderStackSize(TextRenderer fontRenderer, IAEFluidStack aeStack, int xPos, int yPos) {
if (aeStack != null && aeStack.getStackSize() > 0) {
final String stackSize = this.getToBeRenderedStackSize(aeStack.getStackSize());
final Text stackSize = this.getToBeRenderedStackSize(aeStack.getStackSize());
StackSizeRenderer.renderSizeLabel(fontRenderer, xPos, yPos, stackSize);
}
}
private String getToBeRenderedStackSize(final long originalSize) {
private Text getToBeRenderedStackSize(final long originalSize) {
// Handle any value below 100 (large font) or 1000 (small font) Buckets with a
// custom formatter,
// otherwise pass it to the normal number converter
@@ -63,25 +66,25 @@ public class FluidStackSizeRenderer {
}
if (AEConfig.instance().isUseLargeFonts()) {
return SLIM_CONVERTER.toSlimReadableForm(originalSize / 1000);
return new LiteralText(SLIM_CONVERTER.toSlimReadableForm(originalSize / 1000));
} else {
return WIDE_CONVERTER.toWideReadableForm(originalSize / 1000);
return new LiteralText(WIDE_CONVERTER.toWideReadableForm(originalSize / 1000));
}
}
private String getSlimRenderedStacksize(final long originalSize) {
private Text getSlimRenderedStacksize(final long originalSize) {
final int log = 1 + (int) Math.floor(Math.log10(originalSize)) / 2;
return this.getRenderedFluidStackSize(originalSize, log);
}
private String getWideRenderedStacksize(final long originalSize) {
private Text getWideRenderedStacksize(final long originalSize) {
final int log = (int) Math.floor(Math.log10(originalSize)) / 2;
return this.getRenderedFluidStackSize(originalSize, log);
}
private String getRenderedFluidStackSize(final long originalSize, final int log) {
private Text getRenderedFluidStackSize(final long originalSize, final int log) {
final int index = Math.max(0, Math.min(3, log));
final DecimalFormatSymbols symbols = new DecimalFormatSymbols();
@@ -90,7 +93,7 @@ public class FluidStackSizeRenderer {
format.setDecimalFormatSymbols(symbols);
format.setRoundingMode(RoundingMode.DOWN);
return format.format(originalSize / 1000d);
return new LiteralText(format.format(originalSize / 1000d));
}
}
@@ -315,7 +315,7 @@ public class FluidAnnihilationPlanePart extends BasicStatePart implements IGridT
}
private boolean isFluidBlacklisted(Fluid fluid) {
Tag<Fluid> tag = FluidTags.getContainer().getOrCreate(TAG_BLACKLIST);
Tag<Fluid> tag = FluidTags.getTagGroup().getTagOrEmpty(TAG_BLACKLIST);
return fluid.isIn(tag);
}
@@ -26,7 +26,6 @@ import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
import alexiil.mc.lib.attributes.Simulation;
import alexiil.mc.lib.attributes.fluid.FluidAttributes;
import alexiil.mc.lib.attributes.fluid.FluidExtractable;