Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.21.1 #122

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@ format = { version = "1.1" }

[versions]
indra = "3.1.3"
minecraft = "1.20.6"
fabricLoader = "0.15.11"
fabricApi = "0.98.0+1.20.6"
modmenu = "10.0.0-beta.1"
minecraft = "1.21.1"
fabricLoader = "0.16.7"
fabricApi = "0.106.0+1.21.1"
modmenu = "11.0.1"
viafabricplus = "3.3.0"
vineflower = "1.10.1"

[libraries]
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
parchment = { module = "org.parchmentmc.data:parchment-1.20.6", version = "2024.05.01" }
parchment = { module = "org.parchmentmc.data:parchment-1.21", version = "2024.07.28" }
fabric-loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabricLoader" }
fabric-api = { module = "net.fabricmc.fabric-api:fabric-api", version.ref = "fabricApi" }
fabric-api-bom = { module = "net.fabricmc.fabric-api:fabric-api-bom", version.ref = "fabricApi" }
fabric-api-networking = { module = "net.fabricmc.fabric-api:fabric-networking-api-v1" }
modmenu = { module = "com.terraformersmc:modmenu", version.ref = "modmenu" }
neoforge = { module = "net.neoforged:neoforge", version = "20.6.119"}
neoforge = { module = "net.neoforged:neoforge", version = "21.1.72"}
viafabricplus-api = { module = "de.florianmichael:ViaFabricPlus", version.ref = "viafabricplus" }
viaversion = { module = "com.viaversion:viaversion-common", version = "5.0.0-SNAPSHOT" }
viaversion = { module = "com.viaversion:viaversion-common", version = "5.0.5" }
vineflower = { module = "org.vineflower:vineflower", version.ref = "vineflower" }
worldedit = { module = "com.sk89q.worldedit:worldedit-fabric-mc1.20.6", version = "7.3.1" }
worldedit = { module = "com.sk89q.worldedit:worldedit-fabric-mc1.21", version = "7.3.7" }

[plugins]
architecturyPlugin = { id = "architectury-plugin", version = "3.4.155" }
curseForgeGradle = { id = "net.darkhax.curseforgegradle", version = "1.1.18" }
architecturyPlugin = { id = "architectury-plugin", version = "3.4.159" }
curseForgeGradle = { id = "net.darkhax.curseforgegradle", version = "1.1.25" }
indra-git = { id = "net.kyori.indra.git", version.ref = "indra" }
indra-spotlessLicenser = { id = "net.kyori.indra.licenser.spotless", version.ref = "indra" }
javaEcosystemCapabilities = { id = "org.gradlex.java-ecosystem-capabilities", version = "1.5.2" }
loom = { id = "dev.architectury.loom", version = "1.6.397" }
jvmConflictResolution = { id = "org.gradlex.jvm-dependency-conflict-resolution", version = "2.1.2" }
loom = { id = "dev.architectury.loom", version = "1.7.413" }
minotaur = { id = "com.modrinth.minotaur", version = "2.8.7" }
publishGithubRelease = { id = "ca.stellardrift.publish-github-release", version = "0.1.0" }
shadow = { id = "io.github.goooler.shadow", version = "8.1.7" }
shadow = { id = "com.gradleup.shadow", version = "8.3.3" }
spotless = { id = "com.diffplug.spotless", version = "6.25.0" }
versions = { id = "com.github.ben-manes.versions", version = "0.51.0" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.enginehub.worldeditcui.config.CUIConfiguration;
import org.enginehub.worldeditcui.event.listeners.CUIListenerChannel;
import org.enginehub.worldeditcui.event.listeners.CUIListenerWorldRender;
import org.enginehub.worldeditcui.fabric.mixins.MinecraftAccess;
import org.enginehub.worldeditcui.protocol.CUIPacket;
import org.enginehub.worldeditcui.protocol.CUIPacketHandler;
import org.enginehub.worldeditcui.render.OptifinePipelineProvider;
Expand Down Expand Up @@ -127,7 +126,7 @@ public void onInitialize() {
private void onTick(final Minecraft mc) {
final CUIConfiguration config = this.controller.getConfiguration();
final boolean inGame = mc.player != null;
final boolean clock = ((MinecraftAccess) mc).getTimer().partialTick > 0;
final boolean clock = mc.getTimer().getGameTimeDeltaPartialTick(false) > 0;

if (inGame && mc.screen == null) {
while (this.keyBindToggleUI.consumeClick()) {
Expand Down Expand Up @@ -195,7 +194,7 @@ public void onJoinGame(final ClientPacketListener handler, final PacketSender se

public void onPostRenderEntities(final WorldRenderContext ctx) {
if (this.visible) {
this.worldRenderListener.onRender(ctx.tickDelta());
this.worldRenderListener.onRender(ctx.tickCounter().getRealtimeDeltaTicks());
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.BufferUploader;
import com.mojang.blaze3d.vertex.Tesselator;
import com.mojang.blaze3d.vertex.VertexFormat;
import net.minecraft.client.renderer.ShaderInstance;
Expand All @@ -34,8 +35,8 @@ public class BufferBuilderRenderSink implements RenderSink {
private boolean active;
private boolean canFlush;
private float r = -1f, g, b, a;
private double loopX, loopY, loopZ; // track previous vertices for lines_loop
private double loopFirstX, loopFirstY, loopFirstZ; // track initial vertices for lines_loop
private float loopX, loopY, loopZ; // track previous vertices for lines_loop
private float loopFirstX, loopFirstY, loopFirstZ; // track initial vertices for lines_loop
private boolean canLoop;

// line state
Expand Down Expand Up @@ -87,9 +88,8 @@ public boolean apply(final LineStyle line, final RenderStyle.RenderType type) {
this.flush();
if (this.active && this.activeRenderType != null) {
this.canFlush = true;
this.builder = Tesselator.getInstance().getBuilder();
RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
this.builder.begin(this.activeRenderType.mode, this.activeRenderType.format);
this.builder = Tesselator.getInstance().begin(this.activeRenderType.mode, this.activeRenderType.format);
}
LineWidth.set(this.lastLineWidth = line.lineWidth);
RenderSystem.depthFunc(this.lastDepthFunc = line.renderType.depthFunc());
Expand All @@ -114,49 +114,45 @@ public RenderSink vertex(final double x, final double y, final double z) {
// duplicate last
if (this.canLoop) {
final Vector3f normal = this.activeRenderType.hasNormals ? this.computeNormal(this.loopX, this.loopY, this.loopZ, x, y, z) : null;
builder.vertex(this.loopX, this.loopY, this.loopZ).color(this.r, this.g, this.b, this.a);
builder.addVertex(this.loopX, this.loopY, this.loopZ).setColor(this.r, this.g, this.b, this.a);
if (normal != null) {
// we need to compute normals pointing directly towards the screen
builder.normal(normal.x(), normal.y(), normal.z());
builder.setNormal(normal.x(), normal.y(), normal.z());
}
builder.endVertex();
builder.vertex(x, y, z).color(this.r, this.g, this.b, this.a);
builder.addVertex((float) x, (float) y, (float) z).setColor(this.r, this.g, this.b, this.a);
if (normal != null) {
builder.normal(normal.x(), normal.y(), normal.z());
builder.setNormal(normal.x(), normal.y(), normal.z());
}
builder.endVertex();
} else {
this.loopFirstX = x;
this.loopFirstY = y;
this.loopFirstZ = z;
this.loopFirstX = (float) x;
this.loopFirstY = (float) y;
this.loopFirstZ = (float) z;
}
this.loopX = x;
this.loopY = y;
this.loopZ = z;
this.loopX = (float) x;
this.loopY = (float) y;
this.loopZ = (float) z;
this.canLoop = true;
} else if (this.activeRenderType == this.lines) {
// we buffer vertices so we can compute normals here
if (this.canLoop) {
final Vector3f normal = this.activeRenderType.hasNormals ? this.computeNormal(this.loopX, this.loopY, this.loopZ, x, y, z) : null;
builder.vertex(this.loopX, this.loopY, this.loopZ).color(this.r, this.g, this.b, this.a);
builder.addVertex(this.loopX, this.loopY, this.loopZ).setColor(this.r, this.g, this.b, this.a);
if (normal != null) {
builder.normal(normal.x(), normal.y(), normal.z());
builder.setNormal(normal.x(), normal.y(), normal.z());
}
builder.endVertex();
builder.vertex(x, y, z).color(this.r, this.g, this.b, this.a);
builder.addVertex((float) x, (float) y, (float) z).setColor(this.r, this.g, this.b, this.a);
if (normal != null) {
builder.normal(normal.x(), normal.y(), normal.z());
builder.setNormal(normal.x(), normal.y(), normal.z());
}
builder.endVertex();
this.canLoop = false;
} else {
this.loopX = x;
this.loopY = y;
this.loopZ = z;
this.loopX = (float) x;
this.loopY = (float) y;
this.loopZ = (float) z;
this.canLoop = true;
}
} else {
builder.vertex(x, y, z).color(this.r, this.g, this.b, this.a).endVertex();
builder.addVertex((float) x, (float) y, (float) z).setColor(this.r, this.g, this.b, this.a);
}
return this;
}
Expand Down Expand Up @@ -184,17 +180,15 @@ public RenderSink endLineLoop() {
if (this.canLoop) {
this.canLoop = false;
final Vector3f normal = this.activeRenderType.hasNormals ? this.computeNormal(this.loopX, this.loopY, this.loopZ, this.loopFirstX, this.loopFirstY, this.loopFirstZ) : null;
this.builder.vertex(this.loopX, this.loopY, this.loopZ).color(this.r, this.g, this.b, this.a);
this.builder.addVertex(this.loopX, this.loopY, this.loopZ).setColor(this.r, this.g, this.b, this.a);
if (normal != null) {
this.builder.normal(normal.x(), normal.y(), normal.z());
this.builder.setNormal(normal.x(), normal.y(), normal.z());
}
this.builder.endVertex();

this.builder.vertex(this.loopFirstX, this.loopFirstY, this.loopFirstZ).color(this.r, this.g, this.b, this.a);
this.builder.addVertex(this.loopFirstX, this.loopFirstY, this.loopFirstZ).setColor(this.r, this.g, this.b, this.a);
if (normal != null) {
this.builder.normal(normal.x(), normal.y(), normal.z());
this.builder.setNormal(normal.x(), normal.y(), normal.z());
}
this.builder.endVertex();
}
return this;
}
Expand Down Expand Up @@ -237,7 +231,7 @@ public void flush() {
if (this.activeRenderType != null) {
RenderSystem.setShader(this.activeRenderType.shader);
}
Tesselator.getInstance().end();
BufferUploader.drawWithShader(this.builder.buildOrThrow());
} finally {
this.postFlush.run();
this.builder = null;
Expand Down Expand Up @@ -265,8 +259,7 @@ private void transitionState(final RenderType renderType) {
if (this.activeRenderType == null || this.activeRenderType.mode != renderType.mode) {
this.canFlush = true;
RenderSystem.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
this.builder = Tesselator.getInstance().getBuilder();
this.builder.begin(renderType.mode, renderType.format);
this.builder = Tesselator.getInstance().begin(renderType.mode, renderType.format);
}
this.activeRenderType = renderType;
this.active = true;
Expand Down
3 changes: 0 additions & 3 deletions worldeditcui-fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
"org.enginehub.worldeditcui.fabric.ConfigPanelFactory"
]
},
"mixins": [
"worldeditcui.mixins.json"
],
"depends": {
"worldeditcui_protocol": "*",
"fabric-api-base": "*",
Expand Down
12 changes: 0 additions & 12 deletions worldeditcui-fabric/src/main/resources/worldeditcui.mixins.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
public record CUIPacket(boolean multi, String eventType, List<String> args) implements CustomPacketPayload {
private static final String PROTOCOL_VERSION = "4";
private static final Logger LOGGER = LogUtils.getLogger();
public static final CustomPacketPayload.Type<CUIPacket> TYPE = new Type<>(new ResourceLocation("worldedit", "cui"));
public static final CustomPacketPayload.Type<CUIPacket> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath("worldedit", "cui"));
public static final StreamCodec<RegistryFriendlyByteBuf, CUIPacket> CODEC = CustomPacketPayload.codec(CUIPacket::encode, CUIPacket::decode);

public CUIPacket {
Expand Down
Loading