mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-27 10:59:16 +00:00
Fix build & diff
This commit is contained in:
@@ -1663,6 +1663,33 @@ index c569074403b1d8b443aaa98ba9cf9bbd0e98bd2d..b1aa7294f9479f45fcde77c5ea46db9f
|
||||
if (hasLineOfSight) {
|
||||
this.seen.add(id);
|
||||
} else {
|
||||
diff --git a/net/minecraft/world/entity/animal/HappyGhast.java b/net/minecraft/world/entity/animal/HappyGhast.java
|
||||
index 24fdfda487bf5348c32707022719ec9907debc80..4e74d5b3076f50f9294553b453f5903ef32f1e8a 100644
|
||||
--- a/net/minecraft/world/entity/animal/HappyGhast.java
|
||||
+++ b/net/minecraft/world/entity/animal/HappyGhast.java
|
||||
@@ -13,8 +13,6 @@ import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.util.Mth;
|
||||
-import net.minecraft.util.profiling.Profiler;
|
||||
-import net.minecraft.util.profiling.ProfilerFiller;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
@@ -379,13 +377,8 @@ public class HappyGhast extends Animal {
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
if (this.isBaby()) {
|
||||
- ProfilerFiller profilerFiller = Profiler.get();
|
||||
- profilerFiller.push("happyGhastBrain");
|
||||
((Brain<HappyGhast>)this.brain).tick(level, this);
|
||||
- profilerFiller.pop();
|
||||
- profilerFiller.push("happyGhastActivityUpdate");
|
||||
HappyGhastAi.updateActivity(this);
|
||||
- profilerFiller.pop();
|
||||
}
|
||||
|
||||
this.checkRestriction();
|
||||
diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
index b7b964bd4e2d611a3e48ece072d5787193077a92..de3bf0b62371f06ecb5d2035638e352ca0c06182 100644
|
||||
--- a/net/minecraft/world/entity/animal/allay/Allay.java
|
||||
@@ -2050,7 +2077,7 @@ index 4a4cc7f9c95d4f4b6ad4948e3ed3504efbbcef15..dd6666bd8b8df4148a1557627ce2a6dd
|
||||
if ((this.tickCount + this.getId()) % 120 == 0) {
|
||||
applyDarknessAround(level, this.position(), this, 20);
|
||||
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
||||
index 98c8653647dc52059d8becfe38a74d4e62edf08f..73214ccad93ccd186c149e8ce8913eb0e3fa324a 100644
|
||||
index 43f16df230f87a43e249a58fc10ef2da517f22ee..532618ae4acd548129006a6c42c62a5b046dbd7e 100644
|
||||
--- a/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -35,8 +35,6 @@ import net.minecraft.stats.Stats;
|
||||
|
||||
@@ -38,14 +38,14 @@ index 383652f0bd32fca3551db85fb6ac42a0e326836e..29466047936ed44f57cb4bcb8f1bff0b
|
||||
// CraftBukkit start
|
||||
if (sync) {
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 898d9ab963a6cf1db8edf4657a65335d15f271c4..8017266123a91e5bd46ae0d39a35cf2e6cbb390f 100644
|
||||
index 898d9ab963a6cf1db8edf4657a65335d15f271c4..77dbd115d99d8f8e2c01ea69ca297ced06b19c12 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -335,6 +335,8 @@ public abstract class PlayerList {
|
||||
return;
|
||||
}
|
||||
|
||||
+ player.didPlayerJoinEvent = true; // Gale - EMC - do not process chat/commands before player has joined
|
||||
+ player.didPlayerJoinEvent = true; // Gale - EMC - do not process chat/commands before player has joined
|
||||
+
|
||||
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
|
||||
|
||||
|
||||
@@ -13,20 +13,21 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index c5ab58c890c7c55f2ad75560269663d3fd5a6aa3..186e0a6e565d29572f5d4771a68e4a9cb2bd45de 100644
|
||||
index b30d4d49edb36cefe6d59bf23440091cb789a6ac..292895796388df9f753c4423fffea35174df5c0b 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -403,7 +403,13 @@ public abstract class PlayerList {
|
||||
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
|
||||
}
|
||||
// Paper end - Configurable player collision
|
||||
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable
|
||||
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), loggableAddress, player.getId(), serverLevel.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
|
||||
+ // Gale start - JettPack - make logging login location configurable
|
||||
+ } else {
|
||||
+ PlayerList.LOGGER.info("{}[{}] logged in with entity id {}", player.getName().getString(), loggableAddress, player.getId());
|
||||
+ }
|
||||
+ // Gale end - JettPack - make logging login location configurable
|
||||
- PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), loggableAddress, player.getId(), serverLevel.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
|
||||
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable
|
||||
+ PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), loggableAddress, player.getId(), serverLevel.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
|
||||
+ // Gale start - JettPack - make logging login location configurable
|
||||
+ } else {
|
||||
+ PlayerList.LOGGER.info("{}[{}] logged in with entity id {}", player.getName().getString(), loggableAddress, player.getId());
|
||||
+ }
|
||||
+ // Gale end - JettPack - make logging login location configurable
|
||||
// Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead
|
||||
if (player.isDeadOrDying()) {
|
||||
net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> plains = serverLevel.registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME)
|
||||
|
||||
@@ -14,19 +14,19 @@ As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 8e7c77174750807bc0e925b100ff73a7bedd76e9..00932be984dae86210329b92c47422c83d670bfb 100644
|
||||
index ec9a9f87615e2130282551f9cc85d339c58bcbb1..0acfb86df4a350e41ea1646a38dad14d43f2cb1d 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -236,6 +236,13 @@ public abstract class PlayerList {
|
||||
org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new org.spigotmc.event.player.PlayerSpawnLocationEvent(spawnPlayer, spawnPlayer.getLocation());
|
||||
this.cserver.getPluginManager().callEvent(ev);
|
||||
|
||||
+ // Gale start - MultiPaper - do not place player in world if kicked before being spawned in
|
||||
+ if (!connection.isConnected() || player.quitReason != null) {
|
||||
+ /*pendingPlayers.remove(player.getUUID(), player);*/ // Gale - MultiPaper - do not place player in world if kicked before being spawned in - this patch was removed from Paper but might be useful later
|
||||
+ return;
|
||||
+ }
|
||||
+ // Gale end - MultiPaper - do not place player in world if kicked before being spawned in
|
||||
+ // Gale start - MultiPaper - do not place player in world if kicked before being spawned in
|
||||
+ if (!connection.isConnected() || player.quitReason != null) {
|
||||
+ /*pendingPlayers.remove(player.getUUID(), player);*/ // Gale - MultiPaper - do not place player in world if kicked before being spawned in - this patch was removed from Paper but might be useful later
|
||||
+ return;
|
||||
+ }
|
||||
+ // Gale end - MultiPaper - do not place player in world if kicked before being spawned in
|
||||
+
|
||||
org.bukkit.Location loc = ev.getSpawnLocation();
|
||||
serverLevel = ((org.bukkit.craftbukkit.CraftWorld) loc.getWorld()).getHandle();
|
||||
|
||||
@@ -1547,7 +1547,7 @@ index dc225eaa0daf238e091a0cf63a42158a30ecb7f0..c61a94a08486cdeba84ccfbc58ef3cab
|
||||
}
|
||||
} catch (AuthenticationUnavailableException var4) {
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 00932be984dae86210329b92c47422c83d670bfb..7fdcdc311e5a3236df0c7d479d0e206e2fa15dd0 100644
|
||||
index 0acfb86df4a350e41ea1646a38dad14d43f2cb1d..0f02eef9bcae59bf3df6471b10dbfa8252337140 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -412,6 +412,7 @@ public abstract class PlayerList {
|
||||
@@ -1555,9 +1555,9 @@ index 00932be984dae86210329b92c47422c83d670bfb..7fdcdc311e5a3236df0c7d479d0e206e
|
||||
}
|
||||
// Paper end - Configurable player collision
|
||||
+ org.purpurmc.purpur.task.BossBarTask.addToAll(player); // Purpur - Implement TPSBar
|
||||
if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable
|
||||
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), loggableAddress, player.getId(), serverLevel.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
|
||||
// Gale start - JettPack - make logging login location configurable
|
||||
if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable
|
||||
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), loggableAddress, player.getId(), serverLevel.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
|
||||
// Gale start - JettPack - make logging login location configurable
|
||||
@@ -525,6 +526,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
public @Nullable net.kyori.adventure.text.Component remove(ServerPlayer player, net.kyori.adventure.text.Component leaveMessage) {
|
||||
@@ -4569,10 +4569,10 @@ index 517c546cfc8eca2191df57289e6a22ac64fc867c..8964bb5098c0dc36741af3656af6bc0b
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/HappyGhast.java b/net/minecraft/world/entity/animal/HappyGhast.java
|
||||
index 24fdfda487bf5348c32707022719ec9907debc80..136b918f053cacbc4fa60b0ed434619c5e07adf5 100644
|
||||
index 4e74d5b3076f50f9294553b453f5903ef32f1e8a..65d4bd89be02973291b85463d242a9b22b1cec5f 100644
|
||||
--- a/net/minecraft/world/entity/animal/HappyGhast.java
|
||||
+++ b/net/minecraft/world/entity/animal/HappyGhast.java
|
||||
@@ -120,6 +120,33 @@ public class HappyGhast extends Animal {
|
||||
@@ -118,6 +118,33 @@ public class HappyGhast extends Animal {
|
||||
this.removeAllGoals(goal -> true);
|
||||
}
|
||||
|
||||
@@ -4606,7 +4606,7 @@ index 24fdfda487bf5348c32707022719ec9907debc80..136b918f053cacbc4fa60b0ed434619c
|
||||
@Override
|
||||
protected void ageBoundaryReached() {
|
||||
if (this.isBaby()) {
|
||||
@@ -143,7 +170,7 @@ public class HappyGhast extends Animal {
|
||||
@@ -141,7 +168,7 @@ public class HappyGhast extends Animal {
|
||||
|
||||
@Override
|
||||
protected float sanitizeScale(float scale) {
|
||||
|
||||
@@ -116,12 +116,12 @@ index 1c75a921695c83ea993d581b5185cf46951361ac..682dd82394ee6e9ad22d5592b2c6e41f
|
||||
this.getCraftPlayer().removeChannel(channel);
|
||||
}
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 2f00e7899c36a2a34f810fc6083846eb3883131f..e547d6c9ee9ad3438cc839389db26a3417cc4ba4 100644
|
||||
index fe44069de549acc81a6037426a405d6fddb87897..0ed45220ce029e5ef538b86f89509f2d2156cbb9 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -346,6 +346,9 @@ public abstract class PlayerList {
|
||||
|
||||
player.didPlayerJoinEvent = true; // Gale - EMC - do not process chat/commands before player has joined
|
||||
player.didPlayerJoinEvent = true; // Gale - EMC - do not process chat/commands before player has joined
|
||||
|
||||
+ if (player.internalConnection == null) player.internalConnection = connection; // Leaf - Leaves - protocol
|
||||
+ org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); // Leaves - protocol
|
||||
|
||||
@@ -177,8 +177,21 @@ index 95c128f028c3cce7d0b37821a6e75208323fb4e9..2cf0fa70ae3d7675cac3cf7a0002097b
|
||||
ServerLevel.this.getWaypointManager().removePlayer(serverPlayer);
|
||||
ServerLevel.this.updateSleepingPlayerList();
|
||||
}
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index 4210089d6ba271ef9d68e18699b1122f07e1946a..8d1571f3db4e7f6c4309b8a46ed0359ecdee85a5 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -216,7 +216,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
private static final boolean DEFAULT_SEEN_CREDITS = false;
|
||||
private static final boolean DEFAULT_SPAWN_EXTRA_PARTICLES_ON_FALL = false;
|
||||
public ServerGamePacketListenerImpl connection;
|
||||
- private final MinecraftServer server;
|
||||
+ public final MinecraftServer server; // Leaves - private -> public
|
||||
public ServerPlayerGameMode gameMode;
|
||||
private final PlayerAdvancements advancements;
|
||||
private final ServerStatsCounter stats;
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 4de0da41eaa71edd0ec7c6829dce424795a63dd8..ca814b82dfb3d4bb04517cf61cb6018c7dd13d79 100644
|
||||
index 418d6970d46b3b592c17f7721ca3ecfd1edce8ad..70d394d8a257390af20bdea5895f7d8a74b16dec 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -131,6 +131,7 @@ public abstract class PlayerList {
|
||||
@@ -275,7 +288,7 @@ index 4de0da41eaa71edd0ec7c6829dce424795a63dd8..ca814b82dfb3d4bb04517cf61cb6018c
|
||||
+ this.server.getCustomBossEvents().onPlayerConnect(player);
|
||||
+ }
|
||||
+
|
||||
+ worldserver1 = player.serverLevel();
|
||||
+ worldserver1 = player.level();
|
||||
+ java.util.Iterator<net.minecraft.world.effect.MobEffectInstance> iterator = player.getActiveEffects().iterator();
|
||||
+ while (iterator.hasNext()) {
|
||||
+ MobEffectInstance mobeffect = iterator.next();
|
||||
@@ -323,7 +336,7 @@ index 4de0da41eaa71edd0ec7c6829dce424795a63dd8..ca814b82dfb3d4bb04517cf61cb6018c
|
||||
|
||||
+ // Leaves start - replay mod api
|
||||
+ public void removePhotographer(org.leavesmc.leaves.replay.ServerPhotographer entityplayer) {
|
||||
+ ServerLevel worldserver = entityplayer.serverLevel();
|
||||
+ ServerLevel worldserver = entityplayer.level();
|
||||
+
|
||||
+ entityplayer.awardStat(Stats.LEAVE_GAME);
|
||||
+
|
||||
|
||||
@@ -9,6 +9,22 @@ Original project: https://github.com/PlazmaMC/PlazmaBukkit
|
||||
Add Pufferfish DAB support for Camel, Sniffer
|
||||
https://github.com/pufferfish-gg/Pufferfish/issues/83
|
||||
|
||||
diff --git a/net/minecraft/world/entity/animal/HappyGhast.java b/net/minecraft/world/entity/animal/HappyGhast.java
|
||||
index 65d4bd89be02973291b85463d242a9b22b1cec5f..80b76c4557020e208eb1224d64fc094f86141363 100644
|
||||
--- a/net/minecraft/world/entity/animal/HappyGhast.java
|
||||
+++ b/net/minecraft/world/entity/animal/HappyGhast.java
|
||||
@@ -401,9 +401,11 @@ public class HappyGhast extends Animal {
|
||||
return HappyGhastAi.makeBrain(this.brainProvider().makeBrain(dynamic));
|
||||
}
|
||||
|
||||
+ private int behaviorTick; // Leaf - Plazma - Add missing Pufferfish configurations
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
if (this.isBaby()) {
|
||||
+ if (this.behaviorTick++ % this.activatedPriority == 0) // Leaf - Plazma - Add missing Pufferfish configurations
|
||||
((Brain<HappyGhast>)this.brain).tick(level, this);
|
||||
HappyGhastAi.updateActivity(this);
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
index b0ce3ab6939cb9e37171bb64e8c5308deb03195e..c520c4e478e3191cea7c2345a2e4c42b67c0762a 100644
|
||||
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
||||
@@ -55,6 +71,22 @@ index a762fc8a4616c4e48e11accdca2129fd47f300e6..08bc21733c08b9df28803b36d3fb17aa
|
||||
this.getBrain().tick(level, this);
|
||||
SnifferAi.updateActivity(this);
|
||||
super.customServerAiStep(level);
|
||||
diff --git a/net/minecraft/world/entity/monster/Zoglin.java b/net/minecraft/world/entity/monster/Zoglin.java
|
||||
index 2a905e8cdf22f9d7f38cc41c1474e80f704d0cb1..385e6d997ea511dd44a7319879baff14addee8bd 100644
|
||||
--- a/net/minecraft/world/entity/monster/Zoglin.java
|
||||
+++ b/net/minecraft/world/entity/monster/Zoglin.java
|
||||
@@ -285,9 +285,10 @@ public class Zoglin extends Monster implements HoglinBase {
|
||||
this.setAggressive(this.brain.hasMemoryValue(MemoryModuleType.ATTACK_TARGET));
|
||||
}
|
||||
|
||||
+ private int behaviorTick; // Leaf - Plazma - Add missing Pufferfish configurations
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
- if (getRider() == null || !this.isControllable()) // Purpur - only use brain if no rider
|
||||
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Purpur - only use brain if no rider // Leaf - Plazma - Add missing Pufferfish configurations
|
||||
this.getBrain().tick(level, this);
|
||||
this.updateActivity();
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/monster/breeze/Breeze.java b/net/minecraft/world/entity/monster/breeze/Breeze.java
|
||||
index d91ce14cc39b1b6ccd558f53ed605d4c6a5acae5..52558a99c915da3c46e5f63bd8014cfcdb38505f 100644
|
||||
--- a/net/minecraft/world/entity/monster/breeze/Breeze.java
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable connection message
|
||||
|
||||
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 04d9501f5496f8557d289c04a818dfc0f91c0d2c..3cf5b85c48c0f77b833e35fcc49fab382565ca4f 100644
|
||||
index e4543611016a648314459144e43565300153f0fe..70bec2fc50c1e6a928e450e617e76dd4434172f9 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -439,7 +439,7 @@ public abstract class PlayerList {
|
||||
@@ -13,7 +13,7 @@ index 04d9501f5496f8557d289c04a818dfc0f91c0d2c..3cf5b85c48c0f77b833e35fcc49fab38
|
||||
player.containerMenu.transferTo(player.containerMenu, bukkitPlayer);
|
||||
|
||||
- org.bukkit.event.player.PlayerJoinEvent playerJoinEvent = new org.bukkit.event.player.PlayerJoinEvent(bukkitPlayer, io.papermc.paper.adventure.PaperAdventure.asAdventure(mutableComponent)); // Paper - Adventure
|
||||
+ org.bukkit.event.player.PlayerJoinEvent playerJoinEvent = new org.bukkit.event.player.PlayerJoinEvent(bukkitPlayer, getJoinMsg(mutableComponent, bukkitPlayer)); // Paper - Adventure // Leaf - Configurable connection message - join message
|
||||
+ org.bukkit.event.player.PlayerJoinEvent playerJoinEvent = new org.bukkit.event.player.PlayerJoinEvent(bukkitPlayer, getJoinMsg(mutableComponent, bukkitPlayer)); // Paper - Adventure // Leaf - Configurable connection message - join message
|
||||
this.cserver.getPluginManager().callEvent(playerJoinEvent);
|
||||
|
||||
if (!player.connection.isAcceptingMessages()) {
|
||||
@@ -22,7 +22,7 @@ index 04d9501f5496f8557d289c04a818dfc0f91c0d2c..3cf5b85c48c0f77b833e35fcc49fab38
|
||||
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
|
||||
|
||||
- if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
|
||||
+ if (org.dreeam.leaf.config.modules.misc.ConnectionMessage.joinEnabled && jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure // Leaf - Configurable connection message - join message
|
||||
+ if (org.dreeam.leaf.config.modules.misc.ConnectionMessage.joinEnabled && jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure // Leaf - Configurable connection message - join message
|
||||
joinMessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(jm); // Paper - Adventure
|
||||
this.server.getPlayerList().broadcastSystemMessage(joinMessage, false); // Paper - Adventure
|
||||
}
|
||||
|
||||
@@ -6,20 +6,20 @@ Subject: [PATCH] Do not place player if the server is full
|
||||
Fix https://github.com/PaperMC/Paper/issues/10668
|
||||
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 3cf5b85c48c0f77b833e35fcc49fab382565ca4f..31cc3575ae6579acf02490476d0e090557e28d95 100644
|
||||
index 70bec2fc50c1e6a928e450e617e76dd4434172f9..3cd9b0df617715d0b3e70a6096e52bb5d22ab426 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -343,6 +343,13 @@ public abstract class PlayerList {
|
||||
return;
|
||||
}
|
||||
// Gale end - MultiPaper - do not place player in world if kicked before being spawned in
|
||||
+ // Leaf start - Do not place player if the server is full - copied from canPlayerLogin
|
||||
+ if (org.dreeam.leaf.config.modules.fixes.DontPlacePlayerIfFull.enabled && this.realPlayers.size() >= this.maxPlayers && !(player.getBukkitEntity().hasPermission("purpur.joinfullserver") || this.canBypassPlayerLimit(gameProfile))) { // Purpur - Allow player join full server by permission // Leaves - only real player
|
||||
+ connection.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.serverFullMessage)));
|
||||
+ //playerconnection.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.serverFullMessage)), org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Leaf end - Do not place player if the server is full - copied from canPlayerLogin
|
||||
return;
|
||||
}
|
||||
// Gale end - MultiPaper - do not place player in world if kicked before being spawned in
|
||||
+ // Leaf start - Do not place player if the server is full - copied from canPlayerLogin
|
||||
+ if (org.dreeam.leaf.config.modules.fixes.DontPlacePlayerIfFull.enabled && this.realPlayers.size() >= this.maxPlayers && !(player.getBukkitEntity().hasPermission("purpur.joinfullserver") || this.canBypassPlayerLimit(gameProfile))) { // Purpur - Allow player join full server by permission // Leaves - only real player
|
||||
+ connection.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.serverFullMessage)));
|
||||
+ //playerconnection.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.serverFullMessage)), org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Leaf end - Do not place player if the server is full - copied from canPlayerLogin
|
||||
|
||||
org.bukkit.Location loc = ev.getSpawnLocation();
|
||||
serverLevel = ((org.bukkit.craftbukkit.CraftWorld) loc.getWorld()).getHandle();
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Fix MC-200418
|
||||
Related MC issue: https://bugs.mojang.com/browse/MC/issues/MC-200418
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/ZombieVillager.java b/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
index 18966860f550ad1f35ec6a03a0b78af73628b964..1c75ba6c5595f0f554df2844663e8e6904055b23 100644
|
||||
index 18966860f550ad1f35ec6a03a0b78af73628b964..22c1545a0329d56e0ec41ae4da1e1922aa1f9737 100644
|
||||
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
@@ -293,6 +293,11 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
|
||||
@@ -14,8 +14,8 @@ index 18966860f550ad1f35ec6a03a0b78af73628b964..1c75ba6c5595f0f554df2844663e8e69
|
||||
level.levelEvent(null, 1027, this.blockPosition(), 0);
|
||||
}
|
||||
+ // Leaf start - Fix MC-200418
|
||||
+ if (villager.isPassenger() && villager.getVehicle() instanceof net.minecraft.world.entity.animal.Chicken && villager.isBaby()) {
|
||||
+ villager.removeVehicle();
|
||||
+ if (mob.isPassenger() && mob.getVehicle() instanceof net.minecraft.world.entity.animal.Chicken && mob.isBaby()) {
|
||||
+ mob.removeVehicle();
|
||||
+ }
|
||||
+ // Leaf end - Fix MC-200418
|
||||
// CraftBukkit start
|
||||
|
||||
@@ -640,7 +640,7 @@ index 3a31f9132a7271ea476cc85c5a10ea7f327256bf..61ccb98e02f30b143226b110d5b5f731
|
||||
// Paper start - extra debug info
|
||||
if (entity.valid) {
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index d6f4c267a819a7ef37a16ad0ea5ad56c12682c33..f1d9fdda9a1d6c0374585fc60ad9354af36efa13 100644
|
||||
index 69d67ad9e8daea33b0ef64aaa04370033a00c265..e5d302609638cbe29d7f379abab612650f9ff010 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -467,6 +467,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
@@ -664,7 +664,7 @@ index d6f4c267a819a7ef37a16ad0ea5ad56c12682c33..f1d9fdda9a1d6c0374585fc60ad9354a
|
||||
return this;
|
||||
} else {
|
||||
+ if (org.dreeam.leaf.config.modules.async.SparklyPaperParallelWorldTicking.enabled) // Leaf - SparklyPaper - parallel world ticking mod (make configurable)
|
||||
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureOnlyTickThread("Cannot change dimension of a player off-main, from world " + serverLevel().getWorld().getName() + " to world " + level.getWorld().getName()); // SparklyPaper - parallel world ticking (additional concurrency issues logs)
|
||||
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureOnlyTickThread("Cannot change dimension of a player off-main, from world " + level().getWorld().getName() + " to world " + level.getWorld().getName()); // SparklyPaper - parallel world ticking (additional concurrency issues logs)
|
||||
// CraftBukkit start
|
||||
/*
|
||||
this.isChangingDimension = true;
|
||||
@@ -694,7 +694,7 @@ index d6f4c267a819a7ef37a16ad0ea5ad56c12682c33..f1d9fdda9a1d6c0374585fc60ad9354a
|
||||
// Paper end - Inventory close reason
|
||||
this.connection.send(new ClientboundContainerClosePacket(this.containerMenu.containerId));
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 31cc3575ae6579acf02490476d0e090557e28d95..42822499ad559bce6734a16056d6e04cef318569 100644
|
||||
index 3cd9b0df617715d0b3e70a6096e52bb5d22ab426..f1002643589f67adce26667b1750a1296c1fb67d 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -251,6 +251,8 @@ public abstract class PlayerList {
|
||||
@@ -731,7 +731,7 @@ index 31cc3575ae6579acf02490476d0e090557e28d95..42822499ad559bce6734a16056d6e04c
|
||||
serverPlayer.connection = player.connection;
|
||||
serverPlayer.restoreFrom(player, keepInventory);
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 2e5d4b8fc6a0ec6692eac63bce13b3f32d3f3e76..602b0ce96cdc8ebd8d875f1dadfc2fdfe6aa0bad 100644
|
||||
index 2e5d4b8fc6a0ec6692eac63bce13b3f32d3f3e76..0e0d87f2c45ac485af326adfec5a1779f06c6d6c 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -3510,15 +3510,40 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -787,7 +787,7 @@ index 2e5d4b8fc6a0ec6692eac63bce13b3f32d3f3e76..602b0ce96cdc8ebd8d875f1dadfc2fdf
|
||||
|
||||
private Entity teleportCrossDimension(ServerLevel oldLevel, ServerLevel newLevel, TeleportTransition teleportTransition) {
|
||||
+ if (org.dreeam.leaf.config.modules.async.SparklyPaperParallelWorldTicking.enabled) // Leaf - SparklyPaper - parallel world ticking mod (make configurable)
|
||||
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(level, "Cannot teleport entity to another world off-main, from world " + this.level.getWorld().getName() + " to world " + level.getWorld().getName()); // SparklyPaper - parallel world ticking (additional concurrency issues logs)
|
||||
+ ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(newLevel, "Cannot teleport entity to another world off-main, from world " + oldLevel.getWorld().getName() + " to world " + newLevel.getWorld().getName()); // SparklyPaper - parallel world ticking (additional concurrency issues logs)
|
||||
List<Entity> passengers = this.getPassengers();
|
||||
List<Entity> list = new ArrayList<>(passengers.size());
|
||||
this.ejectPassengers();
|
||||
@@ -905,7 +905,7 @@ index 3614551856c594f3c0cfee984fcf03fad672b007..f4577f908ca9f279b72d89e5b0822d34
|
||||
});
|
||||
entity.getBrain().eraseMemory(MemoryModuleType.POTENTIAL_JOB_SITE);
|
||||
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
|
||||
index 806f05a24ac37a4f012a931699a99632424a428f..8257c0d5bd7105c34e310b1a4da99b3cc5f02ac2 100644
|
||||
index 377e98469328f08db751c0f6a6f434b03f63c225..743c0c956ddd9e35d3c9c7b45fa8d36490d648dd 100644
|
||||
--- a/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -797,13 +797,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -1291,7 +1291,7 @@ index a22cb810622e0ae97bc2a0d6390d026d9482b783..3e7478e959da3a0191de6c76b80cbb9b
|
||||
}
|
||||
if (event == null || !event.isCancelled()) {
|
||||
diff --git a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
index 5a094257a31f0500278a706a418e1697f8810ffb..d18b29346a44004bba4bac8ffb9d2db05fc65fd6 100644
|
||||
index 5a094257a31f0500278a706a418e1697f8810ffb..dd1343cd1e7fe007ddf47d654653eb2fbf91bcdf 100644
|
||||
--- a/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java
|
||||
@@ -76,6 +76,12 @@ public abstract class BaseContainerBlockEntity extends BlockEntity implements Co
|
||||
@@ -1299,7 +1299,7 @@ index 5a094257a31f0500278a706a418e1697f8810ffb..d18b29346a44004bba4bac8ffb9d2db0
|
||||
|
||||
public static boolean canUnlock(Player player, LockCode code, Component displayName, @Nullable BlockEntity blockEntity) {
|
||||
+ // SparklyPaper - parallel world ticking (see: PARALLEL_NOTES.md - Opening an inventory after a world switch)
|
||||
+ if (org.dreeam.leaf.config.modules.async.SparklyPaperParallelWorldTicking.enabled && player instanceof net.minecraft.server.level.ServerPlayer serverPlayer && blockEntity != null && blockEntity.getLevel() != serverPlayer.serverLevel()) { // Leaf - SparklyPaper - parallel world ticking mod (make configurable)
|
||||
+ if (org.dreeam.leaf.config.modules.async.SparklyPaperParallelWorldTicking.enabled && player instanceof net.minecraft.server.level.ServerPlayer serverPlayer && blockEntity != null && blockEntity.getLevel() != serverPlayer.level()) { // Leaf - SparklyPaper - parallel world ticking mod (make configurable)
|
||||
+ net.minecraft.server.MinecraftServer.LOGGER.warn("Player " + serverPlayer.getScoreboardName() + " (" + serverPlayer.getStringUUID() + ") attempted to open a BlockEntity @ " + blockEntity.getLevel().getWorld().getName() + " " + blockEntity.getBlockPos().getX() + ", " + blockEntity.getBlockPos().getY() + ", " + blockEntity.getBlockPos().getZ() + " while they were in a different world " + serverPlayer.level().getWorld().getName() + " than the block themselves!");
|
||||
+ return false;
|
||||
+ }
|
||||
|
||||
@@ -1064,7 +1064,7 @@ index 6463c3c9b08d6058f2843c225b08a40fc30a960b..98c2b4a298ada4b02afa55f991791d86
|
||||
@Override
|
||||
public boolean canContinueToUse() {
|
||||
diff --git a/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
index f15da598cb1d7872fafb8b173e5134b9667c9a9f..810bddf42d83159ed62ec4876e25fd0ac35683b7 100644
|
||||
index f15da598cb1d7872fafb8b173e5134b9667c9a9f..7a870c4efcb1022790f9baf1bac0f3c0b3c29eb3 100644
|
||||
--- a/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
@@ -41,8 +41,60 @@ public abstract class MoveToBlockGoal extends Goal {
|
||||
@@ -1075,7 +1075,7 @@ index f15da598cb1d7872fafb8b173e5134b9667c9a9f..810bddf42d83159ed62ec4876e25fd0a
|
||||
+ protected boolean poll() {
|
||||
+ if (!(this.mob.getGoalCtx().result() instanceof BlockPos blockPos1)) return false;
|
||||
+ if (!this.mob.level().hasChunkAt(blockPos1)
|
||||
+ || !this.mob.isWithinRestriction(blockPos1)
|
||||
+ || !this.mob.isWithinHome(blockPos1)
|
||||
+ || !this.isValidTarget(this.mob.level(), blockPos1)) {
|
||||
+ return false;
|
||||
+ }
|
||||
@@ -1100,9 +1100,9 @@ index f15da598cb1d7872fafb8b173e5134b9667c9a9f..810bddf42d83159ed62ec4876e25fd0a
|
||||
+ final int searchRange = this.searchRange;
|
||||
+ final int verticalSearchRange = this.verticalSearchRange;
|
||||
+ final BlockPos blockPos = mob.blockPosition();
|
||||
+ final float restrictRadius = mob.getRestrictRadius();
|
||||
+ final BlockPos restrictCenter = mob.getRestrictCenter();
|
||||
+ ctx.wake = () -> findNearestBlockAsync(ty, toRemove, mob, serverLevel, verticalSearchStart, searchRange, verticalSearchRange, blockPos, restrictRadius, restrictCenter);
|
||||
+ final float homeRadius = mob.getHomeRadius();
|
||||
+ final BlockPos homePosition = mob.getHomePosition();
|
||||
+ ctx.wake = () -> findNearestBlockAsync(ty, toRemove, mob, serverLevel, verticalSearchStart, searchRange, verticalSearchRange, blockPos, homeRadius, homePosition);
|
||||
+ }
|
||||
+
|
||||
+ protected enum TypeToCheck {
|
||||
@@ -1155,8 +1155,8 @@ index f15da598cb1d7872fafb8b173e5134b9667c9a9f..810bddf42d83159ed62ec4876e25fd0a
|
||||
+ final int searchRange,
|
||||
+ final int verticalSearchRange,
|
||||
+ final BlockPos blockPos,
|
||||
+ final float restrictRadius,
|
||||
+ final BlockPos restrictCenter
|
||||
+ final float homeRadius,
|
||||
+ final BlockPos homePosition
|
||||
+ ) {
|
||||
+ BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
|
||||
+ for (int i2 = verticalSearchStart; i2 <= verticalSearchRange; i2 = i2 > 0 ? -i2 : 1 - i2) {
|
||||
@@ -1165,7 +1165,7 @@ index f15da598cb1d7872fafb8b173e5134b9667c9a9f..810bddf42d83159ed62ec4876e25fd0a
|
||||
+ for (int i5 = i4 < i3 && i4 > -i3 ? i3 : 0; i5 <= i3; i5 = i5 > 0 ? -i5 : 1 - i5) {
|
||||
+ mutableBlockPos.setWithOffset(blockPos, i4, i2 - 1, i5);
|
||||
+ if (!serverLevel.hasChunkAt(mutableBlockPos)) continue;
|
||||
+ if (isWithinRestriction(restrictRadius, restrictCenter, mutableBlockPos)
|
||||
+ if (isWithinHome(homeRadius, homePosition, mutableBlockPos)
|
||||
+ && isValidTargetAsync(ty, toRemove, mob, serverLevel, mutableBlockPos)) {
|
||||
+ return mutableBlockPos.immutable();
|
||||
+ }
|
||||
@@ -1176,8 +1176,8 @@ index f15da598cb1d7872fafb8b173e5134b9667c9a9f..810bddf42d83159ed62ec4876e25fd0a
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ private static boolean isWithinRestriction(float restrictRadius, BlockPos restrictCenter, BlockPos pos) {
|
||||
+ return restrictRadius == -1.0F || restrictCenter.distSqr(pos) < restrictRadius * restrictRadius;
|
||||
+ private static boolean isWithinHome(float homeRadius, BlockPos homePosition, BlockPos pos) {
|
||||
+ return homeRadius == -1.0F || homePosition.distSqr(pos) < homeRadius * homeRadius;
|
||||
+ }
|
||||
+ // Leaf end - Async search block
|
||||
+
|
||||
|
||||
@@ -82,7 +82,7 @@ public class AppleSkinProtocol implements LeavesProtocol {
|
||||
}
|
||||
|
||||
case "natural_regeneration" -> {
|
||||
boolean regeneration = player.serverLevel().getGameRules().getBoolean(GameRules.RULE_NATURAL_REGENERATION);
|
||||
boolean regeneration = player.level().getGameRules().getBoolean(GameRules.RULE_NATURAL_REGENERATION);
|
||||
Boolean previousRegeneration = previousNaturalRegeneration.get(player);
|
||||
if (previousRegeneration == null || regeneration != previousRegeneration) {
|
||||
ProtocolUtils.sendBytebufPacket(player, NATURAL_REGENERATION_KEY, buf -> buf.writeBoolean(regeneration));
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.network.codec.StreamCodec;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerData;
|
||||
import net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.leavesmc.leaves.protocol.jade.JadeProtocol;
|
||||
@@ -21,7 +21,7 @@ public enum MobSpawnerCooldownProvider implements StreamServerDataProvider<Block
|
||||
@Override
|
||||
public @Nullable Integer streamData(@NotNull BlockAccessor accessor) {
|
||||
TrialSpawnerBlockEntity spawner = (TrialSpawnerBlockEntity) accessor.getBlockEntity();
|
||||
TrialSpawnerData spawnerData = spawner.getTrialSpawner().getData();
|
||||
TrialSpawnerStateData spawnerData = spawner.getTrialSpawner().getStateData();
|
||||
ServerLevel level = ((ServerLevel) accessor.getLevel());
|
||||
if (spawner.getTrialSpawner().canSpawnInLevel(level) && level.getGameTime() < spawnerData.cooldownEndsAt) {
|
||||
return (int) (spawnerData.cooldownEndsAt - level.getGameTime());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.leavesmc.leaves.replay;
|
||||
|
||||
import com.mojang.serialization.DynamicOps;
|
||||
import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.local.LocalChannel;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.core.LayeredRegistryAccess;
|
||||
@@ -9,7 +10,6 @@ import net.minecraft.nbt.NbtOps;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.ConnectionProtocol;
|
||||
import net.minecraft.network.PacketSendListener;
|
||||
import net.minecraft.network.protocol.BundlePacket;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.protocol.PacketFlow;
|
||||
@@ -87,7 +87,7 @@ public class Recorder extends Connection {
|
||||
metaData.singleplayer = false;
|
||||
metaData.serverName = recorderOption.serverName;
|
||||
metaData.date = startTime;
|
||||
metaData.mcversion = SharedConstants.getCurrentVersion().getName();
|
||||
metaData.mcversion = SharedConstants.getCurrentVersion().name();
|
||||
|
||||
// TODO start event
|
||||
this.savePacket(new ClientboundLoginFinishedPacket(photographer.getGameProfile()), ConnectionProtocol.LOGIN);
|
||||
@@ -169,7 +169,7 @@ public class Recorder extends Connection {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void send(@NotNull Packet<?> packet, @Nullable PacketSendListener callbacks, boolean flush) {
|
||||
public void send(@NotNull Packet<?> packet, @Nullable ChannelFutureListener callbacks, boolean flush) {
|
||||
if (!stopped) {
|
||||
if (packet instanceof BundlePacket<?> packet1) {
|
||||
packet1.subPackets().forEach(subPacket -> send(subPacket, null));
|
||||
|
||||
@@ -111,7 +111,7 @@ public class ReplayFile {
|
||||
public void saveMetaData(@NotNull RecordMetaData data) throws IOException {
|
||||
data.fileFormat = "MCPR";
|
||||
data.fileFormatVersion = RecordMetaData.CURRENT_FILE_FORMAT_VERSION;
|
||||
data.protocol = SharedConstants.getCurrentVersion().getProtocolVersion();
|
||||
data.protocol = SharedConstants.getCurrentVersion().protocolVersion();
|
||||
data.generator = ProtocolUtils.buildProtocolVersion("replay");
|
||||
|
||||
try (Writer writer = new OutputStreamWriter(new FileOutputStream(metaFile), StandardCharsets.UTF_8)) {
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ServerPhotographer extends ServerPlayer {
|
||||
|
||||
photographer.recorder.start();
|
||||
MinecraftServer.getServer().getPlayerList().placeNewPhotographer(photographer.recorder, photographer, world);
|
||||
photographer.serverLevel().chunkSource.move(photographer);
|
||||
photographer.level().chunkSource.move(photographer);
|
||||
photographer.setInvisible(true);
|
||||
photographers.add(photographer);
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ServerPhotographer extends ServerPlayer {
|
||||
|
||||
if (this.server.getTickCount() % 10 == 0) {
|
||||
connection.resetPosition();
|
||||
this.serverLevel().chunkSource.move(this);
|
||||
this.level().chunkSource.move(this);
|
||||
}
|
||||
|
||||
if (this.followPlayer != null) {
|
||||
|
||||
Reference in New Issue
Block a user