merge errors

This commit is contained in:
gnembon committed 2021-04-19 23:48:55 -03:00
1 parent 709d74ea47
commit 4b85bdcb86
2 files changed
+5 -4

No files matched your search

@@ -105,7 +105,7 @@ public class ServerNetworkHandler
new SnoopyCommandSource(player, error, output), command new SnoopyCommandSource(player, error, output), command
); );
} }
CompoundTag result = new CompoundTag(); NbtCompound result = new NbtCompound();
result.putString("id", id); result.putString("id", id);
result.putInt("code", resultCode); result.putInt("code", resultCode);
if (error[0] != null) result.putString("error", error[0].asString()); if (error[0] != null) result.putString("error", error[0].asString());
@@ -2,7 +2,6 @@ package carpet.script.utils;
import carpet.CarpetSettings; import carpet.CarpetSettings;
import com.mojang.brigadier.ResultConsumer; import com.mojang.brigadier.ResultConsumer;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.command.argument.EntityAnchorArgumentType; import net.minecraft.command.argument.EntityAnchorArgumentType;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.server.MinecraftServer; 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); return new SnoopyCommandSource(output, position, rotation, world, level, simpleName, name, server, entity, consumer, entityAnchor, error, chatOutput);
} }
public ServerCommandSource mergeConsumers(ResultConsumer<ServerCommandSource> consumer, BinaryOperator<ResultConsumer<ServerCommandSource>> binaryOperator) { public ServerCommandSource mergeConsumers(ResultConsumer<ServerCommandSource> consumer, BinaryOperator<ResultConsumer<ServerCommandSource>> binaryOperator)
{
ResultConsumer<ServerCommandSource> resultConsumer = binaryOperator.apply(this.resultConsumer, consumer); ResultConsumer<ServerCommandSource> resultConsumer = binaryOperator.apply(this.resultConsumer, consumer);
return this.withConsumer(resultConsumer); 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); 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); Vec3d vec3d = this.entityAnchor.positionAt(this);
double d = position.x - vec3d.x; double d = position.x - vec3d.x;
double e = position.y - vec3d.y; double e = position.y - vec3d.y;