Compiles again.

This commit is contained in:
Sebastian Hartte
2020-07-27 23:50:28 +02:00
parent 56ecda5173
commit 84e6aaa122
136 changed files with 1004 additions and 1108 deletions
@@ -26,6 +26,7 @@ import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.client.util.InputMappings;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Hand;
@@ -207,7 +208,7 @@ public class ClientHelper extends ServerHelper {
private void spawnLightningArc(final World world, final double posX, final double posY, final double posZ,
final Vector3d second) {
final LightningFX fx = new LightningArcFX(world, posX, posY, posZ, second.x, second.y, second.z, 0.0f, 0.0f,
final LightningFX fx = new LightningArcFX((ClientWorld) world, posX, posY, posZ, second.x, second.y, second.z, 0.0f, 0.0f,
0.0f);
Minecraft.getInstance().particles.addEffect(fx);
}
@@ -61,31 +61,23 @@ public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseSc
if (myStack != null) {
if (myStack.getStackSize() > bigNumber || (myStack.getStackSize() > 1 && stack.isDamaged())) {
final String local = ButtonToolTips.ItemsStored.getLocal();
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US)
.format(myStack.getStackSize());
final String format = String.format(local, formattedAmount);
currentToolTip.add(new StringTextComponent(TextFormatting.GRAY + format));
currentToolTip.add(ButtonToolTips.ItemsStored.text(formattedAmount).func_240699_a_(TextFormatting.GRAY));
}
if (myStack.getCountRequestable() > 0) {
final String local = ButtonToolTips.ItemsRequestable.getLocal();
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US)
.format(myStack.getCountRequestable());
final String format = String.format(local, formattedAmount);
currentToolTip.add(new StringTextComponent(format));
currentToolTip.add(ButtonToolTips.ItemsRequestable.text(formattedAmount));
}
this.renderToolTip(matrixStack, currentToolTip, x, y, this.font);
return;
} else if (stack.getCount() > bigNumber) {
final String local = ButtonToolTips.ItemsStored.getLocal();
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US).format(stack.getCount());
final String format = String.format(local, formattedAmount);
currentToolTip.add(new StringTextComponent(TextFormatting.GRAY + format));
currentToolTip.add(ButtonToolTips.ItemsStored.text(formattedAmount).func_240699_a_(TextFormatting.GRAY));
this.renderToolTip(matrixStack, currentToolTip, x, y, this.font);
@@ -24,6 +24,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import com.google.common.base.Preconditions;
import com.google.common.base.Stopwatch;
@@ -31,6 +32,7 @@ import com.google.common.collect.Lists;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.util.text.Style;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.opengl.GL11;
@@ -145,7 +147,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
RenderSystem.popMatrix();
RenderSystem.enableDepthTest();
this.renderHoveredToolTip(matrixStack, mouseX, mouseY);
this.func_230459_a_(matrixStack, mouseX, mouseY);
for (final Object c : this.buttons) {
if (c instanceof ITooltip) {
@@ -189,33 +191,35 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
}
}
protected void drawTooltip(MatrixStack matrixStack, int x, int y, ITextComponent message) {
String[] lines = message.split("\n");
this.drawTooltip(matrixStack, x, y, Arrays.asList(lines));
protected void drawTooltip(MatrixStack matrices, int x, int y, ITextComponent message) {
String[] lines = message.getString().split("\n"); // FIXME FABRIC
List<ITextComponent> textLines = Arrays.stream(lines).map(StringTextComponent::new).collect(Collectors.toList());
this.drawTooltip(matrices, x, y, textLines);
}
protected void drawTooltip(MatrixStack matrixStack, int x, int y, List<String> lines) {
// FIXME FABRIC: move out to json (?)
private static final Style TOOLTIP_HEADER = Style.EMPTY.applyFormatting(TextFormatting.WHITE);
private static final Style TOOLTIP_BODY = Style.EMPTY.applyFormatting(TextFormatting.GRAY);
protected void drawTooltip(MatrixStack matrices, int x, int y, List<ITextComponent> lines) {
if (lines.isEmpty()) {
return;
}
// For an explanation of the formatting codes, see
// http://minecraft.gamepedia.com/Formatting_codes
lines = Lists.newArrayList(lines); // Make a copy
// Make the first line white
lines.set(0, TextFormatting.WHITE + lines.get(0));
// All lines after the first are colored gray
for (int i = 1; i < lines.size(); i++) {
lines.set(i, TextFormatting.GRAY + lines.get(i));
List<ITextComponent> styledLines = new ArrayList<>(lines.size());
for (int i = 0; i < lines.size(); i++) {
Style style = (i == 0) ? TOOLTIP_HEADER : TOOLTIP_BODY;
styledLines.add(lines.get(i).deepCopy().func_240700_a_(s -> style));
}
this.renderTooltip(matrixStack, lines, x, y, this.font);
this.renderTooltip(matrices, styledLines, x, y);
}
@Override
protected final void drawGuiContainerForegroundLayer(MatrixStack matrixStack, final int x, final int y) {
protected final void func_230451_b_(MatrixStack matrixStack, final int x, final int y) {
final int ox = this.guiLeft; // (width - xSize) / 2;
final int oy = this.guiTop; // (height - ySize) / 2;
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -230,7 +234,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
public abstract void drawFG(MatrixStack matrixStack, int offsetX, int offsetY, int mouseX, int mouseY);
@Override
protected final void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, final float f, final int x,
protected final void func_230450_a_(MatrixStack matrixStack, final float f, final int x,
final int y) {
final int ox = this.guiLeft; // (width - xSize) / 2;
final int oy = this.guiTop; // (height - ySize) / 2;
@@ -627,16 +631,16 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
* hackery...
*/
@Override
public void drawSlot(MatrixStack matrixStack, Slot s) {
public void func_238746_a_(MatrixStack matrices, Slot s) {
if (s instanceof SlotME) {
try {
if (!this.isPowered()) {
fill(matrixStack, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
fill(matrices, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
}
// Annoying but easier than trying to splice into render item
super.drawSlot(new Size1Slot((SlotME) s));
super.func_238746_a_(matrices, new Size1Slot((SlotME) s));
this.stackSizeRenderer.renderStackSize(this.font, ((SlotME) s).getAEStack(), s.xPos, s.yPos);
@@ -665,13 +669,13 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
float blue = (fluidAttributes.getColor() & 255) / 255.0F;
RenderSystem.color3f(red, green, blue);
blit(matrixStack, s.xPos, s.yPos, 0 /* FIXME: Validate this was previous the controls zindex */, 16, 16,
blit(matrices, s.xPos, s.yPos, 0 /* FIXME: Validate this was previous the controls zindex */, 16, 16,
sprite);
RenderSystem.enableBlend();
this.fluidStackSizeRenderer.renderStackSize(this.font, fs, s.xPos, s.yPos);
} else if (!this.isPowered()) {
fill(matrixStack, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
fill(matrices, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
}
return;
@@ -743,7 +747,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
setBlitOffset(100);
this.itemRenderer.zLevel = 100.0F;
fill(matrixStack, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66ff6666);
fill(matrices, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66ff6666);
setBlitOffset(0);
this.itemRenderer.zLevel = 0.0F;
@@ -752,9 +756,9 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
if (s instanceof AppEngSlot) {
((AppEngSlot) s).setDisplay(true);
super.drawSlot(s);
super.func_238746_a_(matrices, s);
} else {
super.drawSlot(s);
super.func_238746_a_(matrices, s);
}
return;
@@ -763,7 +767,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
}
}
// do the usual for non-ME Slots.
super.drawSlot(s);
super.func_238746_a_(matrices, s);
}
protected boolean isPowered() {
@@ -800,10 +804,4 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
}
}
@Override
protected void func_230450_a_(MatrixStack p_230450_1_, float p_230450_2_, int p_230450_3_, int p_230450_4_) {
// TODO Auto-generated method stub
}
}
@@ -43,7 +43,7 @@ public class ChestScreen extends AEBaseScreen<ChestContainer> {
public void init() {
super.init();
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriority()));
}
@@ -53,8 +53,8 @@ public class ChestScreen extends AEBaseScreen<ChestContainer> {
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Chest.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Chest.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
@@ -51,14 +51,14 @@ public class CondenserScreen extends AEBaseScreen<CondenserContainer> {
this.container.getOutput());
this.addButton(new ProgressBar(this.container, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop, 178,
25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.textComponent()));
25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.text()));
this.addButton(this.mode);
}
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Condenser.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Condenser.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
this.mode.set(this.container.getOutput());
this.mode.setFillVar(String.valueOf(this.container.getOutput().requiredPower));
@@ -56,7 +56,7 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
this.amountToCraft.addButtons(children::add, this::addButton);
this.next = this.addButton(
new Button(this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.textComponent(), this::confirm));
new Button(this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.text(), this::confirm));
subGui.addBackButton(this::addButton, 154, 0);
}
@@ -68,12 +68,12 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, GuiText.SelectAmount.textComponent().getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.SelectAmount.text().getString(), 8, 6, 4210752);
}
@Override
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
this.next.setMessage(hasShiftDown() ? GuiText.Start.textComponent() : GuiText.Next.textComponent());
this.next.setMessage(hasShiftDown() ? GuiText.Start.text() : GuiText.Next.text());
this.bindTexture("guis/craft_amt.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
@@ -85,7 +85,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
super.init();
this.start = new Button(this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20,
GuiText.Start.textComponent(), btn -> start());
GuiText.Start.text(), btn -> start());
this.start.active = false;
this.addButton(this.start);
@@ -95,7 +95,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
this.selectCPU.active = false;
this.addButton(this.selectCPU);
addButton(new Button(this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.textComponent(),
addButton(new Button(this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.text(),
btn -> subGui.goBack()));
}
@@ -255,7 +255,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
str = Long.toString(missingStack.getStackSize() / 1000000) + 'm';
}
str = GuiText.Missing.textComponent().getString() + ": " + str;
str = GuiText.Missing.text().getString() + ": " + str;
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(matrixStack, str,
(int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2),
@@ -117,7 +117,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
super.init();
this.setScrollBar();
this.cancel = new Button(this.guiLeft + CANCEL_LEFT_OFFSET, this.guiTop + this.ySize - CANCEL_TOP_OFFSET,
CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel.textComponent(), btn -> cancel());
CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel.text(), btn -> cancel());
this.addButton(this.cancel);
}
@@ -165,7 +165,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
String title = this.getGuiDisplayName(GuiText.CraftingStatus.textComponent()).getString();
String title = this.getGuiDisplayName(GuiText.CraftingStatus.text()).getString();
if (this.container.getEstimatedTime() > 0 && !this.visual.isEmpty()) {
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert(this.container.getEstimatedTime(),
@@ -43,7 +43,7 @@ public class DriveScreen extends AEBaseScreen<DriveContainer> {
public void init() {
super.init();
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriorityGui()));
}
@@ -54,9 +54,9 @@ public class DriveScreen extends AEBaseScreen<DriveContainer> {
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Drive.textComponent()).getString(), 8, 6,
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Drive.text()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3,
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3,
4210752);
}
@@ -52,7 +52,7 @@ public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContai
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE,
FuzzyMode.IGNORE_ALL);
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriorityGui()));
this.addButton(this.placeMode);
@@ -61,7 +61,7 @@ public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContai
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.FormationPlane.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.FormationPlane.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (this.fuzzyMode != null) {
@@ -37,8 +37,8 @@ public class GrinderScreen extends AEBaseScreen<GrinderContainer> {
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.GrindStone.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.GrindStone.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
@@ -61,7 +61,7 @@ public class IOPortScreen extends UpgradeableScreen<IOPortContainer> {
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.IOPort.textComponent()).getString(), 8, 6,
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.IOPort.text()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
@@ -59,8 +59,8 @@ public class InscriberScreen extends AEBaseScreen<InscriberContainer> {
this.pb.setFullMsg(new StringTextComponent(
this.container.getCurrentProgress() * 100 / this.container.getMaxProgress() + "%"));
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Inscriber.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Inscriber.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
@@ -48,7 +48,7 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
@Override
protected void addButtons() {
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriorityGui()));
this.blockMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK, YesNo.NO);
@@ -70,7 +70,7 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
this.interfaceMode.setState(((InterfaceContainer) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
}
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Interface.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Interface.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.Config.getLocal(), 8, 6 + 11 + 7, 4210752);
this.font.drawString(matrixStack, GuiText.StoredItems.getLocal(), 8, 6 + 60 + 7, 4210752);
@@ -95,8 +95,8 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.InterfaceTerminal.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.InterfaceTerminal.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
final int ex = this.getScrollBar().getCurrentScroll();
@@ -236,7 +236,7 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
if (this.viewCell || this instanceof WirelessTermScreen) {
this.craftingStatusBtn = this.addButton(new TabButton(this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16,
GuiText.CraftingStatus.textComponent(), this.itemRenderer, btn -> showCraftingStatus()));
GuiText.CraftingStatus.text(), this.itemRenderer, btn -> showCraftingStatus()));
this.craftingStatusBtn.setHideEdge(13);
}
@@ -287,8 +287,8 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(this.myName.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(this.myName.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
this.currentMouseX = mouseX;
this.currentMouseY = mouseY;
@@ -224,9 +224,9 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
currentToolTip.remove(1);
}
currentToolTip.add(GuiText.Installed.getLocal() + ": " + (myStack.getStackSize()));
currentToolTip.add(GuiText.EnergyDrain.getLocal() + ": "
+ Platform.formatPowerLong(myStack.getCountRequestable(), true));
currentToolTip.add(GuiText.Installed.withSuffix(": " + (myStack.getStackSize())));
currentToolTip.add(GuiText.EnergyDrain.withSuffix(": "
+ Platform.formatPowerLong(myStack.getCountRequestable(), true)));
this.drawTooltip(matrixStack, x, y, currentToolTip);
}
@@ -62,7 +62,7 @@ public class NetworkToolScreen extends AEBaseScreen<NetworkToolContainer> {
this.tFacades.setState(container.isFacadeMode());
}
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.NetworkTool.textComponent()).getString(), 8, 6,
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.NetworkTool.text()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@@ -60,12 +60,12 @@ public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer>
super.init();
this.tabCraftButton = new TabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
new ItemStack(Blocks.CRAFTING_TABLE), GuiText.CraftingPattern.textComponent(), this.itemRenderer,
new ItemStack(Blocks.CRAFTING_TABLE), GuiText.CraftingPattern.text(), this.itemRenderer,
btn -> toggleCraftMode(CRAFTMODE_PROCESSING));
this.addButton(this.tabCraftButton);
this.tabProcessButton = new TabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.textComponent(), this.itemRenderer,
new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.text(), this.itemRenderer,
btn -> toggleCraftMode(CRAFTMODE_CRFTING));
this.addButton(this.tabProcessButton);
@@ -39,7 +39,7 @@ public class QNBScreen extends AEBaseScreen<QNBContainer> {
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack,
this.getGuiDisplayName(GuiText.QuantumLinkChamber.textComponent()).getString(), 8, 6, 4210752);
this.getGuiDisplayName(GuiText.QuantumLinkChamber.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@@ -63,7 +63,7 @@ public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack,
this.getGuiDisplayName(GuiText.QuartzCuttingKnife.textComponent()).getString(), 8, 6, 4210752);
this.getGuiDisplayName(GuiText.QuartzCuttingKnife.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@@ -42,7 +42,7 @@ public class SkyChestScreen extends AEBaseScreen<SkyChestContainer> {
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SkyChest.textComponent()).getString(), 8, 8,
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SkyChest.text()).getString(), 8, 8,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752);
}
@@ -58,7 +58,7 @@ public class SpatialIOPortScreen extends AEBaseScreen<SpatialIOPortContainer> {
GuiText.Efficiency.getLocal() + ": " + (((float) this.container.getEfficency()) / 100) + '%', 13, 83,
4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SpatialIOPort.textComponent()).getString(), 8,
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SpatialIOPort.text()).getString(), 8,
6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752);
@@ -60,7 +60,7 @@ public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE,
FuzzyMode.IGNORE_ALL);
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
this.itemRenderer, btn -> openPriorityGui()));
this.addButton(this.storageFilter);
@@ -71,7 +71,7 @@ public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.StorageBus.textComponent()).getString(), 8, 6,
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.StorageBus.text()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
@@ -86,7 +86,7 @@ public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScr
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(this.getName().textComponent()).getString(), 8, 6,
this.font.drawString(matrixStack, this.getGuiDisplayName(this.getName().text()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
@@ -54,7 +54,7 @@ public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContain
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.VibrationChamber.textComponent()).getString(),
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.VibrationChamber.text()).getString(),
8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
@@ -46,7 +46,7 @@ public class WirelessScreen extends AEBaseScreen<WirelessContainer> {
@Override
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Wireless.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Wireless.text()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (container.getRange() > 0) {
@@ -23,6 +23,8 @@ import java.util.regex.Pattern;
import appeng.api.config.ActionItems;
import appeng.core.localization.ButtonToolTips;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
public class ActionButton extends IconButton implements ITooltip {
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
@@ -76,9 +78,9 @@ public class ActionButton extends IconButton implements ITooltip {
return iconIndex;
}
private String buildMessage(ButtonToolTips displayName, ButtonToolTips displayValue) {
String name = displayName.getTranslationKey().getString();
String value = displayValue.getTranslationKey().getString();
private ITextComponent buildMessage(ButtonToolTips displayName, ButtonToolTips displayValue) {
String name = displayName.text().getString();
String value = displayValue.text().getString();
value = PATTERN_NEW_LINE.matcher(value).replaceAll("\n");
final StringBuilder sb = new StringBuilder(value);
@@ -91,7 +93,7 @@ public class ActionButton extends IconButton implements ITooltip {
sb.replace(i, i + 1, "\n");
}
return name + '\n' + sb;
return new StringTextComponent(name + '\n' + sb);
}
}
@@ -89,7 +89,7 @@ public class ProgressBar extends Widget implements ITooltip {
return result.deepCopy().func_240702_b_("\n").func_240702_b_(this.source.getCurrentProgress() + " ")
.func_230529_a_(
GuiText.Of.textComponent().deepCopy().func_240702_b_(" " + this.source.getMaxProgress()));
GuiText.Of.text().deepCopy().func_240702_b_(" " + this.source.getMaxProgress()));
}
@Override
@@ -48,6 +48,7 @@ import appeng.api.config.ViewItems;
import appeng.api.config.YesNo;
import appeng.core.localization.ButtonToolTips;
import appeng.util.EnumCycler;
import net.minecraft.util.text.StringTextComponent;
public class SettingToggleButton<T extends Enum<T>> extends IconButton {
private static final Pattern COMPILE = Pattern.compile("%s");
@@ -236,7 +237,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
private static void registerApp(final int iconIndex, final Settings setting, final Enum<?> val,
final ButtonToolTips title, final ITextComponent hint) {
final ButtonAppearance a = new ButtonAppearance();
a.displayName = title.getTranslationKey();
a.displayName = title.text();
a.displayValue = hint;
a.index = iconIndex;
appearances.put(new EnumPair(setting, val), a);
@@ -244,7 +245,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
private static void registerApp(final int iconIndex, final Settings setting, final Enum<?> val,
final ButtonToolTips title, final ButtonToolTips hint) {
registerApp(iconIndex, setting, val, title, hint.getTranslationKey());
registerApp(iconIndex, setting, val, title, hint.text());
}
@Override
@@ -278,7 +279,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
}
@Override
public String getMessage() {
public ITextComponent getMessage() {
ITextComponent displayName = null;
ITextComponent displayValue = null;
@@ -286,7 +287,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
final ButtonAppearance buttonAppearance = appearances
.get(new EnumPair(this.buttonSetting, this.currentValue));
if (buttonAppearance == null) {
return "No Such Message";
return new StringTextComponent("No Such Message");
}
displayName = buttonAppearance.displayName;
@@ -312,9 +313,9 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
sb.replace(i, i + 1, "\n");
}
return name + '\n' + sb;
return new StringTextComponent(name + '\n' + sb);
}
return "";
return StringTextComponent.EMPTY;
}
public String getFillVar() {
@@ -36,7 +36,7 @@ public class ClientDCInternalInv implements Comparable<ClientDCInternalInv> {
public ClientDCInternalInv(final int size, final long id, final long sortBy, final ITextComponent name) {
this.inventory = new AppEngInternalInventory(null, size);
this.searchName = name.getString().toLowerCase();
this.formattedName = name.getFormattedText();
this.formattedName = name.getString(); // FIXME FABRIC no longer formatted!
this.id = id;
this.sortBy = sortBy;
}
@@ -22,6 +22,7 @@ import java.util.Objects;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@@ -50,7 +51,7 @@ public class FacadeDispatcherBakedModel extends DelegateBakedModel {
public ItemOverrideList getOverrides() {
return new ItemOverrideList() {
@Override
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, World world,
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world,
LivingEntity entity) {
if (!(stack.getItem() instanceof FacadeItem)) {
return originalModel;
@@ -110,7 +110,7 @@ public enum FacingToRotation implements IStringSerializable {
}
@Override
public String getName() {
public String getString() {
return name().toLowerCase();
}
}
@@ -35,8 +35,7 @@ import net.minecraft.util.math.vector.Quaternion;
import net.minecraftforge.client.IRenderHandler;
import net.minecraftforge.client.SkyRenderHandler;
//TODO https://github.com/MinecraftForge/MinecraftForge/pull/6537
public class SpatialSkyRender implements SkyRenderHandler {
public class SpatialSkyRender {
private static final SpatialSkyRender INSTANCE = new SpatialSkyRender();
@@ -48,7 +47,7 @@ public class SpatialSkyRender implements SkyRenderHandler {
this.dspList = GL11.glGenLists(1);
}
public static IRenderHandler getInstance() {
public static SpatialSkyRender getInstance() {
return INSTANCE;
}
@@ -56,8 +55,7 @@ public class SpatialSkyRender implements SkyRenderHandler {
new Quaternion(-90.0F, 0.0F, 0.0F, true), new Quaternion(180.0F, 0.0F, 0.0F, true),
new Quaternion(0.0F, 0.0F, 90.0F, true), new Quaternion(0.0F, 0.0F, -90.0F, true), };
@Override
public void render(int ticks, float partialTicks, MatrixStack matrixStack, ClientWorld world, Minecraft mc) {
public void render(MatrixStack matrixStack) {
final long now = System.currentTimeMillis();
if (now - this.cycle > 2000) {
this.cycle = now;
@@ -68,6 +68,12 @@ public class FacadeBlockAccess implements IBlockDisplayReader {
return world.getFluidState(pos);
}
// This is for diffuse lighting
@Override
public float func_230487_a_(Direction p_230487_1_, boolean p_230487_2_) {
return world.func_230487_a_(p_230487_1_, p_230487_2_);
}
@Override
public WorldLightManager getLightManager() {
return world.getLightManager();
@@ -10,6 +10,7 @@ import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.vector.TransformationMatrix;
@@ -112,7 +113,7 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
@Nullable
@Override
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world,
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, @Nullable ClientWorld world,
@Nullable LivingEntity entity) {
boolean shiftHeld = Screen.hasShiftDown();
if (shiftHeld) {
@@ -122,12 +123,12 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
IBakedModel realModel = Minecraft.getInstance().getItemRenderer().getItemModelMesher()
.getItemModel(output);
// Give the item model a chance to handle the overrides as well
realModel = realModel.getOverrides().getModelWithOverrides(realModel, output, world, entity);
realModel = realModel.getOverrides().func_239290_a_(realModel, output, world, entity);
return new ShiftHoldingModelWrapper(getBaseModel(), realModel);
}
}
return getBaseModel().getOverrides().getModelWithOverrides(originalModel, stack, world, entity);
return getBaseModel().getOverrides().func_239290_a_(originalModel, stack, world, entity);
}
}
@@ -22,6 +22,7 @@ import net.minecraft.client.particle.IAnimatedSprite;
import net.minecraft.client.particle.IParticleFactory;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.RedstoneParticle;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particles.BasicParticleType;
import net.minecraft.particles.RedstoneParticleData;
import net.minecraft.world.World;
@@ -33,7 +34,7 @@ public class ChargedOreFX extends RedstoneParticle {
private static final RedstoneParticleData PARTICLE_DATA = new RedstoneParticleData(0.21f, 0.61f, 1.0f, 1.0f);
private ChargedOreFX(World worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed,
private ChargedOreFX(ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed,
IAnimatedSprite spriteSet) {
super(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, PARTICLE_DATA, spriteSet);
}
@@ -58,8 +59,8 @@ public class ChargedOreFX extends RedstoneParticle {
}
@Override
public Particle makeParticle(BasicParticleType typeIn, World worldIn, double x, double y, double z,
double xSpeed, double ySpeed, double zSpeed) {
public Particle makeParticle(BasicParticleType typeIn, ClientWorld worldIn, double x, double y, double z,
double xSpeed, double ySpeed, double zSpeed) {
return new ChargedOreFX(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet);
}
}
@@ -135,7 +135,7 @@ public class CraftingFx extends SpriteTexturedParticle {
}
@Override
public Particle makeParticle(BasicParticleType data, World worldIn, double x, double y, double z, double xSpeed,
public Particle makeParticle(BasicParticleType data, ClientWorld worldIn, double x, double y, double z, double xSpeed,
double ySpeed, double zSpeed) {
return new CraftingFx(worldIn, x, y, z, spriteSet);
}
@@ -24,6 +24,7 @@ import net.minecraft.client.particle.IAnimatedSprite;
import net.minecraft.client.particle.IParticleFactory;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.SpriteTexturedParticle;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -37,7 +38,7 @@ public class LightningArcFX extends LightningFX {
private final double ry;
private final double rz;
public LightningArcFX(final World w, final double x, final double y, final double z, final double ex,
public LightningArcFX(final ClientWorld w, final double x, final double y, final double z, final double ex,
final double ey, final double ez, final double r, final double g, final double b) {
super(w, x, y, z, r, g, b, 6);
@@ -75,8 +76,8 @@ public class LightningArcFX extends LightningFX {
}
@Override
public Particle makeParticle(LightningArcParticleData data, World worldIn, double x, double y, double z,
double xSpeed, double ySpeed, double zSpeed) {
public Particle makeParticle(LightningArcParticleData data, ClientWorld worldIn, double x, double y, double z,
double xSpeed, double ySpeed, double zSpeed) {
SpriteTexturedParticle lightningFX = new LightningArcFX(worldIn, x, y, z, data.target.x, data.target.y,
data.target.z, 0, 0, 0);
lightningFX.selectSpriteRandomly(this.spriteSet);
@@ -1,5 +1,6 @@
package appeng.client.render.effects;
import com.mojang.serialization.Codec;
import net.minecraft.particles.BasicParticleType;
import net.minecraft.particles.ParticleType;
@@ -12,10 +13,19 @@ public final class ParticleTypes {
public static final BasicParticleType CHARGED_ORE = new BasicParticleType(false);
public static final BasicParticleType CRAFTING = new BasicParticleType(false);
public static final ParticleType<EnergyParticleData> ENERGY = new ParticleType<>(false,
EnergyParticleData.DESERIALIZER);
public static final ParticleType<LightningArcParticleData> LIGHTNING_ARC = new ParticleType<>(false,
LightningArcParticleData.DESERIALIZER);
public static final ParticleType<EnergyParticleData> ENERGY = new ParticleType<EnergyParticleData>(false,
EnergyParticleData.DESERIALIZER) {
public Codec<EnergyParticleData> func_230522_e_() {
return null;
}
};
public static final ParticleType<LightningArcParticleData> LIGHTNING_ARC = new ParticleType<LightningArcParticleData>(false,
LightningArcParticleData.DESERIALIZER) {
@Override
public Codec<LightningArcParticleData> func_230522_e_() {
return null;
}
};
public static final BasicParticleType LIGHTNING = new BasicParticleType(false);
public static final BasicParticleType MATTER_CANNON = new BasicParticleType(false);
public static final BasicParticleType VIBRANT = new BasicParticleType(false);
@@ -107,7 +107,7 @@ public class AutoRotatingBakedModel implements IBakedModel {
// when piping it
// to the AO lighter, thus fixing our problem.
BakedQuad packedQuad = new BakedQuad(unpackedQuad.getVertexData(), quad.getTintIndex(),
unpackedQuad.getFace(), quad.func_187508_a(), quad.shouldApplyDiffuseLighting());
unpackedQuad.getFace(), quad.func_187508_a(), quad.func_239287_f_());
rotated.add(packedQuad);
}
return rotated;
@@ -19,6 +19,7 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
@@ -143,7 +144,7 @@ class BiometricCardBakedModel implements IBakedModel {
public ItemOverrideList getOverrides() {
return new ItemOverrideList() {
@Override
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, World world,
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world,
LivingEntity entity) {
String username = "";
if (stack.getItem() instanceof IBiometricCard) {
@@ -62,7 +62,7 @@ class ColorApplicatorBakedModel implements IBakedModel {
}
BakedQuad newQuad = new BakedQuad(quad.getVertexData(), tint, quad.getFace(), quad.func_187508_a(),
quad.shouldApplyDiffuseLighting());
quad.func_239287_f_());
result.add(newQuad);
}
@@ -19,6 +19,7 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
@@ -128,7 +129,7 @@ class MemoryCardBakedModel implements IBakedModel {
public ItemOverrideList getOverrides() {
return new ItemOverrideList() {
@Override
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, World world,
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world,
LivingEntity entity) {
try {
if (stack.getItem() instanceof IMemoryCard) {
@@ -31,11 +31,11 @@ import appeng.core.AppEng;
public class MemoryCardModel implements IModelGeometry<MemoryCardModel> {
public static final ResourceLocation MODEL_BASE = new ResourceLocation(AppEng.MOD_ID, "item/memory_card_base");
private static final Material TEXTURE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "item/memory_card_hash"));
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return Collections.singleton(TEXTURE);
}
@@ -31,6 +31,7 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
@@ -149,7 +150,7 @@ public class SkyCompassBakedModel implements IDynamicBakedModel {
*/
return new ItemOverrideList() {
@Override
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world,
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, @Nullable ClientWorld world,
@Nullable LivingEntity entity) {
// FIXME: This check prevents compasses being held by OTHERS from getting the
// rotation, BUT do we actually still need this???
@@ -159,7 +160,7 @@ public class SkyCompassBakedModel implements IDynamicBakedModel {
float offRads = (float) (player.rotationYaw / 180.0f * (float) Math.PI + Math.PI);
SkyCompassBakedModel.this.fallbackRotation = offRads
+ getAnimatedRotation(player.getPosition(), true);
+ getAnimatedRotation(player.func_233580_cy_(), true);
} else {
SkyCompassBakedModel.this.fallbackRotation = getAnimatedRotation(null, false);
}
@@ -144,7 +144,7 @@ public class ChestTileEntityRenderer extends TileEntityRenderer<ChestTileEntity>
for (int i = 0; i < quads.size(); i++) {
BakedQuad quad = quads.get(i);
quads.set(i, new BakedQuad(quad.getVertexData(), quad.getTintIndex(), r.rotate(quad.getFace()),
quad.func_187508_a(), quad.shouldApplyDiffuseLighting()));
quad.func_187508_a(), quad.func_239287_f_()));
}
return quads;
@@ -62,7 +62,7 @@ public class CrankTESR extends TileEntityRenderer<CrankTileEntity> {
BlockState blockState = te.getBlockState();
BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
IBakedModel model = dispatcher.getModelForState(blockState);
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
IVertexBuilder buffer = buffers.getBuffer(Atlases.getCutoutBlockType());
dispatcher.getBlockModelRenderer().renderModelBrightnessColor(ms.getLast(), buffer, null, model, 1, 1, 1,
combinedLightIn, combinedOverlayIn);
ms.pop();
@@ -55,7 +55,7 @@ public class SkyCompassTESR extends TileEntityRenderer<SkyCompassTileEntity> {
blockRenderer = Minecraft.getInstance().getBlockRendererDispatcher();
}
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
IVertexBuilder buffer = buffers.getBuffer(Atlases.getCutoutBlockType());
BlockState blockState = te.getBlockState();
IBakedModel model = blockRenderer.getBlockModelShapes().getModel(blockState);