1.20-pre2

This commit is contained in:
gnembon committed 2023-05-16 21:16:09 +02:00
1 parent 344b0a5b7c
commit 044c66388a
6 files changed
+12 -11

No files matched your search

@@ -55,7 +55,7 @@ public class CounterCommand
for (Component message: counter.format(source.getServer(), realtime, false))
{
source.sendSuccess(message, false);
source.sendSuccess(() -> message, false);
}
return 1;
}
@@ -88,7 +88,7 @@ public class CounterCommand
{
for (Component message: HopperCounter.formatAll(source.getServer(), realtime))
{
source.sendSuccess(message, false);
source.sendSuccess(() -> message, false);
}
return 1;
}
@@ -92,7 +92,7 @@ public class TickCommand
ServerPlayer player = source.getPlayer(); // may be null
TickRateManager trm = ((MinecraftServerInterface)source.getServer()).getTickRateManager();
Component message = trm.tickrate_advance(player, advance, tail_command, source);
source.sendSuccess(message, false);
source.sendSuccess(() -> message, false);
return 1;
}
@@ -533,11 +533,11 @@ public class Auxiliary
Component message = FormattedTextValue.getTextByValue(res);
if (targets == null)
{
s.sendSuccess(message, false);
s.sendSuccess(() -> message, false);
}
else
{
targets.forEach(p -> p.sendSuccess(message, false));
targets.forEach(p -> p.sendSuccess(() -> message, false));
}
return res; // pass through for variables
});
@@ -20,6 +20,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.function.BinaryOperator;
import java.util.function.Supplier;
public class SnoopyCommandSource extends CommandSourceStack
{
@@ -196,9 +197,9 @@ public class SnoopyCommandSource extends CommandSourceStack
}
@Override
public void sendSuccess(Component message, boolean broadcastToOps)
public void sendSuccess(Supplier<Component> message, boolean broadcastToOps)
{
chatOutput.add(message);
chatOutput.add(message.get());
}
}
+2 -2
View File
@@ -231,7 +231,7 @@ public class Messenger
public static void m(CommandSourceStack source, Object ... fields)
{
if (source != null)
source.sendSuccess(Messenger.c(fields), source.getServer() != null && source.getServer().overworld() != null);
source.sendSuccess(() -> Messenger.c(fields), source.getServer() != null && source.getServer().overworld() != null);
}
public static void m(Player player, Object ... fields)
{
@@ -283,7 +283,7 @@ public class Messenger
}
public static void send(CommandSourceStack source, Collection<Component> lines)
{
lines.stream().forEachOrdered((s) -> source.sendSuccess(s, false));
lines.stream().forEachOrdered((s) -> source.sendSuccess(() -> s, false));
}