Skip to content

Commit

Permalink
"1.21 port"
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGlitch76 committed Jul 1, 2024
1 parent ad2808d commit 009a672
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions build-logic/src/main/java/qsl/internal/Versions.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public final class Versions {
* The QSL version
*/
// Note: Make sure this matches QFAPI's gradle.properties entry for qsl_version
public static final String QSL_VERSION = "9.0.0-alpha.1";
public static final String QSL_VERSION = "10.0.0-alpha.1";

/**
* The target Minecraft version.
*/
public static final MinecraftVersion MINECRAFT_VERSION = new MinecraftVersion("1.20.6");
public static final MinecraftVersion MINECRAFT_VERSION = new MinecraftVersion("1.21");

/**
* The Minecraft versions this version of QSL is compatible with.
Expand All @@ -39,7 +39,7 @@ public final class Versions {
/**
* The target Quilt Mappings build.
*/
public static final int MAPPINGS_BUILD = 6;
public static final int MAPPINGS_BUILD = 2;

/**
* The version of Quilt Loader to use.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public final class Event<T> {
* The identifier of the default phase.
* Have a look at {@link Event#createWithPhases} for an explanation of event phases.
*/
public static final Identifier DEFAULT_PHASE = new Identifier("quilt", "default");
public static final Identifier DEFAULT_PHASE = Identifier.of("quilt", "default");

/**
* Creates a new instance of {@link Event}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private static Map<Class<?>, Identifier> getListenedPhases(Class<?> listenerClas

for (var annotation : listenerClass.getAnnotations()) {
if (annotation instanceof ListenerPhase phase) {
map.put(phase.callbackTarget(), new Identifier(phase.namespace(), phase.path()));
map.put(phase.callbackTarget(), Identifier.of(phase.namespace(), phase.path()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ private static void testDefaultPhaseOnly() {
}

private static void testMultipleDefaultPhases() {
var first = new Identifier("quilt", "first");
var second = new Identifier("quilt", "second");
var first = Identifier.of("quilt", "first");
var second = Identifier.of("quilt", "second");
var event = Event.createWithPhases(TestCallback.class, INVOKER_FACTORY, first, second, Event.DEFAULT_PHASE);

event.register(second, ensureOrder(1));
Expand All @@ -101,10 +101,10 @@ private static void testMultipleDefaultPhases() {
private static void testAddedPhases() {
var event = createEvent();

var veryEarly = new Identifier("quilt", "very_early");
var early = new Identifier("quilt", "early");
var late = new Identifier("quilt", "late");
var veryLate = new Identifier("quilt", "very_late");
var veryEarly = Identifier.of("quilt", "very_early");
var early = Identifier.of("quilt", "early");
var late = Identifier.of("quilt", "late");
var veryLate = Identifier.of("quilt", "very_late");

event.addPhaseOrdering(veryEarly, early);
event.addPhaseOrdering(early, Event.DEFAULT_PHASE);
Expand Down Expand Up @@ -132,10 +132,10 @@ private static void testAddedPhases() {
private static void testCycle() {
var event = createEvent();

var a = new Identifier("quilt", "a");
var b1 = new Identifier("quilt", "b1");
var b2 = new Identifier("quilt", "b2");
var b3 = new Identifier("quilt", "b3");
var a = Identifier.of("quilt", "a");
var b1 = Identifier.of("quilt", "b1");
var b2 = Identifier.of("quilt", "b2");
var b3 = Identifier.of("quilt", "b3");
var c = Event.DEFAULT_PHASE;

// A always first and C always last.
Expand Down Expand Up @@ -185,13 +185,13 @@ private static void testCycle() {
* We get for the final order: [a, d, e, cycle [b, y, z], f].
*/
private static void testDeterministicOrdering() {
var a = new Identifier("quilt", "a");
var b = new Identifier("quilt", "b");
var d = new Identifier("quilt", "d");
var e = new Identifier("quilt", "e");
var f = new Identifier("quilt", "f");
var y = new Identifier("quilt", "y");
var z = new Identifier("quilt", "z");
var a = Identifier.of("quilt", "a");
var b = Identifier.of("quilt", "b");
var d = Identifier.of("quilt", "d");
var e = Identifier.of("quilt", "e");
var f = Identifier.of("quilt", "f");
var y = Identifier.of("quilt", "y");
var z = Identifier.of("quilt", "z");

List<Consumer<Event<TestCallback>>> dependencies = List.of(
ev -> ev.addPhaseOrdering(a, z),
Expand Down Expand Up @@ -230,11 +230,11 @@ private static void testDeterministicOrdering() {
* </pre>
*/
private static void testTwoCycles() {
Identifier a = new Identifier("quilt", "a");
Identifier b = new Identifier("quilt", "b");
Identifier c = new Identifier("quilt", "c");
Identifier d = new Identifier("quilt", "d");
Identifier e = new Identifier("quilt", "e");
Identifier a = Identifier.of("quilt", "a");
Identifier b = Identifier.of("quilt", "b");
Identifier c = Identifier.of("quilt", "c");
Identifier d = Identifier.of("quilt", "d");
Identifier e = Identifier.of("quilt", "e");

List<Consumer<Event<TestCallback>>> dependencies = List.of(
ev -> ev.addPhaseOrdering(e, a),
Expand Down

0 comments on commit 009a672

Please sign in to comment.