mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 11:45:52 -07:00
@@ -12,6 +12,6 @@
|
||||
} else {
|
||||
- minecraftserver.setDifficulty(enumdifficulty, true);
|
||||
+ worldServer.serverLevelData.setDifficulty(enumdifficulty); // CraftBukkit
|
||||
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.difficulty.success", new Object[]{enumdifficulty.getDisplayName()}), true);
|
||||
commandlistenerwrapper.sendSuccess(IChatBaseComponent.translatable("commands.difficulty.success", enumdifficulty.getDisplayName()), true);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
+ T t0 = commandlistenerwrapper.getLevel().getGameRules().getRule(gamerules_gamerulekey); // CraftBukkit
|
||||
|
||||
t0.setFromArgument(commandcontext, "value");
|
||||
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.gamerule.set", new Object[]{gamerules_gamerulekey.getId(), t0.toString()}), true);
|
||||
commandlistenerwrapper.sendSuccess(IChatBaseComponent.translatable("commands.gamerule.set", gamerules_gamerulekey.getId(), t0.toString()), true);
|
||||
@@ -39,7 +39,7 @@
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@
|
||||
- T t0 = commandlistenerwrapper.getServer().getGameRules().getRule(gamerules_gamerulekey);
|
||||
+ T t0 = commandlistenerwrapper.getLevel().getGameRules().getRule(gamerules_gamerulekey); // CraftBukkit
|
||||
|
||||
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.gamerule.query", new Object[]{gamerules_gamerulekey.getId(), t0.toString()}), false);
|
||||
commandlistenerwrapper.sendSuccess(IChatBaseComponent.translatable("commands.gamerule.query", gamerules_gamerulekey.getId(), t0.toString()), false);
|
||||
return t0.getCommandResult();
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/commands/CommandGive.java
|
||||
+++ b/net/minecraft/server/commands/CommandGive.java
|
||||
@@ -59,7 +59,7 @@
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
if (flag && itemstack.isEmpty()) {
|
||||
itemstack.setCount(1);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/commands/CommandList.java
|
||||
+++ b/net/minecraft/server/commands/CommandList.java
|
||||
@@ -37,6 +37,12 @@
|
||||
@@ -36,6 +36,12 @@
|
||||
private static int format(CommandListenerWrapper commandlistenerwrapper, Function<EntityPlayer, IChatBaseComponent> function) {
|
||||
PlayerList playerlist = commandlistenerwrapper.getServer().getPlayerList();
|
||||
List<EntityPlayer> list = playerlist.getPlayers();
|
||||
@@ -12,4 +12,4 @@
|
||||
+ // CraftBukkit end
|
||||
IChatBaseComponent ichatbasecomponent = ChatComponentUtils.formatList(list, function);
|
||||
|
||||
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.list.players", new Object[]{list.size(), playerlist.getMaxPlayers(), ichatbasecomponent}), false);
|
||||
commandlistenerwrapper.sendSuccess(IChatBaseComponent.translatable("commands.list.players", list.size(), playerlist.getMaxPlayers(), ichatbasecomponent), false);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/commands/CommandLoot.java
|
||||
+++ b/net/minecraft/server/commands/CommandLoot.java
|
||||
@@ -90,7 +90,7 @@
|
||||
@@ -91,7 +91,7 @@
|
||||
}
|
||||
|
||||
private static <T extends ArgumentBuilder<CommandListenerWrapper, T>> T addTargets(T t0, CommandLoot.c commandloot_c) {
|
||||
@@ -9,7 +9,7 @@
|
||||
return entityReplace(ArgumentEntity.getEntities(commandcontext, "entities"), ArgumentInventorySlot.getSlot(commandcontext, "slot"), list.size(), list, commandloot_a);
|
||||
}).then(commandloot_c.construct(net.minecraft.commands.CommandDispatcher.argument("count", IntegerArgumentType.integer(0)), (commandcontext, list, commandloot_a) -> {
|
||||
return entityReplace(ArgumentEntity.getEntities(commandcontext, "entities"), ArgumentInventorySlot.getSlot(commandcontext, "slot"), IntegerArgumentType.getInteger(commandcontext, "count"), list, commandloot_a);
|
||||
@@ -247,6 +247,7 @@
|
||||
@@ -248,6 +248,7 @@
|
||||
private static int dropInWorld(CommandListenerWrapper commandlistenerwrapper, Vec3D vec3d, List<ItemStack> list, CommandLoot.a commandloot_a) throws CommandSyntaxException {
|
||||
WorldServer worldserver = commandlistenerwrapper.getLevel();
|
||||
|
||||
|
@@ -28,8 +28,8 @@
|
||||
|
||||
return blockposition.getY() < i && !material.isLiquid() && material != Material.FIRE;
|
||||
@@ -322,5 +322,12 @@
|
||||
this.x = MathHelper.nextDouble(random, d0, d2);
|
||||
this.z = MathHelper.nextDouble(random, d1, d3);
|
||||
this.x = MathHelper.nextDouble(randomsource, d0, d2);
|
||||
this.z = MathHelper.nextDouble(randomsource, d1, d3);
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start - add a version of getBlockState which force loads chunks
|
||||
|
@@ -8,4 +8,4 @@
|
||||
+ if (!worldserver.tryAddFreshEntityWithPassengers(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.COMMAND)) { // CraftBukkit - pass a spawn reason of "COMMAND"
|
||||
throw CommandSummon.ERROR_DUPLICATE_UUID.create();
|
||||
} else {
|
||||
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.summon.success", new Object[]{entity.getDisplayName()}), true);
|
||||
commandlistenerwrapper.sendSuccess(IChatBaseComponent.translatable("commands.summon.success", entity.getDisplayName()), true);
|
||||
|
@@ -12,7 +12,7 @@
|
||||
+
|
||||
public class CommandTeleport {
|
||||
|
||||
private static final SimpleCommandExceptionType INVALID_POSITION = new SimpleCommandExceptionType(new ChatMessage("commands.teleport.invalidPosition"));
|
||||
private static final SimpleCommandExceptionType INVALID_POSITION = new SimpleCommandExceptionType(IChatBaseComponent.translatable("commands.teleport.invalidPosition"));
|
||||
@@ -159,14 +165,29 @@
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/server/commands/CommandTime.java
|
||||
+++ b/net/minecraft/server/commands/CommandTime.java
|
||||
@@ -9,6 +9,11 @@
|
||||
import net.minecraft.network.chat.ChatMessage;
|
||||
import net.minecraft.network.chat.IChatBaseComponent;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
|
||||
+// CraftBukkit start
|
||||
@@ -32,7 +32,7 @@
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.time.set", new Object[]{i}), true);
|
||||
commandlistenerwrapper.sendSuccess(IChatBaseComponent.translatable("commands.time.set", i), true);
|
||||
@@ -60,12 +71,18 @@
|
||||
}
|
||||
|
||||
|
@@ -43,7 +43,7 @@
|
||||
- double d0 = commandlistenerwrapper.getServer().overworld().getWorldBorder().getSize();
|
||||
+ double d0 = commandlistenerwrapper.getLevel().getWorldBorder().getSize(); // CraftBukkit
|
||||
|
||||
commandlistenerwrapper.sendSuccess(new ChatMessage("commands.worldborder.get", new Object[]{String.format(Locale.ROOT, "%.0f", d0)}), false);
|
||||
commandlistenerwrapper.sendSuccess(IChatBaseComponent.translatable("commands.worldborder.get", String.format(Locale.ROOT, "%.0f", d0)), false);
|
||||
return MathHelper.floor(d0 + 0.5D);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user