1.19.1-rc2

This commit is contained in:
gnembon committed 2022-07-22 18:25:43 +02:00
1 parent 86ac49c0ae
commit 6d3c4fa508
7 files changed
+16 -14

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
# or better: https://modmuss50.me/fabric.html # or better: https://modmuss50.me/fabric.html
minecraft_version=1.19.1-pre4 minecraft_version=1.19.1-rc2
loader_version=0.14.8 loader_version=0.14.8
fabric_version=0.56.0+1.19 fabric_version=0.56.0+1.19
+1 -1
View File
@@ -149,7 +149,7 @@ public class TickSpeed
Commands icommandmanager = tick_warp_sender.getServer().getCommands(); Commands icommandmanager = tick_warp_sender.getServer().getCommands();
try try
{ {
icommandmanager.performCommand(tick_warp_sender, tick_warp_callback); icommandmanager.performPrefixedCommand(tick_warp_sender, tick_warp_callback);
} }
catch (Throwable var23) catch (Throwable var23)
{ {
@@ -3,6 +3,7 @@ package carpet.mixins;
import carpet.CarpetServer; import carpet.CarpetServer;
import carpet.CarpetSettings; import carpet.CarpetSettings;
import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.ParseResults;
import net.minecraft.commands.CommandBuildContext; import net.minecraft.commands.CommandBuildContext;
import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands; import net.minecraft.commands.Commands;
@@ -31,14 +32,14 @@ public abstract class Commands_customCommandsMixin
} }
@Inject(method = "performCommand", at = @At("HEAD")) @Inject(method = "performCommand", at = @At("HEAD"))
private void onExecuteBegin(CommandSourceStack serverCommandSource_1, String string_1, CallbackInfoReturnable<Integer> cir) private void onExecuteBegin(ParseResults<CommandSourceStack> parseResults, String string, CallbackInfoReturnable<Integer> cir)
{ {
if (!CarpetSettings.fillUpdates) if (!CarpetSettings.fillUpdates)
CarpetSettings.impendingFillSkipUpdates.set(true); CarpetSettings.impendingFillSkipUpdates.set(true);
} }
@Inject(method = "performCommand", at = @At("RETURN")) @Inject(method = "performCommand", at = @At("RETURN"))
private void onExecuteEnd(CommandSourceStack serverCommandSource_1, String string_1, CallbackInfoReturnable<Integer> cir) private void onExecuteEnd(ParseResults<CommandSourceStack> parseResults, String string, CallbackInfoReturnable<Integer> cir)
{ {
CarpetSettings.impendingFillSkipUpdates.set(false); CarpetSettings.impendingFillSkipUpdates.set(false);
} }
@@ -1,7 +1,7 @@
package carpet.mixins; package carpet.mixins;
import net.minecraft.network.chat.Component;
import net.minecraft.network.protocol.game.ServerboundChatPacket; import net.minecraft.network.protocol.game.ServerboundChatPacket;
import net.minecraft.server.network.FilteredText;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@@ -282,13 +282,13 @@ public class ServerGamePacketListenerImpl_scarpetEventsMixin
} }
} }
@Inject(method = "handleChat(Lnet/minecraft/network/protocol/game/ServerboundChatPacket;Lnet/minecraft/server/network/FilteredText;)V", @Inject(method = "handleChat(Lnet/minecraft/network/protocol/game/ServerboundChatPacket;)V",
at = @At(value = "INVOKE", target = "Lnet/minecraft/network/protocol/game/ServerboundChatPacket;signedPreview()Z") at = @At(value = "HEAD")
) )
private void onChatMessage(ServerboundChatPacket serverboundChatPacket, FilteredText<String> filteredText, CallbackInfo ci) { private void onChatMessage(ServerboundChatPacket serverboundChatPacket, CallbackInfo ci) {
if (PLAYER_MESSAGE.isNeeded()) if (PLAYER_MESSAGE.isNeeded())
{ {
PLAYER_MESSAGE.onPlayerMessage(player, filteredText.raw()); PLAYER_MESSAGE.onPlayerMessage(player, serverboundChatPacket.message());
} }
} }
} }
@@ -99,7 +99,7 @@ public class ServerNetworkHandler
} }
else else
{ {
resultCode = player.getServer().getCommands().performCommand( resultCode = player.getServer().getCommands().performPrefixedCommand(
new SnoopyCommandSource(player, error, output), command new SnoopyCommandSource(player, error, output), command
); );
} }
@@ -607,7 +607,7 @@ public class Auxiliary {
{ {
Component[] error = {null}; Component[] error = {null};
List<Component> output = new ArrayList<>(); List<Component> output = new ArrayList<>();
Value retval = new NumericValue(s.getServer().getCommands().performCommand( Value retval = new NumericValue(s.getServer().getCommands().performPrefixedCommand(
new SnoopyCommandSource(s, error, output), new SnoopyCommandSource(s, error, output),
lv.get(0).getString()) lv.get(0).getString())
); );
@@ -11,6 +11,7 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.ServerPlayer;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.util.TaskChainer;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.dimension.DimensionType; import net.minecraft.world.level.dimension.DimensionType;
import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec2;
@@ -43,7 +44,7 @@ public class SnoopyCommandSource extends CommandSourceStack
{ {
super(CommandSource.NULL, original.getPosition(), original.getRotation(), original.getLevel(), CarpetSettings.runPermissionLevel, super(CommandSource.NULL, original.getPosition(), original.getRotation(), original.getLevel(), CarpetSettings.runPermissionLevel,
original.getTextName(), original.getDisplayName(), original.getServer(), original.getEntity(), false, original.getTextName(), original.getDisplayName(), original.getServer(), original.getEntity(), false,
(ctx, succ, res) -> { }, EntityAnchorArgument.Anchor.FEET, CommandSigningContext.anonymous()); (ctx, succ, res) -> { }, EntityAnchorArgument.Anchor.FEET, CommandSigningContext.ANONYMOUS, TaskChainer.IMMEDIATE);
this.output = CommandSource.NULL; this.output = CommandSource.NULL;
this.position = original.getPosition(); this.position = original.getPosition();
this.world = original.getLevel(); this.world = original.getLevel();
@@ -78,7 +79,7 @@ public class SnoopyCommandSource extends CommandSourceStack
this.rotation = player.getRotationVector(); // not a client call really this.rotation = player.getRotationVector(); // not a client call really
this.error = error; this.error = error;
this.chatOutput = output; this.chatOutput = output;
this.signingContext = CommandSigningContext.anonymous(); this.signingContext = CommandSigningContext.ANONYMOUS;
} }
private SnoopyCommandSource(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String simpleName, Component name, MinecraftServer server, @Nullable Entity entity, ResultConsumer<CommandSourceStack> consumer, EntityAnchorArgument.Anchor entityAnchor, CommandSigningContext context, private SnoopyCommandSource(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String simpleName, Component name, MinecraftServer server, @Nullable Entity entity, ResultConsumer<CommandSourceStack> consumer, EntityAnchorArgument.Anchor entityAnchor, CommandSigningContext context,
@@ -86,7 +87,7 @@ public class SnoopyCommandSource extends CommandSourceStack
) { ) {
super(output, pos, rot, world, level, super(output, pos, rot, world, level,
simpleName, name, server, entity, false, simpleName, name, server, entity, false,
consumer, entityAnchor, context); consumer, entityAnchor, context, TaskChainer.IMMEDIATE);
this.output = output; this.output = output;
this.position = pos; this.position = pos;
this.rotation = rot; this.rotation = rot;