Repackage NMS

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-03-16 09:00:00 +11:00
parent 18496e998f
commit 9da047989c
968 changed files with 5448 additions and 5050 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandEffect.java
+++ b/net/minecraft/server/CommandEffect.java
@@ -62,7 +62,7 @@
--- a/net/minecraft/server/commands/CommandEffect.java
+++ b/net/minecraft/server/commands/CommandEffect.java
@@ -71,7 +71,7 @@
if (entity instanceof EntityLiving) {
MobEffect mobeffect = new MobEffect(mobeffectlist, k, i, false, flag);
@@ -9,7 +9,7 @@
++j;
}
}
@@ -88,7 +88,7 @@
@@ -97,7 +97,7 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@@ -18,7 +18,7 @@
++i;
}
}
@@ -113,7 +113,7 @@
@@ -122,7 +122,7 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();

View File

@@ -1,12 +1,12 @@
--- a/net/minecraft/server/CommandGamemode.java
+++ b/net/minecraft/server/CommandGamemode.java
@@ -55,6 +55,12 @@
--- a/net/minecraft/server/commands/CommandGamemode.java
+++ b/net/minecraft/server/commands/CommandGamemode.java
@@ -63,6 +63,12 @@
if (entityplayer.playerInteractManager.getGameMode() != enumgamemode) {
entityplayer.a(enumgamemode);
+ // CraftBukkit start - handle event cancelling the change
+ if (entityplayer.playerInteractManager.getGameMode() != enumgamemode) {
+ commandcontext.getSource().sendFailureMessage(new ChatComponentText("Failed to set the gamemode of '" + entityplayer.getName() + "'"));
+ commandcontext.getSource().sendFailureMessage(new net.minecraft.network.chat.ChatComponentText("Failed to set the gamemode of '" + entityplayer.getName() + "'"));
+ continue;
+ }
+ // CraftBukkit end

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandGamerule.java
+++ b/net/minecraft/server/CommandGamerule.java
@@ -25,7 +25,7 @@
--- a/net/minecraft/server/commands/CommandGamerule.java
+++ b/net/minecraft/server/commands/CommandGamerule.java
@@ -29,7 +29,7 @@
private static <T extends GameRules.GameRuleValue<T>> int b(CommandContext<CommandListenerWrapper> commandcontext, GameRules.GameRuleKey<T> gamerules_gamerulekey) {
CommandListenerWrapper commandlistenerwrapper = (CommandListenerWrapper) commandcontext.getSource();
@@ -9,7 +9,7 @@
t0.b(commandcontext, "value");
commandlistenerwrapper.sendMessage(new ChatMessage("commands.gamerule.set", new Object[]{gamerules_gamerulekey.a(), t0.toString()}), true);
@@ -33,7 +33,7 @@
@@ -37,7 +37,7 @@
}
private static <T extends GameRules.GameRuleValue<T>> int b(CommandListenerWrapper commandlistenerwrapper, GameRules.GameRuleKey<T> gamerules_gamerulekey) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandReload.java
+++ b/net/minecraft/server/CommandReload.java
@@ -36,6 +36,16 @@
--- a/net/minecraft/server/commands/CommandReload.java
+++ b/net/minecraft/server/commands/CommandReload.java
@@ -42,6 +42,16 @@
return collection1;
}
@@ -14,6 +14,6 @@
+ }
+ // CraftBukkit end
+
public static void a(com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> com_mojang_brigadier_commanddispatcher) {
com_mojang_brigadier_commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) CommandDispatcher.a("reload").requires((commandlistenerwrapper) -> {
public static void a(CommandDispatcher<CommandListenerWrapper> commanddispatcher) {
commanddispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) net.minecraft.commands.CommandDispatcher.a("reload").requires((commandlistenerwrapper) -> {
return commandlistenerwrapper.hasPermission(2);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/CommandSpreadPlayers.java
+++ b/net/minecraft/server/CommandSpreadPlayers.java
@@ -61,7 +61,7 @@
--- a/net/minecraft/server/commands/CommandSpreadPlayers.java
+++ b/net/minecraft/server/commands/CommandSpreadPlayers.java
@@ -77,7 +77,7 @@
if (entity instanceof EntityHuman) {
set.add(entity.getScoreboardTeam());
} else {
@@ -9,7 +9,7 @@
}
}
@@ -270,7 +270,7 @@
@@ -286,7 +286,7 @@
for (boolean flag2 = iblockaccess.getType(blockposition_mutableblockposition).isAir(); blockposition_mutableblockposition.getY() > 0; flag2 = flag1) {
blockposition_mutableblockposition.c(EnumDirection.DOWN);
@@ -18,7 +18,7 @@
if (!flag1 && flag2 && flag) {
return blockposition_mutableblockposition.getY() + 1;
}
@@ -283,7 +283,7 @@
@@ -299,7 +299,7 @@
public boolean b(IBlockAccess iblockaccess, int i) {
BlockPosition blockposition = new BlockPosition(this.a, (double) (this.a(iblockaccess, i) - 1), this.b);
@@ -27,7 +27,7 @@
Material material = iblockdata.getMaterial();
return blockposition.getY() < i && !material.isLiquid() && material != Material.FIRE;
@@ -293,5 +293,12 @@
@@ -309,5 +309,12 @@
this.a = MathHelper.a(random, d0, d2);
this.b = MathHelper.a(random, d1, d3);
}

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/CommandTeleport.java
+++ b/net/minecraft/server/CommandTeleport.java
@@ -13,6 +13,12 @@
import java.util.Set;
import javax.annotation.Nullable;
--- a/net/minecraft/server/commands/CommandTeleport.java
+++ b/net/minecraft/server/commands/CommandTeleport.java
@@ -35,6 +35,12 @@
import net.minecraft.world.phys.Vec2F;
import net.minecraft.world.phys.Vec3D;
+// CraftBukkit start
+import org.bukkit.Location;
@@ -13,7 +13,7 @@
public class CommandTeleport {
private static final SimpleCommandExceptionType a = new SimpleCommandExceptionType(new ChatMessage("commands.teleport.invalidPosition"));
@@ -128,9 +134,9 @@
@@ -150,9 +156,9 @@
}
if (worldserver == entity.world) {
@@ -25,7 +25,7 @@
}
entity.setHeadRotation(f);
@@ -139,6 +145,21 @@
@@ -161,6 +167,21 @@
float f3 = MathHelper.g(f1);
f3 = MathHelper.a(f3, -90.0F, 90.0F);

View File

@@ -1,8 +1,8 @@
--- a/net/minecraft/server/CommandTime.java
+++ b/net/minecraft/server/CommandTime.java
@@ -5,6 +5,11 @@
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import java.util.Iterator;
--- a/net/minecraft/server/commands/CommandTime.java
+++ b/net/minecraft/server/commands/CommandTime.java
@@ -10,6 +10,11 @@
import net.minecraft.network.chat.ChatMessage;
import net.minecraft.server.level.WorldServer;
+// CraftBukkit start
+import org.bukkit.Bukkit;
@@ -11,8 +11,8 @@
+
public class CommandTime {
public static void a(com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> com_mojang_brigadier_commanddispatcher) {
@@ -46,7 +51,13 @@
public static void a(CommandDispatcher<CommandListenerWrapper> commanddispatcher) {
@@ -51,7 +56,13 @@
while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next();
@@ -27,7 +27,7 @@
}
commandlistenerwrapper.sendMessage(new ChatMessage("commands.time.set", new Object[]{i}), true);
@@ -59,7 +70,13 @@
@@ -64,7 +75,13 @@
while (iterator.hasNext()) {
WorldServer worldserver = (WorldServer) iterator.next();