Updated to 1.16.2-rc2
This commit is contained in:
+4
-4
@@ -9,12 +9,12 @@ org.gradle.jvmargs=-Xmx2G
|
|||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# Check these on https://modmuss50.me/fabric.html
|
# Check these on https://modmuss50.me/fabric.html
|
||||||
|
|
||||||
minecraft_version=1.16.2-pre1
|
minecraft_version=1.16.2-rc2
|
||||||
yarn_mappings=1.16.2-pre1+build.5
|
yarn_mappings=1.16.2-rc2+build.1
|
||||||
loader_version=0.9.0+build.204
|
loader_version=0.9.1+build.205
|
||||||
|
|
||||||
#Fabric api
|
#Fabric api
|
||||||
fabric_version=0.16.3+build.390-1.16
|
fabric_version=0.17.1+build.394-1.16
|
||||||
|
|
||||||
loom_version=0.4-SNAPSHOT
|
loom_version=0.4-SNAPSHOT
|
||||||
|
|
||||||
|
|||||||
@@ -70,14 +70,14 @@ public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseSc
|
|||||||
currentToolTip.add(ButtonToolTips.ItemsRequestable.text(formattedAmount));
|
currentToolTip.add(ButtonToolTips.ItemsRequestable.text(formattedAmount));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.method_30901(matrices, currentToolTip, x, y);
|
this.renderTooltip(matrices, currentToolTip, x, y);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else if (stack.getCount() > bigNumber) {
|
} else if (stack.getCount() > bigNumber) {
|
||||||
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US).format(stack.getCount());
|
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US).format(stack.getCount());
|
||||||
currentToolTip.add(ButtonToolTips.ItemsStored.text(formattedAmount).formatted(Formatting.GRAY));
|
currentToolTip.add(ButtonToolTips.ItemsStored.text(formattedAmount).formatted(Formatting.GRAY));
|
||||||
|
|
||||||
this.method_30901(matrices, currentToolTip, x, y);
|
this.renderTooltip(matrices, currentToolTip, x, y);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
|
|||||||
styledLines.add(lines.get(i).copy().styled(s -> style));
|
styledLines.add(lines.get(i).copy().styled(s -> style));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.method_30901(matrices, styledLines, x, y);
|
this.renderTooltip(matrices, styledLines, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -535,7 +535,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends HandledScr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theSlot.getMaxStackAmount() == 64) {
|
if (theSlot.getMaxItemCount() == 64) {
|
||||||
this.onMouseClick(theSlot, theSlot.id, j, SlotActionType.SWAP);
|
this.onMouseClick(theSlot, theSlot.id, j, SlotActionType.SWAP);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -48,13 +48,13 @@ class Size1Slot extends Slot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxStackAmount() {
|
public int getMaxItemCount() {
|
||||||
return this.delegate.getMaxStackAmount();
|
return this.delegate.getMaxItemCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxStackAmount(ItemStack stack) {
|
public int getMaxItemCount(ItemStack stack) {
|
||||||
return this.delegate.getMaxStackAmount(stack);
|
return this.delegate.getMaxItemCount(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ public class ChestScreen extends AEBaseScreen<ChestContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.Chest.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.Chest.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ public class CondenserScreen extends AEBaseScreen<CondenserContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.Condenser.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.Condenser.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
|
|
||||||
this.mode.set(this.handler.getOutput());
|
this.mode.set(this.handler.getOutput());
|
||||||
this.mode.setFillVar(String.valueOf(this.handler.getOutput().requiredPower));
|
this.mode.setFillVar(String.valueOf(this.handler.getOutput().requiredPower));
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, GuiText.SelectAmount.text(), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, GuiText.SelectAmount.text(), 8, 6, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
|||||||
final String byteUsed = NumberFormat.getInstance().format(BytesUsed);
|
final String byteUsed = NumberFormat.getInstance().format(BytesUsed);
|
||||||
final Text Add = BytesUsed > 0 ? new LiteralText(byteUsed + " ").append(GuiText.BytesUsed.text())
|
final Text Add = BytesUsed > 0 ? new LiteralText(byteUsed + " ").append(GuiText.BytesUsed.text())
|
||||||
: GuiText.CalculatingWait.text();
|
: GuiText.CalculatingWait.text();
|
||||||
this.textRenderer.method_30883(matrices, GuiText.CraftingPlan.withSuffix(" - ").append(Add), 8, 7, 4210752);
|
this.textRenderer.draw(matrices, GuiText.CraftingPlan.withSuffix(" - ").append(Add), 8, 7, 4210752);
|
||||||
|
|
||||||
Text dsp;
|
Text dsp;
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int offset = (219 - this.textRenderer.getWidth(dsp)) / 2;
|
final int offset = (219 - this.textRenderer.getWidth(dsp)) / 2;
|
||||||
this.textRenderer.method_30883(matrices, dsp, offset, 165, 4210752);
|
this.textRenderer.draw(matrices, dsp, offset, 165, 4210752);
|
||||||
|
|
||||||
final int sectionLength = 67;
|
final int sectionLength = 67;
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
|
|||||||
title = title.copy().append(" - " + etaTimeText);
|
title = title.copy().append(" - " + etaTimeText);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.textRenderer.method_30883(matrices, title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, TEXT_COLOR);
|
this.textRenderer.draw(matrices, title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, TEXT_COLOR);
|
||||||
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class CraftingTermScreen extends MEMonitorableScreen<CraftingTermContaine
|
|||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
super.drawFG(matrices, offsetX, offsetY, mouseX, mouseY);
|
super.drawFG(matrices, offsetX, offsetY, mouseX, mouseY);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.CraftingTerminal.text(), 8,
|
this.textRenderer.draw(matrices, GuiText.CraftingTerminal.text(), 8,
|
||||||
this.backgroundHeight - 96 + 1 - this.getReservedSpace(), 4210752);
|
this.backgroundHeight - 96 + 1 - this.getReservedSpace(), 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ public class DriveScreen extends AEBaseScreen<DriveContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.Drive.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.Drive.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContai
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.FormationPlane.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.FormationPlane.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
|
|
||||||
if (this.fuzzyMode != null) {
|
if (this.fuzzyMode != null) {
|
||||||
this.fuzzyMode.set(this.cvb.getFuzzyMode());
|
this.fuzzyMode.set(this.cvb.getFuzzyMode());
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ public class GrinderScreen extends AEBaseScreen<GrinderContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.GrindStone.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.GrindStone.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ public class IOPortScreen extends UpgradeableScreen<IOPortContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.IOPort.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.IOPort.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
|
|
||||||
if (this.redstoneMode != null) {
|
if (this.redstoneMode != null) {
|
||||||
this.redstoneMode.set(this.cvb.getRedStoneMode());
|
this.redstoneMode.set(this.cvb.getRedStoneMode());
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ public class InscriberScreen extends AEBaseScreen<InscriberContainer> {
|
|||||||
this.pb.setFullMsg(
|
this.pb.setFullMsg(
|
||||||
new LiteralText(this.handler.getCurrentProgress() * 100 / this.handler.getMaxProgress() + "%"));
|
new LiteralText(this.handler.getCurrentProgress() * 100 / this.handler.getMaxProgress() + "%"));
|
||||||
|
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.Inscriber.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.Inscriber.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -68,13 +68,13 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
|
|||||||
this.interfaceMode.setState(((InterfaceContainer) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
|
this.interfaceMode.setState(((InterfaceContainer) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.Interface.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.Interface.text()), 8, 6, 4210752);
|
||||||
|
|
||||||
this.textRenderer.method_30883(matrices, GuiText.Config.text(), 8, 6 + 11 + 7, 4210752);
|
this.textRenderer.draw(matrices, GuiText.Config.text(), 8, 6 + 11 + 7, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.StoredItems.text(), 8, 6 + 60 + 7, 4210752);
|
this.textRenderer.draw(matrices, GuiText.StoredItems.text(), 8, 6 + 60 + 7, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.Patterns.text(), 8, 6 + 73 + 7, 4210752);
|
this.textRenderer.draw(matrices, GuiText.Patterns.text(), 8, 6 + 73 + 7, 4210752);
|
||||||
|
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -95,9 +95,9 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.InterfaceTerminal.text()), 8, 6,
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.InterfaceTerminal.text()), 8, 6,
|
||||||
4210752);
|
4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
|
|
||||||
final int ex = this.getScrollBar().getCurrentScroll();
|
final int ex = this.getScrollBar().getCurrentScroll();
|
||||||
|
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
getClient().keyboard.enableRepeatEvents(true);
|
getClient().keyboard.setRepeatEvents(true);
|
||||||
|
|
||||||
this.maxRows = this.getMaxRows();
|
this.maxRows = this.getMaxRows();
|
||||||
TerminalStyle terminalStyle = AEConfig.instance().getTerminalStyle();
|
TerminalStyle terminalStyle = AEConfig.instance().getTerminalStyle();
|
||||||
@@ -285,8 +285,8 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(this.myName.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(this.myName.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
|
|
||||||
this.currentMouseX = mouseX;
|
this.currentMouseX = mouseX;
|
||||||
this.currentMouseY = mouseY;
|
this.currentMouseY = mouseY;
|
||||||
@@ -313,7 +313,7 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
|
|||||||
@Override
|
@Override
|
||||||
public void removed() {
|
public void removed() {
|
||||||
super.removed();
|
super.removed();
|
||||||
getClient().keyboard.enableRepeatEvents(false);
|
getClient().keyboard.setRepeatEvents(false);
|
||||||
memoryText = this.searchField.getText();
|
memoryText = this.searchField.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,19 +101,19 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, GuiText.NetworkDetails.text(), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, GuiText.NetworkDetails.text(), 8, 6, 4210752);
|
||||||
|
|
||||||
this.textRenderer.method_30883(matrices,
|
this.textRenderer.draw(matrices,
|
||||||
GuiText.StoredPower.withSuffix(": " + Platform.formatPowerLong(handler.getCurrentPower(), false)), 13, 16,
|
GuiText.StoredPower.withSuffix(": " + Platform.formatPowerLong(handler.getCurrentPower(), false)), 13, 16,
|
||||||
4210752);
|
4210752);
|
||||||
this.textRenderer.method_30883(matrices,
|
this.textRenderer.draw(matrices,
|
||||||
GuiText.MaxPower.withSuffix(": " + Platform.formatPowerLong(handler.getMaxPower(), false)), 13, 26,
|
GuiText.MaxPower.withSuffix(": " + Platform.formatPowerLong(handler.getMaxPower(), false)), 13, 26,
|
||||||
4210752);
|
4210752);
|
||||||
|
|
||||||
this.textRenderer.method_30883(matrices,
|
this.textRenderer.draw(matrices,
|
||||||
GuiText.PowerInputRate.withSuffix(": " + Platform.formatPowerLong(handler.getAverageAddition(), true)), 13,
|
GuiText.PowerInputRate.withSuffix(": " + Platform.formatPowerLong(handler.getAverageAddition(), true)), 13,
|
||||||
143 - 10, 4210752);
|
143 - 10, 4210752);
|
||||||
this.textRenderer.method_30883(matrices,
|
this.textRenderer.draw(matrices,
|
||||||
GuiText.PowerUsageRate.withSuffix(": " + Platform.formatPowerLong(handler.getPowerUsage(), true)), 13,
|
GuiText.PowerUsageRate.withSuffix(": " + Platform.formatPowerLong(handler.getPowerUsage(), true)), 13,
|
||||||
143 - 20, 4210752);
|
143 - 20, 4210752);
|
||||||
|
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ public class NetworkToolScreen extends AEBaseScreen<NetworkToolContainer> {
|
|||||||
this.tFacades.setState(handler.isFacadeMode());
|
this.tFacades.setState(handler.isFacadeMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.NetworkTool.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.NetworkTool.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ import net.minecraft.text.Text;
|
|||||||
*/
|
*/
|
||||||
public class NumberEntryWidget implements ITickingWidget {
|
public class NumberEntryWidget implements ITickingWidget {
|
||||||
|
|
||||||
private static final Text PLUS = Text.method_30163("+");
|
private static final Text PLUS = Text.of("+");
|
||||||
private static final Text MINUS = Text.method_30163("+");
|
private static final Text MINUS = Text.of("+");
|
||||||
|
|
||||||
private final AEBaseScreen<?> parent;
|
private final AEBaseScreen<?> parent;
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer>
|
|||||||
}
|
}
|
||||||
|
|
||||||
super.drawFG(matrices, offsetX, offsetY, mouseX, mouseY);
|
super.drawFG(matrices, offsetX, offsetY, mouseX, mouseY);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.PatternTerminal.text(), 8,
|
this.textRenderer.draw(matrices, GuiText.PatternTerminal.text(), 8,
|
||||||
this.backgroundHeight - 96 + 2 - this.getReservedSpace(), 4210752);
|
this.backgroundHeight - 96 + 2 - this.getReservedSpace(), 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class PriorityScreen extends AEBaseScreen<PriorityContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, GuiText.Priority.text(), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, GuiText.Priority.text(), 8, 6, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ public class QNBScreen extends AEBaseScreen<QNBContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.QuantumLinkChamber.text()), 8, 6,
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.QuantumLinkChamber.text()), 8, 6,
|
||||||
4210752);
|
4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.QuartzCuttingKnife.text()), 8, 6,
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.QuartzCuttingKnife.text()), 8, 6,
|
||||||
4210752);
|
4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class SecurityStationScreen extends MEMonitorableScreen<SecurityStationCo
|
|||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
super.drawFG(matrices, offsetX, offsetY, mouseX, mouseY);
|
super.drawFG(matrices, offsetX, offsetY, mouseX, mouseY);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.SecurityCardEditor.text(), 8,
|
this.textRenderer.draw(matrices, GuiText.SecurityCardEditor.text(), 8,
|
||||||
this.backgroundHeight - 96 + 1 - this.getReservedSpace(), 4210752);
|
this.backgroundHeight - 96 + 1 - this.getReservedSpace(), 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ public class SkyChestScreen extends AEBaseScreen<SkyChestContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.SkyChest.text()), 8, 8, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.SkyChest.text()), 8, 8, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 2, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 2, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -43,27 +43,27 @@ public class SpatialIOPortScreen extends AEBaseScreen<SpatialIOPortContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices,
|
this.textRenderer.draw(matrices,
|
||||||
GuiText.StoredPower.withSuffix(": " + Platform.formatPowerLong(this.handler.getCurrentPower(), false)),
|
GuiText.StoredPower.withSuffix(": " + Platform.formatPowerLong(this.handler.getCurrentPower(), false)),
|
||||||
13, 21, 4210752);
|
13, 21, 4210752);
|
||||||
this.textRenderer.method_30883(matrices,
|
this.textRenderer.draw(matrices,
|
||||||
GuiText.MaxPower.withSuffix(": " + Platform.formatPowerLong(this.handler.getMaxPower(), false)), 13, 31,
|
GuiText.MaxPower.withSuffix(": " + Platform.formatPowerLong(this.handler.getMaxPower(), false)), 13, 31,
|
||||||
4210752);
|
4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.RequiredPower
|
this.textRenderer.draw(matrices, GuiText.RequiredPower
|
||||||
.withSuffix(": " + Platform.formatPowerLong(this.handler.getRequiredPower(), false)), 13, 73, 4210752);
|
.withSuffix(": " + Platform.formatPowerLong(this.handler.getRequiredPower(), false)), 13, 73, 4210752);
|
||||||
this.textRenderer.method_30883(matrices,
|
this.textRenderer.draw(matrices,
|
||||||
GuiText.Efficiency.withSuffix(": " + (((float) this.handler.getEfficency()) / 100) + '%'), 13, 83,
|
GuiText.Efficiency.withSuffix(": " + (((float) this.handler.getEfficency()) / 100) + '%'), 13, 83,
|
||||||
4210752);
|
4210752);
|
||||||
|
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.SpatialIOPort.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.SpatialIOPort.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96, 4210752);
|
||||||
|
|
||||||
if (this.handler.xSize != 0 && this.handler.ySize != 0 && this.handler.zSize != 0) {
|
if (this.handler.xSize != 0 && this.handler.ySize != 0 && this.handler.zSize != 0) {
|
||||||
final Text text = GuiText.SCSSize
|
final Text text = GuiText.SCSSize
|
||||||
.withSuffix(": " + this.handler.xSize + "x" + this.handler.ySize + "x" + this.handler.zSize);
|
.withSuffix(": " + this.handler.xSize + "x" + this.handler.ySize + "x" + this.handler.zSize);
|
||||||
this.textRenderer.method_30883(matrices, text, 13, 93, 4210752);
|
this.textRenderer.draw(matrices, text, 13, 93, 4210752);
|
||||||
} else {
|
} else {
|
||||||
this.textRenderer.method_30883(matrices, GuiText.SCSSize.withSuffix(": ").append(GuiText.SCSInvalid.text()),
|
this.textRenderer.draw(matrices, GuiText.SCSSize.withSuffix(": ").append(GuiText.SCSInvalid.text()),
|
||||||
13, 93, 4210752);
|
13, 93, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.StorageBus.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.StorageBus.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
|
|
||||||
if (this.fuzzyMode != null) {
|
if (this.fuzzyMode != null) {
|
||||||
this.fuzzyMode.set(this.cvb.getFuzzyMode());
|
this.fuzzyMode.set(this.cvb.getFuzzyMode());
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(this.getName().text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(this.getName().text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
|
|
||||||
if (this.redstoneMode != null) {
|
if (this.redstoneMode != null) {
|
||||||
this.redstoneMode.set(this.cvb.getRedStoneMode());
|
this.redstoneMode.set(this.cvb.getRedStoneMode());
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContain
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.VibrationChamber.text()), 8, 6,
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.VibrationChamber.text()), 8, 6,
|
||||||
4210752);
|
4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
|
|
||||||
this.pb.setFullMsg(new LiteralText(VibrationChamberBlockEntity.POWER_PER_TICK
|
this.pb.setFullMsg(new LiteralText(VibrationChamberBlockEntity.POWER_PER_TICK
|
||||||
* this.handler.getCurrentProgress() / VibrationChamberBlockEntity.DILATION_SCALING + " AE/t"));
|
* this.handler.getCurrentProgress() / VibrationChamberBlockEntity.DILATION_SCALING + " AE/t"));
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ public class WirelessScreen extends AEBaseScreen<WirelessContainer> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.Wireless.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.Wireless.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
|
|
||||||
if (handler.getRange() > 0) {
|
if (handler.getRange() > 0) {
|
||||||
final String firstMessage = GuiText.Range.text() + ": " + (handler.getRange() / 10.0) + " m";
|
final String firstMessage = GuiText.Range.text() + ": " + (handler.getRange() / 10.0) + " m";
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class SlotDisconnected extends AppEngSlot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxStackAmount() {
|
public int getMaxItemCount() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class SlotFluidME extends Slot implements IMEFluidSlot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxStackAmount() {
|
public int getMaxItemCount() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class SlotME extends Slot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxStackAmount() {
|
public int getMaxItemCount() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class StackSizeRenderer {
|
|||||||
final int Y = (int) ((yPos + offset + 16.0f - 7.0f * scaleFactor) * inverseScaleFactor);
|
final int Y = (int) ((yPos + offset + 16.0f - 7.0f * scaleFactor) * inverseScaleFactor);
|
||||||
VertexConsumerProvider.Immediate buffer = VertexConsumerProvider
|
VertexConsumerProvider.Immediate buffer = VertexConsumerProvider
|
||||||
.immediate(Tessellator.getInstance().getBuffer());
|
.immediate(Tessellator.getInstance().getBuffer());
|
||||||
fontRenderer.method_30882(text, X, Y, 16777215, true, tm.getMatrix(), buffer, false, 0, 15728880);
|
fontRenderer.draw(text, X, Y, 16777215, true, tm.getMatrix(), buffer, false, 0, 15728880);
|
||||||
buffer.draw();
|
buffer.draw();
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -424,8 +424,8 @@ public abstract class AEBaseContainer extends ScreenHandler {
|
|||||||
|
|
||||||
if (Platform.itemComparisons().isSameItem(t, tis)) {
|
if (Platform.itemComparisons().isSameItem(t, tis)) {
|
||||||
int maxSize = t.getMaxCount();
|
int maxSize = t.getMaxCount();
|
||||||
if (maxSize > d.getMaxStackAmount()) {
|
if (maxSize > d.getMaxItemCount()) {
|
||||||
maxSize = d.getMaxStackAmount();
|
maxSize = d.getMaxItemCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
int placeable = maxSize - t.getCount();
|
int placeable = maxSize - t.getCount();
|
||||||
@@ -468,8 +468,8 @@ public abstract class AEBaseContainer extends ScreenHandler {
|
|||||||
|
|
||||||
if (Platform.itemComparisons().isSameItem(t, tis)) {
|
if (Platform.itemComparisons().isSameItem(t, tis)) {
|
||||||
int maxSize = t.getMaxCount();
|
int maxSize = t.getMaxCount();
|
||||||
if (maxSize > d.getMaxStackAmount()) {
|
if (maxSize > d.getMaxItemCount()) {
|
||||||
maxSize = d.getMaxStackAmount();
|
maxSize = d.getMaxItemCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
int placeable = maxSize - t.getCount();
|
int placeable = maxSize - t.getCount();
|
||||||
@@ -497,8 +497,8 @@ public abstract class AEBaseContainer extends ScreenHandler {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int maxSize = tis.getMaxCount();
|
int maxSize = tis.getMaxCount();
|
||||||
if (maxSize > d.getMaxStackAmount()) {
|
if (maxSize > d.getMaxItemCount()) {
|
||||||
maxSize = d.getMaxStackAmount();
|
maxSize = d.getMaxItemCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
final ItemStack tmp = tis.copy();
|
final ItemStack tmp = tis.copy();
|
||||||
@@ -964,25 +964,25 @@ public abstract class AEBaseContainer extends ScreenHandler {
|
|||||||
ItemStack testB = isA.isEmpty() ? ItemStack.EMPTY : isA.copy();
|
ItemStack testB = isA.isEmpty() ? ItemStack.EMPTY : isA.copy();
|
||||||
|
|
||||||
// can put some back?
|
// can put some back?
|
||||||
if (!testA.isEmpty() && testA.getCount() > a.getMaxStackAmount()) {
|
if (!testA.isEmpty() && testA.getCount() > a.getMaxItemCount()) {
|
||||||
if (!testB.isEmpty()) {
|
if (!testB.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int totalA = testA.getCount();
|
final int totalA = testA.getCount();
|
||||||
testA.setCount(a.getMaxStackAmount());
|
testA.setCount(a.getMaxItemCount());
|
||||||
testB = testA.copy();
|
testB = testA.copy();
|
||||||
|
|
||||||
testB.setCount(totalA - testA.getCount());
|
testB.setCount(totalA - testA.getCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!testB.isEmpty() && testB.getCount() > b.getMaxStackAmount()) {
|
if (!testB.isEmpty() && testB.getCount() > b.getMaxItemCount()) {
|
||||||
if (!testA.isEmpty()) {
|
if (!testA.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int totalB = testB.getCount();
|
final int totalB = testB.getCount();
|
||||||
testB.setCount(b.getMaxStackAmount());
|
testB.setCount(b.getMaxItemCount());
|
||||||
testA = testB.copy();
|
testA = testB.copy();
|
||||||
|
|
||||||
testA.setCount(totalB - testA.getCount());
|
testA.setCount(totalB - testA.getCount());
|
||||||
|
|||||||
@@ -126,13 +126,13 @@ public class AppEngSlot extends Slot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxStackAmount() {
|
public int getMaxItemCount() {
|
||||||
return this.backingSlot.getMaxAmount(ItemStack.EMPTY);
|
return this.backingSlot.getMaxAmount(ItemStack.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxStackAmount(@Nonnull ItemStack stack) {
|
public int getMaxItemCount(@Nonnull ItemStack stack) {
|
||||||
return Math.min(this.getMaxStackAmount(), stack.getMaxCount());
|
return Math.min(this.getMaxItemCount(), stack.getMaxCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -80,11 +80,11 @@ public class RestrictedInputSlot extends AppEngSlot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxStackAmount() {
|
public int getMaxItemCount() {
|
||||||
if (this.stackLimit != -1) {
|
if (this.stackLimit != -1) {
|
||||||
return this.stackLimit;
|
return this.stackLimit;
|
||||||
}
|
}
|
||||||
return super.getMaxStackAmount();
|
return super.getMaxItemCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isValid(final ItemStack is, final World theWorld) {
|
public boolean isValid(final ItemStack is, final World theWorld) {
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ import appeng.worldgen.BiomeModifier;
|
|||||||
import appeng.worldgen.ChargedQuartzOreConfig;
|
import appeng.worldgen.ChargedQuartzOreConfig;
|
||||||
import appeng.worldgen.ChargedQuartzOreFeature;
|
import appeng.worldgen.ChargedQuartzOreFeature;
|
||||||
import appeng.worldgen.meteorite.MeteoriteStructure;
|
import appeng.worldgen.meteorite.MeteoriteStructure;
|
||||||
import appeng.worldgen.meteorite.MeteoriteStructurePiece;
|
|
||||||
import net.earthcomputer.libstructure.LibStructure;
|
import net.earthcomputer.libstructure.LibStructure;
|
||||||
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
|
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
|
||||||
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
|
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
|
||||||
@@ -549,15 +548,14 @@ public abstract class AppEngBase implements AppEng {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void registerWorldGen() {
|
private void registerWorldGen() {
|
||||||
MeteoriteStructurePiece.register();
|
|
||||||
|
|
||||||
LibStructure.registerStructure(MeteoriteStructure.ID, MeteoriteStructure.INSTANCE,
|
LibStructure.registerStructure(MeteoriteStructure.ID, MeteoriteStructure.INSTANCE,
|
||||||
GenerationStep.Feature.TOP_LAYER_MODIFICATION, new StructureConfig(32, 8, 124895654),
|
GenerationStep.Feature.TOP_LAYER_MODIFICATION, new StructureConfig(32, 8, 124895654),
|
||||||
new MeteoriteStructure(DefaultFeatureConfig.CODEC).configure(DefaultFeatureConfig.INSTANCE));
|
new MeteoriteStructure(DefaultFeatureConfig.CODEC).configure(DefaultFeatureConfig.INSTANCE));
|
||||||
Registry.register(Registry.FEATURE, AppEng.makeId("charged_quartz_ore"), ChargedQuartzOreFeature.INSTANCE);
|
Registry.register(Registry.FEATURE, AppEng.makeId("charged_quartz_ore"), ChargedQuartzOreFeature.INSTANCE);
|
||||||
|
|
||||||
// add to all standard biomes
|
// add to all standard biomes
|
||||||
Biome.BIOMES.forEach(b -> {
|
// TODO: Wrong...
|
||||||
|
BuiltinRegistries.BIOME.forEach(b -> {
|
||||||
addMeteoriteWorldGen(b);
|
addMeteoriteWorldGen(b);
|
||||||
addQuartzWorldGen(b);
|
addQuartzWorldGen(b);
|
||||||
});
|
});
|
||||||
@@ -612,7 +610,7 @@ public abstract class AppEngBase implements AppEng {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void registerDimension() {
|
private void registerDimension() {
|
||||||
Registry.register(BuiltinRegistries.BIOME, SpatialStorageDimensionIds.BIOME_ID, SpatialStorageBiome.INSTANCE);
|
BuiltinRegistries.add(BuiltinRegistries.BIOME, SpatialStorageDimensionIds.BIOME_KEY.getValue(), SpatialStorageBiome.INSTANCE);
|
||||||
Registry.register(Registry.CHUNK_GENERATOR, SpatialStorageDimensionIds.CHUNK_GENERATOR_ID, SpatialStorageChunkGenerator.CODEC);
|
Registry.register(Registry.CHUNK_GENERATOR, SpatialStorageDimensionIds.CHUNK_GENERATOR_ID, SpatialStorageChunkGenerator.CODEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package appeng.core.config;
|
package appeng.core.config;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
@@ -34,7 +33,7 @@ public class EnumOption<T extends Enum<T>> extends BaseOption {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected JsonElement write() {
|
protected JsonElement write() {
|
||||||
return new JsonPrimitive(currentValue.name().toLowerCase(Locale.ROOT));
|
return new JsonPrimitive(currentValue.name().toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -56,7 +55,7 @@ public class EnumOption<T extends Enum<T>> extends BaseOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String allowedValues = Arrays.stream(enumConstants).map(e -> e.name().toLowerCase(Locale.ROOT))
|
String allowedValues = Arrays.stream(enumConstants).map(e -> e.name().toLowerCase())
|
||||||
.collect(Collectors.joining(", "));
|
.collect(Collectors.joining(", "));
|
||||||
throw new ConfigValidationException(this, "Expected one of: " + allowedValues);
|
throw new ConfigValidationException(this, "Expected one of: " + allowedValues);
|
||||||
}
|
}
|
||||||
@@ -68,12 +67,12 @@ public class EnumOption<T extends Enum<T>> extends BaseOption {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDefaultAsString() {
|
public String getDefaultAsString() {
|
||||||
return String.valueOf(defaultValue.name().toLowerCase(Locale.ROOT));
|
return String.valueOf(defaultValue.name().toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getCurrentValueAsString() {
|
public String getCurrentValueAsString() {
|
||||||
return String.valueOf(currentValue.name().toLowerCase(Locale.ROOT));
|
return String.valueOf(currentValue.name().toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public final class WorldGenRegistry implements IWorldGen {
|
|||||||
throw new IllegalArgumentException("Bad Provider Passed");
|
throw new IllegalArgumentException("Bad Provider Passed");
|
||||||
}
|
}
|
||||||
|
|
||||||
Identifier id = w.getDimensionRegistryKey().getValue();
|
Identifier id = w.getRegistryKey().getValue();
|
||||||
final boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains(id);
|
final boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains(id);
|
||||||
final boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains(id);
|
final boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains(id);
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import com.google.common.base.Preconditions;
|
|||||||
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.world.ServerWorld;
|
import net.minecraft.server.world.ServerWorld;
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import appeng.services.CompassService;
|
import appeng.services.CompassService;
|
||||||
import appeng.services.compass.CompassThreadFactory;
|
import appeng.services.compass.CompassThreadFactory;
|
||||||
@@ -62,7 +62,7 @@ public final class WorldData implements IWorldData {
|
|||||||
Preconditions.checkNotNull(overworld);
|
Preconditions.checkNotNull(overworld);
|
||||||
|
|
||||||
// Attach shared data to the server's overworld dimension
|
// Attach shared data to the server's overworld dimension
|
||||||
if (overworld.getDimension() != DimensionType.getOverworldDimensionType()) {
|
if (overworld.getRegistryKey() != World.OVERWORLD) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"The server doesn't have an Overworld dimension we could store our data on!");
|
"The server doesn't have an Overworld dimension we could store our data on!");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import net.minecraft.util.math.BlockBox;
|
|||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.ChunkPos;
|
import net.minecraft.util.math.ChunkPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
|
||||||
import net.minecraft.world.chunk.WorldChunk;
|
import net.minecraft.world.chunk.WorldChunk;
|
||||||
|
|
||||||
import appeng.hooks.AEToolItem;
|
import appeng.hooks.AEToolItem;
|
||||||
@@ -131,7 +130,7 @@ public class MeteoritePlacerItem extends AEBaseItem implements AEToolItem {
|
|||||||
// is a debug tool, we'll not care about being terribly efficient here
|
// is a debug tool, we'll not care about being terribly efficient here
|
||||||
ChunkPos.stream(new ChunkPos(spawned.getPos()), 2).forEach(cp -> {
|
ChunkPos.stream(new ChunkPos(spawned.getPos()), 2).forEach(cp -> {
|
||||||
WorldChunk c = world.getChunk(cp.x, cp.z);
|
WorldChunk c = world.getChunk(cp.x, cp.z);
|
||||||
player.networkHandler.sendPacket(new ChunkDataS2CPacket(c, 65535, false)); // 65535 == full chunk
|
player.networkHandler.sendPacket(new ChunkDataS2CPacket(c, 65535)); // 65535 == full chunk
|
||||||
});
|
});
|
||||||
|
|
||||||
return ActionResult.SUCCESS;
|
return ActionResult.SUCCESS;
|
||||||
|
|||||||
@@ -64,10 +64,10 @@ public class FluidInterfaceScreen extends UpgradeableScreen<FluidInterfaceContai
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, int offsetX, int offsetY, int mouseX, int mouseY) {
|
public void drawFG(MatrixStack matrices, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(GuiText.FluidInterface.text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(GuiText.FluidInterface.text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.Config.text(), 35, 6 + 11 + 7, 4210752);
|
this.textRenderer.draw(matrices, GuiText.Config.text(), 35, 6 + 11 + 7, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.StoredFluids.text(), 35, 6 + 112 + 7, 4210752);
|
this.textRenderer.draw(matrices, GuiText.StoredFluids.text(), 35, 6 + 112 + 7, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class FluidLevelEmitterScreen extends UpgradeableScreen<FluidLevelEmitter
|
|||||||
public void drawFG(MatrixStack matrices, int offsetX, int offsetY, int mouseX, int mouseY) {
|
public void drawFG(MatrixStack matrices, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||||
super.drawFG(matrices, offsetX, offsetY, mouseX, mouseY);
|
super.drawFG(matrices, offsetX, offsetY, mouseX, mouseY);
|
||||||
|
|
||||||
this.textRenderer.method_30883(matrices, GuiText.FluidLevelEmitterUnit.text(), 110, 44, COLOR_DARK_GRAY);
|
this.textRenderer.draw(matrices, GuiText.FluidLevelEmitterUnit.text(), 110, 44, COLOR_DARK_GRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -98,8 +98,8 @@ public class FluidStorageBusScreen extends UpgradeableScreen<FluidStorageBusCont
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
public void drawFG(MatrixStack matrices, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(this.getName().text()), 8, 6, 4210752);
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(this.getName().text()), 8, 6, 4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
|
|
||||||
if (this.fuzzyMode != null) {
|
if (this.fuzzyMode != null) {
|
||||||
this.fuzzyMode.set(this.cvb.getFuzzyMode());
|
this.fuzzyMode.set(this.cvb.getFuzzyMode());
|
||||||
|
|||||||
@@ -125,9 +125,9 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawFG(MatrixStack matrices, int offsetX, int offsetY, int mouseX, int mouseY) {
|
public void drawFG(MatrixStack matrices, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||||
this.textRenderer.method_30883(matrices, this.getGuiDisplayName(new LiteralText("Fluid Terminal")), 8, 6,
|
this.textRenderer.draw(matrices, this.getGuiDisplayName(new LiteralText("Fluid Terminal")), 8, 6,
|
||||||
4210752);
|
4210752);
|
||||||
this.textRenderer.method_30883(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
this.textRenderer.draw(matrices, GuiText.inventory.text(), 8, this.backgroundHeight - 96 + 3, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -172,7 +172,7 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
|
|||||||
list.add(new LiteralText(formattedAmount));
|
list.add(new LiteralText(formattedAmount));
|
||||||
list.add(new LiteralText(modName));
|
list.add(new LiteralText(modName));
|
||||||
|
|
||||||
this.method_30901(matrices, list, mouseX, mouseY);
|
this.renderTooltip(matrices, list, mouseX, mouseY);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import java.text.DecimalFormatSymbols;
|
|||||||
|
|
||||||
import net.minecraft.client.font.TextRenderer;
|
import net.minecraft.client.font.TextRenderer;
|
||||||
import net.minecraft.text.LiteralText;
|
import net.minecraft.text.LiteralText;
|
||||||
import net.minecraft.text.StringRenderable;
|
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
|
|
||||||
import appeng.api.storage.data.IAEFluidStack;
|
import appeng.api.storage.data.IAEFluidStack;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import appeng.mixins.FluidTagsAccessor;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.FluidDrainable;
|
import net.minecraft.block.FluidDrainable;
|
||||||
import net.minecraft.block.entity.BlockEntity;
|
import net.minecraft.block.entity.BlockEntity;
|
||||||
@@ -13,18 +14,13 @@ import net.minecraft.fluid.Fluid;
|
|||||||
import net.minecraft.fluid.FluidState;
|
import net.minecraft.fluid.FluidState;
|
||||||
import net.minecraft.fluid.Fluids;
|
import net.minecraft.fluid.Fluids;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tag.FluidTags;
|
|
||||||
import net.minecraft.tag.Tag;
|
import net.minecraft.tag.Tag;
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Direction;
|
|
||||||
import net.minecraft.world.BlockView;
|
import net.minecraft.world.BlockView;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import alexiil.mc.lib.attributes.fluid.FluidAttributes;
|
|
||||||
import alexiil.mc.lib.attributes.fluid.amount.FluidAmount;
|
import alexiil.mc.lib.attributes.fluid.amount.FluidAmount;
|
||||||
import alexiil.mc.lib.attributes.fluid.volume.FluidKeys;
|
import alexiil.mc.lib.attributes.fluid.volume.FluidKeys;
|
||||||
import alexiil.mc.lib.attributes.fluid.volume.FluidVolume;
|
|
||||||
|
|
||||||
import appeng.api.config.Actionable;
|
import appeng.api.config.Actionable;
|
||||||
import appeng.api.config.PowerMultiplier;
|
import appeng.api.config.PowerMultiplier;
|
||||||
@@ -60,8 +56,7 @@ import appeng.util.Platform;
|
|||||||
|
|
||||||
public class FluidAnnihilationPlanePart extends BasicStatePart implements IGridTickable {
|
public class FluidAnnihilationPlanePart extends BasicStatePart implements IGridTickable {
|
||||||
|
|
||||||
public static final Identifier TAG_BLACKLIST = new Identifier(AppEng.MOD_ID,
|
public static final Tag.Identified<Fluid> TAG_BLACKLIST = FluidTagsAccessor.register(AppEng.makeId("blacklisted/fluid_annihilation_plane").toString());
|
||||||
"blacklisted/fluid_annihilation_plane");
|
|
||||||
|
|
||||||
private static final PlaneModels MODELS = new PlaneModels("part/fluid_annihilation_plane",
|
private static final PlaneModels MODELS = new PlaneModels("part/fluid_annihilation_plane",
|
||||||
"part/fluid_annihilation_plane_on");
|
"part/fluid_annihilation_plane_on");
|
||||||
@@ -217,8 +212,7 @@ public class FluidAnnihilationPlanePart extends BasicStatePart implements IGridT
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isFluidBlacklisted(Fluid fluid) {
|
private boolean isFluidBlacklisted(Fluid fluid) {
|
||||||
Tag<Fluid> tag = FluidTags.getTagGroup().getTagOrEmpty(TAG_BLACKLIST);
|
return fluid.isIn(TAG_BLACKLIST);
|
||||||
return fluid.isIn(tag);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package appeng.mixins;
|
||||||
|
|
||||||
|
import net.minecraft.fluid.Fluid;
|
||||||
|
import net.minecraft.tag.FluidTags;
|
||||||
|
import net.minecraft.tag.Tag;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||||
|
|
||||||
|
@Mixin(FluidTags.class)
|
||||||
|
public interface FluidTagsAccessor {
|
||||||
|
|
||||||
|
@Invoker("register")
|
||||||
|
static Tag.Identified<Fluid> register(String id) {
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,10 +2,12 @@ package appeng.mixins.spatial;
|
|||||||
|
|
||||||
import appeng.spatial.SpatialStorageDimensionIds;
|
import appeng.spatial.SpatialStorageDimensionIds;
|
||||||
import net.minecraft.tag.BlockTags;
|
import net.minecraft.tag.BlockTags;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.registry.DynamicRegistryManager;
|
import net.minecraft.util.registry.DynamicRegistryManager;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
import net.minecraft.world.dimension.DimensionType;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
@@ -20,10 +22,15 @@ import java.util.OptionalLong;
|
|||||||
@Mixin(DimensionType.class)
|
@Mixin(DimensionType.class)
|
||||||
public class DimensionTypeMixin {
|
public class DimensionTypeMixin {
|
||||||
|
|
||||||
|
@Invoker("<init>")
|
||||||
|
static DimensionType create(OptionalLong fixedTime, boolean hasSkylight, boolean hasCeiling, boolean ultrawarm, boolean natural, double coordinateScale, boolean piglinSafe, boolean bedWorks, boolean respawnAnchorWorks, boolean hasRaids, int logicalHeight, Identifier infiniburn, Identifier skyProperties, float ambientLight) {
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
|
||||||
@Inject(method = "addRegistryDefaults", at = @At("TAIL"))
|
@Inject(method = "addRegistryDefaults", at = @At("TAIL"))
|
||||||
private static void addRegistryDefaults(DynamicRegistryManager.Impl registryTracker, CallbackInfoReturnable<?> cir) {
|
private static void addRegistryDefaults(DynamicRegistryManager.Impl registryTracker, CallbackInfoReturnable<?> cir) {
|
||||||
DimensionType dimensionType = new DimensionType(OptionalLong.of(12000), false, false, false, false, false,
|
DimensionType dimensionType = create(OptionalLong.of(12000), false, false, false, false, 1.0,
|
||||||
false, true, false, false, 256, BlockTags.INFINIBURN_OVERWORLD.getId(), 1.0f);
|
false, false, false, false, 256, BlockTags.INFINIBURN_OVERWORLD.getId(), SpatialStorageDimensionIds.SKY_PROPERTIES_ID, 1.0f);
|
||||||
|
|
||||||
Registry.register(registryTracker.getDimensionTypes(),
|
Registry.register(registryTracker.getDimensionTypes(),
|
||||||
SpatialStorageDimensionIds.DIMENSION_TYPE_ID.getValue(), dimensionType);
|
SpatialStorageDimensionIds.DIMENSION_TYPE_ID.getValue(), dimensionType);
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package appeng.mixins.spatial;
|
||||||
|
|
||||||
|
import appeng.spatial.SpatialStorageDimensionIds;
|
||||||
|
import appeng.spatial.SpatialStorageHelper;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.world.TeleportTarget;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This mixin sets the teleport destination, because otherwise Vanilla will not move
|
||||||
|
* the player.
|
||||||
|
*/
|
||||||
|
@Mixin(Entity.class)
|
||||||
|
public class EntityMixin {
|
||||||
|
|
||||||
|
@Inject(method = "getTeleportTarget", at = @At("HEAD"), cancellable = true, allow = 1)
|
||||||
|
public void getTeleportTarget(ServerWorld destination, CallbackInfoReturnable<TeleportTarget> cri) {
|
||||||
|
// Check if a destination has been set for the entity currently being teleported
|
||||||
|
if (destination.getRegistryKey() == SpatialStorageDimensionIds.WORLD_ID) {
|
||||||
|
TeleportTarget target = SpatialStorageHelper.getInstance().getTeleportTarget();
|
||||||
|
if (target != null) {
|
||||||
|
cri.setReturnValue(target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,28 +1,25 @@
|
|||||||
package appeng.mixins.spatial;
|
package appeng.mixins.spatial;
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|
||||||
|
|
||||||
import net.minecraft.client.render.SkyProperties;
|
|
||||||
import net.minecraft.util.registry.RegistryKey;
|
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
|
||||||
|
|
||||||
import appeng.spatial.SpatialStorageDimensionIds;
|
import appeng.spatial.SpatialStorageDimensionIds;
|
||||||
import appeng.spatial.SpatialStorageSkyProperties;
|
import appeng.spatial.SpatialStorageSkyProperties;
|
||||||
|
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
|
||||||
|
import net.minecraft.client.render.SkyProperties;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
@Mixin(SkyProperties.class)
|
@Mixin(SkyProperties.class)
|
||||||
public class SkyPropertiesMixin {
|
public class SkyPropertiesMixin {
|
||||||
|
|
||||||
@Inject(method = "byDimensionType", at = @At("HEAD"), cancellable = true)
|
@Shadow
|
||||||
private static void byDimensionType(Optional<RegistryKey<DimensionType>> optional,
|
private static Object2ObjectMap<Identifier, SkyProperties> BY_IDENTIFIER;
|
||||||
CallbackInfoReturnable<SkyProperties> ci) {
|
|
||||||
if (optional.orElse(null) == SpatialStorageDimensionIds.DIMENSION_TYPE_ID) {
|
@Inject(method = "<clinit>", at = @At("TAIL"))
|
||||||
ci.setReturnValue(SpatialStorageSkyProperties.INSTANCE);
|
private static void init(CallbackInfo ci) {
|
||||||
}
|
BY_IDENTIFIER.put(SpatialStorageDimensionIds.SKY_PROPERTIES_ID, SpatialStorageSkyProperties.INSTANCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class SpatialStorageCommand implements ISubCommand {
|
|||||||
private void teleportBack(ServerCommandSource source) {
|
private void teleportBack(ServerCommandSource source) {
|
||||||
|
|
||||||
if (source.getWorld().getRegistryKey() != SpatialStorageDimensionIds.WORLD_ID) {
|
if (source.getWorld().getRegistryKey() != SpatialStorageDimensionIds.WORLD_ID) {
|
||||||
throw new CommandException(Text.method_30163("Must be within the spatial storage world."));
|
throw new CommandException(Text.of("Must be within the spatial storage world."));
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockPos playerPos = new BlockPos(source.getPosition());
|
BlockPos playerPos = new BlockPos(source.getPosition());
|
||||||
@@ -110,7 +110,7 @@ public class SpatialStorageCommand implements ISubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new CommandException(Text.method_30163("Couldn't find a plot for the current position."));
|
throw new CommandException(Text.of("Couldn't find a plot for the current position."));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ public class SpatialStorageCommand implements ISubCommand {
|
|||||||
TransitionInfo lastTransition = plot.getLastTransition();
|
TransitionInfo lastTransition = plot.getLastTransition();
|
||||||
if (lastTransition == null) {
|
if (lastTransition == null) {
|
||||||
throw new CommandException(
|
throw new CommandException(
|
||||||
Text.method_30163("This plot doesn't have a last known transition."));
|
Text.of("This plot doesn't have a last known transition."));
|
||||||
}
|
}
|
||||||
|
|
||||||
String command = getTeleportCommand(lastTransition.getWorldId(), lastTransition.getMin().add(0, 1, 0));
|
String command = getTeleportCommand(lastTransition.getWorldId(), lastTransition.getMin().add(0, 1, 0));
|
||||||
@@ -181,7 +181,7 @@ public class SpatialStorageCommand implements ISubCommand {
|
|||||||
sendKeyValuePair(source, "Source", sourceLink);
|
sendKeyValuePair(source, "Source", sourceLink);
|
||||||
sendKeyValuePair(source, "When", lastTransition.getTimestamp().toString());
|
sendKeyValuePair(source, "When", lastTransition.getTimestamp().toString());
|
||||||
} else {
|
} else {
|
||||||
source.sendFeedback(Text.method_30163("Last Transition unknown"), true);
|
source.sendFeedback(Text.of("Last Transition unknown"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -212,7 +212,7 @@ public class SpatialStorageCommand implements ISubCommand {
|
|||||||
|
|
||||||
if (!(cell.getItem() instanceof SpatialStorageCellItem)) {
|
if (!(cell.getItem() instanceof SpatialStorageCellItem)) {
|
||||||
throw new CommandException(
|
throw new CommandException(
|
||||||
Text.method_30163("Storage cell items don't implement the storage cell interface!"));
|
Text.of("Storage cell items don't implement the storage cell interface!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
SpatialStorageCellItem spatialCellItem = (SpatialStorageCellItem) cell.getItem();
|
SpatialStorageCellItem spatialCellItem = (SpatialStorageCellItem) cell.getItem();
|
||||||
@@ -267,7 +267,7 @@ public class SpatialStorageCommand implements ISubCommand {
|
|||||||
|
|
||||||
return style -> style.withFormatting(Formatting.UNDERLINE)
|
return style -> style.withFormatting(Formatting.UNDERLINE)
|
||||||
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command) )
|
.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command) )
|
||||||
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.method_30163(tooltip)));
|
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.of(tooltip)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ public class SpatialStorageCommand implements ISubCommand {
|
|||||||
private static SpatialStoragePlot getPlot(int plotId) {
|
private static SpatialStoragePlot getPlot(int plotId) {
|
||||||
SpatialStoragePlot plot = SpatialStoragePlotManager.INSTANCE.getPlot(plotId);
|
SpatialStoragePlot plot = SpatialStoragePlotManager.INSTANCE.getPlot(plotId);
|
||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
throw new CommandException(Text.method_30163("Plot not found: " + plotId));
|
throw new CommandException(Text.of("Plot not found: " + plotId));
|
||||||
}
|
}
|
||||||
return plot;
|
return plot;
|
||||||
}
|
}
|
||||||
@@ -296,7 +296,7 @@ public class SpatialStorageCommand implements ISubCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void sendKeyValuePair(ServerCommandSource source, String label, String value) {
|
private static void sendKeyValuePair(ServerCommandSource source, String label, String value) {
|
||||||
sendKeyValuePair(source, label, Text.method_30163(value));
|
sendKeyValuePair(source, label, Text.of(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -304,7 +304,7 @@ public class SpatialStorageCommand implements ISubCommand {
|
|||||||
*/
|
*/
|
||||||
private static SpatialStoragePlot getCurrentPlot(ServerCommandSource source) {
|
private static SpatialStoragePlot getCurrentPlot(ServerCommandSource source) {
|
||||||
if (source.getWorld().getRegistryKey() != SpatialStorageDimensionIds.WORLD_ID) {
|
if (source.getWorld().getRegistryKey() != SpatialStorageDimensionIds.WORLD_ID) {
|
||||||
throw new CommandException(Text.method_30163("Must be within the spatial storage world."));
|
throw new CommandException(Text.of("Must be within the spatial storage world."));
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockPos playerPos = new BlockPos(source.getPosition());
|
BlockPos playerPos = new BlockPos(source.getPosition());
|
||||||
@@ -321,7 +321,7 @@ public class SpatialStorageCommand implements ISubCommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new CommandException(Text.method_30163("Couldn't find a plot for the current position."));
|
throw new CommandException(Text.of("Couldn't find a plot for the current position."));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ public class CachedPlane {
|
|||||||
WorldData.instance().compassData().service().updateArea((ServerWorld) this.getWorld(), c);
|
WorldData.instance().compassData().service().updateArea((ServerWorld) this.getWorld(), c);
|
||||||
|
|
||||||
// FIXME this was sending chunks to players...
|
// FIXME this was sending chunks to players...
|
||||||
ChunkDataS2CPacket cdp = new ChunkDataS2CPacket(c, verticalBits, false);
|
ChunkDataS2CPacket cdp = new ChunkDataS2CPacket(c, verticalBits);
|
||||||
world.getChunkManager().threadedAnvilChunkStorage
|
world.getChunkManager().threadedAnvilChunkStorage
|
||||||
.getPlayersWatchingChunk(c.getPos(), false).forEach(spe -> spe.networkHandler.sendPacket(cdp));
|
.getPlayersWatchingChunk(c.getPos(), false).forEach(spe -> spe.networkHandler.sendPacket(cdp));
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import net.minecraft.world.gen.surfacebuilder.SurfaceBuilder;
|
|||||||
*/
|
*/
|
||||||
public class SpatialStorageBiome {
|
public class SpatialStorageBiome {
|
||||||
|
|
||||||
public static final Biome INSTANCE = new Biome.Settings()
|
public static final Biome INSTANCE = new Biome.Builder()
|
||||||
.generationSettings(new GenerationSettings.Builder()
|
.generationSettings(new GenerationSettings.Builder()
|
||||||
.surfaceBuilder(new ConfiguredSurfaceBuilder<>(SurfaceBuilder.NOPE, SurfaceBuilder.STONE_CONFIG))
|
.surfaceBuilder(new ConfiguredSurfaceBuilder<>(SurfaceBuilder.NOPE, SurfaceBuilder.STONE_CONFIG))
|
||||||
.build())
|
.build())
|
||||||
@@ -39,6 +39,6 @@ public class SpatialStorageBiome {
|
|||||||
.temperature(0.5F).downfall(0.5F)
|
.temperature(0.5F).downfall(0.5F)
|
||||||
.effects(new BiomeEffects.Builder().waterColor(4159204).waterFogColor(329011).fogColor(0).skyColor(0x111111)
|
.effects(new BiomeEffects.Builder().waterColor(4159204).waterFogColor(329011).fogColor(0).skyColor(0x111111)
|
||||||
.build())
|
.build())
|
||||||
.parent(null).spawnSettings(new SpawnSettings.Builder().creatureSpawnProbability(0).build()).build();
|
.spawnSettings(new SpawnSettings.Builder().creatureSpawnProbability(0).build()).build();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,21 +18,18 @@
|
|||||||
|
|
||||||
package appeng.spatial;
|
package appeng.spatial;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import appeng.core.Api;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import com.mojang.serialization.Codec;
|
import com.mojang.serialization.Codec;
|
||||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.registry.Registry;
|
||||||
|
import net.minecraft.util.registry.RegistryLookupCodec;
|
||||||
import net.minecraft.world.BlockView;
|
import net.minecraft.world.BlockView;
|
||||||
import net.minecraft.world.ChunkRegion;
|
import net.minecraft.world.ChunkRegion;
|
||||||
import net.minecraft.world.Heightmap;
|
import net.minecraft.world.Heightmap;
|
||||||
import net.minecraft.world.WorldAccess;
|
import net.minecraft.world.WorldAccess;
|
||||||
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.biome.source.BiomeAccess;
|
import net.minecraft.world.biome.source.BiomeAccess;
|
||||||
import net.minecraft.world.biome.source.BiomeSource;
|
|
||||||
import net.minecraft.world.biome.source.FixedBiomeSource;
|
import net.minecraft.world.biome.source.FixedBiomeSource;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
import net.minecraft.world.gen.GenerationStep;
|
import net.minecraft.world.gen.GenerationStep;
|
||||||
@@ -41,25 +38,34 @@ import net.minecraft.world.gen.chunk.ChunkGenerator;
|
|||||||
import net.minecraft.world.gen.chunk.StructuresConfig;
|
import net.minecraft.world.gen.chunk.StructuresConfig;
|
||||||
import net.minecraft.world.gen.chunk.VerticalBlockSample;
|
import net.minecraft.world.gen.chunk.VerticalBlockSample;
|
||||||
|
|
||||||
import appeng.core.Api;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Chunk generator the spatial storage world.
|
* Chunk generator the spatial storage world.
|
||||||
*/
|
*/
|
||||||
public class SpatialStorageChunkGenerator extends ChunkGenerator {
|
public class SpatialStorageChunkGenerator extends ChunkGenerator {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This codec is necessary to restore the actual instance of the Biome we use,
|
||||||
|
* since it is sources from the dynamic registries and <em>must be the same object as in the registry!</em>.
|
||||||
|
* <p>If it was not the same object, then the Object->ID lookup would fail since it uses an identity hashmap
|
||||||
|
* internally.
|
||||||
|
*/
|
||||||
|
public static final Codec<SpatialStorageChunkGenerator> CODEC
|
||||||
|
= RegistryLookupCodec.of(Registry.BIOME_KEY).xmap(SpatialStorageChunkGenerator::new, SpatialStorageChunkGenerator::getBiomeRegistry).stable().codec();
|
||||||
|
|
||||||
|
private final Registry<Biome> biomeRegistry;
|
||||||
|
|
||||||
private final VerticalBlockSample columnSample;
|
private final VerticalBlockSample columnSample;
|
||||||
|
|
||||||
public static final SpatialStorageChunkGenerator INSTANCE = new SpatialStorageChunkGenerator();
|
|
||||||
|
|
||||||
public static final Codec<SpatialStorageChunkGenerator> CODEC = RecordCodecBuilder
|
|
||||||
.create((instance) -> instance.stable(INSTANCE));
|
|
||||||
|
|
||||||
private final BlockState defaultBlockState;
|
private final BlockState defaultBlockState;
|
||||||
|
|
||||||
private SpatialStorageChunkGenerator() {
|
private SpatialStorageChunkGenerator(Registry<Biome> biomeRegistry) {
|
||||||
super(createBiomeProvider(), createSettings());
|
super(createBiomeSource(biomeRegistry), createSettings());
|
||||||
this.defaultBlockState = Api.instance().definitions().blocks().matrixFrame().block().getDefaultState();
|
this.defaultBlockState = Api.instance().definitions().blocks().matrixFrame().block().getDefaultState();
|
||||||
|
this.biomeRegistry = biomeRegistry;
|
||||||
|
|
||||||
// Vertical sample is mostly used for Feature generation, for those purposes
|
// Vertical sample is mostly used for Feature generation, for those purposes
|
||||||
// we're all filled with matrix blocks
|
// we're all filled with matrix blocks
|
||||||
@@ -68,13 +74,18 @@ public class SpatialStorageChunkGenerator extends ChunkGenerator {
|
|||||||
this.columnSample = new VerticalBlockSample(columnSample);
|
this.columnSample = new VerticalBlockSample(columnSample);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Codec<? extends ChunkGenerator> getCodec() {
|
protected Codec<? extends ChunkGenerator> getCodec() {
|
||||||
return CODEC;
|
return CODEC;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static BiomeSource createBiomeProvider() {
|
private static FixedBiomeSource createBiomeSource(Registry<Biome> biomeRegistry) {
|
||||||
return new FixedBiomeSource(SpatialStorageBiome.INSTANCE);
|
return new FixedBiomeSource(biomeRegistry.method_31140(SpatialStorageDimensionIds.BIOME_KEY));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Registry<Biome> getBiomeRegistry() {
|
||||||
|
return biomeRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static StructuresConfig createSettings() {
|
private static StructuresConfig createSettings() {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import net.minecraft.util.Identifier;
|
|||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
import net.minecraft.util.registry.RegistryKey;
|
import net.minecraft.util.registry.RegistryKey;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.dimension.DimensionOptions;
|
import net.minecraft.world.dimension.DimensionOptions;
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
import net.minecraft.world.dimension.DimensionType;
|
||||||
|
|
||||||
@@ -31,7 +32,7 @@ public final class SpatialStorageDimensionIds {
|
|||||||
* ID of the {@link net.minecraft.world.biome.Biome} used for the spatial
|
* ID of the {@link net.minecraft.world.biome.Biome} used for the spatial
|
||||||
* storage world.
|
* storage world.
|
||||||
*/
|
*/
|
||||||
public static final Identifier BIOME_ID = AppEng.makeId("spatial_storage");
|
public static final RegistryKey<Biome> BIOME_KEY = RegistryKey.of(Registry.BIOME_KEY, AppEng.makeId("spatial_storage"));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the {@link DimensionOptions} used for the spatial storage dimension.
|
* ID of the {@link DimensionOptions} used for the spatial storage dimension.
|
||||||
@@ -49,6 +50,11 @@ public final class SpatialStorageDimensionIds {
|
|||||||
public static final RegistryKey<World> WORLD_ID = RegistryKey.of(Registry.DIMENSION,
|
public static final RegistryKey<World> WORLD_ID = RegistryKey.of(Registry.DIMENSION,
|
||||||
AppEng.makeId("spatial_storage"));
|
AppEng.makeId("spatial_storage"));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID of the {@link net.minecraft.client.render.SkyProperties} used for the spatial storage world.
|
||||||
|
*/
|
||||||
|
public static Identifier SKY_PROPERTIES_ID = AppEng.makeId("spatial_storage");
|
||||||
|
|
||||||
private SpatialStorageDimensionIds() {
|
private SpatialStorageDimensionIds() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
|
|
||||||
package appeng.spatial;
|
package appeng.spatial;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import appeng.api.util.WorldCoord;
|
||||||
import java.util.List;
|
import appeng.core.Api;
|
||||||
|
import appeng.core.AppEng;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
@@ -30,15 +30,13 @@ import net.minecraft.server.world.ServerWorld;
|
|||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Box;
|
import net.minecraft.util.math.Box;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.util.registry.RegistryKey;
|
import net.minecraft.world.TeleportTarget;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.ChunkStatus;
|
import net.minecraft.world.chunk.ChunkStatus;
|
||||||
import net.minecraft.world.dimension.DimensionType;
|
|
||||||
|
|
||||||
import appeng.api.util.WorldCoord;
|
import java.util.ArrayList;
|
||||||
import appeng.core.Api;
|
import java.util.List;
|
||||||
import appeng.core.AppEng;
|
|
||||||
|
|
||||||
public class SpatialStorageHelper {
|
public class SpatialStorageHelper {
|
||||||
|
|
||||||
@@ -51,12 +49,20 @@ public class SpatialStorageHelper {
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final ThreadLocal<TeleportTarget> teleportTarget = new ThreadLocal<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If an entity is currently being teleported, this will return the target within the target dimension.
|
||||||
|
*/
|
||||||
|
public TeleportTarget getTeleportTarget() {
|
||||||
|
return teleportTarget.get();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mostly from dimensional doors.. which mostly got it form X-Comp.
|
* Mostly from dimensional doors.. which mostly got it form X-Comp.
|
||||||
*
|
*
|
||||||
* @param entity to be teleported entity
|
* @param entity to be teleported entity
|
||||||
* @param link destination
|
* @param link destination
|
||||||
*
|
|
||||||
* @return teleported entity
|
* @return teleported entity
|
||||||
*/
|
*/
|
||||||
private Entity teleportEntity(Entity entity, final TelDestination link) {
|
private Entity teleportEntity(Entity entity, final TelDestination link) {
|
||||||
@@ -99,16 +105,20 @@ public class SpatialStorageHelper {
|
|||||||
ChunkStatus.FULL, true);
|
ChunkStatus.FULL, true);
|
||||||
|
|
||||||
if (entity instanceof ServerPlayerEntity
|
if (entity instanceof ServerPlayerEntity
|
||||||
&& link.dim.getDimensionRegistryKey() == SpatialStorageDimensionIds.DIMENSION_TYPE_ID) {
|
&& link.dim.getRegistryKey() == SpatialStorageDimensionIds.WORLD_ID) {
|
||||||
AppEng.instance().getAdvancementTriggers().getSpatialExplorer().trigger((ServerPlayerEntity) entity);
|
AppEng.instance().getAdvancementTriggers().getSpatialExplorer().trigger((ServerPlayerEntity) entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME FABRIC new METeleporter(link)
|
// Store in a threadlocal so that EntityMixin can return it for the Vanilla logic to use
|
||||||
float yaw = entity.yaw;
|
teleportTarget.set(new TeleportTarget(new Vec3d(link.x, link.y, link.z),
|
||||||
|
Vec3d.ZERO,
|
||||||
|
entity.yaw,
|
||||||
|
entity.pitch));
|
||||||
|
try {
|
||||||
entity = entity.moveToWorld(link.dim);
|
entity = entity.moveToWorld(link.dim);
|
||||||
entity.yaw = yaw;
|
} finally {
|
||||||
entity.refreshPositionAfterTeleport(link.x, link.y, link.z);
|
teleportTarget.remove();
|
||||||
entity.setVelocity(0, 0, 0);
|
}
|
||||||
|
|
||||||
if (!passengersOnOtherSide.isEmpty()) {
|
if (!passengersOnOtherSide.isEmpty()) {
|
||||||
for (Entity passanger : passengersOnOtherSide) {
|
for (Entity passanger : passengersOnOtherSide) {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import net.minecraft.util.math.BlockPos;
|
|||||||
|
|
||||||
import appeng.core.AELog;
|
import appeng.core.AELog;
|
||||||
import appeng.core.Api;
|
import appeng.core.Api;
|
||||||
|
import net.minecraft.world.TeleportTarget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocates and manages plots for spatial storage in the spatial storage world.
|
* Allocates and manages plots for spatial storage in the spatial storage world.
|
||||||
|
|||||||
@@ -121,7 +121,8 @@ public class MeteoriteStructureStart extends StructureStart<DefaultFeatureConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
private CraterType determineCraterType(Biome biome) {
|
private CraterType determineCraterType(Biome biome) {
|
||||||
final Biome.TemperatureGroup temp = biome.getTemperatureGroup();
|
// The temperature thresholds below are taken from older Vanilla code (temperature categories)
|
||||||
|
final float temp = biome.getTemperature();
|
||||||
final Category category = biome.getCategory();
|
final Category category = biome.getCategory();
|
||||||
|
|
||||||
// No craters in oceans
|
// No craters in oceans
|
||||||
@@ -138,7 +139,7 @@ public class MeteoriteStructureStart extends StructureStart<DefaultFeatureConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Warm biomes, higher chance for lava
|
// Warm biomes, higher chance for lava
|
||||||
if (temp == Biome.TemperatureGroup.WARM) {
|
if (temp >= 1) {
|
||||||
|
|
||||||
// 50% chance to actually spawn as lava
|
// 50% chance to actually spawn as lava
|
||||||
final boolean lava = random.nextFloat() > .5f;
|
final boolean lava = random.nextFloat() > .5f;
|
||||||
@@ -161,7 +162,7 @@ public class MeteoriteStructureStart extends StructureStart<DefaultFeatureConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Temperate biomes. Water or maybe lava
|
// Temperate biomes. Water or maybe lava
|
||||||
if (temp == Biome.TemperatureGroup.MEDIUM) {
|
if (temp < 1 && temp >= 0.2) {
|
||||||
// 75% chance to actually spawn with a crater lake
|
// 75% chance to actually spawn with a crater lake
|
||||||
final boolean lake = random.nextFloat() > .25f;
|
final boolean lake = random.nextFloat() > .25f;
|
||||||
// 20% to spawn with lava
|
// 20% to spawn with lava
|
||||||
@@ -187,7 +188,7 @@ public class MeteoriteStructureStart extends StructureStart<DefaultFeatureConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Cold biomes, Snow or Ice, maybe water and very rarely lava.
|
// Cold biomes, Snow or Ice, maybe water and very rarely lava.
|
||||||
if (temp == Biome.TemperatureGroup.COLD) {
|
if (temp < 0.2) {
|
||||||
// 75% chance to actually spawn with a crater lake
|
// 75% chance to actually spawn with a crater lake
|
||||||
final boolean lake = random.nextFloat() > .25f;
|
final boolean lake = random.nextFloat() > .25f;
|
||||||
// 5% to spawn with lava
|
// 5% to spawn with lava
|
||||||
|
|||||||
@@ -20,3 +20,4 @@ accessible method net/minecraft/data/server/BlockLootTableGenerator applyExplosi
|
|||||||
accessible method net/minecraft/world/dimension/DimensionType <init> (Ljava/util/OptionalLong;ZZZZZZZZZILnet/minecraft/util/Identifier;F)V
|
accessible method net/minecraft/world/dimension/DimensionType <init> (Ljava/util/OptionalLong;ZZZZZZZZZILnet/minecraft/util/Identifier;F)V
|
||||||
|
|
||||||
accessible method net/minecraft/recipe/RecipeManager getAllOfType (Lnet/minecraft/recipe/RecipeType;)Ljava/util/Map;
|
accessible method net/minecraft/recipe/RecipeManager getAllOfType (Lnet/minecraft/recipe/RecipeType;)Ljava/util/Map;
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"mixins": [
|
"mixins": [
|
||||||
"spatial.DimensionTypeMixin",
|
"spatial.DimensionTypeMixin",
|
||||||
"spatial.DimensionOptionMixin",
|
"spatial.DimensionOptionMixin",
|
||||||
|
"spatial.EntityMixin",
|
||||||
"CriteriaRegisterMixin",
|
"CriteriaRegisterMixin",
|
||||||
"RemainderSetter",
|
"RemainderSetter",
|
||||||
"ScreenHandlerListeners",
|
"ScreenHandlerListeners",
|
||||||
@@ -16,7 +17,8 @@
|
|||||||
"GenerationSettingsAccessor",
|
"GenerationSettingsAccessor",
|
||||||
"BiomeAccessor",
|
"BiomeAccessor",
|
||||||
"ServerWorldCustomItemEntityMixin",
|
"ServerWorldCustomItemEntityMixin",
|
||||||
"HopperMixin"
|
"HopperMixin",
|
||||||
|
"FluidTagsAccessor"
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
"spatial.SkyRenderMixin",
|
"spatial.SkyRenderMixin",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"tag": "c:sand_blocks"
|
"tag": "c:sand_blocks"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"tag": "forge:dusts/quartz"
|
"tag": "c:quartz_dusts"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"result": "appliedenergistics2:silicon",
|
"result": "appliedenergistics2:silicon",
|
||||||
"ingredient": [
|
"ingredient": [
|
||||||
{
|
{
|
||||||
"tag": "c:dusts/quartz"
|
"tag": "c:quartz_dusts"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"tag": "appliedenergistics2:dusts/certus_quartz"
|
"tag": "appliedenergistics2:dusts/certus_quartz"
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"values": ["#appliedenergistics2:dusts/certus_quartz", "#forge:dusts/quartz"]
|
"values": ["#appliedenergistics2:dusts/certus_quartz", "#c:quartz_dusts"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user