Merge branch 'port/1.19.4' into 1.19.4
@@ -122,7 +122,7 @@ dependencies {
|
|||||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||||
|
|
||||||
jarJar("com.jozufozu.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}") {
|
jarJar("com.jozufozu.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}") {
|
||||||
jarJar.ranged(it, '[0.6.10,0.7)')
|
jarJar.ranged(it, '[0.6.9,0.7)')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flywheelInWorkspace) {
|
if (flywheelInWorkspace) {
|
||||||
|
|||||||
@@ -3,18 +3,18 @@
|
|||||||
org.gradle.jvmargs=-Xmx3G
|
org.gradle.jvmargs=-Xmx3G
|
||||||
org.gradle.daemon=false
|
org.gradle.daemon=false
|
||||||
|
|
||||||
mod_version = 3.6
|
mod_version = 3.7
|
||||||
artifact_minecraft_version = 1.20.1
|
artifact_minecraft_version = 1.19.4
|
||||||
|
|
||||||
minecraft_version = 1.20.1
|
minecraft_version = 1.19.4
|
||||||
forge_version = 47.1.3
|
forge_version = 45.2.6
|
||||||
|
|
||||||
forgegradle_version = 6.0.7
|
forgegradle_version = 6.0.7
|
||||||
mixingradle_version = 0.7-SNAPSHOT
|
mixingradle_version = 0.7-SNAPSHOT
|
||||||
mixin_version = 0.8.5
|
mixin_version = 0.8.5
|
||||||
librarian_version = 1.+
|
librarian_version = 1.+
|
||||||
cursegradle_version = 1.4.0
|
cursegradle_version = 1.4.0
|
||||||
parchment_version = 2023.09.03
|
parchment_version = 2023.06.26
|
||||||
|
|
||||||
flywheel_minecraft_version = 1.20.1
|
flywheel_minecraft_version = 1.19.3
|
||||||
flywheel_version = 0.6.10-7
|
flywheel_version = 0.6.9-2
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
package nl.requios.effortlessbuilding;
|
package nl.requios.effortlessbuilding;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.gui.GuiComponent;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
@@ -49,13 +50,20 @@ public enum AllGuiTextures implements ScreenElement {
|
|||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics ms, int x, int y) {
|
public void render(PoseStack poseStack, int x, int y) {
|
||||||
ms.blit(location, x, y, 0, startX, startY, width, height, 256, 256);
|
bind();
|
||||||
|
GuiComponent.blit(poseStack, x, y, 0, startX, startY, width, height, 256, 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void render(GuiGraphics ms, int x, int y, Color c) {
|
public void render(PoseStack poseStack, int x, int y, GuiComponent component) {
|
||||||
bind();
|
bind();
|
||||||
UIRenderHelper.drawColoredTexture(ms, c, x, y, startX, startY, width, height);
|
component.blit(poseStack, x, y, 0, startX, startY, width, height, 256, 256);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
public void render(PoseStack poseStack, int x, int y, Color c, GuiComponent component) {
|
||||||
|
bind();
|
||||||
|
UIRenderHelper.drawColoredTexture(poseStack, c, x, y, startX, startY, width, height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package nl.requios.effortlessbuilding;
|
package nl.requios.effortlessbuilding;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiComponent;
|
||||||
import net.minecraft.client.renderer.LightTexture;
|
import net.minecraft.client.renderer.LightTexture;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
@@ -100,10 +101,15 @@ public class AllIcons implements ScreenElement {
|
|||||||
return new AllIcons(x = 0, ++y);
|
return new AllIcons(x = 0, ++y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void bind() {
|
||||||
|
RenderSystem.setShaderTexture(0, ICON_ATLAS);
|
||||||
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int x, int y) {
|
public void render(PoseStack ms, int x, int y) {
|
||||||
guiGraphics.blit(ICON_ATLAS, x, y, 0, iconX, iconY, 16, 16, 256, 256);
|
bind();
|
||||||
|
GuiComponent.blit(ms, x, y, 0, iconX, iconY, 16, 16, 256, 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import net.minecraft.world.item.ItemStack;
|
|||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.common.loot.IGlobalLootModifier;
|
import net.minecraftforge.common.loot.IGlobalLootModifier;
|
||||||
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
|
import net.minecraftforge.event.CreativeModeTabEvent;
|
||||||
import net.minecraftforge.eventbus.api.IEventBus;
|
import net.minecraftforge.eventbus.api.IEventBus;
|
||||||
import net.minecraftforge.fml.DistExecutor;
|
import net.minecraftforge.fml.DistExecutor;
|
||||||
import net.minecraftforge.fml.ModLoadingContext;
|
import net.minecraftforge.fml.ModLoadingContext;
|
||||||
@@ -106,8 +106,8 @@ public class EffortlessBuilding {
|
|||||||
CompatHelper.setup();
|
CompatHelper.setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addTabContents(final BuildCreativeModeTabContentsEvent event) {
|
public static void addTabContents(final CreativeModeTabEvent.BuildContents event) {
|
||||||
if (event.getTabKey() == CreativeModeTabs.TOOLS_AND_UTILITIES) {
|
if (event.getTab() == CreativeModeTabs.TOOLS_AND_UTILITIES) {
|
||||||
List<ItemStack> stacks = ITEMS.getEntries().stream().map(reg -> new ItemStack(reg.get())).toList();
|
List<ItemStack> stacks = ITEMS.getEntries().stream().map(reg -> new ItemStack(reg.get())).toList();
|
||||||
event.acceptAll(stacks);
|
event.acceptAll(stacks);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public class BuildModes {
|
|||||||
if (!skipRaytrace) {
|
if (!skipRaytrace) {
|
||||||
//collision within a 1 block radius to selected is fine
|
//collision within a 1 block radius to selected is fine
|
||||||
ClipContext rayTraceContext = new ClipContext(start, lineBound, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, player);
|
ClipContext rayTraceContext = new ClipContext(start, lineBound, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, player);
|
||||||
HitResult rayTraceResult = player.level().clip(rayTraceContext);
|
HitResult rayTraceResult = player.level.clip(rayTraceContext);
|
||||||
intersects = rayTraceResult != null && rayTraceResult.getType() == HitResult.Type.BLOCK &&
|
intersects = rayTraceResult != null && rayTraceResult.getType() == HitResult.Type.BLOCK &&
|
||||||
planeBound.subtract(rayTraceResult.getLocation()).lengthSqr() > 4;
|
planeBound.subtract(rayTraceResult.getLocation()).lengthSqr() > 4;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class ModeOptions {
|
|||||||
case CIRCLE_START_CORNER -> circleStart = ActionEnum.CIRCLE_START_CORNER;
|
case CIRCLE_START_CORNER -> circleStart = ActionEnum.CIRCLE_START_CORNER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.level().isClientSide &&
|
if (player.level.isClientSide &&
|
||||||
action != ActionEnum.OPEN_MODIFIER_SETTINGS &&
|
action != ActionEnum.OPEN_MODIFIER_SETTINGS &&
|
||||||
action != ActionEnum.OPEN_PLAYER_SETTINGS &&
|
action != ActionEnum.OPEN_PLAYER_SETTINGS &&
|
||||||
action != ActionEnum.PREVIOUS_BUILD_MODE &&
|
action != ActionEnum.PREVIOUS_BUILD_MODE &&
|
||||||
|
|||||||
@@ -112,11 +112,11 @@ public class RadialMirror extends BaseModifier {
|
|||||||
BlockState newBlockState = blockState;
|
BlockState newBlockState = blockState;
|
||||||
|
|
||||||
if (startAngleToCenter < -0.751 * Math.PI || startAngleToCenter > 0.749 * Math.PI) {
|
if (startAngleToCenter < -0.751 * Math.PI || startAngleToCenter > 0.749 * Math.PI) {
|
||||||
newBlockState = blockState.rotate(player.level(), startPos, Rotation.CLOCKWISE_180);
|
newBlockState = blockState.rotate(player.level, startPos, Rotation.CLOCKWISE_180);
|
||||||
} else if (startAngleToCenter < -0.251 * Math.PI) {
|
} else if (startAngleToCenter < -0.251 * Math.PI) {
|
||||||
newBlockState = blockState.rotate(player.level(), startPos, Rotation.COUNTERCLOCKWISE_90);
|
newBlockState = blockState.rotate(player.level, startPos, Rotation.COUNTERCLOCKWISE_90);
|
||||||
} else if (startAngleToCenter > 0.249 * Math.PI) {
|
} else if (startAngleToCenter > 0.249 * Math.PI) {
|
||||||
newBlockState = blockState.rotate(player.level(), startPos, Rotation.CLOCKWISE_90);
|
newBlockState = blockState.rotate(player.level, startPos, Rotation.CLOCKWISE_90);
|
||||||
}
|
}
|
||||||
|
|
||||||
return newBlockState;
|
return newBlockState;
|
||||||
@@ -127,17 +127,17 @@ public class RadialMirror extends BaseModifier {
|
|||||||
double angleToCenter = Mth.atan2(relVec.x, relVec.z); //between -PI and PI
|
double angleToCenter = Mth.atan2(relVec.x, relVec.z); //between -PI and PI
|
||||||
|
|
||||||
if (angleToCenter < -0.751 * Math.PI || angleToCenter > 0.749 * Math.PI) {
|
if (angleToCenter < -0.751 * Math.PI || angleToCenter > 0.749 * Math.PI) {
|
||||||
newBlockState = blockState.rotate(player.level(), startPos, Rotation.CLOCKWISE_180);
|
newBlockState = blockState.rotate(player.level, startPos, Rotation.CLOCKWISE_180);
|
||||||
if (alternate) {
|
if (alternate) {
|
||||||
newBlockState = newBlockState.mirror(Mirror.FRONT_BACK);
|
newBlockState = newBlockState.mirror(Mirror.FRONT_BACK);
|
||||||
}
|
}
|
||||||
} else if (angleToCenter < -0.251 * Math.PI) {
|
} else if (angleToCenter < -0.251 * Math.PI) {
|
||||||
newBlockState = blockState.rotate(player.level(), startPos, Rotation.CLOCKWISE_90);
|
newBlockState = blockState.rotate(player.level, startPos, Rotation.CLOCKWISE_90);
|
||||||
if (alternate) {
|
if (alternate) {
|
||||||
newBlockState = newBlockState.mirror(Mirror.LEFT_RIGHT);
|
newBlockState = newBlockState.mirror(Mirror.LEFT_RIGHT);
|
||||||
}
|
}
|
||||||
} else if (angleToCenter > 0.249 * Math.PI) {
|
} else if (angleToCenter > 0.249 * Math.PI) {
|
||||||
newBlockState = blockState.rotate(player.level(), startPos, Rotation.COUNTERCLOCKWISE_90);
|
newBlockState = blockState.rotate(player.level, startPos, Rotation.COUNTERCLOCKWISE_90);
|
||||||
if (alternate) {
|
if (alternate) {
|
||||||
newBlockState = newBlockState.mirror(Mirror.LEFT_RIGHT);
|
newBlockState = newBlockState.mirror(Mirror.LEFT_RIGHT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package nl.requios.effortlessbuilding.create.foundation.gui;
|
|||||||
|
|
||||||
import com.mojang.blaze3d.platform.InputConstants;
|
import com.mojang.blaze3d.platform.InputConstants;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.components.AbstractWidget;
|
import net.minecraft.client.gui.components.AbstractWidget;
|
||||||
import net.minecraft.client.gui.components.EditBox;
|
import net.minecraft.client.gui.components.EditBox;
|
||||||
import net.minecraft.client.gui.components.Renderable;
|
import net.minecraft.client.gui.components.Renderable;
|
||||||
@@ -105,18 +104,16 @@ public abstract class AbstractSimiScreen extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
partialTicks = minecraft.getFrameTime();
|
partialTicks = minecraft.getFrameTime();
|
||||||
PoseStack ms = graphics.pose();
|
|
||||||
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
|
|
||||||
prepareFrame();
|
prepareFrame();
|
||||||
|
|
||||||
renderWindowBackground(graphics, mouseX, mouseY, partialTicks);
|
renderWindowBackground(ms, mouseX, mouseY, partialTicks);
|
||||||
renderWindow(graphics, mouseX, mouseY, partialTicks);
|
renderWindow(ms, mouseX, mouseY, partialTicks);
|
||||||
super.render(graphics, mouseX, mouseY, partialTicks);
|
super.render(ms, mouseX, mouseY, partialTicks);
|
||||||
renderWindowForeground(graphics, mouseX, mouseY, partialTicks);
|
renderWindowForeground(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
endFrame();
|
endFrame();
|
||||||
|
|
||||||
@@ -140,13 +137,13 @@ public abstract class AbstractSimiScreen extends Screen {
|
|||||||
|
|
||||||
protected void prepareFrame() {}
|
protected void prepareFrame() {}
|
||||||
|
|
||||||
protected void renderWindowBackground(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
protected void renderWindowBackground(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
renderBackground(graphics);
|
renderBackground(ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void renderWindow(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks);
|
protected abstract void renderWindow(PoseStack ms, int mouseX, int mouseY, float partialTicks);
|
||||||
|
|
||||||
protected void renderWindowForeground(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
protected void renderWindowForeground(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
for (Renderable widget : renderables) {
|
for (Renderable widget : renderables) {
|
||||||
if (widget instanceof AbstractSimiWidget simiWidget && simiWidget.isMouseOver(mouseX, mouseY)
|
if (widget instanceof AbstractSimiWidget simiWidget && simiWidget.isMouseOver(mouseX, mouseY)
|
||||||
&& simiWidget.visible) {
|
&& simiWidget.visible) {
|
||||||
@@ -155,12 +152,12 @@ public abstract class AbstractSimiScreen extends Screen {
|
|||||||
continue;
|
continue;
|
||||||
int ttx = simiWidget.lockedTooltipX == -1 ? mouseX : simiWidget.lockedTooltipX + simiWidget.getX();
|
int ttx = simiWidget.lockedTooltipX == -1 ? mouseX : simiWidget.lockedTooltipX + simiWidget.getX();
|
||||||
int tty = simiWidget.lockedTooltipY == -1 ? mouseY : simiWidget.lockedTooltipY + simiWidget.getY();
|
int tty = simiWidget.lockedTooltipY == -1 ? mouseY : simiWidget.lockedTooltipY + simiWidget.getY();
|
||||||
graphics.renderComponentTooltip(font, tooltip, ttx, tty);
|
renderComponentTooltip(ms, tooltip, ttx, tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Added
|
//Added
|
||||||
if (widget instanceof ModifiersScreenList list) {
|
if (widget instanceof ModifiersScreenList list) {
|
||||||
list.renderWindowForeground(graphics, mouseX, mouseY, partialTicks);
|
list.renderWindowForeground(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,8 +165,8 @@ public abstract class AbstractSimiScreen extends Screen {
|
|||||||
protected void endFrame() {}
|
protected void endFrame() {}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
protected void debugWindowArea(GuiGraphics graphics) {
|
protected void debugWindowArea(PoseStack graphics) {
|
||||||
graphics.fill(guiLeft + windowWidth, guiTop + windowHeight, guiLeft, guiTop, 0xD3D3D3D3);
|
fill(graphics, guiLeft + windowWidth, guiTop + windowHeight, guiLeft, guiTop, 0xD3D3D3D3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.gui;
|
package nl.requios.effortlessbuilding.create.foundation.gui;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import net.minecraft.client.gui.GuiComponent;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
@@ -72,15 +73,21 @@ public enum AllGuiTextures implements ScreenElement {
|
|||||||
RenderSystem.setShaderTexture(0, location);
|
RenderSystem.setShaderTexture(0, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
public void render(PoseStack ms, int x, int y) {
|
||||||
public void render(GuiGraphics graphics, int x, int y) {
|
bind();
|
||||||
graphics.blit(location, x, y, startX, startY, width, height);
|
GuiComponent.blit(ms, x, y, startX, startY, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void render(GuiGraphics graphics, int x, int y, Color c) {
|
public void render(PoseStack ms, int x, int y, GuiComponent component) {
|
||||||
bind();
|
bind();
|
||||||
UIRenderHelper.drawColoredTexture(graphics, c, x, y, startX, startY, width, height);
|
component.blit(ms, x, y, startX, startY, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
public void render(PoseStack ms, int x, int y, Color c) {
|
||||||
|
bind();
|
||||||
|
UIRenderHelper.drawColoredTexture(ms, c, x, y, startX, startY, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package nl.requios.effortlessbuilding.create.foundation.gui;
|
|||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiComponent;
|
||||||
import net.minecraft.client.renderer.LightTexture;
|
import net.minecraft.client.renderer.LightTexture;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
@@ -173,8 +173,9 @@ public class AllIcons implements ScreenElement {
|
|||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics graphics, int x, int y) {
|
public void render(PoseStack ms, int x, int y) {
|
||||||
graphics.blit(ICON_ATLAS, x, y, 0, iconX, iconY, 16, 16, 256, 256);
|
bind();
|
||||||
|
GuiComponent.blit(ms, x, y, 0, iconX, iconY, 16, 16, 256, 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package nl.requios.effortlessbuilding.create.foundation.gui;
|
|||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraft.network.chat.FormattedText;
|
import net.minecraft.network.chat.FormattedText;
|
||||||
import net.minecraft.network.chat.Style;
|
import net.minecraft.network.chat.Style;
|
||||||
@@ -174,12 +173,11 @@ public class ConfirmationScreen extends AbstractSimiScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderWindow(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
protected void renderWindow(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
textBackground.render(graphics);
|
textBackground.render(ms);
|
||||||
int offset = font.lineHeight + 1;
|
int offset = font.lineHeight + 1;
|
||||||
int lineY = y - offset;
|
int lineY = y - offset;
|
||||||
|
|
||||||
PoseStack ms = graphics.pose();
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
ms.translate(0, 0, 200);
|
ms.translate(0, 0, 200);
|
||||||
|
|
||||||
@@ -187,21 +185,21 @@ public class ConfirmationScreen extends AbstractSimiScreen {
|
|||||||
lineY += offset;
|
lineY += offset;
|
||||||
if (line == null)
|
if (line == null)
|
||||||
continue;
|
continue;
|
||||||
graphics.drawString(font, line.getString(), x, lineY, 0xeaeaea, false);
|
font.draw(ms, line.getString(), x, lineY, 0xeaeaea);
|
||||||
}
|
}
|
||||||
|
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderWindowBackground(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
protected void renderWindowBackground(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
endFrame();
|
endFrame();
|
||||||
|
|
||||||
source.render(graphics, 0, 0, 10); // zero mouse coords to prevent further tooltips
|
source.render(ms, 0, 0, 10); // zero mouse coords to prevent further tooltips
|
||||||
|
|
||||||
prepareFrame();
|
prepareFrame();
|
||||||
|
|
||||||
graphics.fillGradient(0, 0, this.width, this.height, 0x70101010, 0x80101010);
|
fillGradient(ms, 0, 0, this.width, this.height, 0x70101010, 0x80101010);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,203 +1,202 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.gui;
|
//package nl.requios.effortlessbuilding.create.foundation.gui;
|
||||||
|
//
|
||||||
import java.util.ArrayList;
|
//import java.util.ArrayList;
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
import javax.annotation.Nonnull;
|
//import javax.annotation.Nonnull;
|
||||||
|
//
|
||||||
import org.joml.Matrix4f;
|
//import net.minecraft.client.gui.GuiComponent;
|
||||||
|
//import org.joml.Matrix4f;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
//
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
//import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.mojang.blaze3d.vertex.Tesselator;
|
//import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
//import com.mojang.blaze3d.vertex.Tesselator;
|
||||||
import net.minecraft.client.gui.Font;
|
//
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
//import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent;
|
//import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
//import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent;
|
||||||
import net.minecraft.network.chat.FormattedText;
|
//import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.network.chat.Style;
|
//import net.minecraft.network.chat.FormattedText;
|
||||||
import net.minecraft.world.item.ItemStack;
|
//import net.minecraft.network.chat.Style;
|
||||||
import net.minecraftforge.client.ForgeHooksClient;
|
//import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraftforge.client.event.RenderTooltipEvent;
|
//import net.minecraftforge.client.ForgeHooksClient;
|
||||||
import net.minecraftforge.client.extensions.IForgeGuiGraphics;
|
//import net.minecraftforge.client.event.RenderTooltipEvent;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
//import net.minecraftforge.client.extensions.IForgeGuiGraphics;
|
||||||
|
//import net.minecraftforge.common.MinecraftForge;
|
||||||
public class RemovedGuiUtils {
|
//
|
||||||
@Nonnull
|
//public class RemovedGuiUtils {
|
||||||
private static ItemStack cachedTooltipStack = ItemStack.EMPTY;
|
// @Nonnull
|
||||||
|
// private static ItemStack cachedTooltipStack = ItemStack.EMPTY;
|
||||||
public static void preItemToolTip(@Nonnull ItemStack stack) {
|
//
|
||||||
cachedTooltipStack = stack;
|
// public static void preItemToolTip(@Nonnull ItemStack stack) {
|
||||||
}
|
// cachedTooltipStack = stack;
|
||||||
|
// }
|
||||||
public static void postItemToolTip() {
|
//
|
||||||
cachedTooltipStack = ItemStack.EMPTY;
|
// public static void postItemToolTip() {
|
||||||
}
|
// cachedTooltipStack = ItemStack.EMPTY;
|
||||||
|
// }
|
||||||
public static void drawHoveringText(GuiGraphics graphics, List<? extends FormattedText> textLines, int mouseX,
|
//
|
||||||
int mouseY, int screenWidth, int screenHeight, int maxTextWidth, Font font) {
|
// public static void drawHoveringText(PoseStack graphics, List<? extends FormattedText> textLines, int mouseX,
|
||||||
drawHoveringText(graphics, textLines, mouseX, mouseY, screenWidth, screenHeight, maxTextWidth,
|
// int mouseY, int screenWidth, int screenHeight, int maxTextWidth, Font font) {
|
||||||
IForgeGuiGraphics.DEFAULT_BACKGROUND_COLOR, IForgeGuiGraphics.DEFAULT_BORDER_COLOR_START, IForgeGuiGraphics.DEFAULT_BORDER_COLOR_END,
|
// drawHoveringText(graphics, textLines, mouseX, mouseY, screenWidth, screenHeight, maxTextWidth,
|
||||||
font);
|
// IForgeGuiGraphics.DEFAULT_BACKGROUND_COLOR, IForgeGuiGraphics.DEFAULT_BORDER_COLOR_START, IForgeGuiGraphics.DEFAULT_BORDER_COLOR_END,
|
||||||
}
|
// font);
|
||||||
|
// }
|
||||||
public static void drawHoveringText(GuiGraphics graphics, List<? extends FormattedText> textLines, int mouseX,
|
//
|
||||||
int mouseY, int screenWidth, int screenHeight, int maxTextWidth, int backgroundColor, int borderColorStart,
|
// public static void drawHoveringText(PoseStack graphics, List<? extends FormattedText> textLines, int mouseX,
|
||||||
int borderColorEnd, Font font) {
|
// int mouseY, int screenWidth, int screenHeight, int maxTextWidth, int backgroundColor, int borderColorStart,
|
||||||
drawHoveringText(cachedTooltipStack, graphics, textLines, mouseX, mouseY, screenWidth, screenHeight, maxTextWidth,
|
// int borderColorEnd, Font font) {
|
||||||
backgroundColor, borderColorStart, borderColorEnd, font);
|
// drawHoveringText(cachedTooltipStack, graphics, textLines, mouseX, mouseY, screenWidth, screenHeight, maxTextWidth,
|
||||||
}
|
// backgroundColor, borderColorStart, borderColorEnd, font);
|
||||||
|
// }
|
||||||
public static void drawHoveringText(@Nonnull final ItemStack stack, GuiGraphics graphics,
|
//
|
||||||
List<? extends FormattedText> textLines, int mouseX, int mouseY, int screenWidth, int screenHeight,
|
// public static void drawHoveringText(@Nonnull final ItemStack stack, PoseStack graphics,
|
||||||
int maxTextWidth, Font font) {
|
// List<? extends FormattedText> textLines, int mouseX, int mouseY, int screenWidth, int screenHeight,
|
||||||
drawHoveringText(stack, graphics, textLines, mouseX, mouseY, screenWidth, screenHeight, maxTextWidth,
|
// int maxTextWidth, Font font) {
|
||||||
IForgeGuiGraphics.DEFAULT_BACKGROUND_COLOR, IForgeGuiGraphics.DEFAULT_BORDER_COLOR_START, IForgeGuiGraphics.DEFAULT_BORDER_COLOR_END,
|
// drawHoveringText(stack, graphics, textLines, mouseX, mouseY, screenWidth, screenHeight, maxTextWidth,
|
||||||
font);
|
// IForgeGuiGraphics.DEFAULT_BACKGROUND_COLOR, IForgeGuiGraphics.DEFAULT_BORDER_COLOR_START, IForgeGuiGraphics.DEFAULT_BORDER_COLOR_END,
|
||||||
}
|
// font);
|
||||||
|
// }
|
||||||
public static void drawHoveringText(@Nonnull final ItemStack stack, GuiGraphics graphics,
|
//
|
||||||
List<? extends FormattedText> textLines, int mouseX, int mouseY, int screenWidth, int screenHeight,
|
// public static void drawHoveringText(@Nonnull final ItemStack stack, PoseStack pStack,
|
||||||
int maxTextWidth, int backgroundColor, int borderColorStart, int borderColorEnd, Font font) {
|
// List<? extends FormattedText> textLines, int mouseX, int mouseY, int screenWidth, int screenHeight,
|
||||||
if (textLines.isEmpty())
|
// int maxTextWidth, int backgroundColor, int borderColorStart, int borderColorEnd, Font font) {
|
||||||
return;
|
// if (textLines.isEmpty())
|
||||||
|
// return;
|
||||||
List<ClientTooltipComponent> list = ForgeHooksClient.gatherTooltipComponents(stack, textLines,
|
//
|
||||||
stack.getTooltipImage(), mouseX, screenWidth, screenHeight, font);
|
// List<ClientTooltipComponent> list = ForgeHooksClient.gatherTooltipComponents(stack, textLines,
|
||||||
RenderTooltipEvent.Pre event =
|
// stack.getTooltipImage(), mouseX, screenWidth, screenHeight, font);
|
||||||
new RenderTooltipEvent.Pre(stack, graphics, mouseX, mouseY, screenWidth, screenHeight, font, list, null);
|
// RenderTooltipEvent.Pre event =
|
||||||
if (MinecraftForge.EVENT_BUS.post(event))
|
// new RenderTooltipEvent.Pre(stack, pStack, mouseX, mouseY, screenWidth, screenHeight, font, list, null);
|
||||||
return;
|
// if (MinecraftForge.EVENT_BUS.post(event))
|
||||||
|
// return;
|
||||||
PoseStack pStack = graphics.pose();
|
//
|
||||||
|
// mouseX = event.getX();
|
||||||
mouseX = event.getX();
|
// mouseY = event.getY();
|
||||||
mouseY = event.getY();
|
// screenWidth = event.getScreenWidth();
|
||||||
screenWidth = event.getScreenWidth();
|
// screenHeight = event.getScreenHeight();
|
||||||
screenHeight = event.getScreenHeight();
|
// font = event.getFont();
|
||||||
font = event.getFont();
|
//
|
||||||
|
// // RenderSystem.disableRescaleNormal();
|
||||||
// RenderSystem.disableRescaleNormal();
|
// RenderSystem.disableDepthTest();
|
||||||
RenderSystem.disableDepthTest();
|
// int tooltipTextWidth = 0;
|
||||||
int tooltipTextWidth = 0;
|
//
|
||||||
|
// for (FormattedText textLine : textLines) {
|
||||||
for (FormattedText textLine : textLines) {
|
// int textLineWidth = font.width(textLine);
|
||||||
int textLineWidth = font.width(textLine);
|
// if (textLineWidth > tooltipTextWidth)
|
||||||
if (textLineWidth > tooltipTextWidth)
|
// tooltipTextWidth = textLineWidth;
|
||||||
tooltipTextWidth = textLineWidth;
|
// }
|
||||||
}
|
//
|
||||||
|
// boolean needsWrap = false;
|
||||||
boolean needsWrap = false;
|
//
|
||||||
|
// int titleLinesCount = 1;
|
||||||
int titleLinesCount = 1;
|
// int tooltipX = mouseX + 12;
|
||||||
int tooltipX = mouseX + 12;
|
// if (tooltipX + tooltipTextWidth + 4 > screenWidth) {
|
||||||
if (tooltipX + tooltipTextWidth + 4 > screenWidth) {
|
// tooltipX = mouseX - 16 - tooltipTextWidth;
|
||||||
tooltipX = mouseX - 16 - tooltipTextWidth;
|
// if (tooltipX < 4) // if the tooltip doesn't fit on the screen
|
||||||
if (tooltipX < 4) // if the tooltip doesn't fit on the screen
|
// {
|
||||||
{
|
// if (mouseX > screenWidth / 2)
|
||||||
if (mouseX > screenWidth / 2)
|
// tooltipTextWidth = mouseX - 12 - 8;
|
||||||
tooltipTextWidth = mouseX - 12 - 8;
|
// else
|
||||||
else
|
// tooltipTextWidth = screenWidth - 16 - mouseX;
|
||||||
tooltipTextWidth = screenWidth - 16 - mouseX;
|
// needsWrap = true;
|
||||||
needsWrap = true;
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//
|
||||||
|
// if (maxTextWidth > 0 && tooltipTextWidth > maxTextWidth) {
|
||||||
if (maxTextWidth > 0 && tooltipTextWidth > maxTextWidth) {
|
// tooltipTextWidth = maxTextWidth;
|
||||||
tooltipTextWidth = maxTextWidth;
|
// needsWrap = true;
|
||||||
needsWrap = true;
|
// }
|
||||||
}
|
//
|
||||||
|
// if (needsWrap) {
|
||||||
if (needsWrap) {
|
// int wrappedTooltipWidth = 0;
|
||||||
int wrappedTooltipWidth = 0;
|
// List<FormattedText> wrappedTextLines = new ArrayList<>();
|
||||||
List<FormattedText> wrappedTextLines = new ArrayList<>();
|
// for (int i = 0; i < textLines.size(); i++) {
|
||||||
for (int i = 0; i < textLines.size(); i++) {
|
// FormattedText textLine = textLines.get(i);
|
||||||
FormattedText textLine = textLines.get(i);
|
// List<FormattedText> wrappedLine = font.getSplitter()
|
||||||
List<FormattedText> wrappedLine = font.getSplitter()
|
// .splitLines(textLine, tooltipTextWidth, Style.EMPTY);
|
||||||
.splitLines(textLine, tooltipTextWidth, Style.EMPTY);
|
// if (i == 0)
|
||||||
if (i == 0)
|
// titleLinesCount = wrappedLine.size();
|
||||||
titleLinesCount = wrappedLine.size();
|
//
|
||||||
|
// for (FormattedText line : wrappedLine) {
|
||||||
for (FormattedText line : wrappedLine) {
|
// int lineWidth = font.width(line);
|
||||||
int lineWidth = font.width(line);
|
// if (lineWidth > wrappedTooltipWidth)
|
||||||
if (lineWidth > wrappedTooltipWidth)
|
// wrappedTooltipWidth = lineWidth;
|
||||||
wrappedTooltipWidth = lineWidth;
|
// wrappedTextLines.add(line);
|
||||||
wrappedTextLines.add(line);
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// tooltipTextWidth = wrappedTooltipWidth;
|
||||||
tooltipTextWidth = wrappedTooltipWidth;
|
// textLines = wrappedTextLines;
|
||||||
textLines = wrappedTextLines;
|
//
|
||||||
|
// if (mouseX > screenWidth / 2)
|
||||||
if (mouseX > screenWidth / 2)
|
// tooltipX = mouseX - 16 - tooltipTextWidth;
|
||||||
tooltipX = mouseX - 16 - tooltipTextWidth;
|
// else
|
||||||
else
|
// tooltipX = mouseX + 12;
|
||||||
tooltipX = mouseX + 12;
|
// }
|
||||||
}
|
//
|
||||||
|
// int tooltipY = mouseY - 12;
|
||||||
int tooltipY = mouseY - 12;
|
// int tooltipHeight = 8;
|
||||||
int tooltipHeight = 8;
|
//
|
||||||
|
// if (textLines.size() > 1) {
|
||||||
if (textLines.size() > 1) {
|
// tooltipHeight += (textLines.size() - 1) * 10;
|
||||||
tooltipHeight += (textLines.size() - 1) * 10;
|
// if (textLines.size() > titleLinesCount)
|
||||||
if (textLines.size() > titleLinesCount)
|
// tooltipHeight += 2; // gap between title lines and next lines
|
||||||
tooltipHeight += 2; // gap between title lines and next lines
|
// }
|
||||||
}
|
//
|
||||||
|
// if (tooltipY < 4)
|
||||||
if (tooltipY < 4)
|
// tooltipY = 4;
|
||||||
tooltipY = 4;
|
// else if (tooltipY + tooltipHeight + 4 > screenHeight)
|
||||||
else if (tooltipY + tooltipHeight + 4 > screenHeight)
|
// tooltipY = screenHeight - tooltipHeight - 4;
|
||||||
tooltipY = screenHeight - tooltipHeight - 4;
|
//
|
||||||
|
// final int zLevel = 400;
|
||||||
final int zLevel = 400;
|
// RenderTooltipEvent.Color colorEvent = new RenderTooltipEvent.Color(stack, pStack, tooltipX, tooltipY,
|
||||||
RenderTooltipEvent.Color colorEvent = new RenderTooltipEvent.Color(stack, graphics, tooltipX, tooltipY,
|
// font, backgroundColor, borderColorStart, borderColorEnd, list);
|
||||||
font, backgroundColor, borderColorStart, borderColorEnd, list);
|
// MinecraftForge.EVENT_BUS.post(colorEvent);
|
||||||
MinecraftForge.EVENT_BUS.post(colorEvent);
|
// backgroundColor = colorEvent.getBackgroundStart();
|
||||||
backgroundColor = colorEvent.getBackgroundStart();
|
// borderColorStart = colorEvent.getBorderStart();
|
||||||
borderColorStart = colorEvent.getBorderStart();
|
// borderColorEnd = colorEvent.getBorderEnd();
|
||||||
borderColorEnd = colorEvent.getBorderEnd();
|
//
|
||||||
|
// pStack.pushPose();
|
||||||
pStack.pushPose();
|
// Matrix4f mat = pStack.last()
|
||||||
Matrix4f mat = pStack.last()
|
// .pose();
|
||||||
.pose();
|
// GuiComponent.fillGradient(pStack, tooltipX - 3, tooltipY - 4, tooltipX + tooltipTextWidth + 3,
|
||||||
graphics.fillGradient(tooltipX - 3, tooltipY - 4, tooltipX + tooltipTextWidth + 3,
|
// tooltipY - 3, zLevel, backgroundColor, backgroundColor);
|
||||||
tooltipY - 3, zLevel, backgroundColor, backgroundColor);
|
// GuiComponent.fillGradient(pStack, tooltipX - 3, tooltipY + tooltipHeight + 3,
|
||||||
graphics.fillGradient(tooltipX - 3, tooltipY + tooltipHeight + 3,
|
// tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 4, zLevel, backgroundColor, backgroundColor);
|
||||||
tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 4, zLevel, backgroundColor, backgroundColor);
|
// GuiComponent.fillGradient(pStack, tooltipX - 3, tooltipY - 3, tooltipX + tooltipTextWidth + 3,
|
||||||
graphics.fillGradient(tooltipX - 3, tooltipY - 3, tooltipX + tooltipTextWidth + 3,
|
// tooltipY + tooltipHeight + 3, zLevel, backgroundColor, backgroundColor);
|
||||||
tooltipY + tooltipHeight + 3, zLevel, backgroundColor, backgroundColor);
|
// GuiComponent.fillGradient(pStack, tooltipX - 4, tooltipY - 3, tooltipX - 3, tooltipY + tooltipHeight + 3,
|
||||||
graphics.fillGradient(tooltipX - 4, tooltipY - 3, tooltipX - 3, tooltipY + tooltipHeight + 3,
|
// zLevel, backgroundColor, backgroundColor);
|
||||||
zLevel, backgroundColor, backgroundColor);
|
// GuiComponent.fillGradient(pStack, tooltipX + tooltipTextWidth + 3, tooltipY - 3,
|
||||||
graphics.fillGradient(tooltipX + tooltipTextWidth + 3, tooltipY - 3,
|
// tooltipX + tooltipTextWidth + 4, tooltipY + tooltipHeight + 3, zLevel, backgroundColor, backgroundColor);
|
||||||
tooltipX + tooltipTextWidth + 4, tooltipY + tooltipHeight + 3, zLevel, backgroundColor, backgroundColor);
|
// GuiComponent.fillGradient(pStack, tooltipX - 3, tooltipY - 3 + 1, tooltipX - 3 + 1,
|
||||||
graphics.fillGradient(tooltipX - 3, tooltipY - 3 + 1, tooltipX - 3 + 1,
|
// tooltipY + tooltipHeight + 3 - 1, zLevel, borderColorStart, borderColorEnd);
|
||||||
tooltipY + tooltipHeight + 3 - 1, zLevel, borderColorStart, borderColorEnd);
|
// GuiComponent.fillGradient(pStack, tooltipX + tooltipTextWidth + 2, tooltipY - 3 + 1,
|
||||||
graphics.fillGradient(tooltipX + tooltipTextWidth + 2, tooltipY - 3 + 1,
|
// tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 3 - 1, zLevel, borderColorStart, borderColorEnd);
|
||||||
tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 3 - 1, zLevel, borderColorStart, borderColorEnd);
|
// GuiComponent.fillGradient(pStack, tooltipX - 3, tooltipY - 3, tooltipX + tooltipTextWidth + 3,
|
||||||
graphics.fillGradient(tooltipX - 3, tooltipY - 3, tooltipX + tooltipTextWidth + 3,
|
// tooltipY - 3 + 1, zLevel, borderColorStart, borderColorStart);
|
||||||
tooltipY - 3 + 1, zLevel, borderColorStart, borderColorStart);
|
// GuiComponent.fillGradient(pStack, tooltipX - 3, tooltipY + tooltipHeight + 2,
|
||||||
graphics.fillGradient(tooltipX - 3, tooltipY + tooltipHeight + 2,
|
// tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 3, zLevel, borderColorEnd, borderColorEnd);
|
||||||
tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 3, zLevel, borderColorEnd, borderColorEnd);
|
//
|
||||||
|
// MultiBufferSource.BufferSource renderType = MultiBufferSource.immediate(Tesselator.getInstance()
|
||||||
MultiBufferSource.BufferSource renderType = MultiBufferSource.immediate(Tesselator.getInstance()
|
// .getBuilder());
|
||||||
.getBuilder());
|
// pStack.translate(0.0D, 0.0D, zLevel);
|
||||||
pStack.translate(0.0D, 0.0D, zLevel);
|
//
|
||||||
|
// for (int lineNumber = 0; lineNumber < list.size(); ++lineNumber) {
|
||||||
for (int lineNumber = 0; lineNumber < list.size(); ++lineNumber) {
|
// ClientTooltipComponent line = list.get(lineNumber);
|
||||||
ClientTooltipComponent line = list.get(lineNumber);
|
//
|
||||||
|
// if (line != null)
|
||||||
if (line != null)
|
// line.renderText(font, tooltipX, tooltipY, mat, renderType);
|
||||||
line.renderText(font, tooltipX, tooltipY, mat, renderType);
|
//
|
||||||
|
// if (lineNumber + 1 == titleLinesCount)
|
||||||
if (lineNumber + 1 == titleLinesCount)
|
// tooltipY += 2;
|
||||||
tooltipY += 2;
|
//
|
||||||
|
// tooltipY += 10;
|
||||||
tooltipY += 10;
|
// }
|
||||||
}
|
//
|
||||||
|
// renderType.endBatch();
|
||||||
renderType.endBatch();
|
// pStack.popPose();
|
||||||
pStack.popPose();
|
//
|
||||||
|
// RenderSystem.enableDepthTest();
|
||||||
RenderSystem.enableDepthTest();
|
// }
|
||||||
}
|
//}
|
||||||
}
|
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import com.mojang.blaze3d.vertex.Tesselator;
|
|||||||
import com.mojang.blaze3d.vertex.VertexFormat;
|
import com.mojang.blaze3d.vertex.VertexFormat;
|
||||||
import com.mojang.math.Axis;
|
import com.mojang.math.Axis;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.renderer.GameRenderer;
|
import net.minecraft.client.renderer.GameRenderer;
|
||||||
|
import net.minecraftforge.client.gui.ScreenUtils;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.utility.Color;
|
import nl.requios.effortlessbuilding.create.foundation.utility.Color;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.utility.Couple;
|
import nl.requios.effortlessbuilding.create.foundation.utility.Couple;
|
||||||
import org.joml.Matrix4f;
|
import org.joml.Matrix4f;
|
||||||
@@ -55,14 +55,14 @@ public class UIRenderHelper {
|
|||||||
GlStateManager._glBindFramebuffer(GlConst.GL_FRAMEBUFFER, dst.frameBufferId);
|
GlStateManager._glBindFramebuffer(GlConst.GL_FRAMEBUFFER, dst.frameBufferId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void streak(GuiGraphics graphics, float angle, int x, int y, int breadth, int length) {
|
public static void streak(PoseStack ms, float angle, int x, int y, int breadth, int length) {
|
||||||
streak(graphics, angle, x, y, breadth, length, Theme.i(Theme.Key.STREAK));
|
streak(ms, angle, x, y, breadth, length, Theme.i(Theme.Key.STREAK));
|
||||||
}
|
}
|
||||||
// angle in degrees; 0° -> fading to the right
|
// angle in degrees; 0° -> fading to the right
|
||||||
// x and y specify the middle point of the starting edge
|
// x and y specify the middle point of the starting edge
|
||||||
// breadth is the total width of the streak
|
// breadth is the total width of the streak
|
||||||
|
|
||||||
public static void streak(GuiGraphics graphics, float angle, int x, int y, int breadth, int length, int color) {
|
public static void streak(PoseStack ms, float angle, int x, int y, int breadth, int length, int color) {
|
||||||
int a1 = 0xa0 << 24;
|
int a1 = 0xa0 << 24;
|
||||||
int a2 = 0x80 << 24;
|
int a2 = 0x80 << 24;
|
||||||
int a3 = 0x10 << 24;
|
int a3 = 0x10 << 24;
|
||||||
@@ -74,60 +74,59 @@ public class UIRenderHelper {
|
|||||||
int c3 = a3 | color;
|
int c3 = a3 | color;
|
||||||
int c4 = a4 | color;
|
int c4 = a4 | color;
|
||||||
|
|
||||||
PoseStack ms = graphics.pose();
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
ms.translate(x, y, 0);
|
ms.translate(x, y, 0);
|
||||||
ms.mulPose(Axis.ZP.rotationDegrees(angle - 90));
|
ms.mulPose(Axis.ZP.rotationDegrees(angle - 90));
|
||||||
|
|
||||||
streak(graphics, breadth / 2, length, c1, c2, c3, c4);
|
streak(ms, breadth / 2, length, c1, c2, c3, c4);
|
||||||
|
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void streak(GuiGraphics graphics, float angle, int x, int y, int breadth, int length, Color c) {
|
public static void streak(PoseStack ms, float angle, int x, int y, int breadth, int length, Color c) {
|
||||||
Color color = c.copy().setImmutable();
|
Color color = c.copy().setImmutable();
|
||||||
int c1 = color.scaleAlpha(0.625f).getRGB();
|
int c1 = color.scaleAlpha(0.625f).getRGB();
|
||||||
int c2 = color.scaleAlpha(0.5f).getRGB();
|
int c2 = color.scaleAlpha(0.5f).getRGB();
|
||||||
int c3 = color.scaleAlpha(0.0625f).getRGB();
|
int c3 = color.scaleAlpha(0.0625f).getRGB();
|
||||||
int c4 = color.scaleAlpha(0f).getRGB();
|
int c4 = color.scaleAlpha(0f).getRGB();
|
||||||
|
|
||||||
PoseStack ms = graphics.pose();
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
ms.translate(x, y, 0);
|
ms.translate(x, y, 0);
|
||||||
ms.mulPose(Axis.ZP.rotationDegrees(angle - 90));
|
ms.mulPose(Axis.ZP.rotationDegrees(angle - 90));
|
||||||
|
|
||||||
streak(graphics, breadth / 2, length, c1, c2, c3, c4);
|
streak(ms, breadth / 2, length, c1, c2, c3, c4);
|
||||||
|
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void streak(GuiGraphics graphics, int width, int height, int c1, int c2, int c3, int c4) {
|
private static void streak(PoseStack ms, int width, int height, int c1, int c2, int c3, int c4) {
|
||||||
double split1 = .5;
|
double split1 = .5;
|
||||||
double split2 = .75;
|
double split2 = .75;
|
||||||
graphics.fillGradient(-width, 0, width, (int) (split1 * height), 0, c1, c2);
|
Matrix4f model = ms.last().pose();
|
||||||
graphics.fillGradient(-width, (int) (split1 * height), width, (int) (split2 * height), 0, c2, c3);
|
ScreenUtils.drawGradientRect(model, -width, 0, width, (int) (split1 * height), 0, c1, c2);
|
||||||
graphics.fillGradient(-width, (int) (split2 * height), width, height, 0, c3, c4);
|
ScreenUtils.drawGradientRect(model, -width, (int) (split1 * height), width, (int) (split2 * height), 0, c2, c3);
|
||||||
|
ScreenUtils.drawGradientRect(model, -width, (int) (split2 * height), width, height, 0, c3, c4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see #angledGradient(GuiGraphics, float, int, int, int, int, int, Color, Color)
|
* @see #angledGradient(PoseStack, float, int, int, int, int, int, Color, Color)
|
||||||
*/
|
*/
|
||||||
public static void angledGradient(GuiGraphics graphics, float angle, int x, int y, int breadth, int length, Couple<Color> c) {
|
public static void angledGradient(PoseStack ms, float angle, int x, int y, int breadth, int length, Couple<Color> c) {
|
||||||
angledGradient(graphics, angle, x, y, 0, breadth, length, c);
|
angledGradient(ms, angle, x, y, 0, breadth, length, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see #angledGradient(GuiGraphics, float, int, int, int, int, int, Color, Color)
|
* @see #angledGradient(PoseStack, float, int, int, int, int, int, Color, Color)
|
||||||
*/
|
*/
|
||||||
public static void angledGradient(GuiGraphics graphics, float angle, int x, int y, int z, int breadth, int length, Couple<Color> c) {
|
public static void angledGradient(PoseStack ms, float angle, int x, int y, int z, int breadth, int length, Couple<Color> c) {
|
||||||
angledGradient(graphics, angle, x, y, z, breadth, length, c.getFirst(), c.getSecond());
|
angledGradient(ms, angle, x, y, z, breadth, length, c.getFirst(), c.getSecond());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see #angledGradient(GuiGraphics, float, int, int, int, int, int, Color, Color)
|
* @see #angledGradient(PoseStack, float, int, int, int, int, int, Color, Color)
|
||||||
*/
|
*/
|
||||||
public static void angledGradient(GuiGraphics graphics, float angle, int x, int y, int breadth, int length, Color color1, Color color2) {
|
public static void angledGradient(PoseStack ms, float angle, int x, int y, int breadth, int length, Color color1, Color color2) {
|
||||||
angledGradient(graphics, angle, x, y, 0, breadth, length, color1, color2);
|
angledGradient(ms, angle, x, y, 0, breadth, length, color1, color2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -138,32 +137,31 @@ public class UIRenderHelper {
|
|||||||
* @param color2 the color at the ending edge
|
* @param color2 the color at the ending edge
|
||||||
* @param breadth the total width of the gradient
|
* @param breadth the total width of the gradient
|
||||||
*/
|
*/
|
||||||
public static void angledGradient(GuiGraphics graphics, float angle, int x, int y, int z, int breadth, int length, Color color1, Color color2) {
|
public static void angledGradient(PoseStack ms, float angle, int x, int y, int z, int breadth, int length, Color color1, Color color2) {
|
||||||
PoseStack ms = graphics.pose();
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
ms.translate(x, y, z);
|
ms.translate(x, y, z);
|
||||||
ms.mulPose(Axis.ZP.rotationDegrees(angle - 90));
|
ms.mulPose(Axis.ZP.rotationDegrees(angle - 90));
|
||||||
|
|
||||||
int w = breadth / 2;
|
int w = breadth / 2;
|
||||||
graphics.fillGradient(-w, 0, w, length, 0, color1.getRGB(), color2.getRGB());
|
Matrix4f model = ms.last().pose();
|
||||||
|
ScreenUtils.drawGradientRect(model, -w, 0, w, length, 0, color1.getRGB(), color2.getRGB());
|
||||||
|
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void breadcrumbArrow(GuiGraphics graphics, int x, int y, int z, int width, int height, int indent, Couple<Color> colors) {breadcrumbArrow(graphics, x, y, z, width, height, indent, colors.getFirst(), colors.getSecond());}
|
public static void breadcrumbArrow(PoseStack ms, int x, int y, int z, int width, int height, int indent, Couple<Color> colors) {breadcrumbArrow(ms, x, y, z, width, height, indent, colors.getFirst(), colors.getSecond());}
|
||||||
|
|
||||||
// draws a wide chevron-style breadcrumb arrow pointing left
|
// draws a wide chevron-style breadcrumb arrow pointing left
|
||||||
public static void breadcrumbArrow(GuiGraphics graphics, int x, int y, int z, int width, int height, int indent, Color startColor, Color endColor) {
|
public static void breadcrumbArrow(PoseStack ms, int x, int y, int z, int width, int height, int indent, Color startColor, Color endColor) {
|
||||||
PoseStack matrixStack = graphics.pose();
|
ms.pushPose();
|
||||||
matrixStack.pushPose();
|
ms.translate(x - indent, y, z);
|
||||||
matrixStack.translate(x - indent, y, z);
|
|
||||||
|
|
||||||
breadcrumbArrow(graphics, width, height, indent, startColor, endColor);
|
breadcrumbArrow(ms, width, height, indent, startColor, endColor);
|
||||||
|
|
||||||
matrixStack.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void breadcrumbArrow(GuiGraphics graphics, int width, int height, int indent, Color c1, Color c2) {
|
private static void breadcrumbArrow(PoseStack ms, int width, int height, int indent, Color c1, Color c2) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 0,0 x1,y1 ********************* x4,y4 ***** x7,y7
|
* 0,0 x1,y1 ********************* x4,y4 ***** x7,y7
|
||||||
@@ -201,7 +199,7 @@ public class UIRenderHelper {
|
|||||||
|
|
||||||
Tesselator tessellator = Tesselator.getInstance();
|
Tesselator tessellator = Tesselator.getInstance();
|
||||||
BufferBuilder bufferbuilder = tessellator.getBuilder();
|
BufferBuilder bufferbuilder = tessellator.getBuilder();
|
||||||
Matrix4f model = graphics.pose().last().pose();
|
Matrix4f model = ms.last().pose();
|
||||||
bufferbuilder.begin(VertexFormat.Mode.TRIANGLES, DefaultVertexFormat.POSITION_COLOR);
|
bufferbuilder.begin(VertexFormat.Mode.TRIANGLES, DefaultVertexFormat.POSITION_COLOR);
|
||||||
|
|
||||||
bufferbuilder.vertex(model, x0, y0, 0).color(fc1.getRed(), fc1.getGreen(), fc1.getBlue(), fc1.getAlpha()).endVertex();
|
bufferbuilder.vertex(model, x0, y0, 0).color(fc1.getRed(), fc1.getGreen(), fc1.getBlue(), fc1.getAlpha()).endVertex();
|
||||||
@@ -235,30 +233,30 @@ public class UIRenderHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//just like AbstractGui#drawTexture, but with a color at every vertex
|
//just like AbstractGui#drawTexture, but with a color at every vertex
|
||||||
public static void drawColoredTexture(GuiGraphics graphics, Color c, int x, int y, int tex_left, int tex_top, int width, int height) {
|
public static void drawColoredTexture(PoseStack ms, Color c, int x, int y, int tex_left, int tex_top, int width, int height) {
|
||||||
drawColoredTexture(graphics, c, x, y, 0, (float) tex_left, (float) tex_top, width, height, 256, 256);
|
drawColoredTexture(ms, c, x, y, 0, (float) tex_left, (float) tex_top, width, height, 256, 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void drawColoredTexture(GuiGraphics graphics, Color c, int x, int y, int z, float tex_left, float tex_top, int width, int height, int sheet_width, int sheet_height) {
|
public static void drawColoredTexture(PoseStack ms, Color c, int x, int y, int z, float tex_left, float tex_top, int width, int height, int sheet_width, int sheet_height) {
|
||||||
drawColoredTexture(graphics, c, x, x + width, y, y + height, z, width, height, tex_left, tex_top, sheet_width, sheet_height);
|
drawColoredTexture(ms, c, x, x + width, y, y + height, z, width, height, tex_left, tex_top, sheet_width, sheet_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void drawStretched(GuiGraphics graphics, int left, int top, int w, int h, int z, AllGuiTextures tex) {
|
public static void drawStretched(PoseStack ms, int left, int top, int w, int h, int z, AllGuiTextures tex) {
|
||||||
tex.bind();
|
tex.bind();
|
||||||
drawTexturedQuad(graphics.pose().last()
|
drawTexturedQuad(ms.last()
|
||||||
.pose(), Color.WHITE, left, left + w, top, top + h, z, tex.startX / 256f, (tex.startX + tex.width) / 256f,
|
.pose(), Color.WHITE, left, left + w, top, top + h, z, tex.startX / 256f, (tex.startX + tex.width) / 256f,
|
||||||
tex.startY / 256f, (tex.startY + tex.height) / 256f);
|
tex.startY / 256f, (tex.startY + tex.height) / 256f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void drawCropped(GuiGraphics graphics, int left, int top, int w, int h, int z, AllGuiTextures tex) {
|
public static void drawCropped(PoseStack ms, int left, int top, int w, int h, int z, AllGuiTextures tex) {
|
||||||
tex.bind();
|
tex.bind();
|
||||||
drawTexturedQuad(graphics.pose().last()
|
drawTexturedQuad(ms.last()
|
||||||
.pose(), Color.WHITE, left, left + w, top, top + h, z, tex.startX / 256f, (tex.startX + w) / 256f,
|
.pose(), Color.WHITE, left, left + w, top, top + h, z, tex.startX / 256f, (tex.startX + w) / 256f,
|
||||||
tex.startY / 256f, (tex.startY + h) / 256f);
|
tex.startY / 256f, (tex.startY + h) / 256f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void drawColoredTexture(GuiGraphics graphics, Color c, int left, int right, int top, int bot, int z, int tex_width, int tex_height, float tex_left, float tex_top, int sheet_width, int sheet_height) {
|
private static void drawColoredTexture(PoseStack ms, Color c, int left, int right, int top, int bot, int z, int tex_width, int tex_height, float tex_left, float tex_top, int sheet_width, int sheet_height) {
|
||||||
drawTexturedQuad(graphics.pose().last().pose(), c, left, right, top, bot, z, (tex_left + 0.0F) / (float) sheet_width, (tex_left + (float) tex_width) / (float) sheet_width, (tex_top + 0.0F) / (float) sheet_height, (tex_top + (float) tex_height) / (float) sheet_height);
|
drawTexturedQuad(ms.last().pose(), c, left, right, top, bot, z, (tex_left + 0.0F) / (float) sheet_width, (tex_left + (float) tex_width) / (float) sheet_width, (tex_top + 0.0F) / (float) sheet_height, (tex_top + (float) tex_height) / (float) sheet_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void drawTexturedQuad(Matrix4f m, Color c, int left, int right, int top, int bot, int z, float u1, float u2, float v1, float v2) {
|
private static void drawTexturedQuad(Matrix4f m, Color c, int left, int right, int top, int bot, int z, float u1, float u2, float v1, float v2) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.gui.container;
|
package nl.requios.effortlessbuilding.create.foundation.gui.container;
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.InputConstants;
|
import com.mojang.blaze3d.platform.InputConstants;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.gui.components.AbstractWidget;
|
import net.minecraft.client.gui.components.AbstractWidget;
|
||||||
import net.minecraft.client.gui.components.EditBox;
|
import net.minecraft.client.gui.components.EditBox;
|
||||||
import net.minecraft.client.gui.components.Renderable;
|
import net.minecraft.client.gui.components.Renderable;
|
||||||
@@ -15,7 +15,6 @@ import net.minecraft.world.entity.player.Inventory;
|
|||||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.AllGuiTextures;
|
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.TickableGuiEventListener;
|
import nl.requios.effortlessbuilding.create.foundation.gui.TickableGuiEventListener;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.widget.AbstractSimiWidget;
|
import nl.requios.effortlessbuilding.create.foundation.gui.widget.AbstractSimiWidget;
|
||||||
|
|
||||||
@@ -92,26 +91,26 @@ public abstract class AbstractSimiContainerScreen<T extends AbstractContainerMen
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
partialTicks = minecraft.getFrameTime();
|
partialTicks = minecraft.getFrameTime();
|
||||||
|
|
||||||
renderBackground(graphics);
|
renderBackground(ms);
|
||||||
|
|
||||||
super.render(graphics, mouseX, mouseY, partialTicks);
|
super.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
renderForeground(graphics, mouseX, mouseY, partialTicks);
|
renderForeground(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderLabels(GuiGraphics graphics, int mouseX, int mouseY) {
|
protected void renderLabels(PoseStack ms, int mouseX, int mouseY) {
|
||||||
// no-op to prevent screen- and inventory-title from being rendered at incorrect
|
// no-op to prevent screen- and inventory-title from being rendered at incorrect
|
||||||
// location
|
// location
|
||||||
// could also set this.titleX/Y and this.playerInventoryTitleX/Y to the proper
|
// could also set this.titleX/Y and this.playerInventoryTitleX/Y to the proper
|
||||||
// values instead
|
// values instead
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void renderForeground(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
protected void renderForeground(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
renderTooltip(graphics, mouseX, mouseY);
|
renderTooltip(ms, mouseX, mouseY);
|
||||||
for (Renderable widget : renderables) {
|
for (Renderable widget : renderables) {
|
||||||
if (widget instanceof AbstractSimiWidget simiWidget && simiWidget.isMouseOver(mouseX, mouseY)) {
|
if (widget instanceof AbstractSimiWidget simiWidget && simiWidget.isMouseOver(mouseX, mouseY)) {
|
||||||
List<Component> tooltip = simiWidget.getToolTip();
|
List<Component> tooltip = simiWidget.getToolTip();
|
||||||
@@ -119,7 +118,7 @@ public abstract class AbstractSimiContainerScreen<T extends AbstractContainerMen
|
|||||||
continue;
|
continue;
|
||||||
int ttx = simiWidget.lockedTooltipX == -1 ? mouseX : simiWidget.lockedTooltipX + simiWidget.getX();
|
int ttx = simiWidget.lockedTooltipX == -1 ? mouseX : simiWidget.lockedTooltipX + simiWidget.getX();
|
||||||
int tty = simiWidget.lockedTooltipY == -1 ? mouseY : simiWidget.lockedTooltipY + simiWidget.getY();
|
int tty = simiWidget.lockedTooltipY == -1 ? mouseY : simiWidget.lockedTooltipY + simiWidget.getY();
|
||||||
graphics.renderComponentTooltip(font, tooltip, ttx, tty);
|
renderComponentTooltip(ms, tooltip, ttx, tty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -128,7 +127,7 @@ public abstract class AbstractSimiContainerScreen<T extends AbstractContainerMen
|
|||||||
return leftPos - windowXOffset + (imageWidth - textureWidth) / 2;
|
return leftPos - windowXOffset + (imageWidth - textureWidth) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void renderPlayerInventory(GuiGraphics graphics, int x, int y) {
|
// public void renderPlayerInventory(PoseStack graphics, int x, int y) {
|
||||||
// AllGuiTextures.PLAYER_INVENTORY.render(graphics, x, y);
|
// AllGuiTextures.PLAYER_INVENTORY.render(graphics, x, y);
|
||||||
// graphics.drawString(font, playerInventoryTitle, x + 8, y + 6, 0x404040, false);
|
// graphics.drawString(font, playerInventoryTitle, x + 8, y + 6, 0x404040, false);
|
||||||
// }
|
// }
|
||||||
@@ -168,14 +167,14 @@ public abstract class AbstractSimiContainerScreen<T extends AbstractContainerMen
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
protected void debugWindowArea(GuiGraphics graphics) {
|
protected void debugWindowArea(PoseStack ms) {
|
||||||
graphics.fill(leftPos + imageWidth, topPos + imageHeight, leftPos, topPos, 0xD3D3D3D3);
|
fill(ms, leftPos + imageWidth, topPos + imageHeight, leftPos, topPos, 0xD3D3D3D3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
protected void debugExtraAreas(GuiGraphics graphics) {
|
protected void debugExtraAreas(PoseStack ms) {
|
||||||
for (Rect2i area : getExtraAreas()) {
|
for (Rect2i area : getExtraAreas()) {
|
||||||
graphics.fill(area.getX() + area.getWidth(), area.getY() + area.getHeight(), area.getX(), area.getY(),
|
fill(ms, area.getX() + area.getWidth(), area.getY() + area.getHeight(), area.getX(), area.getY(),
|
||||||
0xD3D3D3D3);
|
0xD3D3D3D3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
|||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.Tesselator;
|
import com.mojang.blaze3d.vertex.Tesselator;
|
||||||
import com.mojang.blaze3d.vertex.VertexFormat;
|
import com.mojang.blaze3d.vertex.VertexFormat;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.renderer.GameRenderer;
|
import net.minecraft.client.renderer.GameRenderer;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.utility.Color;
|
import nl.requios.effortlessbuilding.create.foundation.utility.Color;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.utility.Couple;
|
import nl.requios.effortlessbuilding.create.foundation.utility.Couple;
|
||||||
@@ -65,8 +64,8 @@ public class BoxElement extends RenderElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics graphics) {
|
public void render(PoseStack ms) {
|
||||||
renderBox(graphics.pose());
|
renderBox(ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
//total box width = 1 * 2 (outer border) + 1 * 2 (inner color border) + 2 * borderOffset + width
|
//total box width = 1 * 2 (outer border) + 1 * 2 (inner color border) + 2 * borderOffset + width
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import javax.annotation.Nonnull;
|
|||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
|
|
||||||
public class CombinedStencilElement extends StencilElement {
|
public class CombinedStencilElement extends StencilElement {
|
||||||
|
|
||||||
private StencilElement element1;
|
private StencilElement element1;
|
||||||
@@ -45,22 +43,21 @@ public class CombinedStencilElement extends StencilElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderStencil(GuiGraphics graphics) {
|
protected void renderStencil(PoseStack ms) {
|
||||||
PoseStack ms = graphics.pose();
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
element1.transform(ms);
|
element1.transform(ms);
|
||||||
element1.withBounds(width, height);
|
element1.withBounds(width, height);
|
||||||
element1.renderStencil(graphics);
|
element1.renderStencil(ms);
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
element2.transform(ms);
|
element2.transform(ms);
|
||||||
element2.withBounds(width, height);
|
element2.withBounds(width, height);
|
||||||
element2.renderStencil(graphics);
|
element2.renderStencil(ms);
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderElement(GuiGraphics graphics) {
|
protected void renderElement(PoseStack graphics) {
|
||||||
if (mode.rendersFirst())
|
if (mode.rendersFirst())
|
||||||
element1.<StencilElement>withBounds(width, height).renderElement(graphics);
|
element1.<StencilElement>withBounds(width, height).renderElement(graphics);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.gui.element;
|
package nl.requios.effortlessbuilding.create.foundation.gui.element;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.UIRenderHelper;
|
import nl.requios.effortlessbuilding.create.foundation.gui.UIRenderHelper;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.utility.Color;
|
import nl.requios.effortlessbuilding.create.foundation.utility.Color;
|
||||||
|
|
||||||
@@ -35,18 +35,18 @@ public class DelegatedStencilElement extends StencilElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderStencil(GuiGraphics graphics) {
|
protected void renderStencil(PoseStack ms) {
|
||||||
stencil.render(graphics, width, height, 1);
|
stencil.render(ms, width, height, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderElement(GuiGraphics graphics) {
|
protected void renderElement(PoseStack ms) {
|
||||||
element.render(graphics, width, height, alpha);
|
element.render(ms, width, height, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface ElementRenderer {
|
public interface ElementRenderer {
|
||||||
void render(GuiGraphics graphics, int width, int height, float alpha);
|
void render(PoseStack ms, int width, int height, float alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
|||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.math.Axis;
|
import com.mojang.math.Axis;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.renderer.LightTexture;
|
import net.minecraft.client.renderer.LightTexture;
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
@@ -161,8 +160,7 @@ public class GuiGameElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics graphics) {
|
public void render(PoseStack matrixStack) {
|
||||||
PoseStack matrixStack = graphics.pose();
|
|
||||||
prepareMatrix(matrixStack);
|
prepareMatrix(matrixStack);
|
||||||
|
|
||||||
Minecraft mc = Minecraft.getInstance();
|
Minecraft mc = Minecraft.getInstance();
|
||||||
@@ -256,8 +254,7 @@ public class GuiGameElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics graphics) {
|
public void render(PoseStack matrixStack) {
|
||||||
PoseStack matrixStack = graphics.pose();
|
|
||||||
prepareMatrix(matrixStack);
|
prepareMatrix(matrixStack);
|
||||||
transformMatrix(matrixStack);
|
transformMatrix(matrixStack);
|
||||||
renderItemIntoGUI(matrixStack, stack, customLighting == null);
|
renderItemIntoGUI(matrixStack, stack, customLighting == null);
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.gui.element;
|
package nl.requios.effortlessbuilding.create.foundation.gui.element;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
|
||||||
public abstract class RenderElement implements ScreenElement {
|
public abstract class RenderElement implements ScreenElement {
|
||||||
|
|
||||||
public static final RenderElement EMPTY = new RenderElement() {
|
public static final RenderElement EMPTY = new RenderElement() {
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics graphics) {
|
public void render(PoseStack ms) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -66,11 +66,11 @@ public abstract class RenderElement implements ScreenElement {
|
|||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void render(GuiGraphics graphics);
|
public abstract void render(PoseStack ms);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics graphics, int x, int y) {
|
public void render(PoseStack ms, int x, int y) {
|
||||||
this.at(x, y).render(graphics);
|
this.at(x, y).render(ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class SimpleRenderElement extends RenderElement {
|
public static class SimpleRenderElement extends RenderElement {
|
||||||
@@ -82,8 +82,8 @@ public abstract class RenderElement implements ScreenElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics graphics) {
|
public void render(PoseStack ms) {
|
||||||
renderable.render(graphics, (int) x, (int) y);
|
renderable.render(ms, (int) x, (int) y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.gui.element;
|
package nl.requios.effortlessbuilding.create.foundation.gui.element;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
|
||||||
public interface ScreenElement {
|
public interface ScreenElement {
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
void render(GuiGraphics graphics, int x, int y);
|
void render(PoseStack poseStack, int x, int y);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,26 +6,24 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
|||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
|
|
||||||
public abstract class StencilElement extends RenderElement {
|
public abstract class StencilElement extends RenderElement {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics graphics) {
|
public void render(PoseStack ms) {
|
||||||
PoseStack ms = graphics.pose();
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
transform(ms);
|
transform(ms);
|
||||||
prepareStencil(ms);
|
prepareStencil(ms);
|
||||||
renderStencil(graphics);
|
renderStencil(ms);
|
||||||
prepareElement(ms);
|
prepareElement(ms);
|
||||||
renderElement(graphics);
|
renderElement(ms);
|
||||||
cleanUp(ms);
|
cleanUp(ms);
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void renderStencil(GuiGraphics graphics);
|
protected abstract void renderStencil(PoseStack graphics);
|
||||||
|
|
||||||
protected abstract void renderElement(GuiGraphics graphics);
|
protected abstract void renderElement(PoseStack graphics);
|
||||||
|
|
||||||
protected void transform(PoseStack ms) {
|
protected void transform(PoseStack ms) {
|
||||||
ms.translate(x, y, z);
|
ms.translate(x, y, z);
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package nl.requios.effortlessbuilding.create.foundation.gui.element;
|
|||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.network.chat.MutableComponent;
|
import net.minecraft.network.chat.MutableComponent;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.utility.Components;
|
import nl.requios.effortlessbuilding.create.foundation.utility.Components;
|
||||||
|
|
||||||
@@ -46,7 +45,7 @@ public class TextStencilElement extends DelegatedStencilElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderStencil(GuiGraphics graphics) {
|
protected void renderStencil(PoseStack ms) {
|
||||||
float x = 0, y = 0;
|
float x = 0, y = 0;
|
||||||
if (centerHorizontally)
|
if (centerHorizontally)
|
||||||
x = width / 2f - font.width(component) / 2f;
|
x = width / 2f - font.width(component) / 2f;
|
||||||
@@ -54,11 +53,11 @@ public class TextStencilElement extends DelegatedStencilElement {
|
|||||||
if (centerVertically)
|
if (centerVertically)
|
||||||
y = height / 2f - (font.lineHeight - 1) / 2f;
|
y = height / 2f - (font.lineHeight - 1) / 2f;
|
||||||
|
|
||||||
graphics.drawString(font, component, Math.round(x), Math.round(y), 0xff_000000, false);
|
font.draw(ms, component, Math.round(x), Math.round(y), 0xff_000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderElement(GuiGraphics graphics) {
|
protected void renderElement(PoseStack ms) {
|
||||||
float x = 0, y = 0;
|
float x = 0, y = 0;
|
||||||
if (centerHorizontally)
|
if (centerHorizontally)
|
||||||
x = width / 2f - font.width(component) / 2f;
|
x = width / 2f - font.width(component) / 2f;
|
||||||
@@ -66,10 +65,9 @@ public class TextStencilElement extends DelegatedStencilElement {
|
|||||||
if (centerVertically)
|
if (centerVertically)
|
||||||
y = height / 2f - (font.lineHeight - 1) / 2f;
|
y = height / 2f - (font.lineHeight - 1) / 2f;
|
||||||
|
|
||||||
PoseStack ms = graphics.pose();
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
ms.translate(x, y, 0);
|
ms.translate(x, y, 0);
|
||||||
element.render(graphics, font.width(component), font.lineHeight + 2, alpha);
|
element.render(ms, font.width(component), font.lineHeight + 2, alpha);
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.gui.components.AbstractWidget;
|
import net.minecraft.client.gui.components.AbstractWidget;
|
||||||
import net.minecraft.client.gui.narration.NarrationElementOutput;
|
import net.minecraft.client.gui.narration.NarrationElementOutput;
|
||||||
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipPositioner;
|
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipPositioner;
|
||||||
@@ -68,22 +68,22 @@ public abstract class AbstractSimiWidget extends AbstractWidget implements Ticka
|
|||||||
public void tick() {}
|
public void tick() {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderWidget(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
public void renderWidget(@Nonnull PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
beforeRender(graphics, mouseX, mouseY, partialTicks);
|
beforeRender(ms, mouseX, mouseY, partialTicks);
|
||||||
doRender(graphics, mouseX, mouseY, partialTicks);
|
doRender(ms, mouseX, mouseY, partialTicks);
|
||||||
afterRender(graphics, mouseX, mouseY, partialTicks);
|
afterRender(ms, mouseX, mouseY, partialTicks);
|
||||||
wasHovered = isHoveredOrFocused();
|
wasHovered = isHoveredOrFocused();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void beforeRender(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
protected void beforeRender(@Nonnull PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
graphics.pose().pushPose();
|
ms.pushPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doRender(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
protected void doRender(@Nonnull PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void afterRender(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
protected void afterRender(@Nonnull PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
graphics.pose().popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void runCallback(double mouseX, double mouseY) {
|
public void runCallback(double mouseX, double mouseY) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.Theme;
|
import nl.requios.effortlessbuilding.create.foundation.gui.Theme;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.UIRenderHelper;
|
import nl.requios.effortlessbuilding.create.foundation.gui.UIRenderHelper;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.element.BoxElement;
|
import nl.requios.effortlessbuilding.create.foundation.gui.element.BoxElement;
|
||||||
@@ -96,8 +96,8 @@ public class BoxWidget extends ElementWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void beforeRender(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
protected void beforeRender(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
super.beforeRender(graphics, mouseX, mouseY, partialTicks);
|
super.beforeRender(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
if (isHovered != wasHovered) {
|
if (isHovered != wasHovered) {
|
||||||
startGradientAnimation(
|
startGradientAnimation(
|
||||||
@@ -119,7 +119,7 @@ public class BoxWidget extends ElementWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doRender(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
public void doRender(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
float fadeValue = fade.getValue(partialTicks);
|
float fadeValue = fade.getValue(partialTicks);
|
||||||
if (fadeValue < .1f)
|
if (fadeValue < .1f)
|
||||||
return;
|
return;
|
||||||
@@ -129,9 +129,9 @@ public class BoxWidget extends ElementWidget {
|
|||||||
.gradientBorder(gradientColor1, gradientColor2)
|
.gradientBorder(gradientColor1, gradientColor2)
|
||||||
.at(getX(), getY(), z)
|
.at(getX(), getY(), z)
|
||||||
.withBounds(width, height)
|
.withBounds(width, height)
|
||||||
.render(graphics);
|
.render(ms);
|
||||||
|
|
||||||
super.doRender(graphics, mouseX, mouseY, partialTicks);
|
super.doRender(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
wasHovered = isHovered;
|
wasHovered = isHovered;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.element.RenderElement;
|
import nl.requios.effortlessbuilding.create.foundation.gui.element.RenderElement;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.element.ScreenElement;
|
import nl.requios.effortlessbuilding.create.foundation.gui.element.ScreenElement;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.utility.animation.LerpedFloat;
|
import nl.requios.effortlessbuilding.create.foundation.utility.animation.LerpedFloat;
|
||||||
@@ -117,20 +116,19 @@ public class ElementWidget extends AbstractSimiWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void beforeRender(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
protected void beforeRender(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
super.beforeRender(graphics, mouseX, mouseY, partialTicks);
|
super.beforeRender(ms, mouseX, mouseY, partialTicks);
|
||||||
isHovered = isMouseOver(mouseX, mouseY);
|
isHovered = isMouseOver(mouseX, mouseY);
|
||||||
|
|
||||||
float fadeValue = fade.getValue(partialTicks);
|
float fadeValue = fade.getValue(partialTicks);
|
||||||
element.withAlpha(fadeValue);
|
element.withAlpha(fadeValue);
|
||||||
if (fadeValue < 1) {
|
if (fadeValue < 1) {
|
||||||
graphics.pose().translate((1 - fadeValue) * fadeModX, (1 - fadeValue) * fadeModY, 0);
|
ms.translate((1 - fadeValue) * fadeModX, (1 - fadeValue) * fadeModY, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doRender(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
public void doRender(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
PoseStack ms = graphics.pose();
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
ms.translate(getX() + paddingX, getY() + paddingY, z);
|
ms.translate(getX() + paddingX, getY() + paddingY, z);
|
||||||
float innerWidth = width - 2 * paddingX;
|
float innerWidth = width - 2 * paddingX;
|
||||||
@@ -144,7 +142,7 @@ public class ElementWidget extends AbstractSimiWidget {
|
|||||||
innerWidth /= xScale;
|
innerWidth /= xScale;
|
||||||
innerHeight /= yScale;
|
innerHeight /= yScale;
|
||||||
}
|
}
|
||||||
element.withBounds((int) innerWidth, (int) innerHeight).render(graphics);
|
element.withBounds((int) innerWidth, (int) innerHeight).render(ms);
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
if (rescaleElement) {
|
if (rescaleElement) {
|
||||||
element.at(eX, eY);
|
element.at(eX, eY);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.AllGuiTextures;
|
import nl.requios.effortlessbuilding.create.foundation.gui.AllGuiTextures;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.element.ScreenElement;
|
import nl.requios.effortlessbuilding.create.foundation.gui.element.ScreenElement;
|
||||||
@@ -20,7 +20,7 @@ public class IconButton extends AbstractSimiWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doRender(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
public void doRender(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
isHovered = mouseX >= getX() && mouseY >= getY() && mouseX < getX() + width && mouseY < getY() + height;
|
isHovered = mouseX >= getX() && mouseY >= getY() && mouseX < getX() + width && mouseY < getY() + height;
|
||||||
|
|
||||||
@@ -28,13 +28,14 @@ public class IconButton extends AbstractSimiWidget {
|
|||||||
: isMouseOver(mouseX, mouseY) ? AllGuiTextures.BUTTON_HOVER : AllGuiTextures.BUTTON;
|
: isMouseOver(mouseX, mouseY) ? AllGuiTextures.BUTTON_HOVER : AllGuiTextures.BUTTON;
|
||||||
|
|
||||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
drawBg(graphics, button);
|
drawBg(ms, button);
|
||||||
icon.render(graphics, getX() + 1, getY() + 1);
|
icon.render(ms, getX() + 1, getY() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawBg(GuiGraphics graphics, AllGuiTextures button) {
|
protected void drawBg(PoseStack ms, AllGuiTextures button) {
|
||||||
graphics.blit(button.location, getX(), getY(), button.startX, button.startY, button.width, button.height);
|
AllGuiTextures.BUTTON.bind();
|
||||||
|
blit(ms, getX(), getY(), button.startX, button.startY, button.width, button.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setToolTip(Component text) {
|
public void setToolTip(Component text) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.AllGuiTextures;
|
import nl.requios.effortlessbuilding.create.foundation.gui.AllGuiTextures;
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ public class Indicator extends AbstractSimiWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks ) {
|
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks ) {
|
||||||
if (!visible)
|
if (!visible)
|
||||||
return;
|
return;
|
||||||
AllGuiTextures toDraw;
|
AllGuiTextures toDraw;
|
||||||
@@ -28,7 +28,7 @@ public class Indicator extends AbstractSimiWidget {
|
|||||||
case GREEN: toDraw = AllGuiTextures.INDICATOR_GREEN; break;
|
case GREEN: toDraw = AllGuiTextures.INDICATOR_GREEN; break;
|
||||||
default: toDraw = AllGuiTextures.INDICATOR; break;
|
default: toDraw = AllGuiTextures.INDICATOR; break;
|
||||||
}
|
}
|
||||||
toDraw.render(graphics, getX(), getY());
|
toDraw.render(ms, getX(), getY());
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum State {
|
public enum State {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.network.chat.MutableComponent;
|
import net.minecraft.network.chat.MutableComponent;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.utility.Components;
|
import nl.requios.effortlessbuilding.create.foundation.utility.Components;
|
||||||
@@ -70,7 +70,7 @@ public class Label extends AbstractSimiWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doRender(@Nonnull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
protected void doRender(@Nonnull PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
if (text == null || text.getString().isEmpty())
|
if (text == null || text.getString().isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -79,7 +79,10 @@ public class Label extends AbstractSimiWidget {
|
|||||||
if (suffix != null && !suffix.isEmpty())
|
if (suffix != null && !suffix.isEmpty())
|
||||||
copy.append(suffix);
|
copy.append(suffix);
|
||||||
|
|
||||||
graphics.drawString(font, copy, getX(), getY(), color, hasShadow);
|
if (hasShadow)
|
||||||
|
font.drawShadow(ms, copy, getX(), getY(), color);
|
||||||
|
else
|
||||||
|
font.draw(ms, copy, getX(), getY(), color);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package nl.requios.effortlessbuilding.create.foundation.gui.widget;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
|
||||||
public class TooltipArea extends AbstractSimiWidget {
|
public class TooltipArea extends AbstractSimiWidget {
|
||||||
@@ -12,7 +12,7 @@ public class TooltipArea extends AbstractSimiWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
public void renderWidget(PoseStack graphics, int mouseX, int mouseY, float partialTicks) {
|
||||||
if (visible)
|
if (visible)
|
||||||
isHovered = mouseX >= getX() && mouseY >= getY() && mouseX < getX() + width && mouseY < getY() + height;
|
isHovered = mouseX >= getX() && mouseY >= getY() && mouseX < getX() + width && mouseY < getY() + height;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public class ItemHelper {
|
|||||||
return true;
|
return true;
|
||||||
if (stacks1.length == stacks2.length) {
|
if (stacks1.length == stacks2.length) {
|
||||||
for (int i = 0; i < stacks1.length; i++)
|
for (int i = 0; i < stacks1.length; i++)
|
||||||
if (!ItemStack.isSameItem(stacks1[i], stacks2[i]))
|
if (!ItemStack.isSame(stacks1[i], stacks2[i]))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.render;
|
package nl.requios.effortlessbuilding.create.foundation.render;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.core.model.ModelUtil;
|
import com.jozufozu.flywheel.core.model.ModelUtil;
|
||||||
import com.jozufozu.flywheel.core.model.ShadeSeparatedBufferedData;
|
import com.jozufozu.flywheel.util.Pair;
|
||||||
|
import com.mojang.blaze3d.vertex.BufferBuilder;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
|
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
|
||||||
@@ -12,7 +13,7 @@ public class BakedModelRenderHelper {
|
|||||||
|
|
||||||
public static SuperByteBuffer standardBlockRender(BlockState renderedState) {
|
public static SuperByteBuffer standardBlockRender(BlockState renderedState) {
|
||||||
BlockRenderDispatcher dispatcher = Minecraft.getInstance()
|
BlockRenderDispatcher dispatcher = Minecraft.getInstance()
|
||||||
.getBlockRenderer();
|
.getBlockRenderer();
|
||||||
return standardModelRender(dispatcher.getBlockModel(renderedState), renderedState);
|
return standardModelRender(dispatcher.getBlockModel(renderedState), renderedState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,10 +22,7 @@ public class BakedModelRenderHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static SuperByteBuffer standardModelRender(BakedModel model, BlockState referenceState, PoseStack ms) {
|
public static SuperByteBuffer standardModelRender(BakedModel model, BlockState referenceState, PoseStack ms) {
|
||||||
ShadeSeparatedBufferedData data = ModelUtil.getBufferedData(model, referenceState, ms);
|
Pair<BufferBuilder.RenderedBuffer, Integer> pair = ModelUtil.getBufferBuilder(model, referenceState, ms);
|
||||||
SuperByteBuffer sbb = new SuperByteBuffer(data);
|
return new SuperByteBuffer(pair.first(), pair.second());
|
||||||
data.release();
|
|
||||||
return sbb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,24 @@
|
|||||||
package nl.requios.effortlessbuilding.create.foundation.render;
|
package nl.requios.effortlessbuilding.create.foundation.render;
|
||||||
|
|
||||||
|
import com.jozufozu.flywheel.util.Color;
|
||||||
|
import nl.requios.effortlessbuilding.create.foundation.block.render.SpriteShiftEntry;
|
||||||
|
import org.joml.Matrix3f;
|
||||||
|
import org.joml.Matrix4f;
|
||||||
|
import org.joml.Quaternionf;
|
||||||
|
import org.joml.Vector3f;
|
||||||
|
import org.joml.Vector4f;
|
||||||
|
|
||||||
import com.jozufozu.flywheel.api.vertex.ShadedVertexList;
|
import com.jozufozu.flywheel.api.vertex.ShadedVertexList;
|
||||||
import com.jozufozu.flywheel.api.vertex.VertexList;
|
|
||||||
import com.jozufozu.flywheel.backend.ShadersModHandler;
|
import com.jozufozu.flywheel.backend.ShadersModHandler;
|
||||||
import com.jozufozu.flywheel.core.model.ShadeSeparatedBufferedData;
|
|
||||||
import com.jozufozu.flywheel.core.vertex.BlockVertexList;
|
import com.jozufozu.flywheel.core.vertex.BlockVertexList;
|
||||||
import com.jozufozu.flywheel.util.Color;
|
|
||||||
import com.jozufozu.flywheel.util.DiffuseLightCalculator;
|
import com.jozufozu.flywheel.util.DiffuseLightCalculator;
|
||||||
import com.jozufozu.flywheel.util.transform.TStack;
|
import com.jozufozu.flywheel.util.transform.TStack;
|
||||||
import com.jozufozu.flywheel.util.transform.Transform;
|
import com.jozufozu.flywheel.util.transform.Transform;
|
||||||
import com.mojang.blaze3d.vertex.BufferBuilder;
|
import com.mojang.blaze3d.vertex.BufferBuilder.DrawState;
|
||||||
|
import com.mojang.blaze3d.vertex.BufferBuilder.RenderedBuffer;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.longs.Long2IntMap;
|
import it.unimi.dsi.fastutil.longs.Long2IntMap;
|
||||||
import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
|
import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
@@ -23,23 +29,13 @@ import net.minecraft.core.BlockPos;
|
|||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.block.render.SpriteShiftEntry;
|
|
||||||
import org.joml.Matrix3f;
|
|
||||||
import org.joml.Matrix4f;
|
|
||||||
import org.joml.Quaternionf;
|
|
||||||
import org.joml.Vector3f;
|
|
||||||
import org.joml.Vector4f;
|
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.util.function.IntPredicate;
|
|
||||||
|
|
||||||
public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<SuperByteBuffer> {
|
public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<SuperByteBuffer> {
|
||||||
|
|
||||||
private final VertexList template;
|
private final ShadedVertexList template;
|
||||||
private final IntPredicate shadedPredicate;
|
|
||||||
|
|
||||||
// Vertex Position
|
// Vertex Position
|
||||||
private final PoseStack transforms = new PoseStack();
|
private final PoseStack transforms;
|
||||||
|
|
||||||
// Vertex Coloring
|
// Vertex Coloring
|
||||||
private boolean shouldColor;
|
private boolean shouldColor;
|
||||||
@@ -67,28 +63,11 @@ public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<Super
|
|||||||
// Temporary
|
// Temporary
|
||||||
private static final Long2IntMap WORLD_LIGHT_CACHE = new Long2IntOpenHashMap();
|
private static final Long2IntMap WORLD_LIGHT_CACHE = new Long2IntOpenHashMap();
|
||||||
|
|
||||||
public SuperByteBuffer(ByteBuffer vertexBuffer, BufferBuilder.DrawState drawState, int unshadedStartVertex) {
|
public SuperByteBuffer(RenderedBuffer buf, int unshadedStartVertex) {
|
||||||
int vertexCount = drawState.vertexCount();
|
DrawState drawState = buf.drawState();
|
||||||
int stride = drawState.format().getVertexSize();
|
template = new BlockVertexList.Shaded(buf.vertexBuffer(), drawState.vertexCount(), drawState.format().getVertexSize(), unshadedStartVertex);
|
||||||
|
|
||||||
ShadedVertexList template = new BlockVertexList.Shaded(vertexBuffer, vertexCount, stride, unshadedStartVertex);
|
|
||||||
shadedPredicate = template::isShaded;
|
|
||||||
this.template = template;
|
|
||||||
|
|
||||||
transforms.pushPose();
|
|
||||||
}
|
|
||||||
|
|
||||||
public SuperByteBuffer(ShadeSeparatedBufferedData data) {
|
|
||||||
this(data.vertexBuffer(), data.drawState(), data.unshadedStartVertex());
|
|
||||||
}
|
|
||||||
|
|
||||||
public SuperByteBuffer(ByteBuffer vertexBuffer, BufferBuilder.DrawState drawState) {
|
|
||||||
int vertexCount = drawState.vertexCount();
|
|
||||||
int stride = drawState.format().getVertexSize();
|
|
||||||
|
|
||||||
template = new BlockVertexList(vertexBuffer, vertexCount, stride);
|
|
||||||
shadedPredicate = index -> true;
|
|
||||||
|
|
||||||
|
transforms = new PoseStack();
|
||||||
transforms.pushPose();
|
transforms.pushPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,21 +76,21 @@ public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<Super
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Matrix4f modelMat = new Matrix4f(input.last()
|
Matrix4f modelMat = new Matrix4f(input.last()
|
||||||
.pose());
|
.pose());
|
||||||
Matrix4f localTransforms = transforms.last()
|
Matrix4f localTransforms = transforms.last()
|
||||||
.pose();
|
.pose();
|
||||||
modelMat.mul(localTransforms);
|
modelMat.mul(localTransforms);
|
||||||
|
|
||||||
Matrix3f normalMat;
|
Matrix3f normalMat;
|
||||||
if (fullNormalTransform) {
|
if (fullNormalTransform) {
|
||||||
normalMat = new Matrix3f(input.last()
|
normalMat = new Matrix3f(input.last()
|
||||||
.normal());
|
.normal());
|
||||||
Matrix3f localNormalTransforms = transforms.last()
|
Matrix3f localNormalTransforms = transforms.last()
|
||||||
.normal();
|
.normal();
|
||||||
normalMat.mul(localNormalTransforms);
|
normalMat.mul(localNormalTransforms);
|
||||||
} else {
|
} else {
|
||||||
normalMat = new Matrix3f(transforms.last()
|
normalMat = new Matrix3f(transforms.last()
|
||||||
.normal());
|
.normal());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useWorldLight) {
|
if (useWorldLight) {
|
||||||
@@ -124,7 +103,7 @@ public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<Super
|
|||||||
|
|
||||||
DiffuseLightCalculator diffuseCalculator = ForcedDiffuseState.getForcedCalculator();
|
DiffuseLightCalculator diffuseCalculator = ForcedDiffuseState.getForcedCalculator();
|
||||||
final boolean disableDiffuseMult =
|
final boolean disableDiffuseMult =
|
||||||
this.disableDiffuseMult || (ShadersModHandler.isShaderPackInUse() && diffuseCalculator == null);
|
this.disableDiffuseMult || (ShadersModHandler.isShaderPackInUse() && diffuseCalculator == null);
|
||||||
if (diffuseCalculator == null) {
|
if (diffuseCalculator == null) {
|
||||||
diffuseCalculator = this.diffuseCalculator;
|
diffuseCalculator = this.diffuseCalculator;
|
||||||
if (diffuseCalculator == null) {
|
if (diffuseCalculator == null) {
|
||||||
@@ -167,7 +146,7 @@ public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<Super
|
|||||||
if (disableDiffuseMult) {
|
if (disableDiffuseMult) {
|
||||||
builder.color(r, g, b, a);
|
builder.color(r, g, b, a);
|
||||||
} else {
|
} else {
|
||||||
float instanceDiffuse = diffuseCalculator.getDiffuse(nx, ny, nz, shadedPredicate.test(i));
|
float instanceDiffuse = diffuseCalculator.getDiffuse(nx, ny, nz, template.isShaded(i));
|
||||||
int colorR = transformColor(r, instanceDiffuse);
|
int colorR = transformColor(r, instanceDiffuse);
|
||||||
int colorG = transformColor(g, instanceDiffuse);
|
int colorG = transformColor(g, instanceDiffuse);
|
||||||
int colorB = transformColor(b, instanceDiffuse);
|
int colorB = transformColor(b, instanceDiffuse);
|
||||||
@@ -246,10 +225,6 @@ public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<Super
|
|||||||
return template.isEmpty();
|
return template.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete() {
|
|
||||||
template.delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
public PoseStack getTransforms() {
|
public PoseStack getTransforms() {
|
||||||
return transforms;
|
return transforms;
|
||||||
}
|
}
|
||||||
@@ -287,40 +262,40 @@ public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<Super
|
|||||||
@Override
|
@Override
|
||||||
public SuperByteBuffer mulPose(Matrix4f pose) {
|
public SuperByteBuffer mulPose(Matrix4f pose) {
|
||||||
transforms.last()
|
transforms.last()
|
||||||
.pose()
|
.pose()
|
||||||
.mul(pose);
|
.mul(pose);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuperByteBuffer mulNormal(Matrix3f normal) {
|
public SuperByteBuffer mulNormal(Matrix3f normal) {
|
||||||
transforms.last()
|
transforms.last()
|
||||||
.normal()
|
.normal()
|
||||||
.mul(normal);
|
.mul(normal);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SuperByteBuffer transform(PoseStack stack) {
|
public SuperByteBuffer transform(PoseStack stack) {
|
||||||
transforms.last()
|
transforms.last()
|
||||||
.pose()
|
.pose()
|
||||||
.mul(stack.last()
|
.mul(stack.last()
|
||||||
.pose());
|
.pose());
|
||||||
transforms.last()
|
transforms.last()
|
||||||
.normal()
|
.normal()
|
||||||
.mul(stack.last()
|
.mul(stack.last()
|
||||||
.normal());
|
.normal());
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SuperByteBuffer rotateCentered(Direction axis, float radians) {
|
public SuperByteBuffer rotateCentered(Direction axis, float radians) {
|
||||||
translate(.5f, .5f, .5f).rotate(axis, radians)
|
translate(.5f, .5f, .5f).rotate(axis, radians)
|
||||||
.translate(-.5f, -.5f, -.5f);
|
.translate(-.5f, -.5f, -.5f);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SuperByteBuffer rotateCentered(Quaternionf q) {
|
public SuperByteBuffer rotateCentered(Quaternionf q) {
|
||||||
translate(.5f, .5f, .5f).multiply(q)
|
translate(.5f, .5f, .5f).multiply(q)
|
||||||
.translate(-.5f, -.5f, -.5f);
|
.translate(-.5f, -.5f, -.5f);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -375,13 +350,13 @@ public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<Super
|
|||||||
public SuperByteBuffer shiftUVScrolling(SpriteShiftEntry entry, float scrollU, float scrollV) {
|
public SuperByteBuffer shiftUVScrolling(SpriteShiftEntry entry, float scrollU, float scrollV) {
|
||||||
this.spriteShiftFunc = (builder, u, v) -> {
|
this.spriteShiftFunc = (builder, u, v) -> {
|
||||||
float targetU = u - entry.getOriginal()
|
float targetU = u - entry.getOriginal()
|
||||||
.getU0() + entry.getTarget()
|
.getU0() + entry.getTarget()
|
||||||
.getU0()
|
.getU0()
|
||||||
+ scrollU;
|
+ scrollU;
|
||||||
float targetV = v - entry.getOriginal()
|
float targetV = v - entry.getOriginal()
|
||||||
.getV0() + entry.getTarget()
|
.getV0() + entry.getTarget()
|
||||||
.getV0()
|
.getV0()
|
||||||
+ scrollV;
|
+ scrollV;
|
||||||
builder.uv(targetU, targetV);
|
builder.uv(targetU, targetV);
|
||||||
};
|
};
|
||||||
return this;
|
return this;
|
||||||
@@ -390,9 +365,9 @@ public class SuperByteBuffer implements Transform<SuperByteBuffer>, TStack<Super
|
|||||||
public SuperByteBuffer shiftUVtoSheet(SpriteShiftEntry entry, float uTarget, float vTarget, int sheetSize) {
|
public SuperByteBuffer shiftUVtoSheet(SpriteShiftEntry entry, float uTarget, float vTarget, int sheetSize) {
|
||||||
this.spriteShiftFunc = (builder, u, v) -> {
|
this.spriteShiftFunc = (builder, u, v) -> {
|
||||||
float targetU = entry.getTarget()
|
float targetU = entry.getTarget()
|
||||||
.getU((SpriteShiftEntry.getUnInterpolatedU(entry.getOriginal(), u) / sheetSize) + uTarget * 16);
|
.getU((SpriteShiftEntry.getUnInterpolatedU(entry.getOriginal(), u) / sheetSize) + uTarget * 16);
|
||||||
float targetV = entry.getTarget()
|
float targetV = entry.getTarget()
|
||||||
.getV((SpriteShiftEntry.getUnInterpolatedV(entry.getOriginal(), v) / sheetSize) + vTarget * 16);
|
.getV((SpriteShiftEntry.getUnInterpolatedV(entry.getOriginal(), v) / sheetSize) + vTarget * 16);
|
||||||
builder.uv(targetU, targetV);
|
builder.uv(targetU, targetV);
|
||||||
};
|
};
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -15,15 +15,13 @@ public class SuperByteBufferCache {
|
|||||||
|
|
||||||
public synchronized void registerCompartment(Compartment<?> compartment) {
|
public synchronized void registerCompartment(Compartment<?> compartment) {
|
||||||
caches.put(compartment, CacheBuilder.newBuilder()
|
caches.put(compartment, CacheBuilder.newBuilder()
|
||||||
.<Object, SuperByteBuffer>removalListener(n -> n.getValue().delete())
|
.build());
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void registerCompartment(Compartment<?> compartment, long ticksUntilExpired) {
|
public synchronized void registerCompartment(Compartment<?> compartment, long ticksUntilExpired) {
|
||||||
caches.put(compartment, CacheBuilder.newBuilder()
|
caches.put(compartment, CacheBuilder.newBuilder()
|
||||||
.expireAfterAccess(ticksUntilExpired * 50, TimeUnit.MILLISECONDS)
|
.expireAfterAccess(ticksUntilExpired * 50, TimeUnit.MILLISECONDS)
|
||||||
.<Object, SuperByteBuffer>removalListener(n -> n.getValue().delete())
|
.build());
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> SuperByteBuffer get(Compartment<T> compartment, T key, Callable<SuperByteBuffer> callable) {
|
public <T> SuperByteBuffer get(Compartment<T> compartment, T key, Callable<SuperByteBuffer> callable) {
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ public class BlockHelper {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
BlockState belowState = world.getBlockState(pos.below());
|
BlockState belowState = world.getBlockState(pos.below());
|
||||||
if (belowState.blocksMotion() || belowState.liquid())
|
if (belowState.getMaterial().blocksMotion() || belowState.getMaterial().isLiquid())
|
||||||
world.setBlockAndUpdate(pos, Blocks.WATER.defaultBlockState());
|
world.setBlockAndUpdate(pos, Blocks.WATER.defaultBlockState());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -213,7 +213,7 @@ public class BlockHelper {
|
|||||||
int idx = chunk.getSectionIndex(target.getY());
|
int idx = chunk.getSectionIndex(target.getY());
|
||||||
LevelChunkSection chunksection = chunk.getSection(idx);
|
LevelChunkSection chunksection = chunk.getSection(idx);
|
||||||
if (chunksection == null) {
|
if (chunksection == null) {
|
||||||
chunksection = new LevelChunkSection(world.registryAccess()
|
chunksection = new LevelChunkSection(chunk.getSectionYFromSectionIndex(idx), world.registryAccess()
|
||||||
.registryOrThrow(Registries.BIOME));
|
.registryOrThrow(Registries.BIOME));
|
||||||
chunk.getSections()[idx] = chunksection;
|
chunk.getSections()[idx] = chunksection;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class WrappedServerWorld extends ServerLevel {
|
|||||||
(ServerLevelData) world.getLevelData(), world.dimension(),
|
(ServerLevelData) world.getLevelData(), world.dimension(),
|
||||||
new LevelStem(world.dimensionTypeRegistration(), world.getChunkSource().getGenerator()),
|
new LevelStem(world.dimensionTypeRegistration(), world.getChunkSource().getGenerator()),
|
||||||
new DummyStatusListener(), world.isDebug(), world.getBiomeManager().biomeZoomSeed,
|
new DummyStatusListener(), world.isDebug(), world.getBiomeManager().biomeZoomSeed,
|
||||||
Collections.emptyList(), false, world.getRandomSequences());
|
Collections.emptyList(), false);
|
||||||
this.world = world;
|
this.world = world;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ public class DiamondRandomizerBagContainer extends AbstractContainerMenu {
|
|||||||
@Override
|
@Override
|
||||||
public void removed(Player player) {
|
public void removed(Player player) {
|
||||||
super.removed(player);
|
super.removed(player);
|
||||||
if (!player.level().isClientSide) {
|
if (!player.level.isClientSide) {
|
||||||
broadcastChanges();
|
broadcastChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package nl.requios.effortlessbuilding.gui;
|
package nl.requios.effortlessbuilding.gui;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@@ -25,22 +26,24 @@ public class DiamondRandomizerBagScreen extends AbstractContainerScreen<DiamondR
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
renderBackground(guiGraphics);
|
renderBackground(ms);
|
||||||
super.render(guiGraphics, mouseX, mouseY, partialTicks);
|
super.render(ms, mouseX, mouseY, partialTicks);
|
||||||
this.renderTooltip(guiGraphics, mouseX, mouseY);
|
this.renderTooltip(ms, mouseX, mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderLabels(GuiGraphics guiGraphics, int mouseX, int mouseY) {
|
protected void renderLabels(PoseStack ms, int mouseX, int mouseY) {
|
||||||
guiGraphics.drawString(this.font, this.title, 8, 6, 0x404040, false);
|
this.font.draw(ms, this.title, 8, 6, 0x404040);
|
||||||
guiGraphics.drawString(this.font, this.playerInventoryTitle, 8, imageHeight - 96 + 2, 0x404040, false);
|
this.font.draw(ms, this.playerInventoryTitle, 8, imageHeight - 96 + 2, 0x404040);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderBg(GuiGraphics guiGraphics, float partialTicks, int mouseX, int mouseY) {
|
protected void renderBg(PoseStack ms, float partialTicks, int mouseX, int mouseY) {
|
||||||
|
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1f);
|
||||||
|
RenderSystem.setShaderTexture(0, guiTextures);
|
||||||
int marginHorizontal = (width - imageWidth) / 2;
|
int marginHorizontal = (width - imageWidth) / 2;
|
||||||
int marginVertical = (height - imageHeight) / 2;
|
int marginVertical = (height - imageHeight) / 2;
|
||||||
guiGraphics.blit(guiTextures, marginHorizontal, marginVertical, 0, 0, imageWidth, imageHeight);
|
blit(ms, marginHorizontal, marginVertical, 0, 0, imageWidth, imageHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public class GoldenRandomizerBagContainer extends AbstractContainerMenu {
|
|||||||
@Override
|
@Override
|
||||||
public void removed(Player player) {
|
public void removed(Player player) {
|
||||||
super.removed(player);
|
super.removed(player);
|
||||||
if (!player.level().isClientSide) {
|
if (!player.level.isClientSide) {
|
||||||
broadcastChanges();
|
broadcastChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package nl.requios.effortlessbuilding.gui;
|
package nl.requios.effortlessbuilding.gui;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@@ -25,22 +26,24 @@ public class GoldenRandomizerBagScreen extends AbstractContainerScreen<GoldenRan
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
renderBackground(guiGraphics);
|
renderBackground(ms);
|
||||||
super.render(guiGraphics, mouseX, mouseY, partialTicks);
|
super.render(ms, mouseX, mouseY, partialTicks);
|
||||||
this.renderTooltip(guiGraphics, mouseX, mouseY);
|
this.renderTooltip(ms, mouseX, mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderLabels(GuiGraphics guiGraphics, int mouseX, int mouseY) {
|
protected void renderLabels(PoseStack ms, int mouseX, int mouseY) {
|
||||||
guiGraphics.drawString(this.font, this.title, 8, 6, 0x404040, false);
|
this.font.draw(ms, this.title, 8, 6, 0x404040);
|
||||||
guiGraphics.drawString(this.font, this.playerInventoryTitle, 8, imageHeight - 96 + 2, 0x404040, false);
|
this.font.draw(ms, this.playerInventoryTitle, 8, imageHeight - 96 + 2, 0x404040);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderBg(GuiGraphics guiGraphics, float partialTicks, int mouseX, int mouseY) {
|
protected void renderBg(PoseStack ms, float partialTicks, int mouseX, int mouseY) {
|
||||||
|
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1f);
|
||||||
|
RenderSystem.setShaderTexture(0, guiTextures);
|
||||||
int marginHorizontal = (width - imageWidth) / 2;
|
int marginHorizontal = (width - imageWidth) / 2;
|
||||||
int marginVertical = (height - imageHeight) / 2;
|
int marginVertical = (height - imageHeight) / 2;
|
||||||
guiGraphics.blit(guiTextures, marginHorizontal, marginVertical, 0, 0, imageWidth, imageHeight);
|
blit(ms, marginHorizontal, marginVertical, 0, 0, imageWidth, imageHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public class RandomizerBagContainer extends AbstractContainerMenu {
|
|||||||
@Override
|
@Override
|
||||||
public void removed(Player player) {
|
public void removed(Player player) {
|
||||||
super.removed(player);
|
super.removed(player);
|
||||||
if (!player.level().isClientSide) {
|
if (!player.level.isClientSide) {
|
||||||
broadcastChanges();
|
broadcastChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package nl.requios.effortlessbuilding.gui;
|
package nl.requios.effortlessbuilding.gui;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@@ -25,22 +26,24 @@ public class RandomizerBagScreen extends AbstractContainerScreen<RandomizerBagCo
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
renderBackground(guiGraphics);
|
renderBackground(ms);
|
||||||
super.render(guiGraphics, mouseX, mouseY, partialTicks);
|
super.render(ms, mouseX, mouseY, partialTicks);
|
||||||
this.renderTooltip(guiGraphics, mouseX, mouseY);
|
this.renderTooltip(ms, mouseX, mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderLabels(GuiGraphics guiGraphics, int mouseX, int mouseY) {
|
protected void renderLabels(PoseStack ms, int mouseX, int mouseY) {
|
||||||
guiGraphics.drawString(this.font, this.title, 8, 6, 0x404040, false);
|
this.font.draw(ms, this.title, 8, 6, 0x404040);
|
||||||
guiGraphics.drawString(this.font, this.playerInventoryTitle, 8, imageHeight - 96 + 2, 0x404040, false);
|
this.font.draw(ms, this.playerInventoryTitle, 8, imageHeight - 96 + 2, 0x404040);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderBg(GuiGraphics guiGraphics, float partialTicks, int mouseX, int mouseY) {
|
protected void renderBg(PoseStack ms, float partialTicks, int mouseX, int mouseY) {
|
||||||
|
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1f);
|
||||||
|
RenderSystem.setShaderTexture(0, guiTextures);
|
||||||
int marginHorizontal = (width - imageWidth) / 2;
|
int marginHorizontal = (width - imageWidth) / 2;
|
||||||
int marginVertical = (height - imageHeight) / 2;
|
int marginVertical = (height - imageHeight) / 2;
|
||||||
guiGraphics.blit(guiTextures, marginHorizontal, marginVertical, 0, 0, imageWidth, imageHeight);
|
blit(ms, marginHorizontal, marginVertical, 0, 0, imageWidth, imageHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import com.mojang.blaze3d.platform.GlStateManager;
|
|||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.renderer.GameRenderer;
|
import net.minecraft.client.renderer.GameRenderer;
|
||||||
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
|
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
@@ -67,19 +66,19 @@ public class PlayerSettingsGui extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
this.renderBackground(guiGraphics);
|
this.renderBackground(ms);
|
||||||
|
|
||||||
int yy = top;
|
int yy = top;
|
||||||
guiGraphics.drawString(font, "Shader type", left, yy + 5, 0xFFFFFF, false);
|
font.draw(ms, "Shader type", left, yy + 5, 0xFFFFFF);
|
||||||
|
|
||||||
yy += 50;
|
yy += 50;
|
||||||
guiGraphics.drawString(font, "Shader speed", left, yy + 5, 0xFFFFFF, false);
|
font.draw(ms, "Shader speed", left, yy + 5, 0xFFFFFF);
|
||||||
|
|
||||||
super.render(guiGraphics, mouseX, mouseY, partialTicks);
|
super.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
if (showShaderList)
|
if (showShaderList)
|
||||||
this.shaderTypeList.render(guiGraphics, mouseX, mouseY, partialTicks);
|
this.shaderTypeList.render(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -191,7 +190,7 @@ public class PlayerSettingsGui extends Screen {
|
|||||||
|
|
||||||
//From AbstractSelectionList, disabled parts
|
//From AbstractSelectionList, disabled parts
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int p_render_1_, int p_render_2_, float p_render_3_) {
|
public void render(PoseStack guiGraphics, int p_render_1_, int p_render_2_, float p_render_3_) {
|
||||||
this.renderBackground(guiGraphics);
|
this.renderBackground(guiGraphics);
|
||||||
int i = this.getScrollbarPosition();
|
int i = this.getScrollbarPosition();
|
||||||
int j = i + 6;
|
int j = i + 6;
|
||||||
@@ -284,9 +283,9 @@ public class PlayerSettingsGui extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int itemIndex, int rowTop, int rowLeft, int rowWidth, int rowHeight, int mouseX, int mouseY, boolean hovered, float partialTicks) {
|
public void render(PoseStack ms, 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)
|
if (rowTop + 10 > ShaderTypeList.this.y0 && rowTop + rowHeight - 5 < ShaderTypeList.this.y1)
|
||||||
guiGraphics.drawString(font, shaderType.name, ShaderTypeList.this.x0 + 8, rowTop + 4, 0xFFFFFF, false);
|
font.draw(ms, shaderType.name, ShaderTypeList.this.x0 + 8, rowTop + 4, 0xFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import com.mojang.blaze3d.vertex.VertexFormat;
|
|||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.KeyMapping;
|
import net.minecraft.client.KeyMapping;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraft.client.renderer.GameRenderer;
|
import net.minecraft.client.renderer.GameRenderer;
|
||||||
import net.minecraft.client.resources.language.I18n;
|
import net.minecraft.client.resources.language.I18n;
|
||||||
@@ -102,10 +102,9 @@ public class RadialMenu extends Screen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, final int mouseX, final int mouseY, final float partialTicks) {
|
public void render(PoseStack ms, final int mouseX, final int mouseY, final float partialTicks) {
|
||||||
BuildModeEnum currentBuildMode = EffortlessBuildingClient.BUILD_MODES.getBuildMode();
|
BuildModeEnum currentBuildMode = EffortlessBuildingClient.BUILD_MODES.getBuildMode();
|
||||||
|
|
||||||
PoseStack ms = guiGraphics.pose();
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
ms.translate(0, 0, 200);
|
ms.translate(0, 0, 200);
|
||||||
|
|
||||||
@@ -115,7 +114,7 @@ public class RadialMenu extends Screen {
|
|||||||
final int startColor = (int) (visibility * 98) << 24;
|
final int startColor = (int) (visibility * 98) << 24;
|
||||||
final int endColor = (int) (visibility * 128) << 24;
|
final int endColor = (int) (visibility * 128) << 24;
|
||||||
|
|
||||||
guiGraphics.fillGradient(0, 0, width, height, startColor, endColor);
|
fillGradient(ms, 0, 0, width, height, startColor, endColor);
|
||||||
|
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
RenderSystem.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
RenderSystem.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||||
@@ -191,9 +190,9 @@ public class RadialMenu extends Screen {
|
|||||||
tessellator.end();
|
tessellator.end();
|
||||||
RenderSystem.disableBlend();
|
RenderSystem.disableBlend();
|
||||||
|
|
||||||
drawIcons(guiGraphics, middleX, middleY, modes, buttons);
|
drawIcons(ms, middleX, middleY, modes, buttons);
|
||||||
|
|
||||||
drawTexts(guiGraphics, currentBuildMode, middleX, middleY, modes, buttons, options, mouseXX, mouseYY);
|
drawTexts(ms, currentBuildMode, middleX, middleY, modes, buttons, options, mouseXX, mouseYY);
|
||||||
|
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
@@ -295,9 +294,8 @@ public class RadialMenu extends Screen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawIcons(GuiGraphics guiGraphics, double middleX, double middleY,
|
private void drawIcons(PoseStack ms, double middleX, double middleY,
|
||||||
ArrayList<MenuRegion> modes, ArrayList<MenuButton> buttons) {
|
ArrayList<MenuRegion> modes, ArrayList<MenuButton> buttons) {
|
||||||
PoseStack ms = guiGraphics.pose();
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
|
|
||||||
//Draw buildmode icons
|
//Draw buildmode icons
|
||||||
@@ -306,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 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);
|
final double y = (menuRegion.y1 + menuRegion.y2) * 0.5 * (ringOuterEdge * 0.55 + 0.45 * ringInnerEdge);
|
||||||
|
|
||||||
menuRegion.mode.icon.render(guiGraphics, (int) (middleX + x - 8), (int) (middleY + y - 8));
|
menuRegion.mode.icon.render(ms, (int) (middleX + x - 8), (int) (middleY + y - 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Draw action icons
|
//Draw action icons
|
||||||
@@ -315,28 +313,28 @@ public class RadialMenu extends Screen {
|
|||||||
final double x = (button.x1 + button.x2) / 2 + 0.01;
|
final double x = (button.x1 + button.x2) / 2 + 0.01;
|
||||||
final double y = (button.y1 + button.y2) / 2 + 0.01;
|
final double y = (button.y1 + button.y2) / 2 + 0.01;
|
||||||
|
|
||||||
button.action.icon.render(guiGraphics, (int) (middleX + x - 8), (int) (middleY + y - 8));
|
button.action.icon.render(ms, (int) (middleX + x - 8), (int) (middleY + y - 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawTexts(GuiGraphics guiGraphics, BuildModeEnum currentBuildMode, double middleX, double middleY, ArrayList<MenuRegion> modes, ArrayList<MenuButton> buttons, OptionEnum[] options, int mouseX, int mouseY) {
|
private void drawTexts(PoseStack ms, BuildModeEnum currentBuildMode, double middleX, double middleY, ArrayList<MenuRegion> modes, ArrayList<MenuButton> buttons, OptionEnum[] options, int mouseX, int mouseY) {
|
||||||
//font.drawStringWithShadow("Actions", (int) (middleX - buttonDistance - 13) - font.getStringWidth("Actions") * 0.5f, (int) middleY - 38, 0xffffffff);
|
//font.drawStringWithShadow("Actions", (int) (middleX - buttonDistance - 13) - font.getStringWidth("Actions") * 0.5f, (int) middleY - 38, 0xffffffff);
|
||||||
|
|
||||||
//Draw option strings
|
//Draw option strings
|
||||||
for (int i = 0; i < currentBuildMode.options.length; i++) {
|
for (int i = 0; i < currentBuildMode.options.length; i++) {
|
||||||
OptionEnum option = options[i];
|
OptionEnum option = options[i];
|
||||||
guiGraphics.drawString(font, I18n.get(option.name), (int) (middleX + buttonDistance - 9), (int) middleY - 37 + i * 39, optionTextColor);
|
font.draw(ms, I18n.get(option.name), (int) (middleX + buttonDistance - 9), (int) middleY - 37 + i * 39, optionTextColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
String credits = "Effortless Building";
|
String credits = "Effortless Building";
|
||||||
guiGraphics.drawString(font, credits, width - font.width(credits) - 4, height - 10, watermarkTextColor);
|
font.draw(ms, credits, width - font.width(credits) - 4, height - 10, watermarkTextColor);
|
||||||
|
|
||||||
//Draw power level info
|
//Draw power level info
|
||||||
String powerLevelValue = minecraft.player.isCreative() ? "Creative" : String.valueOf(EffortlessBuildingClient.POWER_LEVEL.getPowerLevel());
|
String powerLevelValue = minecraft.player.isCreative() ? "Creative" : String.valueOf(EffortlessBuildingClient.POWER_LEVEL.getPowerLevel());
|
||||||
String powerLevelText = I18n.get("key.effortlessbuilding.power_level") + ": " + powerLevelValue;
|
String powerLevelText = I18n.get("key.effortlessbuilding.power_level") + ": " + powerLevelValue;
|
||||||
guiGraphics.drawString(font, powerLevelText, width - font.width(powerLevelText) - 4, height - 22, minecraft.player.isCreative() ? watermarkTextColor : ChatFormatting.DARK_PURPLE.getColor());
|
font.draw(ms, powerLevelText, width - font.width(powerLevelText) - 4, height - 22, minecraft.player.isCreative() ? watermarkTextColor : ChatFormatting.DARK_PURPLE.getColor());
|
||||||
|
|
||||||
//if hover over power level info, show tooltip
|
//if hover over power level info, show tooltip
|
||||||
if (mouseX >= width - font.width(powerLevelText) - 14 && mouseX <= width && mouseY >= height - 24 && mouseY <= height) {
|
if (mouseX >= width - font.width(powerLevelText) - 14 && mouseX <= width && mouseY >= height - 24 && mouseY <= height) {
|
||||||
@@ -359,7 +357,7 @@ public class RadialMenu extends Screen {
|
|||||||
tooltip.addAll(TooltipHelper.cutTextComponent(Components.translatable("key.effortlessbuilding.next_power_level_how"), ChatFormatting.GRAY, ChatFormatting.WHITE));
|
tooltip.addAll(TooltipHelper.cutTextComponent(Components.translatable("key.effortlessbuilding.next_power_level_how"), ChatFormatting.GRAY, ChatFormatting.WHITE));
|
||||||
}
|
}
|
||||||
|
|
||||||
guiGraphics.renderComponentTooltip(font, tooltip, mouseX, mouseY);
|
renderComponentTooltip(ms, tooltip, mouseX, mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -380,11 +378,11 @@ public class RadialMenu extends Screen {
|
|||||||
fixed_x -= font.width(text) / 2;
|
fixed_x -= font.width(text) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
guiGraphics.drawString(font, text, (int) middleX + fixed_x, (int) middleY + fixed_y, whiteTextColor);
|
font.draw(ms, text, (int) middleX + fixed_x, (int) middleY + fixed_y, whiteTextColor);
|
||||||
|
|
||||||
//Draw description
|
//Draw description
|
||||||
text = I18n.get(menuRegion.mode.getDescriptionKey());
|
text = I18n.get(menuRegion.mode.getDescriptionKey());
|
||||||
guiGraphics.drawString(font, text, (int) ((int) middleX - font.width(text) / 2f), (int) middleY + buildModeDescriptionHeight, descriptionTextColor);
|
font.draw(ms, text, (int) ((int) middleX - font.width(text) / 2f), (int) middleY + buildModeDescriptionHeight, descriptionTextColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -407,7 +405,7 @@ public class RadialMenu extends Screen {
|
|||||||
var keybind = findKeybind(button);
|
var keybind = findKeybind(button);
|
||||||
if (keybind != null)
|
if (keybind != null)
|
||||||
tooltip.add(Lang.translateDirect("tooltip.keybind", keybind.withStyle(ChatFormatting.GRAY)).withStyle(ChatFormatting.DARK_GRAY));
|
tooltip.add(Lang.translateDirect("tooltip.keybind", keybind.withStyle(ChatFormatting.GRAY)).withStyle(ChatFormatting.DARK_GRAY));
|
||||||
guiGraphics.renderComponentTooltip(font, tooltip, mouseX, mouseY);
|
renderComponentTooltip(ms, tooltip, mouseX, mouseY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
@@ -59,25 +59,25 @@ public class ArrayEntry extends BaseModifierEntry<Array> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
public void render(PoseStack ms, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||||
super.render(guiGraphics, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
super.render(ms, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||||
|
|
||||||
//draw offset inputs
|
//draw offset inputs
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
offsetInputs.get(i).setX(left + 49 + 20 * i);
|
offsetInputs.get(i).setX(left + 49 + 20 * i);
|
||||||
offsetInputs.get(i).setY(top + 19);
|
offsetInputs.get(i).setY(top + 19);
|
||||||
offsetInputs.get(i).render(guiGraphics, mouseX, mouseY, partialTicks);
|
offsetInputs.get(i).render(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
//draw count input
|
//draw count input
|
||||||
countInput.setX(left + 49);
|
countInput.setX(left + 49);
|
||||||
countInput.setY(top + 41);
|
countInput.setY(top + 41);
|
||||||
countInput.render(guiGraphics, mouseX, mouseY, partialTicks);
|
countInput.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
//draw reach label
|
//draw reach label
|
||||||
reachLabel.setX(right - 8 - getFont().width(reachLabel.text));
|
reachLabel.setX(right - 8 - getFont().width(reachLabel.text));
|
||||||
reachLabel.setY(top + 24);
|
reachLabel.setY(top + 24);
|
||||||
reachLabel.render(guiGraphics, mouseX, mouseY, partialTicks);
|
reachLabel.render(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import nl.requios.effortlessbuilding.AllGuiTextures;
|
import nl.requios.effortlessbuilding.AllGuiTextures;
|
||||||
import nl.requios.effortlessbuilding.buildmodifier.BaseModifier;
|
import nl.requios.effortlessbuilding.buildmodifier.BaseModifier;
|
||||||
@@ -80,39 +80,39 @@ public abstract class BaseModifierEntry<T extends BaseModifier> extends Modifier
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
public void render(PoseStack ms, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||||
|
|
||||||
left = x + width / 2 - BACKGROUND_WIDTH / 2;
|
left = x + width / 2 - BACKGROUND_WIDTH / 2;
|
||||||
right = x + width / 2 + BACKGROUND_WIDTH / 2;
|
right = x + width / 2 + BACKGROUND_WIDTH / 2;
|
||||||
top = y;
|
top = y;
|
||||||
bottom = y + BACKGROUND_HEIGHT;
|
bottom = y + BACKGROUND_HEIGHT;
|
||||||
|
|
||||||
background.render(guiGraphics, left, top);
|
background.render(ms, left, top);
|
||||||
|
|
||||||
enableButton.setX(left + 4);
|
enableButton.setX(left + 4);
|
||||||
enableButton.setY(top + 3);
|
enableButton.setY(top + 3);
|
||||||
enableButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
enableButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
if (modifier.enabled)
|
if (modifier.enabled)
|
||||||
AllGuiTextures.CHECKMARK.render(guiGraphics, left + 5, top + 3);
|
AllGuiTextures.CHECKMARK.render(ms, left + 5, top + 3);
|
||||||
|
|
||||||
nameLabel.setX(left + 18);
|
nameLabel.setX(left + 18);
|
||||||
nameLabel.setY(top + 4);
|
nameLabel.setY(top + 4);
|
||||||
nameLabel.render(guiGraphics, mouseX, mouseY, partialTicks);
|
nameLabel.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
moveUpButton.visible = screen.canMoveUp(this);
|
moveUpButton.visible = screen.canMoveUp(this);
|
||||||
moveDownButton.visible = screen.canMoveDown(this);
|
moveDownButton.visible = screen.canMoveDown(this);
|
||||||
|
|
||||||
moveUpButton.setX(right - 31);
|
moveUpButton.setX(right - 31);
|
||||||
moveUpButton.setY(top + 3);
|
moveUpButton.setY(top + 3);
|
||||||
moveUpButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
moveUpButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
moveDownButton.setX(right - 22);
|
moveDownButton.setX(right - 22);
|
||||||
moveDownButton.setY(top + 3);
|
moveDownButton.setY(top + 3);
|
||||||
moveDownButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
moveDownButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
removeButton.setX(right - 13);
|
removeButton.setX(right - 13);
|
||||||
removeButton.setY(top + 3);
|
removeButton.setY(top + 3);
|
||||||
removeButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
removeButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onValueChanged() {
|
public void onValueChanged() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
@@ -135,49 +135,49 @@ public class MirrorEntry extends BaseModifierEntry<Mirror> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
public void render(PoseStack ms, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||||
super.render(guiGraphics, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
super.render(ms, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||||
|
|
||||||
//draw position inputs
|
//draw position inputs
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
ScrollInput input = positionInputs.get(i);
|
ScrollInput input = positionInputs.get(i);
|
||||||
input.setX(left + 49 + 38 * i);
|
input.setX(left + 49 + 38 * i);
|
||||||
input.setY(top + 19);
|
input.setY(top + 19);
|
||||||
input.render(guiGraphics, mouseX, mouseY, partialTicks);
|
input.render(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
//draw player position button
|
//draw player position button
|
||||||
playerPositionButton.setX(left + 163);
|
playerPositionButton.setX(left + 163);
|
||||||
playerPositionButton.setY(top + 19);
|
playerPositionButton.setY(top + 19);
|
||||||
playerPositionButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
playerPositionButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
//draw toggle offset button
|
//draw toggle offset button
|
||||||
toggleOffsetButton.setX(left + 183);
|
toggleOffsetButton.setX(left + 183);
|
||||||
toggleOffsetButton.setY(top + 19);
|
toggleOffsetButton.setY(top + 19);
|
||||||
toggleOffsetButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
toggleOffsetButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
//draw axis buttons
|
//draw axis buttons
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
IconButton button = axisButtons.get(i);
|
IconButton button = axisButtons.get(i);
|
||||||
button.setX(left + 49 + 18 * i);
|
button.setX(left + 49 + 18 * i);
|
||||||
button.setY(top + 41);
|
button.setY(top + 41);
|
||||||
button.render(guiGraphics, mouseX, mouseY, partialTicks);
|
button.render(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
//draw radius input
|
//draw radius input
|
||||||
radiusInput.setX(left + 134);
|
radiusInput.setX(left + 134);
|
||||||
radiusInput.setY(top + 41);
|
radiusInput.setY(top + 41);
|
||||||
radiusInput.render(guiGraphics, mouseX, mouseY, partialTicks);
|
radiusInput.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
//draw show lines button
|
//draw show lines button
|
||||||
showLinesButton.setX(left + 163);
|
showLinesButton.setX(left + 163);
|
||||||
showLinesButton.setY(top + 41);
|
showLinesButton.setY(top + 41);
|
||||||
showLinesButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
showLinesButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
//draw show areas button
|
//draw show areas button
|
||||||
showAreasButton.setX(left + 183);
|
showAreasButton.setX(left + 183);
|
||||||
showAreasButton.setY(top + 41);
|
showAreasButton.setY(top + 41);
|
||||||
showAreasButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
showAreasButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
@@ -145,7 +145,7 @@ public class ModifiersScreen extends AbstractSimiScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderWindow(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
protected void renderWindow(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ package nl.requios.effortlessbuilding.gui.buildmodifier;
|
|||||||
|
|
||||||
import com.mojang.blaze3d.platform.Window;
|
import com.mojang.blaze3d.platform.Window;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.components.ObjectSelectionList;
|
import net.minecraft.client.gui.components.ObjectSelectionList;
|
||||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
@@ -30,30 +30,30 @@ public class ModifiersScreenList extends ObjectSelectionList<ModifiersScreenList
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
public void render(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
Color c = new Color(0x60_000000);
|
Color c = new Color(0x60_000000);
|
||||||
UIRenderHelper.angledGradient(guiGraphics, 90, x0 + width / 2, y0, width, 5, c, Color.TRANSPARENT_BLACK);
|
UIRenderHelper.angledGradient(ms, 90, x0 + width / 2, y0, width, 5, c, Color.TRANSPARENT_BLACK);
|
||||||
UIRenderHelper.angledGradient(guiGraphics, -90, x0 + width / 2, y1, width, 5, c, Color.TRANSPARENT_BLACK);
|
UIRenderHelper.angledGradient(ms, -90, x0 + width / 2, y1, width, 5, c, Color.TRANSPARENT_BLACK);
|
||||||
UIRenderHelper.angledGradient(guiGraphics, 0, x0, y0 + height / 2, height, 5, c, Color.TRANSPARENT_BLACK);
|
UIRenderHelper.angledGradient(ms, 0, x0, y0 + height / 2, height, 5, c, Color.TRANSPARENT_BLACK);
|
||||||
UIRenderHelper.angledGradient(guiGraphics, 180, x1, y0 + height / 2, height, 5, c, Color.TRANSPARENT_BLACK);
|
UIRenderHelper.angledGradient(ms, 180, x1, y0 + height / 2, height, 5, c, Color.TRANSPARENT_BLACK);
|
||||||
|
|
||||||
super.render(guiGraphics, mouseX, mouseY, partialTicks);
|
super.render(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderList(GuiGraphics guiGraphics, int p_239229_, int p_239230_, float p_239231_) {
|
protected void renderList(PoseStack ms, int p_239229_, int p_239230_, float p_239231_) {
|
||||||
Window window = minecraft.getWindow();
|
Window window = minecraft.getWindow();
|
||||||
double d0 = window.getGuiScale();
|
double d0 = window.getGuiScale();
|
||||||
RenderSystem.enableScissor((int) (this.x0 * d0), (int) (window.getHeight() - (this.y1 * d0)), (int) (this.width * d0), (int) (this.height * d0));
|
RenderSystem.enableScissor((int) (this.x0 * d0), (int) (window.getHeight() - (this.y1 * d0)), (int) (this.width * d0), (int) (this.height * d0));
|
||||||
super.renderList(guiGraphics, p_239229_, p_239230_, p_239231_);
|
super.renderList(ms, p_239229_, p_239230_, p_239231_);
|
||||||
RenderSystem.disableScissor();
|
RenderSystem.disableScissor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderWindowForeground(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
public void renderWindowForeground(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
renderListForeground(guiGraphics, mouseX, mouseY, partialTicks);
|
renderListForeground(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void renderListForeground(GuiGraphics guiGraphics, int pMouseX, int pMouseY, float pPartialTick) {
|
protected void renderListForeground(PoseStack ms, int pMouseX, int pMouseY, float pPartialTick) {
|
||||||
int i = this.getRowLeft();
|
int i = this.getRowLeft();
|
||||||
int j = this.getRowWidth();
|
int j = this.getRowWidth();
|
||||||
int k = this.itemHeight - 4;
|
int k = this.itemHeight - 4;
|
||||||
@@ -63,14 +63,14 @@ public class ModifiersScreenList extends ObjectSelectionList<ModifiersScreenList
|
|||||||
int j1 = this.getRowTop(i1);
|
int j1 = this.getRowTop(i1);
|
||||||
int k1 = j1 + itemHeight;
|
int k1 = j1 + itemHeight;
|
||||||
if (k1 >= this.y0 && j1 <= this.y1) {
|
if (k1 >= this.y0 && j1 <= this.y1) {
|
||||||
renderItemForeground(guiGraphics, pMouseX, pMouseY, pPartialTick, i1, i, j1, j, k);
|
renderItemForeground(ms, pMouseX, pMouseY, pPartialTick, i1, i, j1, j, k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void renderItemForeground(GuiGraphics guiGraphics, int pMouseX, int pMouseY, float pPartialTick, int pIndex, int pLeft, int pTop, int pWidth, int pHeight) {
|
protected void renderItemForeground(PoseStack ms, int pMouseX, int pMouseY, float pPartialTick, int pIndex, int pLeft, int pTop, int pWidth, int pHeight) {
|
||||||
Entry e = this.getEntry(pIndex);
|
Entry e = this.getEntry(pIndex);
|
||||||
e.renderForeground(guiGraphics, pIndex, pTop, pLeft, pWidth, pHeight, pMouseX, pMouseY, Objects.equals(this.getHovered(), e), pPartialTick);
|
e.renderForeground(ms, pIndex, pTop, pLeft, pWidth, pHeight, pMouseX, pMouseY, Objects.equals(this.getHovered(), e), pPartialTick);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -146,14 +146,12 @@ public class ModifiersScreenList extends ObjectSelectionList<ModifiersScreenList
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
public void render(PoseStack ms, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||||
|
// UIRenderHelper.streak(ms, 0, x - 10, y + height / 2, height - 6, width, 0xdd_000000);
|
||||||
// UIRenderHelper.streak(guiGraphics, 0, x - 10, y + height / 2, height - 6, width, 0xdd_000000);
|
// UIRenderHelper.streak(ms, 180, x + (int) (width * 1.35f) + 10, y + height / 2, height - 6, width / 8 * 7, 0xdd_000000);
|
||||||
// UIRenderHelper.streak(guiGraphics, 180, x + (int) (width * 1.35f) + 10, y + height / 2, height - 6, width / 8 * 7, 0xdd_000000);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderForeground(GuiGraphics guiGraphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
public void renderForeground(PoseStack ms, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||||
|
|
||||||
for (var listener : listeners) {
|
for (var listener : listeners) {
|
||||||
if (listener instanceof AbstractSimiWidget simiWidget && simiWidget.isHoveredOrFocused()
|
if (listener instanceof AbstractSimiWidget simiWidget && simiWidget.isHoveredOrFocused()
|
||||||
@@ -163,7 +161,7 @@ public class ModifiersScreenList extends ObjectSelectionList<ModifiersScreenList
|
|||||||
continue;
|
continue;
|
||||||
int ttx = simiWidget.lockedTooltipX == -1 ? mouseX : simiWidget.lockedTooltipX + simiWidget.getX();
|
int ttx = simiWidget.lockedTooltipX == -1 ? mouseX : simiWidget.lockedTooltipX + simiWidget.getX();
|
||||||
int tty = simiWidget.lockedTooltipY == -1 ? mouseY : simiWidget.lockedTooltipY + simiWidget.getY();
|
int tty = simiWidget.lockedTooltipY == -1 ? mouseY : simiWidget.lockedTooltipY + simiWidget.getY();
|
||||||
guiGraphics.renderComponentTooltip(getFont(), tooltip, ttx, tty);
|
screen.renderComponentTooltip(ms, tooltip, ttx, tty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
package nl.requios.effortlessbuilding.gui.buildmodifier;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
@@ -141,51 +141,51 @@ public class RadialMirrorEntry extends BaseModifierEntry<RadialMirror> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
public void render(PoseStack ms, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean p_230432_9_, float partialTicks) {
|
||||||
super.render(guiGraphics, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
super.render(ms, index, y, x, width, height, mouseX, mouseY, p_230432_9_, partialTicks);
|
||||||
|
|
||||||
//draw position inputs
|
//draw position inputs
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
ScrollInput input = positionInputs.get(i);
|
ScrollInput input = positionInputs.get(i);
|
||||||
input.setX(left + 49 + 38 * i);
|
input.setX(left + 49 + 38 * i);
|
||||||
input.setY(top + 19);
|
input.setY(top + 19);
|
||||||
input.render(guiGraphics, mouseX, mouseY, partialTicks);
|
input.render(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
//draw player position button
|
//draw player position button
|
||||||
playerPositionButton.setX(left + 163);
|
playerPositionButton.setX(left + 163);
|
||||||
playerPositionButton.setY(top + 19);
|
playerPositionButton.setY(top + 19);
|
||||||
playerPositionButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
playerPositionButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
//draw toggle offset button
|
//draw toggle offset button
|
||||||
toggleOffsetButton.setX(left + 183);
|
toggleOffsetButton.setX(left + 183);
|
||||||
toggleOffsetButton.setY(top + 19);
|
toggleOffsetButton.setY(top + 19);
|
||||||
toggleOffsetButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
toggleOffsetButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
//draw slices input
|
//draw slices input
|
||||||
slicesInput.setX(left + 49);
|
slicesInput.setX(left + 49);
|
||||||
slicesInput.setY(top + 41);
|
slicesInput.setY(top + 41);
|
||||||
slicesInput.render(guiGraphics, mouseX, mouseY, partialTicks);
|
slicesInput.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
//draw alternate button
|
//draw alternate button
|
||||||
alternateButton.setX(left + 78);
|
alternateButton.setX(left + 78);
|
||||||
alternateButton.setY(top + 41);
|
alternateButton.setY(top + 41);
|
||||||
alternateButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
alternateButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
//draw radius input
|
//draw radius input
|
||||||
radiusInput.setX(left + 134);
|
radiusInput.setX(left + 134);
|
||||||
radiusInput.setY(top + 41);
|
radiusInput.setY(top + 41);
|
||||||
radiusInput.render(guiGraphics, mouseX, mouseY, partialTicks);
|
radiusInput.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
//draw show lines button
|
//draw show lines button
|
||||||
showLinesButton.setX(left + 163);
|
showLinesButton.setX(left + 163);
|
||||||
showLinesButton.setY(top + 41);
|
showLinesButton.setY(top + 41);
|
||||||
showLinesButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
showLinesButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
//draw show areas button
|
//draw show areas button
|
||||||
showAreasButton.setX(left + 183);
|
showAreasButton.setX(left + 183);
|
||||||
showAreasButton.setY(top + 41);
|
showAreasButton.setY(top + 41);
|
||||||
showAreasButton.render(guiGraphics, mouseX, mouseY, partialTicks);
|
showAreasButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package nl.requios.effortlessbuilding.gui.elements;
|
package nl.requios.effortlessbuilding.gui.elements;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.components.Button;
|
import net.minecraft.client.gui.components.Button;
|
||||||
import net.minecraft.client.renderer.GameRenderer;
|
import net.minecraft.client.renderer.GameRenderer;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
@@ -29,11 +29,11 @@ public class GuiCheckBoxFixed extends Button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float partial) {
|
public void renderWidget(PoseStack ms, int mouseX, int mouseY, float partial) {
|
||||||
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||||
RenderSystem.setShaderTexture(0, WIDGETS_LOCATION);
|
RenderSystem.setShaderTexture(0, WIDGETS_LOCATION);
|
||||||
//Is deprecated but still works
|
//Is deprecated but still works
|
||||||
ScreenUtils.blitWithBorder(guiGraphics, this.getX(), this.getY(), 0, 46, this.boxWidth, this.height, 200, 20, 2, 3, 2, 2, 0);
|
ScreenUtils.blitWithBorder(ms, this.getX(), this.getY(), 0, 46, this.boxWidth, this.height, 200, 20, 2, 3, 2, 2, 0);
|
||||||
int color = 14737632;
|
int color = 14737632;
|
||||||
|
|
||||||
if (packedFGColor != 0) {
|
if (packedFGColor != 0) {
|
||||||
@@ -45,9 +45,9 @@ public class GuiCheckBoxFixed extends Button {
|
|||||||
Font font = Minecraft.getInstance().font;
|
Font font = Minecraft.getInstance().font;
|
||||||
|
|
||||||
if (this.isChecked)
|
if (this.isChecked)
|
||||||
guiGraphics.drawCenteredString(font, "x", this.getX() + this.boxWidth / 2 + 1, this.getY() + 1, 14737632);
|
drawCenteredString(ms, font, "x", this.getX() + this.boxWidth / 2 + 1, this.getY() + 1, 14737632);
|
||||||
|
|
||||||
guiGraphics.drawString(font, getMessage(), this.getX() + this.boxWidth + 2, this.getY() + 2, color, false);
|
font.draw(ms, getMessage(), this.getX() + this.boxWidth + 2, this.getY() + 2, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package nl.requios.effortlessbuilding.gui.elements;
|
package nl.requios.effortlessbuilding.gui.elements;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.components.Renderable;
|
import net.minecraft.client.gui.components.Renderable;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
@@ -39,7 +39,7 @@ public abstract class GuiCollapsibleScrollEntry implements GuiScrollPane.IScroll
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawTooltip(GuiGraphics guiGraphics, Screen guiScreen, int mouseX, int mouseY) {
|
public void drawTooltip(PoseStack ms, Screen guiScreen, int mouseX, int mouseY) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package nl.requios.effortlessbuilding.gui.elements;
|
package nl.requios.effortlessbuilding.gui.elements;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraft.client.gui.components.Button;
|
import net.minecraft.client.gui.components.Button;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@@ -50,7 +51,9 @@ public class GuiIconButton extends Button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
public void renderWidget(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
|
RenderSystem.setShaderTexture(0, this.resourceLocation);
|
||||||
|
|
||||||
int currentIconX = this.iconX;
|
int currentIconX = this.iconX;
|
||||||
int currentIconY = this.iconY;
|
int currentIconY = this.iconY;
|
||||||
|
|
||||||
@@ -60,14 +63,14 @@ public class GuiIconButton extends Button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Draws a textured rectangle at the current z-value. Used to be drawTexturedModalRect in Gui.
|
//Draws a textured rectangle at the current z-value. Used to be drawTexturedModalRect in Gui.
|
||||||
guiGraphics.blit(resourceLocation, this.getX(), this.getY(), currentIconX, currentIconY, this.iconWidth, this.iconHeight);
|
blit(ms, this.getX(), this.getY(), currentIconX, currentIconY, this.iconWidth, this.iconHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawTooltip(GuiGraphics guiGraphics, Screen screen, int mouseX, int mouseY) {
|
public void drawTooltip(PoseStack ms, Screen screen, int mouseX, int mouseY) {
|
||||||
boolean flag = mouseX >= getX() && mouseX < getX() + width && mouseY >= getY() && mouseY < getY() + height;
|
boolean flag = mouseX >= getX() && mouseX < getX() + width && mouseY >= getY() && mouseY < getY() + height;
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
guiGraphics.renderComponentTooltip(screen.getMinecraft().font, tooltip, mouseX - 10, mouseY + 25);
|
screen.renderComponentTooltip(ms, tooltip, mouseX - 10, mouseY + 25);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package nl.requios.effortlessbuilding.gui.elements;
|
package nl.requios.effortlessbuilding.gui.elements;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.components.Button;
|
import net.minecraft.client.gui.components.Button;
|
||||||
import net.minecraft.client.gui.components.EditBox;
|
import net.minecraft.client.gui.components.EditBox;
|
||||||
import net.minecraft.client.gui.components.Renderable;
|
import net.minecraft.client.gui.components.Renderable;
|
||||||
@@ -95,17 +95,17 @@ public class GuiNumberField {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawNumberField(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
|
public void drawNumberField(PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
textField.setY(y + 1);
|
textField.setY(y + 1);
|
||||||
minusButton.setY(y - 1);
|
minusButton.setY(y - 1);
|
||||||
plusButton.setY(y - 1);
|
plusButton.setY(y - 1);
|
||||||
|
|
||||||
textField.render(graphics, mouseX, mouseY, partialTicks);
|
textField.render(ms, mouseX, mouseY, partialTicks);
|
||||||
minusButton.render(graphics, mouseX, mouseY, partialTicks);
|
minusButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
plusButton.render(graphics, mouseX, mouseY, partialTicks);
|
plusButton.render(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawTooltip(GuiGraphics graphics, Screen screen, int mouseX, int mouseY) {
|
public void drawTooltip(PoseStack ms, Screen screen, int mouseX, int mouseY) {
|
||||||
boolean insideTextField = mouseX >= x + buttonWidth && mouseX < x + width - buttonWidth && mouseY >= y && mouseY < y + height;
|
boolean insideTextField = mouseX >= x + buttonWidth && mouseX < x + width - buttonWidth && mouseY >= y && mouseY < y + height;
|
||||||
boolean insideMinusButton = mouseX >= x && mouseX < x + buttonWidth && mouseY >= y && mouseY < y + height;
|
boolean insideMinusButton = mouseX >= x && mouseX < x + buttonWidth && mouseY >= y && mouseY < y + height;
|
||||||
boolean insidePlusButton = mouseX >= x + width - buttonWidth && mouseX < x + width && mouseY >= y && mouseY < y + height;
|
boolean insidePlusButton = mouseX >= x + width - buttonWidth && mouseX < x + width && mouseY >= y && mouseY < y + height;
|
||||||
@@ -133,7 +133,7 @@ public class GuiNumberField {
|
|||||||
textLines.add(Component.literal("Hold ").append(Component.literal("ctrl ").withStyle(ChatFormatting.DARK_GREEN)).append("for ")
|
textLines.add(Component.literal("Hold ").append(Component.literal("ctrl ").withStyle(ChatFormatting.DARK_GREEN)).append("for ")
|
||||||
.append(Component.literal("5").withStyle(ChatFormatting.RED)));
|
.append(Component.literal("5").withStyle(ChatFormatting.RED)));
|
||||||
}
|
}
|
||||||
graphics.renderComponentTooltip(screen.getMinecraft().font, textLines, mouseX - 10, mouseY + 25);
|
screen.renderComponentTooltip(ms, textLines, mouseX - 10, mouseY + 25);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
|||||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.components.Renderable;
|
import net.minecraft.client.gui.components.Renderable;
|
||||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
@@ -72,7 +71,7 @@ public class GuiScrollPane extends SlotGui {
|
|||||||
|
|
||||||
//Removed background
|
//Removed background
|
||||||
@Override
|
@Override
|
||||||
public void render(GuiGraphics guiGraphics, int mouseXIn, int mouseYIn, float partialTicks) {
|
public void render(PoseStack guiGraphics, int mouseXIn, int mouseYIn, float partialTicks) {
|
||||||
if (this.visible) {
|
if (this.visible) {
|
||||||
this.mouseX = mouseXIn;
|
this.mouseX = mouseXIn;
|
||||||
this.mouseY = mouseYIn;
|
this.mouseY = mouseYIn;
|
||||||
@@ -170,8 +169,8 @@ public class GuiScrollPane extends SlotGui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderItem(GuiGraphics guiGraphics, int slotIndex, int xPos, int yPos, int heightIn, int mouseXIn, int mouseYIn, float partialTicks) {
|
protected void renderItem(PoseStack ms, int slotIndex, int xPos, int yPos, int heightIn, int mouseXIn, int mouseYIn, float partialTicks) {
|
||||||
this.getListEntry(slotIndex).drawEntry(guiGraphics, slotIndex, xPos, yPos, this.getRowWidth(), heightIn, mouseXIn, mouseYIn,
|
this.getListEntry(slotIndex).drawEntry(ms, slotIndex, xPos, yPos, this.getRowWidth(), heightIn, mouseXIn, mouseYIn,
|
||||||
this.getSlotIndexFromScreenCoords(mouseXIn, mouseYIn) == slotIndex, partialTicks);
|
this.getSlotIndexFromScreenCoords(mouseXIn, mouseYIn) == slotIndex, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,7 +323,7 @@ public class GuiScrollPane extends SlotGui {
|
|||||||
|
|
||||||
//Draw in center if it fits
|
//Draw in center if it fits
|
||||||
@Override
|
@Override
|
||||||
protected void renderList(GuiGraphics guiGraphics, int insideLeft, int insideTop, int mouseXIn, int mouseYIn, float partialTicks) {
|
protected void renderList(PoseStack guiGraphics, int insideLeft, int insideTop, int mouseXIn, int mouseYIn, float partialTicks) {
|
||||||
int itemCount = this.getItemCount();
|
int itemCount = this.getItemCount();
|
||||||
Tesselator tessellator = Tesselator.getInstance();
|
Tesselator tessellator = Tesselator.getInstance();
|
||||||
BufferBuilder bufferbuilder = tessellator.getBuilder();
|
BufferBuilder bufferbuilder = tessellator.getBuilder();
|
||||||
@@ -405,7 +404,7 @@ public class GuiScrollPane extends SlotGui {
|
|||||||
entry.updateScreen();
|
entry.updateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawTooltip(GuiGraphics guiGraphics, Screen guiScreen, int mouseX, int mouseY) {
|
public void drawTooltip(PoseStack guiGraphics, Screen guiScreen, int mouseX, int mouseY) {
|
||||||
for (IScrollEntry entry : this.listEntries)
|
for (IScrollEntry entry : this.listEntries)
|
||||||
entry.drawTooltip(guiGraphics, guiScreen, mouseX, mouseY);
|
entry.drawTooltip(guiGraphics, guiScreen, mouseX, mouseY);
|
||||||
}
|
}
|
||||||
@@ -436,7 +435,7 @@ public class GuiScrollPane extends SlotGui {
|
|||||||
|
|
||||||
void updateScreen();
|
void updateScreen();
|
||||||
|
|
||||||
void drawTooltip(GuiGraphics guiGraphics, Screen guiScreen, int mouseX, int mouseY);
|
void drawTooltip(PoseStack guiGraphics, Screen guiScreen, int mouseX, int mouseY);
|
||||||
|
|
||||||
boolean charTyped(char eventChar, int eventKey);
|
boolean charTyped(char eventChar, int eventKey);
|
||||||
|
|
||||||
@@ -446,7 +445,7 @@ public class GuiScrollPane extends SlotGui {
|
|||||||
|
|
||||||
void updatePosition(int slotIndex, int x, int y, float partialTicks);
|
void updatePosition(int slotIndex, int x, int y, float partialTicks);
|
||||||
|
|
||||||
void drawEntry(GuiGraphics guiGraphics, int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partialTicks);
|
void drawEntry(PoseStack guiGraphics, int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float partialTicks);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the mouse is clicked within this entry. Returning true means that something within this entry was
|
* Called when the mouse is clicked within this entry. Returning true means that something within this entry was
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package nl.requios.effortlessbuilding.gui.elements;
|
package nl.requios.effortlessbuilding.gui.elements;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.widget.Label;
|
import nl.requios.effortlessbuilding.create.foundation.gui.widget.Label;
|
||||||
import nl.requios.effortlessbuilding.create.foundation.gui.widget.ScrollInput;
|
import nl.requios.effortlessbuilding.create.foundation.gui.widget.ScrollInput;
|
||||||
@@ -31,12 +31,12 @@ public class LabeledScrollInput extends ScrollInput {
|
|||||||
|
|
||||||
//TODO: Check if this works
|
//TODO: Check if this works
|
||||||
@Override
|
@Override
|
||||||
public void doRender(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
|
public void doRender(@NotNull PoseStack ms, int mouseX, int mouseY, float partialTicks) {
|
||||||
super.doRender(guiGraphics, mouseX, mouseY, partialTicks);
|
super.doRender(ms, mouseX, mouseY, partialTicks);
|
||||||
|
|
||||||
label.setX(getX() + width / 2 - Minecraft.getInstance().font.width(label.text) / 2);
|
label.setX(getX() + width / 2 - Minecraft.getInstance().font.width(label.text) / 2);
|
||||||
label.setY(getY() + height / 2 - Minecraft.getInstance().font.lineHeight / 2);
|
label.setY(getY() + height / 2 - Minecraft.getInstance().font.lineHeight / 2);
|
||||||
label.render(guiGraphics, mouseX, mouseY, partialTicks);
|
label.render(ms, mouseX, mouseY, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ package nl.requios.effortlessbuilding.gui.elements;
|
|||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.mojang.blaze3d.vertex.BufferBuilder;
|
import com.mojang.blaze3d.vertex.BufferBuilder;
|
||||||
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
import com.mojang.blaze3d.vertex.Tesselator;
|
import com.mojang.blaze3d.vertex.Tesselator;
|
||||||
import com.mojang.blaze3d.vertex.VertexFormat;
|
import com.mojang.blaze3d.vertex.VertexFormat;
|
||||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.gui.components.Renderable;
|
import net.minecraft.client.gui.components.Renderable;
|
||||||
import net.minecraft.client.gui.components.events.AbstractContainerEventHandler;
|
import net.minecraft.client.gui.components.events.AbstractContainerEventHandler;
|
||||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||||
@@ -76,7 +76,7 @@ public abstract class SlotGui extends AbstractContainerEventHandler implements R
|
|||||||
protected void updateItemPosition(int p_updateItemPosition_1_, int p_updateItemPosition_2_, int p_updateItemPosition_3_, float p_updateItemPosition_4_) {
|
protected void updateItemPosition(int p_updateItemPosition_1_, int p_updateItemPosition_2_, int p_updateItemPosition_3_, float p_updateItemPosition_4_) {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void renderItem(GuiGraphics guiGraphics, int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, int p_renderItem_5_, int p_renderItem_6_, float p_renderItem_7_);
|
protected abstract void renderItem(PoseStack ms, int p_renderItem_1_, int p_renderItem_2_, int p_renderItem_3_, int p_renderItem_4_, int p_renderItem_5_, int p_renderItem_6_, float p_renderItem_7_);
|
||||||
|
|
||||||
protected void renderHeader(int p_renderHeader_1_, int p_renderHeader_2_, Tesselator p_renderHeader_3_) {
|
protected void renderHeader(int p_renderHeader_1_, int p_renderHeader_2_, Tesselator p_renderHeader_3_) {
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ public abstract class SlotGui extends AbstractContainerEventHandler implements R
|
|||||||
return p_isMouseInList_3_ >= (double) this.y0 && p_isMouseInList_3_ <= (double) this.y1 && p_isMouseInList_1_ >= (double) this.x0 && p_isMouseInList_1_ <= (double) this.x1;
|
return p_isMouseInList_3_ >= (double) this.y0 && p_isMouseInList_3_ <= (double) this.y1 && p_isMouseInList_1_ >= (double) this.x0 && p_isMouseInList_1_ <= (double) this.x1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void render(GuiGraphics guiGraphics, int p_render_1_, int p_render_2_, float p_render_3_);
|
public abstract void render(PoseStack guiGraphics, int p_render_1_, int p_render_2_, float p_render_3_);
|
||||||
|
|
||||||
protected void updateScrollingState(double p_updateScrollingState_1_, double p_updateScrollingState_3_, int p_updateScrollingState_5_) {
|
protected void updateScrollingState(double p_updateScrollingState_1_, double p_updateScrollingState_3_, int p_updateScrollingState_5_) {
|
||||||
this.scrolling = p_updateScrollingState_5_ == 0 && p_updateScrollingState_1_ >= (double) this.getScrollbarPosition() && p_updateScrollingState_1_ < (double) (this.getScrollbarPosition() + 6);
|
this.scrolling = p_updateScrollingState_5_ == 0 && p_updateScrollingState_1_ >= (double) this.getScrollbarPosition() && p_updateScrollingState_1_ < (double) (this.getScrollbarPosition() + 6);
|
||||||
@@ -215,7 +215,7 @@ public abstract class SlotGui extends AbstractContainerEventHandler implements R
|
|||||||
return 220;
|
return 220;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void renderList(GuiGraphics guiGraphics, int p_renderList_1_, int p_renderList_2_, int p_renderList_3_, int p_renderList_4_, float p_renderList_5_) {
|
protected void renderList(PoseStack guiGraphics, int p_renderList_1_, int p_renderList_2_, int p_renderList_3_, int p_renderList_4_, float p_renderList_5_) {
|
||||||
int i = this.getItemCount();
|
int i = this.getItemCount();
|
||||||
Tesselator tessellator = Tesselator.getInstance();
|
Tesselator tessellator = Tesselator.getInstance();
|
||||||
BufferBuilder bufferbuilder = tessellator.getBuilder();
|
BufferBuilder bufferbuilder = tessellator.getBuilder();
|
||||||
|
|||||||
@@ -146,10 +146,10 @@ public class BlockPreviews {
|
|||||||
if (EffortlessBuildingClient.BUILDER_CHAIN.getLookingAtNear() != null) return;
|
if (EffortlessBuildingClient.BUILDER_CHAIN.getLookingAtNear() != null) return;
|
||||||
|
|
||||||
AABB aabb = new AABB(pos);
|
AABB aabb = new AABB(pos);
|
||||||
if (player.level().isLoaded(pos)) {
|
if (player.level.isLoaded(pos)) {
|
||||||
var blockState = player.level().getBlockState(pos);
|
var blockState = player.level.getBlockState(pos);
|
||||||
if (!blockState.isAir()) {
|
if (!blockState.isAir()) {
|
||||||
aabb = blockState.getShape(player.level(), pos).bounds().move(pos);
|
aabb = blockState.getShape(player.level, pos).bounds().move(pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
|
|||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
|
||||||
import net.minecraft.client.renderer.MultiBufferSource;
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
@@ -49,9 +48,9 @@ public class RenderHandler {
|
|||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void onRenderGuiEvent(RenderGuiEvent event) {
|
public static void onRenderGuiEvent(RenderGuiEvent event) {
|
||||||
renderSubText(event.getGuiGraphics());
|
renderSubText(event.getPoseStack());
|
||||||
|
|
||||||
drawStacks(event.getGuiGraphics());
|
drawStacks(event.getPoseStack());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final ChatFormatting highlightColor = ChatFormatting.DARK_AQUA;
|
private static final ChatFormatting highlightColor = ChatFormatting.DARK_AQUA;
|
||||||
@@ -64,7 +63,7 @@ public class RenderHandler {
|
|||||||
normalColor + "Left-click to " + highlightColor + "break, " +
|
normalColor + "Left-click to " + highlightColor + "break, " +
|
||||||
normalColor + "Right-click to " + highlightColor + "cancel");
|
normalColor + "Right-click to " + highlightColor + "cancel");
|
||||||
|
|
||||||
private static void renderSubText(GuiGraphics guiGraphics) {
|
private static void renderSubText(PoseStack ms) {
|
||||||
var state = EffortlessBuildingClient.BUILDER_CHAIN.getBuildingState();
|
var state = EffortlessBuildingClient.BUILDER_CHAIN.getBuildingState();
|
||||||
if (state == BuilderChain.BuildingState.IDLE) return;
|
if (state == BuilderChain.BuildingState.IDLE) return;
|
||||||
|
|
||||||
@@ -74,19 +73,18 @@ public class RenderHandler {
|
|||||||
int screenHeight = Minecraft.getInstance().getWindow().getGuiScaledHeight();
|
int screenHeight = Minecraft.getInstance().getWindow().getGuiScaledHeight();
|
||||||
var font = Minecraft.getInstance().font;
|
var font = Minecraft.getInstance().font;
|
||||||
|
|
||||||
PoseStack ms = guiGraphics.pose();
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
ms.translate(screenWidth / 2.0, screenHeight - 54, 0.0D);
|
ms.translate(screenWidth / 2.0, screenHeight - 54, 0.0D);
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
RenderSystem.defaultBlendFunc();
|
RenderSystem.defaultBlendFunc();
|
||||||
int l = font.width(text);
|
int l = font.width(text);
|
||||||
guiGraphics.drawString(font, text, (int)((float)(-l / 2)), -4, 0xffffffff, true);
|
font.drawShadow(ms, text, (int)((float)(-l / 2)), -4, 0xffffffff);
|
||||||
RenderSystem.disableBlend();
|
RenderSystem.disableBlend();
|
||||||
ms.popPose();
|
ms.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Draw item stacks at cursor, showing what will be used and what is missing
|
//Draw item stacks at cursor, showing what will be used and what is missing
|
||||||
private static void drawStacks(GuiGraphics guiGraphics) {
|
private static void drawStacks(PoseStack ms) {
|
||||||
var state = EffortlessBuildingClient.BUILDER_CHAIN.getBuildingState();
|
var state = EffortlessBuildingClient.BUILDER_CHAIN.getBuildingState();
|
||||||
if (state != BuilderChain.BuildingState.PLACING) return;
|
if (state != BuilderChain.BuildingState.PLACING) return;
|
||||||
|
|
||||||
@@ -109,23 +107,22 @@ public class RenderHandler {
|
|||||||
int missing = EffortlessBuildingClient.ITEM_USAGE_TRACKER.getMissingCount(stack.getKey());
|
int missing = EffortlessBuildingClient.ITEM_USAGE_TRACKER.getMissingCount(stack.getKey());
|
||||||
|
|
||||||
if (total - missing > 0) {
|
if (total - missing > 0) {
|
||||||
drawItemStack(guiGraphics, new ItemStack(stack.getKey(), total - missing), x + i * 20, y, false);
|
drawItemStack(ms, new ItemStack(stack.getKey(), total - missing), x + i * 20, y, false);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (missing > 0) {
|
if (missing > 0) {
|
||||||
drawItemStack(guiGraphics, new ItemStack(stack.getKey(), missing), x + i * 20, y, true);
|
drawItemStack(ms, new ItemStack(stack.getKey(), missing), x + i * 20, y, true);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void drawItemStack(GuiGraphics guiGraphics, ItemStack stack, int x, int y, boolean missing) {
|
private static void drawItemStack(PoseStack ms, ItemStack stack, int x, int y, boolean missing) {
|
||||||
guiGraphics.renderItem(stack, x, y);
|
Minecraft.getInstance().getItemRenderer().renderGuiItem(ms, stack, x, y);
|
||||||
|
|
||||||
//draw count text, red if missing
|
//draw count text, red if missing
|
||||||
//from ItemRenderer#renderGuiItemDecorations
|
//from ItemRenderer#renderGuiItemDecorations
|
||||||
PoseStack ms = guiGraphics.pose();
|
|
||||||
ms.pushPose();
|
ms.pushPose();
|
||||||
Font font = Minecraft.getInstance().font;
|
Font font = Minecraft.getInstance().font;
|
||||||
String text = String.valueOf(stack.getCount());
|
String text = String.valueOf(stack.getCount());
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class BuilderChain {
|
|||||||
player.swing(InteractionHand.MAIN_HAND);
|
player.swing(InteractionHand.MAIN_HAND);
|
||||||
|
|
||||||
blocks.skipFirst = buildMode == BuildModeEnum.DISABLED;
|
blocks.skipFirst = buildMode == BuildModeEnum.DISABLED;
|
||||||
long placeTime = player.level().getGameTime();
|
long placeTime = player.level.getGameTime();
|
||||||
if (blocks.size() > 1) placeTime += ClientConfig.visuals.appearAnimationLength.get();
|
if (blocks.size() > 1) placeTime += ClientConfig.visuals.appearAnimationLength.get();
|
||||||
PacketHandler.INSTANCE.sendToServer(new ServerPlaceBlocksPacket(blocks, placeTime));
|
PacketHandler.INSTANCE.sendToServer(new ServerPlaceBlocksPacket(blocks, placeTime));
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class BuilderChain {
|
|||||||
blocks.setStartPos(new BlockEntry(startPosForBreaking));
|
blocks.setStartPos(new BlockEntry(startPosForBreaking));
|
||||||
EffortlessBuildingClient.BUILD_MODIFIERS.findCoordinates(blocks, player);
|
EffortlessBuildingClient.BUILD_MODIFIERS.findCoordinates(blocks, player);
|
||||||
EffortlessBuildingClient.BUILDER_FILTER.filterOnCoordinates(blocks, player);
|
EffortlessBuildingClient.BUILDER_FILTER.filterOnCoordinates(blocks, player);
|
||||||
findExistingBlockStates(player.level());
|
findExistingBlockStates(player.level);
|
||||||
EffortlessBuildingClient.BUILDER_FILTER.filterOnExistingBlockStates(blocks, player);
|
EffortlessBuildingClient.BUILDER_FILTER.filterOnExistingBlockStates(blocks, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ public class BuilderChain {
|
|||||||
|
|
||||||
//Offset in direction of sidehit if not quickreplace and not replaceable
|
//Offset in direction of sidehit if not quickreplace and not replaceable
|
||||||
boolean shouldOffsetStartPosition = EffortlessBuildingClient.BUILD_SETTINGS.shouldOffsetStartPosition();
|
boolean shouldOffsetStartPosition = EffortlessBuildingClient.BUILD_SETTINGS.shouldOffsetStartPosition();
|
||||||
boolean replaceable = player.level().getBlockState(startPos).canBeReplaced();
|
boolean replaceable = player.level.getBlockState(startPos).canBeReplaced();
|
||||||
boolean becomesDoubleSlab = SurvivalHelper.doesBecomeDoubleSlab(player, startPos);
|
boolean becomesDoubleSlab = SurvivalHelper.doesBecomeDoubleSlab(player, startPos);
|
||||||
if (!shouldOffsetStartPosition && !replaceable && !becomesDoubleSlab) {
|
if (!shouldOffsetStartPosition && !replaceable && !becomesDoubleSlab) {
|
||||||
startPos = startPos.relative(lookingAt.getDirection());
|
startPos = startPos.relative(lookingAt.getDirection());
|
||||||
@@ -281,7 +281,7 @@ public class BuilderChain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Find new blockstate
|
//Find new blockstate
|
||||||
blockEntry.setItemAndFindNewBlockState(itemStack, player.level(), originalDirection, clickedFace, relativeHitVec);
|
blockEntry.setItemAndFindNewBlockState(itemStack, player.level, originalDirection, clickedFace, relativeHitVec);
|
||||||
|
|
||||||
//Filter on new blockstate
|
//Filter on new blockstate
|
||||||
if (EffortlessBuildingClient.BUILDER_FILTER.filterOnNewBlockState(blockEntry, player)) {
|
if (EffortlessBuildingClient.BUILDER_FILTER.filterOnNewBlockState(blockEntry, player)) {
|
||||||
@@ -320,9 +320,9 @@ public class BuilderChain {
|
|||||||
|
|
||||||
if (blocks.getLastBlockEntry() != null && blocks.getLastBlockEntry().newBlockState != null) {
|
if (blocks.getLastBlockEntry() != null && blocks.getLastBlockEntry().newBlockState != null) {
|
||||||
var lastBlockState = blocks.getLastBlockEntry().newBlockState;
|
var lastBlockState = blocks.getLastBlockEntry().newBlockState;
|
||||||
SoundType soundType = lastBlockState.getBlock().getSoundType(lastBlockState, player.level(), blocks.lastPos, player);
|
SoundType soundType = lastBlockState.getBlock().getSoundType(lastBlockState, player.level, blocks.lastPos, player);
|
||||||
SoundEvent soundEvent = buildingState == BuildingState.BREAKING ? soundType.getBreakSound() : soundType.getPlaceSound();
|
SoundEvent soundEvent = buildingState == BuildingState.BREAKING ? soundType.getBreakSound() : soundType.getPlaceSound();
|
||||||
player.level().playSound(player, player.blockPosition(), soundEvent, SoundSource.BLOCKS, 0.3f, 0.8f);
|
player.level.playSound(player, player.blockPosition(), soundEvent, SoundSource.BLOCKS, 0.3f, 0.8f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import nl.requios.effortlessbuilding.utilities.PlaceChecker;
|
|||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public class BuilderFilter {
|
public class BuilderFilter {
|
||||||
public void filterOnCoordinates(BlockSet blocks, Player player) {
|
public void filterOnCoordinates(BlockSet blocks, Player player) {
|
||||||
var world = player.level();
|
var world = player.level;
|
||||||
var iter = blocks.entrySet().iterator();
|
var iter = blocks.entrySet().iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
var pos = iter.next().getValue().blockPos;
|
var pos = iter.next().getValue().blockPos;
|
||||||
@@ -76,7 +76,7 @@ public class BuilderFilter {
|
|||||||
|
|
||||||
boolean remove = false;
|
boolean remove = false;
|
||||||
|
|
||||||
if (placing && !PlaceChecker.shouldPlaceBlock(player.level(), blockEntry)) remove = true;
|
if (placing && !PlaceChecker.shouldPlaceBlock(player.level, blockEntry)) remove = true;
|
||||||
|
|
||||||
return remove;
|
return remove;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class ServerBlockPlacer {
|
|||||||
//Iterator to prevent concurrent modification exception
|
//Iterator to prevent concurrent modification exception
|
||||||
for (var iterator = delayedEntries.iterator(); iterator.hasNext(); ) {
|
for (var iterator = delayedEntries.iterator(); iterator.hasNext(); ) {
|
||||||
DelayedEntry entry = iterator.next();
|
DelayedEntry entry = iterator.next();
|
||||||
long gameTime = entry.player.level().getGameTime();
|
long gameTime = entry.player.level.getGameTime();
|
||||||
if (gameTime >= entry.placeTime) {
|
if (gameTime >= entry.placeTime) {
|
||||||
applyBlockSet(entry.player, entry.blocks);
|
applyBlockSet(entry.player, entry.blocks);
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
@@ -99,7 +99,7 @@ public class ServerBlockPlacer {
|
|||||||
|
|
||||||
private boolean applyBlockEntry(Player player, BlockEntry block) {
|
private boolean applyBlockEntry(Player player, BlockEntry block) {
|
||||||
|
|
||||||
block.existingBlockState = player.level().getBlockState(block.blockPos);
|
block.existingBlockState = player.level.getBlockState(block.blockPos);
|
||||||
boolean breaking = BlockUtilities.isNullOrAir(block.newBlockState);
|
boolean breaking = BlockUtilities.isNullOrAir(block.newBlockState);
|
||||||
if (!validateBlockEntry(player, block, breaking)) return false;
|
if (!validateBlockEntry(player, block, breaking)) return false;
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ public class ServerBlockPlacer {
|
|||||||
if (!validateBlockEntry(player, tempBlockEntry, breaking)) return false;
|
if (!validateBlockEntry(player, tempBlockEntry, breaking)) return false;
|
||||||
|
|
||||||
//Update newBlockState for future redo's
|
//Update newBlockState for future redo's
|
||||||
block.newBlockState = player.level().getBlockState(block.blockPos);
|
block.newBlockState = player.level.getBlockState(block.blockPos);
|
||||||
|
|
||||||
boolean success;
|
boolean success;
|
||||||
isPlacingOrBreakingBlocks = true;
|
isPlacingOrBreakingBlocks = true;
|
||||||
@@ -231,7 +231,7 @@ public class ServerBlockPlacer {
|
|||||||
|
|
||||||
private boolean validateBlockEntry(Player player, BlockEntry block, boolean breaking) {
|
private boolean validateBlockEntry(Player player, BlockEntry block, boolean breaking) {
|
||||||
|
|
||||||
if (!player.level().isLoaded(block.blockPos)) return false;
|
if (!player.level.isLoaded(block.blockPos)) return false;
|
||||||
|
|
||||||
if (breaking && BlockUtilities.isNullOrAir(block.existingBlockState)) return false;
|
if (breaking && BlockUtilities.isNullOrAir(block.existingBlockState)) return false;
|
||||||
|
|
||||||
|
|||||||
@@ -285,8 +285,8 @@ public class UndoRedo {
|
|||||||
//then anything it drops
|
//then anything it drops
|
||||||
if (itemStack.isEmpty()) {
|
if (itemStack.isEmpty()) {
|
||||||
//Cannot check drops on clientside because loot tables are server only
|
//Cannot check drops on clientside because loot tables are server only
|
||||||
if (!player.level().isClientSide) {
|
if (!player.level.isClientSide) {
|
||||||
List<ItemStack> itemsDropped = Block.getDrops(blockState, (ServerLevel) player.level(), BlockPos.ZERO, null);
|
List<ItemStack> itemsDropped = Block.getDrops(blockState, (ServerLevel) player.level, BlockPos.ZERO, null);
|
||||||
for (ItemStack itemStackDropped : itemsDropped) {
|
for (ItemStack itemStackDropped : itemsDropped) {
|
||||||
if (itemStackDropped.getItem() instanceof BlockItem) {
|
if (itemStackDropped.getItem() instanceof BlockItem) {
|
||||||
Block block = ((BlockItem) itemStackDropped.getItem()).getBlock();
|
Block block = ((BlockItem) itemStackDropped.getItem()).getBlock();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class BlockPlacerHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean brokeBlock = BlockHelper.destroyBlockAs(player.level(), blockEntry.blockPos, player, usedTool, 0f, stack -> {
|
boolean brokeBlock = BlockHelper.destroyBlockAs(player.level, blockEntry.blockPos, player, usedTool, 0f, stack -> {
|
||||||
if (!player.isCreative()) {
|
if (!player.isCreative()) {
|
||||||
ItemHandlerHelper.giveItemToPlayer(player, stack);
|
ItemHandlerHelper.giveItemToPlayer(player, stack);
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,7 @@ public class BlockPlacerHelper {
|
|||||||
//ForgeHooks::onPlaceItemIntoWorld, removed itemstack usage
|
//ForgeHooks::onPlaceItemIntoWorld, removed itemstack usage
|
||||||
public static boolean placeBlock(Player player, BlockEntry blockEntry) {
|
public static boolean placeBlock(Player player, BlockEntry blockEntry) {
|
||||||
|
|
||||||
Level level = player.level();
|
Level level = player.level;
|
||||||
var itemStack = new ItemStack(blockEntry.item);
|
var itemStack = new ItemStack(blockEntry.item);
|
||||||
|
|
||||||
level.captureBlockSnapshots = true;
|
level.captureBlockSnapshots = true;
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ public class ClientBlockUtilities {
|
|||||||
if (blockEntry == null || blockEntry.newBlockState == null)
|
if (blockEntry == null || blockEntry.newBlockState == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SoundType soundType = blockEntry.newBlockState.getBlock().getSoundType(blockEntry.newBlockState, player.level(), blockEntry.blockPos, player);
|
SoundType soundType = blockEntry.newBlockState.getBlock().getSoundType(blockEntry.newBlockState, player.level, blockEntry.blockPos, player);
|
||||||
SoundEvent soundEvent = breaking ? soundType.getBreakSound() : soundType.getPlaceSound();
|
SoundEvent soundEvent = breaking ? soundType.getBreakSound() : soundType.getPlaceSound();
|
||||||
player.level().playSound(player, player.blockPosition(), soundEvent, SoundSource.BLOCKS, 0.6f, soundType.getPitch());
|
player.level.playSound(player, player.blockPosition(), soundEvent, SoundSource.BLOCKS, 0.6f, soundType.getPitch());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BlockHitResult getLookingAtFar(Player player) {
|
public static BlockHitResult getLookingAtFar(Player player) {
|
||||||
Level world = player.level();
|
Level world = player.level;
|
||||||
|
|
||||||
//base distance off of player ability (config)
|
//base distance off of player ability (config)
|
||||||
float raytraceRange = EffortlessBuildingClient.POWER_LEVEL.getPlacementReach(player);
|
float raytraceRange = EffortlessBuildingClient.POWER_LEVEL.getPlacementReach(player);
|
||||||
|
|||||||
@@ -43,12 +43,12 @@ public class PowerLevelCommand {
|
|||||||
|
|
||||||
private static void logPowerLevel(CommandSourceStack source, Player player) {
|
private static void logPowerLevel(CommandSourceStack source, Player player) {
|
||||||
int powerLevel = EffortlessBuilding.SERVER_POWER_LEVEL.getPowerLevel(player);
|
int powerLevel = EffortlessBuilding.SERVER_POWER_LEVEL.getPowerLevel(player);
|
||||||
source.sendSuccess(() -> Component.translatable("effortlessbuilding.commands.powerlevel", player.getDisplayName(), powerLevel), false);
|
source.sendSuccess(Component.translatable("effortlessbuilding.commands.powerlevel", player.getDisplayName(), powerLevel), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setPowerLevel(CommandSourceStack source, Player player, int powerLevel) throws CommandSyntaxException {
|
private static void setPowerLevel(CommandSourceStack source, Player player, int powerLevel) throws CommandSyntaxException {
|
||||||
EffortlessBuilding.SERVER_POWER_LEVEL.setPowerLevel(player, powerLevel);
|
EffortlessBuilding.SERVER_POWER_LEVEL.setPowerLevel(player, powerLevel);
|
||||||
EffortlessBuilding.SERVER_POWER_LEVEL.sendToClient(player);
|
EffortlessBuilding.SERVER_POWER_LEVEL.sendToClient(player);
|
||||||
source.sendSuccess(() -> Component.translatable("effortlessbuilding.commands.powerlevel.success", player.getDisplayName(), powerLevel), true);
|
source.sendSuccess(Component.translatable("effortlessbuilding.commands.powerlevel.success", player.getDisplayName(), powerLevel), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class SurvivalHelper {
|
|||||||
|
|
||||||
public static boolean doesBecomeDoubleSlab(Player player, BlockPos pos) {
|
public static boolean doesBecomeDoubleSlab(Player player, BlockPos pos) {
|
||||||
|
|
||||||
BlockState placedBlockState = player.level().getBlockState(pos);
|
BlockState placedBlockState = player.level.getBlockState(pos);
|
||||||
|
|
||||||
ItemStack itemstack = player.getItemInHand(InteractionHand.MAIN_HAND);
|
ItemStack itemstack = player.getItemInHand(InteractionHand.MAIN_HAND);
|
||||||
if (CompatHelper.isItemBlockProxy(itemstack))
|
if (CompatHelper.isItemBlockProxy(itemstack))
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
modLoader="javafml"
|
modLoader="javafml"
|
||||||
loaderVersion="[47,)"
|
loaderVersion="[45,)"
|
||||||
license="GNU LESSER GENERAL PUBLIC LICENSE"
|
license="GNU LESSER GENERAL PUBLIC LICENSE"
|
||||||
issueTrackerURL="https://bitbucket.org/Requios/effortless-building/issues?status=new&status=open&status=submitted&is_spam=%21spam"
|
issueTrackerURL="https://bitbucket.org/Requios/effortless-building/issues?status=new&status=open&status=submitted&is_spam=%21spam"
|
||||||
showAsResourcePack=false
|
showAsResourcePack=false
|
||||||
@@ -19,20 +19,20 @@ Makes building easier by providing tools like mirrors, arrays, build modes and a
|
|||||||
[[dependencies.effortlessbuilding]]
|
[[dependencies.effortlessbuilding]]
|
||||||
modId="forge"
|
modId="forge"
|
||||||
mandatory=true
|
mandatory=true
|
||||||
versionRange="[47.1.3,)"
|
versionRange="[45.2.0,)"
|
||||||
ordering="NONE"
|
ordering="NONE"
|
||||||
side="BOTH"
|
side="BOTH"
|
||||||
|
|
||||||
[[dependencies.effortlessbuilding]]
|
[[dependencies.effortlessbuilding]]
|
||||||
modId="minecraft"
|
modId="minecraft"
|
||||||
mandatory=true
|
mandatory=true
|
||||||
versionRange="[1.20,1.21)"
|
versionRange="[1.19.4,1.20)"
|
||||||
ordering="NONE"
|
ordering="NONE"
|
||||||
side="BOTH"
|
side="BOTH"
|
||||||
|
|
||||||
[[dependencies.effortlessbuilding]]
|
#[[dependencies.effortlessbuilding]]
|
||||||
modId="flywheel"
|
# modId="flywheel"
|
||||||
mandatory=true
|
# mandatory=true
|
||||||
versionRange="[0.6.10,0.7)"
|
# versionRange="[0.6.10,0.7)"
|
||||||
ordering="AFTER"
|
# ordering="AFTER"
|
||||||
side="CLIENT"
|
# side="CLIENT"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"parent": "item/generated",
|
"parent": "item/generated",
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "effortlessbuilding:items/buildingtechniquesbook"
|
"layer0": "effortlessbuilding:item/buildingtechniquesbook"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"parent": "item/generated",
|
"parent": "item/generated",
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "effortlessbuilding:items/diamondrandomizerbag"
|
"layer0": "effortlessbuilding:item/diamondrandomizerbag"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"parent": "item/generated",
|
"parent": "item/generated",
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "effortlessbuilding:items/elastichand"
|
"layer0": "effortlessbuilding:item/elastichand"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"parent": "item/generated",
|
"parent": "item/generated",
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "effortlessbuilding:items/goldenrandomizerbag"
|
"layer0": "effortlessbuilding:item/goldenrandomizerbag"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"parent": "item/generated",
|
"parent": "item/generated",
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "effortlessbuilding:items/muscles"
|
"layer0": "effortlessbuilding:item/muscles"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"parent": "item/generated",
|
"parent": "item/generated",
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "effortlessbuilding:items/randomizerbag"
|
"layer0": "effortlessbuilding:item/randomizerbag"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"parent": "item/generated",
|
"parent": "item/generated",
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "effortlessbuilding:items/reachupgrade1"
|
"layer0": "effortlessbuilding:item/reachupgrade1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"parent": "item/generated",
|
"parent": "item/generated",
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "effortlessbuilding:items/reachupgrade2"
|
"layer0": "effortlessbuilding:item/reachupgrade2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"parent": "item/generated",
|
"parent": "item/generated",
|
||||||
"textures": {
|
"textures": {
|
||||||
"layer0": "effortlessbuilding:items/reachupgrade3"
|
"layer0": "effortlessbuilding:item/reachupgrade3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 432 B After Width: | Height: | Size: 432 B |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 400 B After Width: | Height: | Size: 400 B |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 395 B After Width: | Height: | Size: 395 B |
|
Before Width: | Height: | Size: 394 B After Width: | Height: | Size: 394 B |
|
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 625 B |
|
Before Width: | Height: | Size: 603 B After Width: | Height: | Size: 603 B |
|
Before Width: | Height: | Size: 618 B After Width: | Height: | Size: 618 B |
@@ -2,7 +2,7 @@
|
|||||||
"type": "effortlessbuilding:single_item_loot_modifier",
|
"type": "effortlessbuilding:single_item_loot_modifier",
|
||||||
"conditions": [
|
"conditions": [
|
||||||
{
|
{
|
||||||
"condition": "minecraft:alternative",
|
"condition": "minecraft:any_of",
|
||||||
"terms": [
|
"terms": [
|
||||||
{
|
{
|
||||||
"condition": "forge:loot_table_id",
|
"condition": "forge:loot_table_id",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"type": "effortlessbuilding:single_item_loot_modifier",
|
"type": "effortlessbuilding:single_item_loot_modifier",
|
||||||
"conditions": [
|
"conditions": [
|
||||||
{
|
{
|
||||||
"condition": "minecraft:alternative",
|
"condition": "minecraft:any_of",
|
||||||
"terms": [
|
"terms": [
|
||||||
{
|
{
|
||||||
"condition": "forge:loot_table_id",
|
"condition": "forge:loot_table_id",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"type": "effortlessbuilding:single_item_loot_modifier",
|
"type": "effortlessbuilding:single_item_loot_modifier",
|
||||||
"conditions": [
|
"conditions": [
|
||||||
{
|
{
|
||||||
"condition": "minecraft:alternative",
|
"condition": "minecraft:any_of",
|
||||||
"terms": [
|
"terms": [
|
||||||
{
|
{
|
||||||
"condition": "forge:loot_table_id",
|
"condition": "forge:loot_table_id",
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"pack": {
|
"pack": {
|
||||||
"description": "Effortless Building resources",
|
"description": "Effortless Building resources",
|
||||||
"pack_format": 15
|
"pack_format": 13,
|
||||||
|
"forge:client_resources_pack_format": 13,
|
||||||
|
"forge:server_data_pack_format": 12
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||