Skip to content

Commit

Permalink
Merge remote-tracking branch 'Lisixo/1.20' into 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
aellul27 committed Jun 14, 2023
2 parents a513502 + 7a82736 commit 9d16091
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 49 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@
- Updated [SpruceUI].
- Updated [pridelib].

## 2.3.1
- Updated to Minecraft 1.20 ([#156](https://github.com/LambdAurora/LambDynamicLights/pull/156))
- Updated [SpruceUI].

[SpruceUI]: https://github.com/LambdAurora/SpruceUI "SpruceUI page"
[pridelib]: https://github.com/Queerbric/pridelib "Pridelib page"
[Sodium]: https://modrinth.com/mod/sodium "Sodium Modrinth page"
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ org.gradle.jvmargs=-Xmx2G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.19.4
quilt_mappings=5
loader_version=0.14.18
minecraft_version=1.20
quilt_mappings=4
loader_version=0.14.21
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_api_version=0.76.0+1.19.4
fabric_api_version=0.83.0+1.20

# Mod Properties
mod_version = 2.3.0
mod_version = 2.3.1
maven_group = dev.lambdaurora
archives_base_name = lambdynamiclights
modrinth_id=yBW8D80W
curseforge_id=393442

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
spruceui_version=4.2.0+1.19.4
spruceui_version=5.0.0+1.20
pridelib_version=1.2.0+1.19.4
modmenu_version=6.1.0-rc.4
modmenu_version=7.0.1
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
11 changes: 6 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -144,15 +141,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
import dev.lambdaurora.spruceui.background.DirtTexturedBackground;
import dev.lambdaurora.spruceui.widget.SpruceWidget;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawableHelper;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.GuiGraphics;

public class InnerBackground implements Background {

public class InnerBackground extends DrawableHelper implements Background {
@Override
public void render(MatrixStack matrices, SpruceWidget widget, int vOffset, int mouseX, int mouseY, float delta) {
public void render(GuiGraphics graphics, SpruceWidget widget, int vOffset, int mouseX, int mouseY, float delta) {
if (MinecraftClient.getInstance().world != null) {
this.fillGradient(matrices, widget.getX(), widget.getY(),
graphics.fillGradient(widget.getX(), widget.getY(),
widget.getX() + widget.getWidth(), widget.getY() + widget.getHeight(),
0xc0060606, 0xd0060606);
} else {
DirtTexturedBackground.DARKENED.render(matrices, widget, vOffset, mouseX, mouseY, delta);
DirtTexturedBackground.DARKENED.render(graphics, widget, vOffset, mouseX, mouseY, delta);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import dev.lambdaurora.spruceui.widget.WithBackground;
import dev.lambdaurora.spruceui.widget.container.SpruceEntryListWidget;
import dev.lambdaurora.spruceui.widget.container.SpruceParentWidget;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
import net.minecraft.client.gui.screen.narration.NarrationPart;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.GLFW;
Expand Down Expand Up @@ -203,14 +203,12 @@ protected boolean onCharTyped(char chr, int keyCode) {

/* Rendering */

@Override
protected void renderWidget(MatrixStack matrices, int mouseX, int mouseY, float delta) {
this.forEach(widget -> widget.render(matrices, mouseX, mouseY, delta));
protected void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
this.forEach(widget -> widget.render(graphics, mouseX, mouseY, delta));
}

@Override
protected void renderBackground(MatrixStack matrices, int mouseX, int mouseY, float delta) {
this.background.render(matrices, this, 0, mouseX, mouseY, delta);
protected void renderBackground(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
this.background.render(graphics, this, 0, mouseX, mouseY, delta);
}

/* Narration */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import io.github.queerbric.pride.PrideFlag;
import io.github.queerbric.pride.PrideFlagShapes;
import io.github.queerbric.pride.PrideFlags;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import org.joml.Matrix4f;
import org.joml.Vector4f;
Expand All @@ -46,13 +46,13 @@ public RandomPrideFlagBackground(PrideFlag flag) {
}

@Override
public void render(MatrixStack matrices, SpruceWidget widget, int vOffset, int mouseX, int mouseY, float delta) {
public void render(GuiGraphics graphics, SpruceWidget widget, int vOffset, int mouseX, int mouseY, float delta) {
int x = widget.getX();
int y = widget.getY();

RenderSystem.setShader(GameRenderer::getPositionColorShader);
if (this.flag.getShape() == PrideFlagShapes.get(new Identifier("pride", "horizontal_stripes"))) {
var model = matrices.peek().getModel();
var model = graphics.getMatrices().peek().getModel();
var tessellator = Tessellator.getInstance();
var vertices = tessellator.getBufferBuilder();
vertices.begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION_COLOR);
Expand Down Expand Up @@ -96,10 +96,10 @@ public void render(MatrixStack matrices, SpruceWidget widget, int vOffset, int m

tessellator.draw();
} else {
this.flag.render(matrices, x, y, widget.getWidth(), widget.getHeight());
this.flag.render(graphics.getMatrices(), x, y, widget.getWidth(), widget.getHeight());
}

SECOND_LAYER.render(matrices, widget, vOffset, mouseX, mouseY, delta);
SECOND_LAYER.render(graphics, widget, vOffset, mouseX, mouseY, delta);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import dev.lambdaurora.spruceui.widget.container.tabbed.SpruceTabbedWidget;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.registry.Registries;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
Expand Down Expand Up @@ -134,12 +133,12 @@ private SpruceContainerWidget buildTabContainer(int width, int height, SpruceTab
innerWidget.getPosition().setRelativeY(43);
container.addChild(innerWidget);

container.setBackground((matrices, widget, vOffset, mouseX, mouseY, delta) -> {
container.setBackground((graphics, widget, vOffset, mouseX, mouseY, delta) -> {
if (this.client.world != null) {
this.fillGradient(matrices, widget.getX(), widget.getY(),
graphics.fillGradient(widget.getX(), widget.getY(),
widget.getX() + widget.getWidth(), innerWidget.getY(),
0xc0101010, 0xd0101010);
this.fillGradient(matrices, widget.getX(), innerWidget.getY() + innerWidget.getHeight(),
graphics.fillGradient(widget.getX(), innerWidget.getY() + innerWidget.getHeight(),
widget.getX() + widget.getWidth(), widget.getY() + widget.getHeight(),
0xc0101010, 0xd0101010);
} else {
Expand Down Expand Up @@ -197,8 +196,4 @@ private LightSourceListWidget buildLightSourcesTab(int width, int height, List<D
list.addAll(entries);
return list;
}

@Override
public void renderBackground(MatrixStack matrices) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

import dev.lambdaurora.lambdynlights.gui.DynamicLightsOptionsOption;
import dev.lambdaurora.spruceui.Tooltip;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.option.GameOptionsScreen;
import net.minecraft.client.gui.screen.option.VideoOptionsScreen;
import net.minecraft.client.option.GameOptions;
import net.minecraft.client.option.Option;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
Expand Down Expand Up @@ -55,7 +55,7 @@ private Option<?>[] addOptionButton(Option<?>[] old) {
}

@Inject(method = "render", at = @At("TAIL"))
private void onRender(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
Tooltip.renderAll(this, matrices);
private void onRender(GuiGraphics graphics, int mouseX, int mouseY, float delta, CallbackInfo ci) {
Tooltip.renderAll(graphics);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public AbstractMinecartEntityMixin(EntityType<?> type, World world) {
@Inject(method = "tick", at = @At("HEAD"))
private void onTick(CallbackInfo ci) {
// We do not want to update the entity on the server.
if (this.world.isClient()) {
if (this.getWorld().isClient()) {
if (this.isRemoved()) {
this.setDynamicLightEnabled(false);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void dynamicLightTick() {
} else {
int luminance = 0;
var eyePos = BlockPos.create(this.getX(), this.getEyeY(), this.getZ());
boolean submergedInFluid = !this.world.getFluidState(eyePos).isEmpty();
boolean submergedInFluid = !this.getWorld().getFluidState(eyePos).isEmpty();
for (var equipped : this.getItemsEquipped()) {
if (!equipped.isEmpty())
luminance = Math.max(luminance, LambDynLights.getLuminanceFromItemStack(equipped, submergedInFluid));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void dynamicLightTick() {
int luminance = DynamicLightHandlers.getLuminanceFrom((Entity) this);

var eyePos = BlockPos.create(this.getX(), this.getEyeY(), this.getZ());
boolean submergedInFluid = !this.world.getFluidState(eyePos).isEmpty();
boolean submergedInFluid = !this.getWorld().getFluidState(eyePos).isEmpty();
for (var equipped : this.getItemsEquipped()) {
if (!equipped.isEmpty())
luminance = Math.max(luminance, LambDynLights.getLuminanceFromItemStack(equipped, submergedInFluid));
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
"lambdynlights.lightsource.mixins.json"
],
"depends": {
"fabricloader": ">=0.14.11",
"fabric": ">=0.76.0+1.19.4",
"minecraft": "1.19.4",
"spruceui": ">=4.2.0",
"fabricloader": ">=0.14.21",
"fabric": ">=0.83.0+1.20",
"minecraft": "1.20",
"spruceui": ">=5.0.0",
"java": ">=17"
},
"recommends": {
"modmenu": ">=5.0.2"
"modmenu": ">=7.0.1"
},
"suggests": {
"ears": "*",
Expand Down

0 comments on commit 9d16091

Please sign in to comment.