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

+2 -2
View File
@@ -3,10 +3,10 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check https://fabricmc.net/develop/ # check https://fabricmc.net/develop/
minecraft_version=1.20-pre1 minecraft_version=1.20-pre2
loader_version=0.14.19 loader_version=0.14.19
jsr305_version=3.0.2 jsr305_version=3.0.2
fabric_version=0.81.1+1.20 fabric_version=0.81.2+1.20
# Mod Properties # Mod Properties
mod_version = 1.4.108 mod_version = 1.4.108
@@ -55,7 +55,7 @@ public class CounterCommand
for (Component message: counter.format(source.getServer(), realtime, false)) for (Component message: counter.format(source.getServer(), realtime, false))
{ {
source.sendSuccess(message, false); source.sendSuccess(() -> message, false);
} }
return 1; return 1;
} }
@@ -88,7 +88,7 @@ public class CounterCommand
{ {
for (Component message: HopperCounter.formatAll(source.getServer(), realtime)) for (Component message: HopperCounter.formatAll(source.getServer(), realtime))
{ {
source.sendSuccess(message, false); source.sendSuccess(() -> message, false);
} }
return 1; return 1;
} }
@@ -92,7 +92,7 @@ public class TickCommand
ServerPlayer player = source.getPlayer(); // may be null ServerPlayer player = source.getPlayer(); // may be null
TickRateManager trm = ((MinecraftServerInterface)source.getServer()).getTickRateManager(); TickRateManager trm = ((MinecraftServerInterface)source.getServer()).getTickRateManager();
Component message = trm.tickrate_advance(player, advance, tail_command, source); Component message = trm.tickrate_advance(player, advance, tail_command, source);
source.sendSuccess(message, false); source.sendSuccess(() -> message, false);
return 1; return 1;
} }
@@ -533,11 +533,11 @@ public class Auxiliary
Component message = FormattedTextValue.getTextByValue(res); Component message = FormattedTextValue.getTextByValue(res);
if (targets == null) if (targets == null)
{ {
s.sendSuccess(message, false); s.sendSuccess(() -> message, false);
} }
else else
{ {
targets.forEach(p -> p.sendSuccess(message, false)); targets.forEach(p -> p.sendSuccess(() -> message, false));
} }
return res; // pass through for variables return res; // pass through for variables
}); });
@@ -20,6 +20,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.List; import java.util.List;
import java.util.function.BinaryOperator; import java.util.function.BinaryOperator;
import java.util.function.Supplier;
public class SnoopyCommandSource extends CommandSourceStack public class SnoopyCommandSource extends CommandSourceStack
{ {
@@ -196,9 +197,9 @@ public class SnoopyCommandSource extends CommandSourceStack
} }
@Override @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) public static void m(CommandSourceStack source, Object ... fields)
{ {
if (source != null) 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) public static void m(Player player, Object ... fields)
{ {
@@ -283,7 +283,7 @@ public class Messenger
} }
public static void send(CommandSourceStack source, Collection<Component> lines) 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));
} }