1.19.1-rc2
This commit is contained in:
1 parent
86ac49c0ae
commit
6d3c4fa508
7 files changed
+16
-14
No files matched your search
@@ -149,7 +149,7 @@ public class TickSpeed
|
||||
Commands icommandmanager = tick_warp_sender.getServer().getCommands();
|
||||
try
|
||||
{
|
||||
icommandmanager.performCommand(tick_warp_sender, tick_warp_callback);
|
||||
icommandmanager.performPrefixedCommand(tick_warp_sender, tick_warp_callback);
|
||||
}
|
||||
catch (Throwable var23)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ package carpet.mixins;
|
||||
import carpet.CarpetServer;
|
||||
import carpet.CarpetSettings;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.ParseResults;
|
||||
import net.minecraft.commands.CommandBuildContext;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
@@ -31,14 +32,14 @@ public abstract class Commands_customCommandsMixin
|
||||
}
|
||||
|
||||
@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)
|
||||
CarpetSettings.impendingFillSkipUpdates.set(true);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.game.ServerboundChatPacket;
|
||||
import net.minecraft.server.network.FilteredText;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
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",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/network/protocol/game/ServerboundChatPacket;signedPreview()Z")
|
||||
@Inject(method = "handleChat(Lnet/minecraft/network/protocol/game/ServerboundChatPacket;)V",
|
||||
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())
|
||||
{
|
||||
PLAYER_MESSAGE.onPlayerMessage(player, filteredText.raw());
|
||||
PLAYER_MESSAGE.onPlayerMessage(player, serverboundChatPacket.message());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,7 @@ public class ServerNetworkHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
resultCode = player.getServer().getCommands().performCommand(
|
||||
resultCode = player.getServer().getCommands().performPrefixedCommand(
|
||||
new SnoopyCommandSource(player, error, output), command
|
||||
);
|
||||
}
|
||||
|
||||
@@ -607,7 +607,7 @@ public class Auxiliary {
|
||||
{
|
||||
Component[] error = {null};
|
||||
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),
|
||||
lv.get(0).getString())
|
||||
);
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.util.TaskChainer;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.level.dimension.DimensionType;
|
||||
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,
|
||||
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.position = original.getPosition();
|
||||
this.world = original.getLevel();
|
||||
@@ -78,7 +79,7 @@ public class SnoopyCommandSource extends CommandSourceStack
|
||||
this.rotation = player.getRotationVector(); // not a client call really
|
||||
this.error = error;
|
||||
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,
|
||||
@@ -86,7 +87,7 @@ public class SnoopyCommandSource extends CommandSourceStack
|
||||
) {
|
||||
super(output, pos, rot, world, level,
|
||||
simpleName, name, server, entity, false,
|
||||
consumer, entityAnchor, context);
|
||||
consumer, entityAnchor, context, TaskChainer.IMMEDIATE);
|
||||
this.output = output;
|
||||
this.position = pos;
|
||||
this.rotation = rot;
|
||||
|
||||
Reference in new issue
Block a user