Fix even more errors
This commit is contained in:
parent
3773770230
commit
7d7779a667
|
@ -1822,7 +1822,7 @@ index 595b56b2ab9a813ba71399d306117294fa90dc65..3527d40102d512d0e276edc969ea3c18
|
|||
}
|
||||
collection = icons;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index daf5dc59a1883570569798630c4991e676e34c1c..5408ba255ee04b75e2f4977fc7aa73866945037c 100644
|
||||
index daf5dc59a1883570569798630c4991e676e34c1c..d3d8935bafb2e0773c96c5807ebd23f20de26592 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -581,8 +581,10 @@ public final class CraftServer implements Server {
|
||||
|
@ -1941,7 +1941,7 @@ index daf5dc59a1883570569798630c4991e676e34c1c..5408ba255ee04b75e2f4977fc7aa7386
|
|||
+ // Paper start
|
||||
+ @Override
|
||||
+ public net.kyori.adventure.text.Component motd() {
|
||||
+ return io.papermc.paper.adventure.PaperAdventure.asAdventure(new net.minecraft.network.chat.TextComponent(console.getMotd()));
|
||||
+ return io.papermc.paper.adventure.PaperAdventure.asAdventure(net.minecraft.network.chat.Component.literal(console.getMotd()));
|
||||
+ }
|
||||
+ // Paper end
|
||||
@Override
|
||||
|
@ -2472,7 +2472,7 @@ index 446fdca49a5a6999626a7ee3a1d5c168b15a09dd..f9863e138994f6c7a7975a852f106faa
|
|||
public boolean isOp() {
|
||||
return true;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 765659b39d30e2e5c491c0808fe1808776ea767b..fd29be7680b601572c97889dbc780a7f179ab831 100644
|
||||
index 765659b39d30e2e5c491c0808fe1808776ea767b..1b881118457da8f51fb579a4298927f41eb0bbe6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -270,14 +270,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
@ -2827,9 +2827,9 @@ index 765659b39d30e2e5c491c0808fe1808776ea767b..fd29be7680b601572c97889dbc780a7f
|
|||
+ final ResourceLocation name = io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.name());
|
||||
+ final java.util.Optional<net.minecraft.sounds.SoundEvent> event = net.minecraft.core.Registry.SOUND_EVENT.getOptional(name);
|
||||
+ if (event.isPresent()) {
|
||||
+ this.getHandle().connection.send(new ClientboundSoundPacket(event.get(), io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), x, y, z, sound.volume(), sound.pitch(), this.getHandle().getRandom().nextLong()));
|
||||
+ this.getHandle().connection.send(new ClientboundSoundPacket(event.get(), io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), x, y, z, sound.volume(), sound.pitch(), this.getHandle().getRandom().nextLong())); // TODO adventure sound seed
|
||||
+ } else {
|
||||
+ this.getHandle().connection.send(new ClientboundCustomSoundPacket(name, io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), new Vec3(x, y, z), sound.volume(), sound.pitch(), this.getHandle().getRandom().nextLong()));
|
||||
+ this.getHandle().connection.send(new ClientboundCustomSoundPacket(name, io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), new Vec3(x, y, z), sound.volume(), sound.pitch(), this.getHandle().getRandom().nextLong())); // TODO adventure sound seed
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
@ -2847,9 +2847,9 @@ index 765659b39d30e2e5c491c0808fe1808776ea767b..fd29be7680b601572c97889dbc780a7f
|
|||
+ final ResourceLocation name = io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.name());
|
||||
+ final java.util.Optional<net.minecraft.sounds.SoundEvent> event = net.minecraft.core.Registry.SOUND_EVENT.getOptional(name);
|
||||
+ if (event.isPresent()) {
|
||||
+ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSoundEntityPacket(event.get(), io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), entity, sound.volume(), sound.pitch(), this.getHandle().getRandom().nextLong()));
|
||||
+ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSoundEntityPacket(event.get(), io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), entity, sound.volume(), sound.pitch(), this.getHandle().getRandom().nextLong())); // TODO adventure sound seed
|
||||
+ } else {
|
||||
+ this.getHandle().connection.send(new ClientboundCustomSoundPacket(name, io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), entity.position(), sound.volume(), sound.pitch(), this.getHandle().getRandom().nextLong()));
|
||||
+ this.getHandle().connection.send(new ClientboundCustomSoundPacket(name, io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.source()), entity.position(), sound.volume(), sound.pitch(), this.getHandle().getRandom().nextLong())); // TODO adventure sound seed
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] ProfileWhitelistVerifyEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 41924db9df7d3d9df0385d3274894ef8058cf2c6..a9821199bd953ad5d16ed663f367556b099e999a 100644
|
||||
index 41924db9df7d3d9df0385d3274894ef8058cf2c6..fe1636a73f1af09314a200b99c196984d09a4b4a 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -619,9 +619,9 @@ public abstract class PlayerList {
|
||||
|
@ -21,16 +21,15 @@ index 41924db9df7d3d9df0385d3274894ef8058cf2c6..a9821199bd953ad5d16ed663f367556b
|
|||
} else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) {
|
||||
IpBanListEntry ipbanentry = this.ipBans.get(socketaddress);
|
||||
|
||||
@@ -1002,9 +1002,25 @@ public abstract class PlayerList {
|
||||
this.server.getCommands().sendCommands(player);
|
||||
@@ -1003,7 +1003,23 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
public boolean isWhiteListed(GameProfile profile) {
|
||||
- return !this.doWhiteList || this.ops.contains(profile) || this.whitelist.contains(profile);
|
||||
+ return isWhitelisted(profile, null);
|
||||
+ // Paper start
|
||||
+ return isWhiteListed(profile, null);
|
||||
+ }
|
||||
+ public boolean isWhitelisted(GameProfile gameprofile, org.bukkit.event.player.PlayerLoginEvent loginEvent) {
|
||||
+ public boolean isWhiteListed(GameProfile gameprofile, org.bukkit.event.player.PlayerLoginEvent loginEvent) {
|
||||
+ boolean isOp = this.ops.contains(gameprofile);
|
||||
+ boolean isWhitelisted = !this.doWhiteList || isOp || this.whitelist.contains(gameprofile);
|
||||
+ final com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent event;
|
||||
|
@ -43,8 +42,7 @@ index 41924db9df7d3d9df0385d3274894ef8058cf2c6..a9821199bd953ad5d16ed663f367556b
|
|||
+ return false;
|
||||
+ }
|
||||
+ return true;
|
||||
}
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
public boolean isOp(GameProfile profile) {
|
||||
return this.ops.contains(profile) || this.server.isSingleplayerOwner(profile) && this.server.getWorldData().getAllowCommands() || this.allowCheatsForAllPlayers;
|
||||
|
|
|
@ -190,7 +190,7 @@ index 67455a5ba75c9b816213e44d6872c5ddf8e27e98..23efad80934930beadf15e65781551d4
|
|||
|
||||
public ClientboundStatusResponsePacket(ServerStatus metadata) {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index f67392be663dd558ce6458dc210c6ac90538d9e5..661ee126886691cbd6db1a6e08ec6ab402698a76 100644
|
||||
index 64a6f488be70dafc09c8d713aa4d9edd4a70177a..b031d4340dbee22108f8cbc15729337c50160a29 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2,6 +2,9 @@ package net.minecraft.server;
|
||||
|
@ -203,7 +203,7 @@ index f67392be663dd558ce6458dc210c6ac90538d9e5..661ee126886691cbd6db1a6e08ec6ab4
|
|||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
@@ -1312,7 +1315,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1308,7 +1311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.lastServerStatus = i;
|
||||
this.status.setPlayers(new ServerStatus.Players(this.getMaxPlayers(), this.getPlayerCount()));
|
||||
if (!this.hidesOnlinePlayers()) {
|
||||
|
|
|
@ -24,7 +24,7 @@ index 5c73ee9b2d3328c9174db067ce674401d7ff5dc9..136ff7de4ffb91d3fc84a90560a2f5db
|
|||
playerName = gameProfile.getName();
|
||||
uniqueId = gameProfile.getId();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 3352880b06a25b90b338dc15c99e9df08caa86dc..e976dc1020d50e669d856951354e82977ad3d8ee 100644
|
||||
index 67ef5832f475894feea4345b50fbbdd3a02c8ea1..b666b1a52d35b2092f8095f7257fd1581f6766d9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -76,6 +76,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
|
@ -129,7 +129,7 @@ index 3352880b06a25b90b338dc15c99e9df08caa86dc..e976dc1020d50e669d856951354e8297
|
|||
+
|
||||
+ //Respawn the player then update their position and selected slot
|
||||
+ ServerLevel worldserver = handle.getLevel();
|
||||
+ connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionTypeRegistration(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), true));
|
||||
+ connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), true, this.getHandle().getLastDeathLocation()));
|
||||
+ handle.onUpdateAbilities();
|
||||
+ connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet(), 0, false));
|
||||
+ net.minecraft.server.MinecraftServer.getServer().getPlayerList().sendAllPlayerInfo(handle);
|
||||
|
|
Loading…
Reference in New Issue