1.19.1-pre4

This commit is contained in:
modmuss50 2022-07-08 18:49:07 +01:00
parent 64e495f64a
commit 240720a216
4 changed files with 24 additions and 26 deletions
fabric-command-api-v2/src/client/java/net/fabricmc/fabric/mixin/command/client
fabric-message-api-v1/src/main/java/net/fabricmc/fabric
gradle.properties

View file

@ -37,7 +37,7 @@ abstract class ClientCommandSourceMixin implements FabricClientCommandSource {
@Override
public void sendFeedback(Text message) {
this.client.method_44714().method_44736(message, false);
this.client.getMessageHandler().onGameMessage(message, false);
}
@Override

View file

@ -22,7 +22,6 @@ import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.filter.FilteredMessage;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import net.minecraft.util.registry.RegistryKey;
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
@ -144,10 +143,10 @@ public final class ServerMessageEvents {
*
* @param message the broadcast message with message decorators applied; use {@code message.raw().getContent()} to get the text
* @param sender the player that sent the message
* @param typeKey the message type
* @param params the {@link MessageType.class_7602}
* @return {@code true} if the message should be broadcast, otherwise {@code false}
*/
boolean allowChatMessage(FilteredMessage<SignedMessage> message, ServerPlayerEntity sender, RegistryKey<MessageType> typeKey);
boolean allowChatMessage(FilteredMessage<SignedMessage> message, ServerPlayerEntity sender, MessageType.class_7602 params);
}
@FunctionalInterface
@ -179,10 +178,10 @@ public final class ServerMessageEvents {
*
* @param message the broadcast message with message decorators applied if applicable; use {@code message.raw().getContent()} to get the text
* @param source the command source that sent the message
* @param typeKey the message type
* @param params the {@link MessageType.class_7602}
* @return {@code true} if the message should be broadcast, otherwise {@code false}
*/
boolean allowCommandMessage(FilteredMessage<SignedMessage> message, ServerCommandSource source, RegistryKey<MessageType> typeKey);
boolean allowCommandMessage(FilteredMessage<SignedMessage> message, ServerCommandSource source, MessageType.class_7602 params);
}
@FunctionalInterface
@ -198,9 +197,9 @@ public final class ServerMessageEvents {
*
* @param message the broadcast message with message decorators applied; use {@code message.raw().getContent()} to get the text
* @param sender the player that sent the message
* @param typeKey the message type
* @param params the {@link MessageType.class_7602}
*/
void onChatMessage(FilteredMessage<SignedMessage> message, ServerPlayerEntity sender, RegistryKey<MessageType> typeKey);
void onChatMessage(FilteredMessage<SignedMessage> message, ServerPlayerEntity sender, MessageType.class_7602 params);
}
@FunctionalInterface
@ -228,8 +227,8 @@ public final class ServerMessageEvents {
*
* @param message the broadcast message with message decorators applied if applicable; use {@code message.raw().getContent()} to get the text
* @param source the command source that sent the message
* @param typeKey the message type
* @param params the {@link MessageType.class_7602}
*/
void onCommandMessage(FilteredMessage<SignedMessage> message, ServerCommandSource source, RegistryKey<MessageType> typeKey);
void onCommandMessage(FilteredMessage<SignedMessage> message, ServerCommandSource source, MessageType.class_7602 params);
}
}

View file

@ -30,20 +30,19 @@ import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.filter.FilteredMessage;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import net.minecraft.util.registry.RegistryKey;
import net.fabricmc.fabric.api.message.v1.ServerMessageEvents;
@Mixin(PlayerManager.class)
public class PlayerManagerMixin {
@Inject(method = "broadcast(Lnet/minecraft/server/filter/FilteredMessage;Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/util/registry/RegistryKey;)V", at = @At("HEAD"), cancellable = true)
private void onSendChatMessage(FilteredMessage<SignedMessage> message, ServerPlayerEntity sender, RegistryKey<MessageType> typeKey, CallbackInfo ci) {
if (!ServerMessageEvents.ALLOW_CHAT_MESSAGE.invoker().allowChatMessage(message, sender, typeKey)) {
@Inject(method = "broadcast(Lnet/minecraft/server/filter/FilteredMessage;Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/network/message/MessageType$class_7602;)V", at = @At("HEAD"), cancellable = true)
private void onSendChatMessage(FilteredMessage<SignedMessage> message, ServerPlayerEntity sender, MessageType.class_7602 params, CallbackInfo ci) {
if (!ServerMessageEvents.ALLOW_CHAT_MESSAGE.invoker().allowChatMessage(message, sender, params)) {
ci.cancel();
return;
}
ServerMessageEvents.CHAT_MESSAGE.invoker().onChatMessage(message, sender, typeKey);
ServerMessageEvents.CHAT_MESSAGE.invoker().onChatMessage(message, sender, params);
}
@Inject(method = "broadcast(Lnet/minecraft/text/Text;Ljava/util/function/Function;Z)V", at = @At("HEAD"), cancellable = true)
@ -56,13 +55,13 @@ public class PlayerManagerMixin {
ServerMessageEvents.GAME_MESSAGE.invoker().onGameMessage(message, overlay);
}
@Inject(method = "broadcast(Lnet/minecraft/server/filter/FilteredMessage;Lnet/minecraft/server/command/ServerCommandSource;Lnet/minecraft/util/registry/RegistryKey;)V", at = @At("HEAD"), cancellable = true)
private void onSendCommandMessage(FilteredMessage<SignedMessage> message, ServerCommandSource source, RegistryKey<MessageType> typeKey, CallbackInfo ci) {
if (!ServerMessageEvents.ALLOW_COMMAND_MESSAGE.invoker().allowCommandMessage(message, source, typeKey)) {
@Inject(method = "broadcast(Lnet/minecraft/server/filter/FilteredMessage;Lnet/minecraft/server/command/ServerCommandSource;Lnet/minecraft/network/message/MessageType$class_7602;)V", at = @At("HEAD"), cancellable = true)
private void onSendCommandMessage(FilteredMessage<SignedMessage> message, ServerCommandSource source, MessageType.class_7602 params, CallbackInfo ci) {
if (!ServerMessageEvents.ALLOW_COMMAND_MESSAGE.invoker().allowCommandMessage(message, source, params)) {
ci.cancel();
return;
}
ServerMessageEvents.COMMAND_MESSAGE.invoker().onCommandMessage(message, source, typeKey);
ServerMessageEvents.COMMAND_MESSAGE.invoker().onCommandMessage(message, source, params);
}
}

View file

@ -1,9 +1,9 @@
org.gradle.jvmargs=-Xmx2560M
org.gradle.parallel=true
version=0.57.1
minecraft_version=1.19.1-pre2
yarn_version=+build.2
version=0.57.2
minecraft_version=1.19.1-pre4
yarn_version=+build.3
loader_version=0.14.8
prerelease=true
@ -13,9 +13,9 @@ fabric-api-base-version=0.4.9
fabric-api-lookup-api-v1-version=1.6.7
fabric-biome-api-v1-version=9.0.15
fabric-blockrenderlayer-v1-version=1.1.18
fabric-command-api-v1-version=1.2.7
fabric-command-api-v2-version=2.1.3
fabric-commands-v0-version=0.2.24
fabric-command-api-v1-version=1.2.8
fabric-command-api-v2-version=2.1.4
fabric-commands-v0-version=0.2.25
fabric-containers-v0-version=0.1.27
fabric-content-registries-v0-version=3.2.0
fabric-crash-report-info-v1-version=0.2.3
@ -33,7 +33,7 @@ fabric-keybindings-v0-version=0.2.16
fabric-lifecycle-events-v1-version=2.1.0
fabric-loot-api-v2-version=1.1.0
fabric-loot-tables-v1-version=1.1.3
fabric-message-api-v1-version=2.0.0
fabric-message-api-v1-version=3.0.0
fabric-mining-level-api-v1-version=2.1.10
fabric-models-v0-version=0.3.15
fabric-networking-api-v1-version=1.0.27