Skip to content

Commit 0801546

Browse files
authored
1.19.4 update (#66)
* 1.19.4 update * remove "on" prefix from tracking events
1 parent 79193be commit 0801546

File tree

11 files changed

+73
-36
lines changed

11 files changed

+73
-36
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ org.gradle.parallel=true
55
kotlin.incremental=true
66
kotlin.code.style=official
77

8-
version=1.1.1
8+
version=2.0.0
99
flkVersion=1.9.2

gradle/libs.versions.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ coroutines = "1.6.4"
44
datetime = "0.4.0"
55
dokka = "1.7.20"
66
kotlin = "1.8.10"
7-
minecraft = "1.19.3"
8-
qsl = "4.0.0-beta.9+1.19.3"
9-
quilt_loader = "0.18.3"
10-
quilt_mappings = "1.19.3+build.5"
7+
minecraft = "1.19.4"
8+
qsl = "5.0.0-beta.1+1.19.4"
9+
quilt_loader = "0.18.5"
10+
quilt_mappings = "1.19.4+build.5"
1111
serialization = "1.5.0"
1212
serialization_plugin = "1.8.10" # usually same as kotlin but can lag behind
1313
binary_compat_plugin = "0.12.1"

library/api/library.api

+10-6
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ public final class org/quiltmc/qkl/library/brigadier/argument/ArgumentsKt {
177177
public static final fun testClass (Ljava/lang/String;)Lorg/quiltmc/qkl/library/brigadier/ArgumentConstructor;
178178
public static final fun testFunction (Ljava/lang/String;)Lorg/quiltmc/qkl/library/brigadier/ArgumentConstructor;
179179
public static final fun text (Ljava/lang/String;)Lorg/quiltmc/qkl/library/brigadier/ArgumentConstructor;
180-
public static final fun time (Ljava/lang/String;)Lorg/quiltmc/qkl/library/brigadier/ArgumentConstructor;
180+
public static final fun time (Ljava/lang/String;I)Lorg/quiltmc/qkl/library/brigadier/ArgumentConstructor;
181+
public static synthetic fun time$default (Ljava/lang/String;IILjava/lang/Object;)Lorg/quiltmc/qkl/library/brigadier/ArgumentConstructor;
181182
public static final fun uuid (Ljava/lang/String;)Lorg/quiltmc/qkl/library/brigadier/ArgumentConstructor;
182183
public static final fun valueAngleArg (Lorg/quiltmc/qkl/library/brigadier/ArgumentReader;)F
183184
public static final fun valueBlockPosArg (Lorg/quiltmc/qkl/library/brigadier/ArgumentReader;)Lnet/minecraft/util/math/BlockPos;
@@ -297,7 +298,9 @@ public final class org/quiltmc/qkl/library/brigadier/util/RequiredChainKt {
297298
public final class org/quiltmc/qkl/library/brigadier/util/ServerCommandUtilKt {
298299
public static final fun broadcastSystemMessage (Lcom/mojang/brigadier/context/CommandContext;Lnet/minecraft/text/Text;Z)V
299300
public static final fun getEntity (Lcom/mojang/brigadier/context/CommandContext;)Lnet/minecraft/entity/Entity;
301+
public static final fun getEntityOrThrow (Lcom/mojang/brigadier/context/CommandContext;)Lnet/minecraft/entity/Entity;
300302
public static final fun getPlayer (Lcom/mojang/brigadier/context/CommandContext;)Lnet/minecraft/server/network/ServerPlayerEntity;
303+
public static final fun getPlayerOrThrow (Lcom/mojang/brigadier/context/CommandContext;)Lnet/minecraft/server/network/ServerPlayerEntity;
301304
public static final fun getServer (Lcom/mojang/brigadier/context/CommandContext;)Lnet/minecraft/server/MinecraftServer;
302305
public static final fun getWorld (Lcom/mojang/brigadier/context/CommandContext;)Lnet/minecraft/server/world/ServerWorld;
303306
public static final fun sendFeedback (Lcom/mojang/brigadier/context/CommandContext;Lnet/minecraft/text/Text;Z)V
@@ -336,7 +339,7 @@ public final class org/quiltmc/qkl/library/client/screen/ScreenEventsKt {
336339
public static final fun afterMouseClick (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function4;)V
337340
public static final fun afterMouseRelease (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function4;)V
338341
public static final fun afterMouseScroll (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function5;)V
339-
public static final fun afterScreenInit (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function4;)V
342+
public static final fun afterScreenInit (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function3;)V
340343
public static final fun afterScreenRender (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function5;)V
341344
public static final fun afterScreenTick (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function1;)V
342345
public static final fun allowKeyPress (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function4;)V
@@ -349,7 +352,7 @@ public final class org/quiltmc/qkl/library/client/screen/ScreenEventsKt {
349352
public static final fun beforeMouseClick (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function4;)V
350353
public static final fun beforeMouseRelease (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function4;)V
351354
public static final fun beforeMouseScroll (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function5;)V
352-
public static final fun beforeScreenInit (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function4;)V
355+
public static final fun beforeScreenInit (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function3;)V
353356
public static final fun beforeScreenRender (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function5;)V
354357
public static final fun beforeScreenTick (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function1;)V
355358
public static final fun onScreenRemoved (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function1;)V
@@ -780,7 +783,8 @@ public final class org/quiltmc/qkl/library/networking/PlayerLookupsKt {
780783
}
781784

782785
public final class org/quiltmc/qkl/library/networking/ServerEventsKt {
783-
public static final fun onEntityTrackingStart (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function2;)V
786+
public static final fun afterEntityTrackingStart (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function2;)V
787+
public static final fun beforeEntityTrackingStart (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function2;)V
784788
public static final fun onEntityTrackingStop (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function2;)V
785789
public static final fun onLoginDisconnect (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function2;)V
786790
public static final fun onLoginInit (Lorg/quiltmc/qkl/library/EventRegistration;Lkotlin/jvm/functions/Function2;)V
@@ -800,8 +804,8 @@ public final class org/quiltmc/qkl/library/recipe/RecipeEventsKt {
800804

801805
public final class org/quiltmc/qkl/library/recipe/RecipeExtensionsKt {
802806
public static final fun coerceIngredient (Ljava/lang/Object;)Lnet/minecraft/recipe/Ingredient;
803-
public static final fun foodCookingRecipe (Lnet/minecraft/util/Identifier;Ljava/lang/String;Ljava/lang/Object;Lnet/minecraft/item/ItemStack;Lnet/minecraft/recipe/book/CookingRecipeCategory;FIII)[Lnet/minecraft/recipe/AbstractCookingRecipe;
804-
public static synthetic fun foodCookingRecipe$default (Lnet/minecraft/util/Identifier;Ljava/lang/String;Ljava/lang/Object;Lnet/minecraft/item/ItemStack;Lnet/minecraft/recipe/book/CookingRecipeCategory;FIIIILjava/lang/Object;)[Lnet/minecraft/recipe/AbstractCookingRecipe;
807+
public static final fun foodCookingRecipe (Lnet/minecraft/util/Identifier;Ljava/lang/String;Ljava/lang/Object;Lnet/minecraft/item/ItemStack;Lnet/minecraft/recipe/CookingCategory;FIII)[Lnet/minecraft/recipe/AbstractCookingRecipe;
808+
public static synthetic fun foodCookingRecipe$default (Lnet/minecraft/util/Identifier;Ljava/lang/String;Ljava/lang/Object;Lnet/minecraft/item/ItemStack;Lnet/minecraft/recipe/CookingCategory;FIIIILjava/lang/Object;)[Lnet/minecraft/recipe/AbstractCookingRecipe;
805809
public static final fun registerStaticRecipe (Lnet/minecraft/recipe/Recipe;)Lnet/minecraft/recipe/Recipe;
806810
public static final fun registerStaticRecipes ([Lnet/minecraft/recipe/Recipe;)V
807811
public static final fun shapedRecipe (Lnet/minecraft/util/Identifier;Ljava/lang/String;Ljava/lang/String;Lnet/minecraft/item/ItemStack;[Lkotlin/Pair;)Lnet/minecraft/recipe/ShapedRecipe;

library/src/main/kotlin/org/quiltmc/qkl/library/brigadier/argument/MiscArguments.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 QuiltMC
2+
* Copyright 2023 QuiltMC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -77,9 +77,10 @@ public fun DefaultArgumentReader<UuidArgumentType>.value(): UUID {
7777
*/
7878
@BrigadierDsl
7979
public fun <S> time(
80-
name: String
80+
name: String,
81+
minimumTicks: Int = 0
8182
): DefaultArgumentConstructor<S, TimeArgumentType> {
82-
return argument(name, TimeArgumentType.time())
83+
return argument(name, TimeArgumentType.of(minimumTicks))
8384
}
8485

8586
/**

library/src/main/kotlin/org/quiltmc/qkl/library/brigadier/argument/TextArguments.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public fun ArgumentReader<
7070
MessageArgumentType
7171
>
7272
>.resolveSigned(consumer: (SignedChatMessage) -> Unit) {
73-
MessageArgumentType.resolveSignedMessage(context, name, consumer)
73+
MessageArgumentType.resolveChatMessage(context, name, consumer)
7474
}
7575

7676
/**

library/src/main/kotlin/org/quiltmc/qkl/library/brigadier/util/ServerCommandUtil.kt

+28-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 QuiltMC
2+
* Copyright 2023 QuiltMC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,25 +29,46 @@ import net.minecraft.text.Text
2929
* Player executing the command or
3030
* `null` if not executed by a player.
3131
*
32-
* @see ServerCommandSource.m_ozupobtn
32+
* @see ServerCommandSource.getPlayer
3333
*
3434
* @author Cypher121
3535
*/
36-
//TODO wait for mappings
3736
public val CommandContext<ServerCommandSource>.player: ServerPlayerEntity?
38-
get() = source.m_ozupobtn()
37+
get() = source.player
38+
39+
/**
40+
* Player executing the command or throws
41+
* `REQUIRES_PLAYER_EXCEPTION` if not executed by a player.
42+
*
43+
* @see ServerCommandSource.getPlayerOrThrow
44+
*
45+
* @author SilverAndro
46+
*/
47+
public val CommandContext<ServerCommandSource>.playerOrThrow: ServerPlayerEntity
48+
get() = source.playerOrThrow
3949

4050
/**
4151
* Entity executing the command or
4252
* `null` if not executed by an entity.
4353
*
44-
* @see ServerCommandSource.entity
54+
* @see ServerCommandSource.getEntity
4555
*
4656
* @author Cypher121
4757
*/
4858
public val CommandContext<ServerCommandSource>.entity: Entity?
4959
get() = source.entity
5060

61+
/**
62+
* Entity executing the command or throws
63+
* `REQUIRES_ENTITY_EXCEPTION` if not executed by an entity.
64+
*
65+
* @see ServerCommandSource.getEntityOrThrow
66+
*
67+
* @author SilverAndro
68+
*/
69+
public val CommandContext<ServerCommandSource>.entityOrThrow: Entity
70+
get() = source.entityOrThrow
71+
5172
/**
5273
* World from which the command originates.
5374
*
@@ -87,13 +108,13 @@ public fun CommandContext<ServerCommandSource>.sendFeedback(
87108
* Sends [message] to every player on the server,
88109
* to chat or the toolbar overlay controlled by [overlay]
89110
*
90-
* @see PlayerManager.m_bgctehjy
111+
* @see PlayerManager.broadcastSystemMessage
91112
*
92113
* @author Cypher121
93114
*/
94115
public fun CommandContext<ServerCommandSource>.broadcastSystemMessage(
95116
message: Text,
96117
overlay: Boolean
97118
) {
98-
server.playerManager.m_bgctehjy(message, overlay)
119+
server.playerManager.broadcastSystemMessage(message, overlay)
99120
}

library/src/main/kotlin/org/quiltmc/qkl/library/client/screen/ScreenEvents.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ public fun EventRegistration.afterKeyRelease(callback: KeyboardKey<Unit>) {
211211
public typealias ScreenGenericCallback = Screen.() -> Unit
212212
public typealias ScreenInitCallback = Screen.(
213213
client: MinecraftClient,
214-
scaledWidth: Int,
215-
scaledHeight: Int
214+
firstTimeInit: Boolean
216215
) -> Unit
217216

218217
public typealias ScreenRenderCallback = Screen.(

library/src/main/kotlin/org/quiltmc/qkl/library/networking/ServerEvents.kt

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 QuiltMC
2+
* Copyright 2023 QuiltMC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -143,16 +143,29 @@ public typealias EntityTrackingCallback = (
143143
) -> Unit
144144

145145
/**
146-
* Invoked when a player on the server starts tracking an entity.
146+
* Invoked before a player on the server starts tracking an entity.
147147
* This usually happens when the entity gets close enough
148148
* to the player to be seen.
149149
*
150-
* @see EntityTrackingEvents.START_TRACKING
150+
* @see EntityTrackingEvents.BEFORE_START_TRACKING
151+
*
152+
* @author SilverAndro
153+
*/
154+
public fun EventRegistration.beforeEntityTrackingStart(callback: EntityTrackingCallback) {
155+
EntityTrackingEvents.BEFORE_START_TRACKING.register(EntityTrackingEvents.BeforeStartTracking(callback))
156+
}
157+
158+
/**
159+
* Invoked after a player on the server starts tracking an entity.
160+
* This usually happens when the entity gets close enough
161+
* to the player to be seen.
162+
*
163+
* @see EntityTrackingEvents.AFTER_START_TRACKING
151164
*
152165
* @author sschr15
153166
*/
154-
public fun EventRegistration.onEntityTrackingStart(callback: EntityTrackingCallback) {
155-
EntityTrackingEvents.START_TRACKING.register(EntityTrackingEvents.StartTracking(callback))
167+
public fun EventRegistration.afterEntityTrackingStart(callback: EntityTrackingCallback) {
168+
EntityTrackingEvents.AFTER_START_TRACKING.register(EntityTrackingEvents.AfterStartTracking(callback))
156169
}
157170

158171
/**

library/src/main/kotlin/org/quiltmc/qkl/library/recipe/RecipeExtensions.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import net.minecraft.item.Item
2121
import net.minecraft.item.ItemConvertible
2222
import net.minecraft.item.ItemStack
2323
import net.minecraft.recipe.*
24-
import net.minecraft.recipe.book.CookingRecipeCategory
2524
import net.minecraft.registry.tag.TagKey
2625
import net.minecraft.util.Identifier
2726
import net.minecraft.registry.RegistryKeys
@@ -174,7 +173,7 @@ public fun foodCookingRecipe(
174173
group: String,
175174
input: IngredientLike,
176175
result: ItemStack,
177-
category: CookingRecipeCategory,
176+
category: CookingCategory,
178177
experience: Float = 0.0f,
179178
cookTime: Int = 200,
180179
smokerCookTime: Int = cookTime / 2,

library/src/main/kotlin/org/quiltmc/qkl/library/serialization/internal/SerializerCodec.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 QuiltMC
2+
* Copyright 2023 QuiltMC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ internal class SerializerCodec<A>(
4747
"Encoding exception at $trace: ${e.message}"
4848
}
4949

50-
DataResult.error(errorMessage)
50+
DataResult.error { errorMessage }
5151
}
5252
}
5353

@@ -65,7 +65,7 @@ internal class SerializerCodec<A>(
6565
"Encoding exception at $trace: ${e.message}"
6666
}
6767

68-
DataResult.error(errorMessage)
68+
DataResult.error { errorMessage }
6969
}
7070
}
7171

library/src/main/kotlin/samples/qkl/brigadier/BrigadierDslSamples.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 QuiltMC
2+
* Copyright 2023 QuiltMC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@ private object BrigadierDslSamples {
5050
required(boolean("toCaps")) { getToCaps -> // or as an accessor
5151
// Standard builder methods can be called as normal
5252
requires {
53-
it.player.experienceLevel > Random.nextInt()
53+
it.playerOrThrow.experienceLevel > Random.nextInt()
5454
}
5555

5656
// Execute the command with an extension method

0 commit comments

Comments
 (0)