More compile error fixes.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package nl.requios.effortlessbuilding.create.foundation;
|
||||
|
||||
import nl.requios.effortlessbuilding.create.CreateClient;
|
||||
import nl.requios.effortlessbuilding.create.foundation.sound.SoundScapes;
|
||||
//import nl.requios.effortlessbuilding.create.foundation.sound.SoundScapes;
|
||||
import nl.requios.effortlessbuilding.create.foundation.utility.LangNumberFormat;
|
||||
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
|
||||
@@ -62,12 +62,12 @@ public class ModularGuiLine {
|
||||
}
|
||||
|
||||
private void box(GuiGraphics graphics, int x, int width, boolean b) {
|
||||
UIRenderHelper.drawStretched(graphics, x, 0, width, 18, 0, AllGuiTextures.DATA_AREA);
|
||||
if (b)
|
||||
AllGuiTextures.DATA_AREA_SPEECH.render(graphics, x - 3, 0);
|
||||
else
|
||||
AllGuiTextures.DATA_AREA_START.render(graphics, x, 0);
|
||||
AllGuiTextures.DATA_AREA_END.render(graphics, x + width - 2, 0);
|
||||
// UIRenderHelper.drawStretched(graphics, x, 0, width, 18, 0, AllGuiTextures.DATA_AREA);
|
||||
// if (b)
|
||||
// AllGuiTextures.DATA_AREA_SPEECH.render(graphics, x - 3, 0);
|
||||
// else
|
||||
// AllGuiTextures.DATA_AREA_START.render(graphics, x, 0);
|
||||
// AllGuiTextures.DATA_AREA_END.render(graphics, x + width - 2, 0);
|
||||
}
|
||||
|
||||
public void saveValues(CompoundTag data) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import nl.requios.effortlessbuilding.create.Create;
|
||||
import nl.requios.effortlessbuilding.create.foundation.utility.AnimationTickHolder;
|
||||
import nl.requios.effortlessbuilding.create.foundation.utility.RegisteredObjects;
|
||||
import nl.requios.effortlessbuilding.create.infrastructure.config.AllConfigs;
|
||||
//import nl.requios.effortlessbuilding.create.infrastructure.config.AllConfigs;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
|
||||
@@ -67,18 +67,18 @@ public class PlayerSettingsGui extends Screen {
|
||||
|
||||
@Override
|
||||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
||||
this.renderBackground(ms);
|
||||
this.renderBackground(graphics);
|
||||
|
||||
int yy = top;
|
||||
font.draw(ms, "Shader type", left, yy + 5, 0xFFFFFF);
|
||||
graphics.drawString(font, "Shader type", left, yy + 5, 0xFFFFFF);
|
||||
|
||||
yy += 50;
|
||||
font.draw(ms, "Shader speed", left, yy + 5, 0xFFFFFF);
|
||||
graphics.drawString(font, "Shader speed", left, yy + 5, 0xFFFFFF);
|
||||
|
||||
super.render(ms, mouseX, mouseY, partialTicks);
|
||||
super.render(graphics, mouseX, mouseY, partialTicks);
|
||||
|
||||
if (showShaderList)
|
||||
this.shaderTypeList.render(ms, mouseX, mouseY, partialTicks);
|
||||
this.shaderTypeList.render(graphics, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -179,7 +179,8 @@ public class PlayerSettingsGui extends Screen {
|
||||
return super.isMouseOver(p_isMouseOver_1_, p_isMouseOver_3_);
|
||||
}
|
||||
|
||||
protected boolean isFocused() {
|
||||
@Override
|
||||
public boolean isFocused() {
|
||||
return PlayerSettingsGui.this.getFocused() == this;
|
||||
}
|
||||
|
||||
@@ -191,7 +192,7 @@ public class PlayerSettingsGui extends Screen {
|
||||
//From AbstractSelectionList, disabled parts
|
||||
@Override
|
||||
public void render(GuiGraphics graphics, int p_render_1_, int p_render_2_, float p_render_3_) {
|
||||
this.renderBackground(ms);
|
||||
this.renderBackground(graphics);
|
||||
int i = this.getScrollbarPosition();
|
||||
int j = i + 6;
|
||||
Tesselator tessellator = Tesselator.getInstance();
|
||||
@@ -210,16 +211,16 @@ public class PlayerSettingsGui extends Screen {
|
||||
int k = this.getRowLeft();
|
||||
int l = this.y0 + 4 - (int) this.getScrollAmount();
|
||||
if (this.renderHeader) {
|
||||
this.renderHeader(ms, k, l, tessellator);
|
||||
this.renderHeader(graphics, k, l);
|
||||
}
|
||||
|
||||
this.renderList(ms, p_render_1_, p_render_2_, p_render_3_);
|
||||
this.renderList(graphics, p_render_1_, p_render_2_, p_render_3_);
|
||||
RenderSystem.disableDepthTest();
|
||||
// this.renderHoleBackground(0, this.y0, 255, 255);
|
||||
// this.renderHoleBackground(this.y1, this.height, 255, 255);
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ZERO, GlStateManager.DestFactor.ONE);
|
||||
RenderSystem.disableTexture();
|
||||
// RenderSystem.disableTexture();
|
||||
// int i1 = 4;
|
||||
// bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
||||
// bufferbuilder.pos((double)this.x0, (double)(this.y0 + 4), 0.0D).tex(0.0F, 1.0F).color(0, 0, 0, 0).endVertex();
|
||||
@@ -265,7 +266,7 @@ public class PlayerSettingsGui extends Screen {
|
||||
}
|
||||
|
||||
// this.renderDecorations(p_render_1_, p_render_2_);
|
||||
RenderSystem.enableTexture();
|
||||
// RenderSystem.enableTexture();
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
|
||||
@@ -282,9 +283,9 @@ public class PlayerSettingsGui extends Screen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack ms, int itemIndex, int rowTop, int rowLeft, int rowWidth, int rowHeight, int mouseX, int mouseY, boolean hovered, float partialTicks) {
|
||||
public void render(GuiGraphics graphics, int itemIndex, int rowTop, int rowLeft, int rowWidth, int rowHeight, int mouseX, int mouseY, boolean hovered, float partialTicks) {
|
||||
if (rowTop + 10 > ShaderTypeList.this.y0 && rowTop + rowHeight - 5 < ShaderTypeList.this.y1)
|
||||
drawString(ms, font, shaderType.name, ShaderTypeList.this.x0 + 8, rowTop + 4, 0xFFFFFF);
|
||||
graphics.drawString(font, shaderType.name, ShaderTypeList.this.x0 + 8, rowTop + 4, 0xFFFFFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,6 +36,8 @@ import nl.requios.effortlessbuilding.buildmode.BuildModeEnum;
|
||||
import nl.requios.effortlessbuilding.buildmode.ModeOptions.ActionEnum;
|
||||
import nl.requios.effortlessbuilding.buildmode.ModeOptions.OptionEnum;
|
||||
|
||||
import javax.swing.text.Style;
|
||||
|
||||
/**
|
||||
* Initially from Chisels and Bits by AlgorithmX2
|
||||
* https://github.com/AlgorithmX2/Chisels-and-Bits/blob/1.12/src/main/java/mod/chiselsandbits/client/gui/ChiselsAndBitsMenu.java
|
||||
@@ -99,8 +101,8 @@ public class RadialMenu extends Screen {
|
||||
public void render(GuiGraphics graphics, final int mouseX, final int mouseY, final float partialTicks) {
|
||||
BuildModeEnum currentBuildMode = EffortlessBuildingClient.BUILD_MODES.getBuildMode();
|
||||
|
||||
ms.pushPose();
|
||||
ms.translate(0, 0, 200);
|
||||
graphics.pose().pushPose();
|
||||
graphics.pose().translate(0, 0, 200);
|
||||
|
||||
visibility += fadeSpeed * partialTicks;
|
||||
if (visibility > 1f) visibility = 1f;
|
||||
@@ -108,9 +110,9 @@ public class RadialMenu extends Screen {
|
||||
final int startColor = (int) (visibility * 98) << 24;
|
||||
final int endColor = (int) (visibility * 128) << 24;
|
||||
|
||||
fillGradient(ms, 0, 0, width, height, startColor, endColor);
|
||||
graphics.fillGradient(0, 0, width, height, startColor, endColor);
|
||||
|
||||
RenderSystem.disableTexture();
|
||||
// RenderSystem.disableTexture();
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
final Tesselator tessellator = Tesselator.getInstance();
|
||||
@@ -183,13 +185,13 @@ public class RadialMenu extends Screen {
|
||||
|
||||
tessellator.end();
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.enableTexture();
|
||||
// RenderSystem.enableTexture();
|
||||
|
||||
drawIcons(ms, middleX, middleY, modes, buttons);
|
||||
drawIcons(graphics, middleX, middleY, modes, buttons);
|
||||
|
||||
drawTexts(ms, currentBuildMode, middleX, middleY, modes, buttons, options, mouseXX, mouseYY);
|
||||
drawTexts(graphics, currentBuildMode, middleX, middleY, modes, buttons, options, mouseXX, mouseYY);
|
||||
|
||||
ms.popPose();
|
||||
graphics.pose().popPose();
|
||||
}
|
||||
|
||||
private void drawRadialButtonBackgrounds(BuildModeEnum currentBuildMode, BufferBuilder buffer, double middleX, double middleY,
|
||||
@@ -291,8 +293,8 @@ public class RadialMenu extends Screen {
|
||||
|
||||
private void drawIcons(GuiGraphics graphics, double middleX, double middleY,
|
||||
ArrayList<MenuRegion> modes, ArrayList<MenuButton> buttons) {
|
||||
ms.pushPose();
|
||||
RenderSystem.enableTexture();
|
||||
graphics.pose().pushPose();
|
||||
// RenderSystem.enableTexture();
|
||||
RenderSystem.setShader(GameRenderer::getPositionColorTexShader);
|
||||
RenderSystem.setShaderColor(1f, 1f, 1f, 1f);
|
||||
|
||||
@@ -302,7 +304,7 @@ public class RadialMenu extends Screen {
|
||||
final double x = (menuRegion.x1 + menuRegion.x2) * 0.5 * (ringOuterEdge * 0.55 + 0.45 * ringInnerEdge);
|
||||
final double y = (menuRegion.y1 + menuRegion.y2) * 0.5 * (ringOuterEdge * 0.55 + 0.45 * ringInnerEdge);
|
||||
|
||||
menuRegion.mode.icon.render(ms, (int) (middleX + x - 8), (int) (middleY + y - 8));
|
||||
menuRegion.mode.icon.render(graphics, (int) (middleX + x - 8), (int) (middleY + y - 8));
|
||||
}
|
||||
|
||||
//Draw action icons
|
||||
@@ -311,10 +313,10 @@ public class RadialMenu extends Screen {
|
||||
final double x = (button.x1 + button.x2) / 2 + 0.01;
|
||||
final double y = (button.y1 + button.y2) / 2 + 0.01;
|
||||
|
||||
button.action.icon.render(ms, (int) (middleX + x - 8), (int) (middleY + y - 8));
|
||||
button.action.icon.render(graphics, (int) (middleX + x - 8), (int) (middleY + y - 8));
|
||||
}
|
||||
|
||||
ms.popPose();
|
||||
graphics.pose().popPose();
|
||||
}
|
||||
|
||||
private void drawTexts(GuiGraphics graphics, BuildModeEnum currentBuildMode, double middleX, double middleY, ArrayList<MenuRegion> modes, ArrayList<MenuButton> buttons, OptionEnum[] options, int mouseX, int mouseY) {
|
||||
@@ -323,16 +325,16 @@ public class RadialMenu extends Screen {
|
||||
//Draw option strings
|
||||
for (int i = 0; i < currentBuildMode.options.length; i++) {
|
||||
OptionEnum option = options[i];
|
||||
font.drawShadow(ms, I18n.get(option.name), (int) (middleX + buttonDistance - 9), (int) middleY - 37 + i * 39, optionTextColor);
|
||||
graphics.drawString(font, I18n.get(option.name), (int) (middleX + buttonDistance - 9), (int) middleY - 37 + i * 39, optionTextColor, true);
|
||||
}
|
||||
|
||||
String credits = "Effortless Building";
|
||||
font.drawShadow(ms, credits, width - font.width(credits) - 4, height - 10, watermarkTextColor);
|
||||
graphics.drawString(font, credits, width - font.width(credits) - 4, height - 10, watermarkTextColor, true);
|
||||
|
||||
//Draw power level info
|
||||
String powerLevelValue = minecraft.player.isCreative() ? "Creative" : String.valueOf(EffortlessBuildingClient.POWER_LEVEL.getPowerLevel());
|
||||
String powerLevelText = I18n.get("key.effortlessbuilding.power_level") + ": " + powerLevelValue;
|
||||
font.drawShadow(ms, powerLevelText, width - font.width(powerLevelText) - 4, height - 22, minecraft.player.isCreative() ? watermarkTextColor : ChatFormatting.DARK_PURPLE.getColor());
|
||||
graphics.drawString(font, powerLevelText, width - font.width(powerLevelText) - 4, height - 22, minecraft.player.isCreative() ? watermarkTextColor : ChatFormatting.DARK_PURPLE.getColor(), true);
|
||||
|
||||
//if hover over power level info, show tooltip
|
||||
if (mouseX >= width - font.width(powerLevelText) - 14 && mouseX <= width && mouseY >= height - 24 && mouseY <= height) {
|
||||
@@ -355,7 +357,7 @@ public class RadialMenu extends Screen {
|
||||
tooltip.addAll(TooltipHelper.cutTextComponent(Components.translatable("key.effortlessbuilding.next_power_level_how"), ChatFormatting.GRAY, ChatFormatting.WHITE));
|
||||
}
|
||||
|
||||
renderComponentTooltip(ms, tooltip, mouseX, mouseY);
|
||||
renderComponentTooltip(graphics, tooltip, mouseX, mouseY);
|
||||
}
|
||||
|
||||
|
||||
@@ -376,11 +378,12 @@ public class RadialMenu extends Screen {
|
||||
fixed_x -= font.width(text) / 2;
|
||||
}
|
||||
|
||||
font.drawShadow(ms, text, (int) middleX + fixed_x, (int) middleY + fixed_y, whiteTextColor);
|
||||
graphics.drawString(font, text, (int) middleX + fixed_x, (int) middleY + fixed_y, whiteTextColor, true);
|
||||
graphics.drawString(font, text, (int) middleX + fixed_x, (int) middleY + fixed_y, whiteTextColor, true);
|
||||
|
||||
//Draw description
|
||||
text = I18n.get(menuRegion.mode.getDescriptionKey());
|
||||
font.drawShadow(ms, text, (int) middleX - font.width(text) / 2f, (int) middleY + buildModeDescriptionHeight, descriptionTextColor);
|
||||
graphics.drawString(font, text, (int) middleX - font.width(text) / 2f, (int) middleY + buildModeDescriptionHeight, descriptionTextColor, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,7 +396,7 @@ public class RadialMenu extends Screen {
|
||||
|
||||
//Add description when holding shift
|
||||
if (!button.description.isEmpty()) {
|
||||
tooltip.add(TooltipHelper.holdShift(ItemDescription.Palette.Blue, hasShiftDown()));
|
||||
tooltip.add(TooltipHelper.holdShift(TooltipHelper.Palette.BLUE, hasShiftDown()));
|
||||
if (hasShiftDown()) {
|
||||
tooltip.addAll(TooltipHelper.cutStringTextComponent(button.description, ChatFormatting.GRAY, ChatFormatting.WHITE));
|
||||
}
|
||||
@@ -402,7 +405,7 @@ public class RadialMenu extends Screen {
|
||||
//Add keybind in brackets
|
||||
var keybind = findKeybind(button);
|
||||
if (keybind != null) tooltip.add(Lang.translateDirect("tooltip.keybind", keybind.withStyle(ChatFormatting.GRAY)).withStyle(ChatFormatting.DARK_GRAY));
|
||||
renderComponentTooltip(ms, tooltip, mouseX, mouseY);
|
||||
renderComponentTooltip(graphics, tooltip, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ArrayEntry extends BaseModifierEntry<Array> {
|
||||
|
||||
@Override
|
||||
public void render(GuiGraphics graphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||
super(graphics, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||
super.render(graphics, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||
|
||||
//draw offset inputs
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ModifiersScreenList extends ObjectSelectionList<ModifiersScreenList
|
||||
Window window = minecraft.getWindow();
|
||||
double d0 = window.getGuiScale();
|
||||
RenderSystem.enableScissor((int) (this.x0 * d0), (int) (window.getHeight() - (this.y1 * d0)), (int) (this.width * d0), (int) (this.height * d0));
|
||||
super.renderList(p_239228_, p_239229_, p_239230_, p_239231_);
|
||||
super.renderList(graphics, p_239229_, p_239230_, p_239231_);
|
||||
RenderSystem.disableScissor();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraftforge.client.gui.ScreenUtils;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
@@ -19,7 +18,7 @@ public class GuiCheckBoxFixed extends Button {
|
||||
|
||||
public GuiCheckBoxFixed(int xPos, int yPos, String displayString, boolean isChecked) {
|
||||
super(xPos, yPos, Minecraft.getInstance().font.width(displayString) + 2 + 11, 11, Component.literal(displayString), b -> {
|
||||
});
|
||||
}, DEFAULT_NARRATION);
|
||||
this.isChecked = isChecked;
|
||||
this.boxWidth = 11;
|
||||
this.height = 11;
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Font;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
@@ -49,9 +50,9 @@ public class RenderHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onRenderGuiEvent(RenderGuiEvent event) {
|
||||
renderSubText(event.getPoseStack());
|
||||
renderSubText(event.getGuiGraphics());
|
||||
|
||||
drawStacks(event.getPoseStack());
|
||||
drawStacks(event.getGuiGraphics());
|
||||
}
|
||||
|
||||
private static final ChatFormatting highlightColor = ChatFormatting.DARK_AQUA;
|
||||
@@ -64,7 +65,7 @@ public class RenderHandler {
|
||||
normalColor + "Left-click to " + highlightColor + "break, " +
|
||||
normalColor + "Right-click to " + highlightColor + "cancel");
|
||||
|
||||
private static void renderSubText(PoseStack ms) {
|
||||
private static void renderSubText(GuiGraphics graphics) {
|
||||
var state = EffortlessBuildingClient.BUILDER_CHAIN.getBuildingState();
|
||||
if (state == BuilderChain.BuildingState.IDLE) return;
|
||||
|
||||
@@ -74,18 +75,18 @@ public class RenderHandler {
|
||||
int screenHeight = Minecraft.getInstance().getWindow().getGuiScaledHeight();
|
||||
var font = Minecraft.getInstance().font;
|
||||
|
||||
ms.pushPose();
|
||||
ms.translate(screenWidth / 2.0, screenHeight - 54, 0.0D);
|
||||
graphics.pose().pushPose();
|
||||
graphics.pose().translate(screenWidth / 2.0, screenHeight - 54, 0.0D);
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
int l = font.width(text);
|
||||
font.drawShadow(ms, text, (float)(-l / 2), -4.0F, 0xffffffff);
|
||||
graphics.drawString(font, text.getString(), (float)(-l / 2), -4.0F, 0xffffffff, true);
|
||||
RenderSystem.disableBlend();
|
||||
ms.popPose();
|
||||
graphics.pose().popPose();
|
||||
}
|
||||
|
||||
//Draw item stacks at cursor, showing what will be used and what is missing
|
||||
private static void drawStacks(PoseStack ms) {
|
||||
private static void drawStacks(GuiGraphics graphics) {
|
||||
var state = EffortlessBuildingClient.BUILDER_CHAIN.getBuildingState();
|
||||
if (state != BuilderChain.BuildingState.PLACING) return;
|
||||
|
||||
@@ -108,30 +109,30 @@ public class RenderHandler {
|
||||
int missing = EffortlessBuildingClient.ITEM_USAGE_TRACKER.getMissingCount(stack.getKey());
|
||||
|
||||
if (total - missing > 0) {
|
||||
drawItemStack(ms, new ItemStack(stack.getKey(), total - missing), x + i * 20, y, false);
|
||||
drawItemStack(graphics, new ItemStack(stack.getKey(), total - missing), x + i * 20, y, false);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (missing > 0) {
|
||||
drawItemStack(ms, new ItemStack(stack.getKey(), missing), x + i * 20, y, true);
|
||||
drawItemStack(graphics, new ItemStack(stack.getKey(), missing), x + i * 20, y, true);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void drawItemStack(PoseStack ms, ItemStack stack, int x, int y, boolean missing) {
|
||||
private static void drawItemStack(GuiGraphics graphics, ItemStack stack, int x, int y, boolean missing) {
|
||||
Minecraft.getInstance().getItemRenderer().renderGuiItem(stack, x, y);
|
||||
|
||||
//draw count text, red if missing
|
||||
//from ItemRenderer#renderGuiItemDecorations
|
||||
ms.pushPose();
|
||||
graphics.pose().pushPose();
|
||||
Font font = Minecraft.getInstance().font;
|
||||
String text = String.valueOf(stack.getCount());
|
||||
ms.translate(0.0D, 0.0D, (double)(Minecraft.getInstance().getItemRenderer().blitOffset + 200.0F));
|
||||
graphics.pose().translate(0.0D, 0.0D, (double)(Minecraft.getInstance().getItemRenderer().blitOffset + 200.0F));
|
||||
MultiBufferSource.BufferSource multibuffersource$buffersource = MultiBufferSource.immediate(Tesselator.getInstance().getBuilder());
|
||||
font.drawInBatch(text, (float)(x + 19 - 2 - font.width(text)), (float)(y + 6 + 3), missing ? ChatFormatting.RED.getColor() : ChatFormatting.WHITE.getColor(), true, ms.last().pose(), multibuffersource$buffersource, false, 0, 15728880);
|
||||
font.drawInBatch(text, (float)(x + 19 - 2 - font.width(text)), (float)(y + 6 + 3), missing ? ChatFormatting.RED.getColor() : ChatFormatting.WHITE.getColor(), true, graphics.pose().last().pose(), multibuffersource$buffersource, false, 0, 15728880);
|
||||
multibuffersource$buffersource.endBatch();
|
||||
ms.popPose();
|
||||
graphics.pose().popPose();
|
||||
}
|
||||
|
||||
protected static VertexConsumer beginLines(MultiBufferSource.BufferSource renderTypeBuffer) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package nl.requios.effortlessbuilding.utilities;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.HolderGetter;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.world.item.Item;
|
||||
|
||||
@@ -50,7 +50,7 @@ public class BlockPlacerHelper {
|
||||
var itemStack = new ItemStack(blockEntry.item);
|
||||
|
||||
level.captureBlockSnapshots = true;
|
||||
BlockHelper.placeSchematicBlock(level, player, blockEntry.newBlockState, blockEntry.blockPos, itemStack, null);
|
||||
BlockHelper.placeSchematicBlock(level, blockEntry.newBlockState, blockEntry.blockPos, itemStack, null);
|
||||
level.captureBlockSnapshots = false;
|
||||
|
||||
//Find out if we get to keep the placed block by sending a forge event
|
||||
|
||||
@@ -1,32 +1,15 @@
|
||||
package nl.requios.effortlessbuilding.utilities;
|
||||
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.SlabBlock;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.pattern.BlockInWorld;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import nl.requios.effortlessbuilding.CommonConfig;
|
||||
import nl.requios.effortlessbuilding.EffortlessBuildingClient;
|
||||
import nl.requios.effortlessbuilding.compatibility.CompatHelper;
|
||||
import nl.requios.effortlessbuilding.systems.ServerBuildState;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class SurvivalHelper {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user