diff --git a/src/main/java/carpet/network/ServerNetworkHandler.java b/src/main/java/carpet/network/ServerNetworkHandler.java index b647306f..aee49d03 100644 --- a/src/main/java/carpet/network/ServerNetworkHandler.java +++ b/src/main/java/carpet/network/ServerNetworkHandler.java @@ -105,7 +105,7 @@ public class ServerNetworkHandler new SnoopyCommandSource(player, error, output), command ); } - CompoundTag result = new CompoundTag(); + NbtCompound result = new NbtCompound(); result.putString("id", id); result.putInt("code", resultCode); if (error[0] != null) result.putString("error", error[0].asString()); diff --git a/src/main/java/carpet/script/utils/SnoopyCommandSource.java b/src/main/java/carpet/script/utils/SnoopyCommandSource.java index 5747d8a2..8a2508d6 100644 --- a/src/main/java/carpet/script/utils/SnoopyCommandSource.java +++ b/src/main/java/carpet/script/utils/SnoopyCommandSource.java @@ -2,7 +2,6 @@ package carpet.script.utils; import carpet.CarpetSettings; import com.mojang.brigadier.ResultConsumer; -import com.mojang.brigadier.exceptions.CommandSyntaxException; import net.minecraft.command.argument.EntityAnchorArgumentType; import net.minecraft.entity.Entity; import net.minecraft.server.MinecraftServer; @@ -123,7 +122,8 @@ public class SnoopyCommandSource extends ServerCommandSource return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, consumer, entityAnchor, error, chatOutput); } - public ServerCommandSource mergeConsumers(ResultConsumer consumer, BinaryOperator> binaryOperator) { + public ServerCommandSource mergeConsumers(ResultConsumer consumer, BinaryOperator> binaryOperator) + { ResultConsumer resultConsumer = binaryOperator.apply(this.resultConsumer, consumer); return this.withConsumer(resultConsumer); } @@ -158,7 +158,8 @@ public class SnoopyCommandSource extends ServerCommandSource return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, resultConsumer, entityAnchor, error, chatOutput); } - public ServerCommandSource withLookingAt(Vec3d position) throws CommandSyntaxException { + public ServerCommandSource withLookingAt(Vec3d position) + { Vec3d vec3d = this.entityAnchor.positionAt(this); double d = position.x - vec3d.x; double e = position.y - vec3d.y;