mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-04-19 17:58:15 +02:00
prep for update
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
--- a/paper-server/build.gradle.kts
|
--- a/paper-server/build.gradle.kts
|
||||||
+++ b/paper-server/build.gradle.kts
|
+++ b/paper-server/build.gradle.kts
|
||||||
@@ -2,6 +_,7 @@
|
@@ -2,6 +_,8 @@
|
||||||
import io.papermc.paperweight.attribute.DevBundleOutput
|
import io.papermc.paperweight.attribute.DevBundleOutput
|
||||||
import io.papermc.paperweight.util.*
|
import io.papermc.paperweight.util.*
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
|
+import kotlin.io.path.createParentDirectories
|
||||||
+import kotlin.io.path.writeText
|
+import kotlin.io.path.writeText
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
@@ -116,7 +117,7 @@
|
|||||||
project("paper")
|
project("paper")
|
||||||
versionFamily(paperweight.minecraftVersion.map { it.split(".", "-").takeWhile { part -> part.toIntOrNull() != null }.take(2).joinToString(".") })
|
versionFamily(paperweight.minecraftVersion.map { it.split(".", "-").takeWhile { part -> part.toIntOrNull() != null }.take(2).joinToString(".") })
|
||||||
version(paperweight.minecraftVersion)
|
version(paperweight.minecraftVersion)
|
||||||
@@ -371,4 +_,44 @@
|
@@ -371,4 +_,47 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,6 +130,9 @@
|
|||||||
+// val patchDir = project.rootDir.resolve("purpur-server/minecraft-patches/sources").convertToPath().cleanDir()
|
+// val patchDir = project.rootDir.resolve("purpur-server/minecraft-patches/sources").convertToPath().cleanDir()
|
||||||
+// val inputDir = this.project.rootDir.resolve("purpur-server/src/minecraft/java").convertToPath()
|
+// val inputDir = this.project.rootDir.resolve("purpur-server/src/minecraft/java").convertToPath()
|
||||||
+//
|
+//
|
||||||
|
+// //val patchDir = project.rootDir.resolve("purpur-server/paper-patches/files").convertToPath().cleanDir()
|
||||||
|
+// //val inputDir = this.project.rootDir.resolve("paper-server").convertToPath()
|
||||||
|
+//
|
||||||
+// val git = Git(inputDir)
|
+// val git = Git(inputDir)
|
||||||
+// git("stash", "push").executeSilently(silenceErr = true)
|
+// git("stash", "push").executeSilently(silenceErr = true)
|
||||||
+// git("checkout", "file").executeSilently(silenceErr = true)
|
+// git("checkout", "file").executeSilently(silenceErr = true)
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
--- a/net/minecraft/gametest/framework/GameTestHelper.java
|
|
||||||
+++ b/net/minecraft/gametest/framework/GameTestHelper.java
|
|
||||||
@@ -322,6 +_,8 @@
|
|
||||||
return gameType;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ public void setAfk(final boolean afk) {} // Purpur - AFK API
|
|
||||||
+
|
|
||||||
@Override
|
|
||||||
public boolean isClientAuthoritative() {
|
|
||||||
return false;
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
--- a/net/minecraft/world/entity/ai/attributes/RangedAttribute.java
|
|
||||||
+++ b/net/minecraft/world/entity/ai/attributes/RangedAttribute.java
|
|
||||||
@@ -29,6 +_,7 @@
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double sanitizeValue(double value) {
|
|
||||||
+ if (!org.purpurmc.purpur.PurpurConfig.clampAttributes) return Double.isNaN(value) ? this.minValue : value; // Purpur - Add attribute clamping and armor limit config
|
|
||||||
return Double.isNaN(value) ? this.minValue : Mth.clamp(value, this.minValue, this.maxValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
--- a/net/minecraft/world/inventory/ItemCombinerMenu.java
|
|
||||||
+++ b/net/minecraft/world/inventory/ItemCombinerMenu.java
|
|
||||||
@@ -156,7 +_,9 @@
|
|
||||||
return ItemStack.EMPTY;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ this.activeQuickItem = itemStack; // Purpur - Anvil API
|
|
||||||
slot.onTake(player, item);
|
|
||||||
+ this.activeQuickItem = null; // Purpur - Anvil API
|
|
||||||
}
|
|
||||||
|
|
||||||
return itemStack;
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
--- a/net/minecraft/world/item/ProjectileWeaponItem.java
|
|
||||||
+++ b/net/minecraft/world/item/ProjectileWeaponItem.java
|
|
||||||
@@ -106,6 +_,8 @@
|
|
||||||
abstractArrow.setCritArrow(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ abstractArrow.setActualEnchantments(weapon.getEnchantments()); // Purpur - Add an option to fix MC-3304 projectile looting
|
|
||||||
+
|
|
||||||
return abstractArrow;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
--- a/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
|
|
||||||
+++ b/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java
|
|
||||||
@@ -39,6 +_,7 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static boolean scanForWater(BlockState state, BlockGetter level, BlockPos pos) {
|
|
||||||
+ if (!((net.minecraft.world.level.LevelAccessor) level).getMinecraftWorld().purpurConfig.coralDieOutsideWater) return true; // Purpur - Config to not let coral die
|
|
||||||
if (state.getValue(WATERLOGGED)) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
--- a/net/minecraft/world/level/block/BigDripleafBlock.java
|
|
||||||
+++ b/net/minecraft/world/level/block/BigDripleafBlock.java
|
|
||||||
@@ -251,7 +_,7 @@
|
|
||||||
playTiltSound(level, pos, sound);
|
|
||||||
}
|
|
||||||
|
|
||||||
- int _int = DELAY_UNTIL_NEXT_TILT_STATE.getInt(tilt);
|
|
||||||
+ int _int = level.purpurConfig.bigDripleafTiltDelay.getOrDefault(tilt, -1); // Purpur - Big dripleaf tilt delay
|
|
||||||
if (_int != -1) {
|
|
||||||
level.scheduleTick(pos, this, _int);
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
--- a/net/minecraft/world/level/block/DragonEggBlock.java
|
|
||||||
+++ b/net/minecraft/world/level/block/DragonEggBlock.java
|
|
||||||
@@ -46,6 +_,7 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
private void teleport(BlockState state, Level level, BlockPos pos) {
|
|
||||||
+ if (!level.purpurConfig.dragonEggTeleport) return; // Purpur - Option to disable dragon egg teleporting
|
|
||||||
WorldBorder worldBorder = level.getWorldBorder();
|
|
||||||
|
|
||||||
for (int i = 0; i < 1000; i++) {
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
--- a/net/minecraft/world/level/block/HayBlock.java
|
|
||||||
+++ b/net/minecraft/world/level/block/HayBlock.java
|
|
||||||
@@ -23,6 +_,6 @@
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void fallOn(Level level, BlockState state, BlockPos pos, Entity entity, double fallDistance) {
|
|
||||||
- entity.causeFallDamage(fallDistance, 0.2F, level.damageSources().fall());
|
|
||||||
+ super.fallOn(level, state, pos, entity, fallDistance); // Purpur - Configurable block fall damage modifiers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
--- a/net/minecraft/world/level/block/KelpBlock.java
|
|
||||||
+++ b/net/minecraft/world/level/block/KelpBlock.java
|
|
||||||
@@ -71,4 +_,11 @@
|
|
||||||
protected FluidState getFluidState(BlockState state) {
|
|
||||||
return Fluids.WATER.getSource(false);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // Purpur start - kelp vines configurable max growth age
|
|
||||||
+ @Override
|
|
||||||
+ public int getMaxGrowthAge() {
|
|
||||||
+ return org.purpurmc.purpur.PurpurConfig.kelpMaxGrowthAge;
|
|
||||||
+ }
|
|
||||||
+ // Purpur end - kelp vines configurable max growth age
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
|
index c18823746ab2edcab536cb1589b7720e3af07e0f..bc62da127a01b33ce8fc0f958bc232d6287d57ec 100644
|
||||||
--- a/io/papermc/paper/entity/activation/ActivationRange.java
|
--- a/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
|
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
|
||||||
@@ -147,6 +_,8 @@
|
@@ -147,6 +147,8 @@ public final class ActivationRange {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
final int worldHeight = world.getHeight();
|
final int worldHeight = world.getHeight();
|
||||||
ActivationRange.maxBB = player.getBoundingBox().inflate(maxRange, worldHeight, maxRange);
|
ActivationRange.maxBB = player.getBoundingBox().inflate(maxRange, worldHeight, maxRange);
|
||||||
ActivationType.MISC.boundingBox = player.getBoundingBox().inflate(miscActivationRange, worldHeight, miscActivationRange);
|
ActivationType.MISC.boundingBox = player.getBoundingBox().inflate(miscActivationRange, worldHeight, miscActivationRange);
|
||||||
@@ -288,6 +_,7 @@
|
@@ -288,6 +290,7 @@ public final class ActivationRange {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static boolean checkIfActive(final Entity entity) {
|
public static boolean checkIfActive(final Entity entity) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/CrashReport.java b/net/minecraft/CrashReport.java
|
||||||
|
index ad10eda79e6b76fc1896b4cdb27546b515d1cfa4..2c60f1d955b17cbc79b5372c536e5463f6c0a186 100644
|
||||||
--- a/net/minecraft/CrashReport.java
|
--- a/net/minecraft/CrashReport.java
|
||||||
+++ b/net/minecraft/CrashReport.java
|
+++ b/net/minecraft/CrashReport.java
|
||||||
@@ -30,6 +_,7 @@
|
@@ -30,6 +30,7 @@ public class CrashReport {
|
||||||
private boolean trackingStackTrace = true;
|
private boolean trackingStackTrace = true;
|
||||||
private StackTraceElement[] uncategorizedStackTrace = new StackTraceElement[0];
|
private StackTraceElement[] uncategorizedStackTrace = new StackTraceElement[0];
|
||||||
private final SystemReport systemReport = new SystemReport();
|
private final SystemReport systemReport = new SystemReport();
|
||||||
@@ -8,7 +16,7 @@
|
|||||||
|
|
||||||
public CrashReport(String title, Throwable exception) {
|
public CrashReport(String title, Throwable exception) {
|
||||||
this.title = title;
|
this.title = title;
|
||||||
@@ -129,7 +_,7 @@
|
@@ -129,7 +130,7 @@ public class CrashReport {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFriendlyReport(ReportType type) {
|
public String getFriendlyReport(ReportType type) {
|
||||||
@@ -17,7 +25,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable Path getSaveFile() {
|
public @Nullable Path getSaveFile() {
|
||||||
@@ -159,7 +_,7 @@
|
@@ -159,7 +160,7 @@ public class CrashReport {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean saveToFile(Path path, ReportType type) {
|
public boolean saveToFile(Path path, ReportType type) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/commands/CommandSourceStack.java b/net/minecraft/commands/CommandSourceStack.java
|
||||||
|
index 566304106fd4f1c677a56e7c66282d1570e7b974..21d135189a4d67605e0dfb991283d48268ce5d5c 100644
|
||||||
--- a/net/minecraft/commands/CommandSourceStack.java
|
--- a/net/minecraft/commands/CommandSourceStack.java
|
||||||
+++ b/net/minecraft/commands/CommandSourceStack.java
|
+++ b/net/minecraft/commands/CommandSourceStack.java
|
||||||
@@ -430,6 +_,19 @@
|
@@ -430,6 +430,19 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@@ -20,11 +28,10 @@
|
|||||||
public Vec3 getPosition() {
|
public Vec3 getPosition() {
|
||||||
return this.worldPosition;
|
return this.worldPosition;
|
||||||
}
|
}
|
||||||
@@ -512,6 +_,30 @@
|
@@ -513,6 +526,30 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // Purpur start - Purpur config files
|
+ // Purpur start - Purpur config files
|
||||||
+ public void sendSuccess(@Nullable String message) {
|
+ public void sendSuccess(@Nullable String message) {
|
||||||
+ sendSuccess(message, false);
|
+ sendSuccess(message, false);
|
||||||
@@ -48,6 +55,7 @@
|
|||||||
+ sendSuccess(() -> io.papermc.paper.adventure.PaperAdventure.asVanilla(message), broadcastToOps);
|
+ sendSuccess(() -> io.papermc.paper.adventure.PaperAdventure.asVanilla(message), broadcastToOps);
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end - Purpur config files
|
+ // Purpur end - Purpur config files
|
||||||
|
+
|
||||||
public void sendSuccess(Supplier<Component> messageSupplier, boolean allowLogging) {
|
public void sendSuccess(Supplier<Component> messageSupplier, boolean allowLogging) {
|
||||||
boolean flag = this.source.acceptsSuccess() && !this.silent;
|
boolean flag = this.source.acceptsSuccess() && !this.silent;
|
||||||
|
boolean flag1 = allowLogging && this.source.shouldInformAdmins() && !this.silent;
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
|
||||||
|
index 668eb52d71d77f75c24d4840be9a6c49d96dfc34..83148f756ecc77ae45abffbd1d7cbfacf6c99e7f 100644
|
||||||
--- a/net/minecraft/commands/Commands.java
|
--- a/net/minecraft/commands/Commands.java
|
||||||
+++ b/net/minecraft/commands/Commands.java
|
+++ b/net/minecraft/commands/Commands.java
|
||||||
@@ -265,11 +_,11 @@
|
@@ -265,11 +265,11 @@ public class Commands {
|
||||||
JfrCommand.register(this.dispatcher);
|
JfrCommand.register(this.dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14,7 +22,7 @@
|
|||||||
RaidCommand.register(this.dispatcher, context);
|
RaidCommand.register(this.dispatcher, context);
|
||||||
DebugPathCommand.register(this.dispatcher);
|
DebugPathCommand.register(this.dispatcher);
|
||||||
DebugMobSpawningCommand.register(this.dispatcher);
|
DebugMobSpawningCommand.register(this.dispatcher);
|
||||||
@@ -297,6 +_,14 @@
|
@@ -297,6 +297,14 @@ public class Commands {
|
||||||
StopCommand.register(this.dispatcher);
|
StopCommand.register(this.dispatcher);
|
||||||
TransferCommand.register(this.dispatcher);
|
TransferCommand.register(this.dispatcher);
|
||||||
WhitelistCommand.register(this.dispatcher);
|
WhitelistCommand.register(this.dispatcher);
|
||||||
@@ -29,7 +37,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (selection.includeIntegrated) {
|
if (selection.includeIntegrated) {
|
||||||
@@ -522,6 +_,7 @@
|
@@ -522,6 +530,7 @@ public class Commands {
|
||||||
private void runSync(ServerPlayer player, java.util.Collection<String> bukkit, RootCommandNode<CommandSourceStack> rootCommandNode) {
|
private void runSync(ServerPlayer player, java.util.Collection<String> bukkit, RootCommandNode<CommandSourceStack> rootCommandNode) {
|
||||||
// Paper end - Perf: Async command map building
|
// Paper end - Perf: Async command map building
|
||||||
new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent<CommandSourceStack>(player.getBukkitEntity(), (RootCommandNode) rootCommandNode, true).callEvent(); // Paper - Brigadier API
|
new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent<CommandSourceStack>(player.getBukkitEntity(), (RootCommandNode) rootCommandNode, true).callEvent(); // Paper - Brigadier API
|
||||||
@@ -37,7 +45,7 @@
|
|||||||
org.bukkit.event.player.PlayerCommandSendEvent event = new org.bukkit.event.player.PlayerCommandSendEvent(player.getBukkitEntity(), new java.util.LinkedHashSet<>(bukkit));
|
org.bukkit.event.player.PlayerCommandSendEvent event = new org.bukkit.event.player.PlayerCommandSendEvent(player.getBukkitEntity(), new java.util.LinkedHashSet<>(bukkit));
|
||||||
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
@@ -532,6 +_,8 @@
|
@@ -532,6 +541,8 @@ public class Commands {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/commands/arguments/selector/EntitySelector.java b/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||||
|
index af71e0e1eb1c93745f3e4954ecc8fbd2ad4808a3..fbab3e2f4e3a9cdc1c148fc794036c5655368666 100644
|
||||||
--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
|
--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||||
+++ b/net/minecraft/commands/arguments/selector/EntitySelector.java
|
+++ b/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||||
@@ -190,26 +_,27 @@
|
@@ -190,26 +190,27 @@ public class EntitySelector {
|
||||||
this.checkPermissions(source);
|
this.checkPermissions(source);
|
||||||
if (this.playerName != null) {
|
if (this.playerName != null) {
|
||||||
ServerPlayer playerByName = source.getServer().getPlayerList().getPlayerByName(this.playerName);
|
ServerPlayer playerByName = source.getServer().getPlayerList().getPlayerByName(this.playerName);
|
||||||
@@ -32,7 +40,7 @@
|
|||||||
players.add(serverPlayer1);
|
players.add(serverPlayer1);
|
||||||
if (players.size() >= resultLimit) {
|
if (players.size() >= resultLimit) {
|
||||||
return players;
|
return players;
|
||||||
@@ -267,4 +_,10 @@
|
@@ -267,4 +268,10 @@ public class EntitySelector {
|
||||||
public static Component joinNames(List<? extends Entity> names) {
|
public static Component joinNames(List<? extends Entity> names) {
|
||||||
return ComponentUtils.formatList(names, Entity::getDisplayName);
|
return ComponentUtils.formatList(names, Entity::getDisplayName);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/core/BlockPos.java b/net/minecraft/core/BlockPos.java
|
||||||
|
index e87473fcb36e18d960ef3e4082995785d64b9c0f..e4dee5426e186d44d4d929967c65710848ace11d 100644
|
||||||
--- a/net/minecraft/core/BlockPos.java
|
--- a/net/minecraft/core/BlockPos.java
|
||||||
+++ b/net/minecraft/core/BlockPos.java
|
+++ b/net/minecraft/core/BlockPos.java
|
||||||
@@ -61,6 +_,12 @@
|
@@ -61,6 +61,12 @@ public class BlockPos extends Vec3i {
|
||||||
public static final int MAX_HORIZONTAL_COORDINATE = 33554431;
|
public static final int MAX_HORIZONTAL_COORDINATE = 33554431;
|
||||||
// Paper end - Optimize Bit Operations by inlining
|
// Paper end - Optimize Bit Operations by inlining
|
||||||
|
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/core/dispenser/DispenseItemBehavior.java b/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||||
|
index bfefb5031544caa59230f0073e8880c2b39ebf4d..ff32a89a720676c5a9f34ea7c859f03d47545b72 100644
|
||||||
--- a/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
--- a/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||||
+++ b/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
+++ b/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||||
@@ -750,5 +_,22 @@
|
@@ -750,5 +750,22 @@ public interface DispenseItemBehavior {
|
||||||
DispenserBlock.registerBehavior(Items.TNT_MINECART, new MinecartDispenseItemBehavior(EntityType.TNT_MINECART));
|
DispenserBlock.registerBehavior(Items.TNT_MINECART, new MinecartDispenseItemBehavior(EntityType.TNT_MINECART));
|
||||||
DispenserBlock.registerBehavior(Items.HOPPER_MINECART, new MinecartDispenseItemBehavior(EntityType.HOPPER_MINECART));
|
DispenserBlock.registerBehavior(Items.HOPPER_MINECART, new MinecartDispenseItemBehavior(EntityType.HOPPER_MINECART));
|
||||||
DispenserBlock.registerBehavior(Items.COMMAND_BLOCK_MINECART, new MinecartDispenseItemBehavior(EntityType.COMMAND_BLOCK_MINECART));
|
DispenserBlock.registerBehavior(Items.COMMAND_BLOCK_MINECART, new MinecartDispenseItemBehavior(EntityType.COMMAND_BLOCK_MINECART));
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/core/dispenser/EquipmentDispenseItemBehavior.java b/net/minecraft/core/dispenser/EquipmentDispenseItemBehavior.java
|
||||||
|
index e2d169b45f1dba6559ca337b07a110f79d3db504..727d04a442053f6d0c4df3e744554e2866fa38cd 100644
|
||||||
--- a/net/minecraft/core/dispenser/EquipmentDispenseItemBehavior.java
|
--- a/net/minecraft/core/dispenser/EquipmentDispenseItemBehavior.java
|
||||||
+++ b/net/minecraft/core/dispenser/EquipmentDispenseItemBehavior.java
|
+++ b/net/minecraft/core/dispenser/EquipmentDispenseItemBehavior.java
|
||||||
@@ -32,7 +_,7 @@
|
@@ -32,7 +32,7 @@ public class EquipmentDispenseItemBehavior extends DefaultDispenseItemBehavior {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
LivingEntity livingEntity = entitiesOfClass.getFirst();
|
LivingEntity livingEntity = entitiesOfClass.getFirst();
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/gametest/framework/GameTestHelper.java b/net/minecraft/gametest/framework/GameTestHelper.java
|
||||||
|
index 2a1aef6bfa15882748b98b5257baaced107ba194..05eb0c3273ffa1b5a1ebd8f8ae42c11830d755c7 100644
|
||||||
|
--- a/net/minecraft/gametest/framework/GameTestHelper.java
|
||||||
|
+++ b/net/minecraft/gametest/framework/GameTestHelper.java
|
||||||
|
@@ -322,6 +322,8 @@ public class GameTestHelper {
|
||||||
|
return gameType;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public void setAfk(final boolean afk) {} // Purpur - AFK API
|
||||||
|
+
|
||||||
|
@Override
|
||||||
|
public boolean isClientAuthoritative() {
|
||||||
|
return false;
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/gametest/framework/TestCommand.java b/net/minecraft/gametest/framework/TestCommand.java
|
||||||
|
index 4a06b20b60f67a2d383dbd09b3bad713155dc81e..63e0294f5624643b6d37983f523bf2434cbe47e2 100644
|
||||||
--- a/net/minecraft/gametest/framework/TestCommand.java
|
--- a/net/minecraft/gametest/framework/TestCommand.java
|
||||||
+++ b/net/minecraft/gametest/framework/TestCommand.java
|
+++ b/net/minecraft/gametest/framework/TestCommand.java
|
||||||
@@ -443,7 +_,7 @@
|
@@ -443,7 +443,7 @@ public class TestCommand {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/network/Connection.java b/net/minecraft/network/Connection.java
|
||||||
|
index 19ec939529eb638bdc4d7fd9260f161fae118314..21e891ecdb90a1828428441aef9c2593253751f8 100644
|
||||||
--- a/net/minecraft/network/Connection.java
|
--- a/net/minecraft/network/Connection.java
|
||||||
+++ b/net/minecraft/network/Connection.java
|
+++ b/net/minecraft/network/Connection.java
|
||||||
@@ -554,11 +_,20 @@
|
@@ -554,11 +554,20 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||||
private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper - Buffer joins to world
|
private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper - Buffer joins to world
|
||||||
private static int joinAttemptsThisTick; // Paper - Buffer joins to world
|
private static int joinAttemptsThisTick; // Paper - Buffer joins to world
|
||||||
private static int currTick; // Paper - Buffer joins to world
|
private static int currTick; // Paper - Buffer joins to world
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/network/chat/SignedMessageChain.java b/net/minecraft/network/chat/SignedMessageChain.java
|
||||||
|
index 67b2f87f8424c5642010b3d9852b55c40d4947e1..37549fba0ad31db502354c7b101a56d8f2e4c473 100644
|
||||||
--- a/net/minecraft/network/chat/SignedMessageChain.java
|
--- a/net/minecraft/network/chat/SignedMessageChain.java
|
||||||
+++ b/net/minecraft/network/chat/SignedMessageChain.java
|
+++ b/net/minecraft/network/chat/SignedMessageChain.java
|
||||||
@@ -44,7 +_,7 @@
|
@@ -44,7 +44,7 @@ public class SignedMessageChain {
|
||||||
SignedMessageLink signedMessageLink = SignedMessageChain.this.nextLink;
|
SignedMessageLink signedMessageLink = SignedMessageChain.this.nextLink;
|
||||||
if (signedMessageLink == null) {
|
if (signedMessageLink == null) {
|
||||||
throw new SignedMessageChain.DecodeException(SignedMessageChain.DecodeException.CHAIN_BROKEN);
|
throw new SignedMessageChain.DecodeException(SignedMessageChain.DecodeException.CHAIN_BROKEN);
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
|
||||||
|
index 9216e85e74bb0121c72665f155b07cf9a37f430a..31ce71305260f082729780d4e8fb4dba557f9883 100644
|
||||||
--- a/net/minecraft/server/Main.java
|
--- a/net/minecraft/server/Main.java
|
||||||
+++ b/net/minecraft/server/Main.java
|
+++ b/net/minecraft/server/Main.java
|
||||||
@@ -105,6 +_,13 @@
|
@@ -105,6 +105,13 @@ public class Main {
|
||||||
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
||||||
|
index ca2caace6aab0dfcb0ab7a0fd28e66555c62fdc5..7a54f6bc2a364c1d3ac1ed58b33ecf720a305840 100644
|
||||||
--- a/net/minecraft/server/MinecraftServer.java
|
--- a/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/net/minecraft/server/MinecraftServer.java
|
+++ b/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -290,6 +_,7 @@
|
@@ -290,6 +290,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
public joptsimple.OptionSet options;
|
public joptsimple.OptionSet options;
|
||||||
public org.bukkit.command.ConsoleCommandSender console;
|
public org.bukkit.command.ConsoleCommandSender console;
|
||||||
public static int currentTick; // Paper - improve tick loop
|
public static int currentTick; // Paper - improve tick loop
|
||||||
@@ -8,7 +16,7 @@
|
|||||||
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
|
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
|
||||||
public int autosavePeriod;
|
public int autosavePeriod;
|
||||||
// Paper - don't store the vanilla dispatcher
|
// Paper - don't store the vanilla dispatcher
|
||||||
@@ -306,6 +_,8 @@
|
@@ -306,6 +307,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||||
private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
|
private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
|
||||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||||
@@ -17,7 +25,7 @@
|
|||||||
// Paper start - improve tick loop
|
// Paper start - improve tick loop
|
||||||
public final ca.spottedleaf.moonrise.common.time.TickData tickTimes1s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(1L));
|
public final ca.spottedleaf.moonrise.common.time.TickData tickTimes1s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(1L));
|
||||||
public final ca.spottedleaf.moonrise.common.time.TickData tickTimes5s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(5L));
|
public final ca.spottedleaf.moonrise.common.time.TickData tickTimes5s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(5L));
|
||||||
@@ -375,6 +_,7 @@
|
@@ -375,6 +378,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
public double[] computeTPS() {
|
public double[] computeTPS() {
|
||||||
final long interval = this.tickRateManager().nanosecondsPerTick();
|
final long interval = this.tickRateManager().nanosecondsPerTick();
|
||||||
return new double[] {
|
return new double[] {
|
||||||
@@ -25,7 +33,7 @@
|
|||||||
getTPS(this.tickTimes1m, interval),
|
getTPS(this.tickTimes1m, interval),
|
||||||
getTPS(this.tickTimes5m, interval),
|
getTPS(this.tickTimes5m, interval),
|
||||||
getTPS(this.tickTimes15m, interval)
|
getTPS(this.tickTimes15m, interval)
|
||||||
@@ -1014,6 +_,15 @@
|
@@ -1014,6 +1018,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
LOGGER.info("Stopping server");
|
LOGGER.info("Stopping server");
|
||||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||||
@@ -41,7 +49,7 @@
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
if (this.server != null) {
|
if (this.server != null) {
|
||||||
this.server.spark.disable(); // Paper - spark
|
this.server.spark.disable(); // Paper - spark
|
||||||
@@ -1107,6 +_,8 @@
|
@@ -1107,6 +1120,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.safeShutdown(waitForShutdown, false);
|
this.safeShutdown(waitForShutdown, false);
|
||||||
}
|
}
|
||||||
public void safeShutdown(boolean waitForShutdown, boolean isRestarting) {
|
public void safeShutdown(boolean waitForShutdown, boolean isRestarting) {
|
||||||
@@ -50,7 +58,7 @@
|
|||||||
this.isRestarting = isRestarting;
|
this.isRestarting = isRestarting;
|
||||||
this.hasLoggedStop = true; // Paper - Debugging
|
this.hasLoggedStop = true; // Paper - Debugging
|
||||||
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
|
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
|
||||||
@@ -1284,11 +_,21 @@
|
@@ -1284,11 +1299,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
// Paper end - Add onboarding message for initial server start
|
// Paper end - Add onboarding message for initial server start
|
||||||
// Paper start - Improve outdated version checking
|
// Paper start - Improve outdated version checking
|
||||||
@@ -73,19 +81,20 @@
|
|||||||
while (this.running) {
|
while (this.running) {
|
||||||
final long tickStart = System.nanoTime(); // Paper - improve tick loop
|
final long tickStart = System.nanoTime(); // Paper - improve tick loop
|
||||||
long l; // Paper - improve tick loop - diff on change, expect this to be tick interval
|
long l; // Paper - improve tick loop - diff on change, expect this to be tick interval
|
||||||
@@ -1302,8 +_,10 @@
|
@@ -1302,9 +1327,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
final long ticksBehind = Math.max(1L, this.tickSchedule.getPeriodsAhead(l, tickStart));
|
final long ticksBehind = Math.max(1L, this.tickSchedule.getPeriodsAhead(l, tickStart));
|
||||||
final long catchup = (long)Math.max(
|
final long catchup = (long)Math.max(
|
||||||
1,
|
1,
|
||||||
- 5 //ConfigHolder.getConfig().tickLoop.catchupTicks.getOrDefault(MoonriseConfig.TickLoop.DEFAULT_CATCHUP_TICKS).intValue()
|
- 5 //ConfigHolder.getConfig().tickLoop.catchupTicks.getOrDefault(MoonriseConfig.TickLoop.DEFAULT_CATCHUP_TICKS).intValue()
|
||||||
+ org.purpurmc.purpur.PurpurConfig.tpsCatchup ? 5 : 1 //ConfigHolder.getConfig().tickLoop.catchupTicks.getOrDefault(MoonriseConfig.TickLoop.DEFAULT_CATCHUP_TICKS).intValue() // Purpur - Configurable TPS Catchup
|
+ org.purpurmc.purpur.PurpurConfig.tpsCatchup ? 5 : 1 //ConfigHolder.getConfig().tickLoop.catchupTicks.getOrDefault(MoonriseConfig.TickLoop.DEFAULT_CATCHUP_TICKS).intValue() // Purpur - Configurable TPS Catchup
|
||||||
);
|
);
|
||||||
+
|
|
||||||
+ lagging = getTPS()[0] < org.purpurmc.purpur.PurpurConfig.laggingThreshold; // Purpur - Lagging threshold
|
|
||||||
|
|
||||||
|
+ lagging = getTPS()[0] < org.purpurmc.purpur.PurpurConfig.laggingThreshold; // Purpur - Lagging threshold
|
||||||
|
+
|
||||||
// adjust ticksBehind so that it is not greater-than catchup
|
// adjust ticksBehind so that it is not greater-than catchup
|
||||||
if (ticksBehind > catchup) {
|
if (ticksBehind > catchup) {
|
||||||
@@ -1785,7 +_,7 @@
|
final long difference = ticksBehind - catchup;
|
||||||
|
@@ -1785,7 +1812,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
long worldTime = level.getGameTime();
|
long worldTime = level.getGameTime();
|
||||||
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
|
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
|
||||||
for (Player entityhuman : level.players()) {
|
for (Player entityhuman : level.players()) {
|
||||||
@@ -94,7 +103,7 @@
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
|
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
|
||||||
@@ -1952,7 +_,7 @@
|
@@ -1952,7 +1979,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
public String getServerModName() {
|
public String getServerModName() {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/PlayerAdvancements.java b/net/minecraft/server/PlayerAdvancements.java
|
||||||
|
index 98004b77b7f40d315f41be82105df6d4b9000e33..9612e9dd36010ffcc0e038301233d90b3ed7aeed 100644
|
||||||
--- a/net/minecraft/server/PlayerAdvancements.java
|
--- a/net/minecraft/server/PlayerAdvancements.java
|
||||||
+++ b/net/minecraft/server/PlayerAdvancements.java
|
+++ b/net/minecraft/server/PlayerAdvancements.java
|
||||||
@@ -146,6 +_,7 @@
|
@@ -146,6 +146,7 @@ public class PlayerAdvancements {
|
||||||
AdvancementHolder advancementHolder = advancementManager.get(path);
|
AdvancementHolder advancementHolder = advancementManager.get(path);
|
||||||
if (advancementHolder == null) {
|
if (advancementHolder == null) {
|
||||||
if (!path.getNamespace().equals(Identifier.DEFAULT_NAMESPACE)) return; // CraftBukkit
|
if (!path.getNamespace().equals(Identifier.DEFAULT_NAMESPACE)) return; // CraftBukkit
|
||||||
@@ -8,7 +16,7 @@
|
|||||||
LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", path, this.playerSavePath);
|
LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", path, this.playerSavePath);
|
||||||
} else {
|
} else {
|
||||||
this.startProgress(advancementHolder, progress);
|
this.startProgress(advancementHolder, progress);
|
||||||
@@ -193,6 +_,7 @@
|
@@ -193,6 +194,7 @@ public class PlayerAdvancements {
|
||||||
advancement.value().display().ifPresent(displayInfo -> {
|
advancement.value().display().ifPresent(displayInfo -> {
|
||||||
// Paper start - Add Adventure message to PlayerAdvancementDoneEvent
|
// Paper start - Add Adventure message to PlayerAdvancementDoneEvent
|
||||||
if (event.message() != null && this.player.level().getGameRules().get(GameRules.SHOW_ADVANCEMENT_MESSAGES)) {
|
if (event.message() != null && this.player.level().getGameRules().get(GameRules.SHOW_ADVANCEMENT_MESSAGES)) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/commands/EnchantCommand.java b/net/minecraft/server/commands/EnchantCommand.java
|
||||||
|
index 21548995eb278236946b6e495d27f6261e24f7a2..1735a87a974028779cc64cbeb39ff2eeb16034b1 100644
|
||||||
--- a/net/minecraft/server/commands/EnchantCommand.java
|
--- a/net/minecraft/server/commands/EnchantCommand.java
|
||||||
+++ b/net/minecraft/server/commands/EnchantCommand.java
|
+++ b/net/minecraft/server/commands/EnchantCommand.java
|
||||||
@@ -70,7 +_,7 @@
|
@@ -70,7 +70,7 @@ public class EnchantCommand {
|
||||||
|
|
||||||
private static int enchant(CommandSourceStack source, Collection<? extends Entity> targets, Holder<Enchantment> enchantment, int level) throws CommandSyntaxException {
|
private static int enchant(CommandSourceStack source, Collection<? extends Entity> targets, Holder<Enchantment> enchantment, int level) throws CommandSyntaxException {
|
||||||
Enchantment enchantment1 = enchantment.value();
|
Enchantment enchantment1 = enchantment.value();
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
throw ERROR_LEVEL_TOO_HIGH.create(level, enchantment1.getMaxLevel());
|
throw ERROR_LEVEL_TOO_HIGH.create(level, enchantment1.getMaxLevel());
|
||||||
} else {
|
} else {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -80,7 +_,7 @@
|
@@ -80,7 +80,7 @@ public class EnchantCommand {
|
||||||
ItemStack mainHandItem = livingEntity.getMainHandItem();
|
ItemStack mainHandItem = livingEntity.getMainHandItem();
|
||||||
if (!mainHandItem.isEmpty()) {
|
if (!mainHandItem.isEmpty()) {
|
||||||
if (enchantment1.canEnchant(mainHandItem)
|
if (enchantment1.canEnchant(mainHandItem)
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/commands/GameModeCommand.java b/net/minecraft/server/commands/GameModeCommand.java
|
||||||
|
index 503447fbb54bed493f1d867c75ef3f344fe7b81b..a601df223c685f435241cd193a912898e60bab03 100644
|
||||||
--- a/net/minecraft/server/commands/GameModeCommand.java
|
--- a/net/minecraft/server/commands/GameModeCommand.java
|
||||||
+++ b/net/minecraft/server/commands/GameModeCommand.java
|
+++ b/net/minecraft/server/commands/GameModeCommand.java
|
||||||
@@ -53,6 +_,18 @@
|
@@ -53,6 +53,18 @@ public class GameModeCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int setMode(CommandContext<CommandSourceStack> context, Collection<ServerPlayer> players, GameType gameType) {
|
private static int setMode(CommandContext<CommandSourceStack> context, Collection<ServerPlayer> players, GameType gameType) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/commands/GiveCommand.java b/net/minecraft/server/commands/GiveCommand.java
|
||||||
|
index 0fc63717af24ca37497db8ea5a2395548d9d8491..2f8fd2240d603346e751a5f7afb91121065423d6 100644
|
||||||
--- a/net/minecraft/server/commands/GiveCommand.java
|
--- a/net/minecraft/server/commands/GiveCommand.java
|
||||||
+++ b/net/minecraft/server/commands/GiveCommand.java
|
+++ b/net/minecraft/server/commands/GiveCommand.java
|
||||||
@@ -68,6 +_,7 @@
|
@@ -68,6 +68,7 @@ public class GiveCommand {
|
||||||
i1 -= min;
|
i1 -= min;
|
||||||
ItemStack itemStack1 = item.createItemStack(min, false);
|
ItemStack itemStack1 = item.createItemStack(min, false);
|
||||||
boolean flag = serverPlayer.getInventory().add(itemStack1);
|
boolean flag = serverPlayer.getInventory().add(itemStack1);
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
|
index eb06d8f012684845146429832e977e6c1ddcd62b..6a0ccd6eb3e355348c68db3de980f4eddea1aaea 100644
|
||||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||||
@@ -195,6 +_,7 @@
|
@@ -195,6 +195,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!org.bukkit.craftbukkit.Main.useConsole) return; // CraftBukkit
|
if (!org.bukkit.craftbukkit.Main.useConsole) return; // CraftBukkit
|
||||||
// Paper start - Use TerminalConsoleAppender
|
// Paper start - Use TerminalConsoleAppender
|
||||||
@@ -8,7 +16,7 @@
|
|||||||
new com.destroystokyo.paper.console.PaperConsole(DedicatedServer.this).start();
|
new com.destroystokyo.paper.console.PaperConsole(DedicatedServer.this).start();
|
||||||
/*
|
/*
|
||||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
|
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
|
||||||
@@ -273,6 +_,15 @@
|
@@ -273,6 +274,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
||||||
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
||||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||||
@@ -24,7 +32,7 @@
|
|||||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||||
|
|
||||||
// this.worldData.setGameType(properties.gameMode.get()); // CraftBukkit - moved to world loading
|
// this.worldData.setGameType(properties.gameMode.get()); // CraftBukkit - moved to world loading
|
||||||
@@ -315,6 +_,30 @@
|
@@ -315,6 +325,30 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
if (true) throw new IllegalStateException("Failed to bind to port", var11); // Paper - Propagate failed to bind to port error
|
if (true) throw new IllegalStateException("Failed to bind to port", var11); // Paper - Propagate failed to bind to port error
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -55,13 +63,13 @@
|
|||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
this.server.loadPlugins();
|
this.server.loadPlugins();
|
||||||
@@ -389,6 +_,9 @@
|
@@ -390,6 +424,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||||
MinecraftServerStatistics.registerJmxMonitoring(this);
|
|
||||||
LOGGER.info("JMX monitoring enabled");
|
LOGGER.info("JMX monitoring enabled");
|
||||||
}
|
}
|
||||||
+
|
|
||||||
+ org.purpurmc.purpur.task.BossBarTask.startAll(); // Purpur - Implement TPSBar
|
+ org.purpurmc.purpur.task.BossBarTask.startAll(); // Purpur - Implement TPSBar
|
||||||
+ if (org.purpurmc.purpur.PurpurConfig.beeCountPayload) org.purpurmc.purpur.task.BeehiveTask.instance().register(); // Purpur - Give bee counts in beehives to Purpur clients
|
+ if (org.purpurmc.purpur.PurpurConfig.beeCountPayload) org.purpurmc.purpur.task.BeehiveTask.instance().register(); // Purpur - Give bee counts in beehives to Purpur clients
|
||||||
|
+
|
||||||
this.notificationManager().serverStarted();
|
this.notificationManager().serverStarted();
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/dedicated/DedicatedServerProperties.java b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
|
index bbd8f68d166ebd0370f4b39362468fdc7d70f7f0..2a3b10c5e031ef44a2b53bc4fdc6e86c917f75d4 100644
|
||||||
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||||
@@ -57,6 +_,7 @@
|
@@ -57,6 +57,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||||
public final boolean onlineMode = this.get("online-mode", true);
|
public final boolean onlineMode = this.get("online-mode", true);
|
||||||
public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
|
public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
|
||||||
public final String serverIp = this.get("server-ip", "");
|
public final String serverIp = this.get("server-ip", "");
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/gui/MinecraftServerGui.java b/net/minecraft/server/gui/MinecraftServerGui.java
|
||||||
|
index f262a7c5ae4e7d56f16f5c0f4f145a2e428abbe4..614c7d9f673c926562acc8fa3b3788623900db41 100644
|
||||||
--- a/net/minecraft/server/gui/MinecraftServerGui.java
|
--- a/net/minecraft/server/gui/MinecraftServerGui.java
|
||||||
+++ b/net/minecraft/server/gui/MinecraftServerGui.java
|
+++ b/net/minecraft/server/gui/MinecraftServerGui.java
|
||||||
@@ -39,6 +_,11 @@
|
@@ -39,6 +39,11 @@ public class MinecraftServerGui extends JComponent {
|
||||||
private Thread logAppenderThread;
|
private Thread logAppenderThread;
|
||||||
private final Collection<Runnable> finalizers = Lists.newArrayList();
|
private final Collection<Runnable> finalizers = Lists.newArrayList();
|
||||||
final AtomicBoolean isClosing = new AtomicBoolean();
|
final AtomicBoolean isClosing = new AtomicBoolean();
|
||||||
@@ -12,7 +20,7 @@
|
|||||||
|
|
||||||
public static MinecraftServerGui showFrameFor(final DedicatedServer server) {
|
public static MinecraftServerGui showFrameFor(final DedicatedServer server) {
|
||||||
try {
|
try {
|
||||||
@@ -46,7 +_,7 @@
|
@@ -46,7 +51,7 @@ public class MinecraftServerGui extends JComponent {
|
||||||
} catch (Exception var3) {
|
} catch (Exception var3) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,7 +29,7 @@
|
|||||||
final MinecraftServerGui minecraftServerGui = new MinecraftServerGui(server);
|
final MinecraftServerGui minecraftServerGui = new MinecraftServerGui(server);
|
||||||
jFrame.setDefaultCloseOperation(2);
|
jFrame.setDefaultCloseOperation(2);
|
||||||
jFrame.add(minecraftServerGui);
|
jFrame.add(minecraftServerGui);
|
||||||
@@ -54,7 +_,7 @@
|
@@ -54,7 +59,7 @@ public class MinecraftServerGui extends JComponent {
|
||||||
jFrame.setLocationRelativeTo(null);
|
jFrame.setLocationRelativeTo(null);
|
||||||
jFrame.setVisible(true);
|
jFrame.setVisible(true);
|
||||||
// Paper start - Improve ServerGUI
|
// Paper start - Improve ServerGUI
|
||||||
@@ -30,7 +38,7 @@
|
|||||||
try {
|
try {
|
||||||
jFrame.setIconImage(javax.imageio.ImageIO.read(java.util.Objects.requireNonNull(MinecraftServerGui.class.getClassLoader().getResourceAsStream("logo.png"))));
|
jFrame.setIconImage(javax.imageio.ImageIO.read(java.util.Objects.requireNonNull(MinecraftServerGui.class.getClassLoader().getResourceAsStream("logo.png"))));
|
||||||
} catch (java.io.IOException ignore) {
|
} catch (java.io.IOException ignore) {
|
||||||
@@ -64,7 +_,7 @@
|
@@ -64,7 +69,7 @@ public class MinecraftServerGui extends JComponent {
|
||||||
@Override
|
@Override
|
||||||
public void windowClosing(WindowEvent event) {
|
public void windowClosing(WindowEvent event) {
|
||||||
if (!minecraftServerGui.isClosing.getAndSet(true)) {
|
if (!minecraftServerGui.isClosing.getAndSet(true)) {
|
||||||
@@ -39,7 +47,7 @@
|
|||||||
server.halt(true);
|
server.halt(true);
|
||||||
minecraftServerGui.runFinalizers();
|
minecraftServerGui.runFinalizers();
|
||||||
}
|
}
|
||||||
@@ -112,7 +_,7 @@
|
@@ -112,7 +117,7 @@ public class MinecraftServerGui extends JComponent {
|
||||||
|
|
||||||
private JComponent buildChatPanel() {
|
private JComponent buildChatPanel() {
|
||||||
JPanel jPanel = new JPanel(new BorderLayout());
|
JPanel jPanel = new JPanel(new BorderLayout());
|
||||||
@@ -48,7 +56,7 @@
|
|||||||
JScrollPane jScrollPane = new JScrollPane(jTextArea, 22, 30);
|
JScrollPane jScrollPane = new JScrollPane(jTextArea, 22, 30);
|
||||||
jTextArea.setEditable(false);
|
jTextArea.setEditable(false);
|
||||||
jTextArea.setFont(MONOSPACED);
|
jTextArea.setFont(MONOSPACED);
|
||||||
@@ -121,10 +_,43 @@
|
@@ -121,10 +126,43 @@ public class MinecraftServerGui extends JComponent {
|
||||||
String trimmed = jTextField.getText().trim();
|
String trimmed = jTextField.getText().trim();
|
||||||
if (!trimmed.isEmpty()) {
|
if (!trimmed.isEmpty()) {
|
||||||
this.server.handleConsoleInput(trimmed, this.server.createCommandSourceStack());
|
this.server.handleConsoleInput(trimmed, this.server.createCommandSourceStack());
|
||||||
@@ -92,7 +100,7 @@
|
|||||||
jTextArea.addFocusListener(new FocusAdapter() {
|
jTextArea.addFocusListener(new FocusAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void focusGained(FocusEvent event) {
|
public void focusGained(FocusEvent event) {
|
||||||
@@ -159,7 +_,7 @@
|
@@ -159,7 +197,7 @@ public class MinecraftServerGui extends JComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final java.util.regex.Pattern ANSI = java.util.regex.Pattern.compile("\\e\\[[\\d;]*[^\\d;]"); // CraftBukkit // Paper
|
private static final java.util.regex.Pattern ANSI = java.util.regex.Pattern.compile("\\e\\[[\\d;]*[^\\d;]"); // CraftBukkit // Paper
|
||||||
@@ -101,7 +109,7 @@
|
|||||||
if (!SwingUtilities.isEventDispatchThread()) {
|
if (!SwingUtilities.isEventDispatchThread()) {
|
||||||
SwingUtilities.invokeLater(() -> this.print(textArea, scrollPane, line));
|
SwingUtilities.invokeLater(() -> this.print(textArea, scrollPane, line));
|
||||||
} else {
|
} else {
|
||||||
@@ -170,16 +_,29 @@
|
@@ -170,10 +208,11 @@ public class MinecraftServerGui extends JComponent {
|
||||||
flag = verticalScrollBar.getValue() + verticalScrollBar.getSize().getHeight() + MONOSPACED.getSize() * 4 > verticalScrollBar.getMaximum();
|
flag = verticalScrollBar.getValue() + verticalScrollBar.getSize().getHeight() + MONOSPACED.getSize() * 4 > verticalScrollBar.getMaximum();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,10 +123,10 @@
|
|||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
verticalScrollBar.setValue(Integer.MAX_VALUE);
|
verticalScrollBar.setValue(Integer.MAX_VALUE);
|
||||||
|
@@ -181,6 +220,18 @@ public class MinecraftServerGui extends JComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
+
|
|
||||||
+ // Purpur start - GUI Improvements
|
+ // Purpur start - GUI Improvements
|
||||||
+ public static class CommandHistory extends java.util.LinkedList<String> {
|
+ public static class CommandHistory extends java.util.LinkedList<String> {
|
||||||
+ @Override
|
+ @Override
|
||||||
@@ -130,6 +138,7 @@
|
|||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end - GUI Improvements
|
+ // Purpur end - GUI Improvements
|
||||||
|
+
|
||||||
// Paper start - Add onboarding message for initial server start
|
// Paper start - Add onboarding message for initial server start
|
||||||
private JComponent buildOnboardingPanel() {
|
private JComponent buildOnboardingPanel() {
|
||||||
|
String onboardingLink = "https://docs.papermc.io/paper/next-steps";
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/gui/StatsComponent.java b/net/minecraft/server/gui/StatsComponent.java
|
||||||
|
index f485e83fa6cbf510472bcffd18d29a41e177e856..84b72e8a44ef8f964079faddd3bff29601a8a3c9 100644
|
||||||
--- a/net/minecraft/server/gui/StatsComponent.java
|
--- a/net/minecraft/server/gui/StatsComponent.java
|
||||||
+++ b/net/minecraft/server/gui/StatsComponent.java
|
+++ b/net/minecraft/server/gui/StatsComponent.java
|
||||||
@@ -41,7 +_,7 @@
|
@@ -41,7 +41,7 @@ public class StatsComponent extends JComponent {
|
||||||
}
|
}
|
||||||
this.msgs[0] = "Memory use: " + l / 1024L / 1024L + " mb (" + Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory() + "% free)";
|
this.msgs[0] = "Memory use: " + l / 1024L / 1024L + " mb (" + Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory() + "% free)";
|
||||||
this.msgs[1] = "Avg tick: " + DECIMAL_FORMAT.format((double)this.server.getAverageTickTimeNanos() / TimeUtil.NANOSECONDS_PER_MILLISECOND) + " ms";
|
this.msgs[1] = "Avg tick: " + DECIMAL_FORMAT.format((double)this.server.getAverageTickTimeNanos() / TimeUtil.NANOSECONDS_PER_MILLISECOND) + " ms";
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||||
|
index dc65503a2d785d64d37b76b0303f51cf66d9769a..5130c0067f01eec31c69b9e71d904f932943b922 100644
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
--- a/net/minecraft/server/level/ServerLevel.java
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||||
@@ -218,6 +_,8 @@
|
@@ -218,6 +218,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
private final StructureManager structureManager;
|
private final StructureManager structureManager;
|
||||||
private final StructureCheck structureCheck;
|
private final StructureCheck structureCheck;
|
||||||
private final boolean tickTime;
|
private final boolean tickTime;
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
private final RandomSequences randomSequences;
|
private final RandomSequences randomSequences;
|
||||||
final LevelDebugSynchronizers debugSynchronizers = new LevelDebugSynchronizers(this);
|
final LevelDebugSynchronizers debugSynchronizers = new LevelDebugSynchronizers(this);
|
||||||
|
|
||||||
@@ -622,8 +_,25 @@
|
@@ -622,8 +624,25 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
this.tickTime = tickTime;
|
this.tickTime = tickTime;
|
||||||
this.server = server;
|
this.server = server;
|
||||||
@@ -36,7 +44,7 @@
|
|||||||
ChunkGenerator chunkGenerator = levelStem.generator();
|
ChunkGenerator chunkGenerator = levelStem.generator();
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
this.serverLevelData.setWorld(this);
|
this.serverLevelData.setWorld(this);
|
||||||
@@ -709,6 +_,7 @@
|
@@ -709,6 +728,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler);
|
this.chunkDataController = new ca.spottedleaf.moonrise.patches.chunk_system.io.datacontroller.ChunkDataController((ServerLevel)(Object)this, this.chunkTaskScheduler);
|
||||||
// Paper end - rewrite chunk system
|
// Paper end - rewrite chunk system
|
||||||
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
|
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
|
||||||
@@ -44,7 +52,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Paper start
|
// Paper start
|
||||||
@@ -760,7 +_,7 @@
|
@@ -760,7 +780,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
|
int i = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
|
||||||
@@ -53,7 +61,7 @@
|
|||||||
// Paper start - create time skip event - move up calculations
|
// Paper start - create time skip event - move up calculations
|
||||||
final long newDayTime = this.levelData.getDayTime() + 24000L;
|
final long newDayTime = this.levelData.getDayTime() + 24000L;
|
||||||
org.bukkit.event.world.TimeSkipEvent event = new org.bukkit.event.world.TimeSkipEvent(
|
org.bukkit.event.world.TimeSkipEvent event = new org.bukkit.event.world.TimeSkipEvent(
|
||||||
@@ -895,6 +_,13 @@
|
@@ -895,6 +915,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
this.serverLevelData.getScheduledEvents().tick(this.server, l);
|
this.serverLevelData.getScheduledEvents().tick(this.server, l);
|
||||||
Profiler.get().pop();
|
Profiler.get().pop();
|
||||||
if (this.getGameRules().get(GameRules.ADVANCE_TIME)) {
|
if (this.getGameRules().get(GameRules.ADVANCE_TIME)) {
|
||||||
@@ -67,7 +75,7 @@
|
|||||||
this.setDayTime(this.levelData.getDayTime() + 1L);
|
this.setDayTime(this.levelData.getDayTime() + 1L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -902,6 +_,20 @@
|
@@ -902,6 +929,20 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
|
|
||||||
public void setDayTime(long time) {
|
public void setDayTime(long time) {
|
||||||
this.serverLevelData.setDayTime(time);
|
this.serverLevelData.setDayTime(time);
|
||||||
@@ -88,7 +96,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public long getDayCount() {
|
public long getDayCount() {
|
||||||
@@ -1010,9 +_,17 @@
|
@@ -1010,9 +1051,17 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
&& this.random.nextDouble() < currentDifficultyAt.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses
|
&& this.random.nextDouble() < currentDifficultyAt.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01) // Paper - Configurable spawn chances for skeleton horses
|
||||||
&& !this.getBlockState(blockPos.below()).is(BlockTags.LIGHTNING_RODS);
|
&& !this.getBlockState(blockPos.below()).is(BlockTags.LIGHTNING_RODS);
|
||||||
if (flag) {
|
if (flag) {
|
||||||
@@ -108,7 +116,7 @@
|
|||||||
skeletonHorse.setAge(0);
|
skeletonHorse.setAge(0);
|
||||||
skeletonHorse.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
skeletonHorse.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
||||||
this.addFreshEntity(skeletonHorse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
this.addFreshEntity(skeletonHorse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||||
@@ -1047,9 +_,35 @@
|
@@ -1047,9 +1096,35 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
if (blockState.is(Blocks.SNOW)) {
|
if (blockState.is(Blocks.SNOW)) {
|
||||||
int layersValue = blockState.getValue(SnowLayerBlock.LAYERS);
|
int layersValue = blockState.getValue(SnowLayerBlock.LAYERS);
|
||||||
if (layersValue < Math.min(i, 8)) {
|
if (layersValue < Math.min(i, 8)) {
|
||||||
@@ -144,7 +152,7 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, heightmapPos, Blocks.SNOW.defaultBlockState(), Block.UPDATE_ALL, null); // CraftBukkit
|
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, heightmapPos, Blocks.SNOW.defaultBlockState(), Block.UPDATE_ALL, null); // CraftBukkit
|
||||||
@@ -1070,7 +_,7 @@
|
@@ -1070,7 +1145,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
poiType -> poiType.is(PoiTypes.LIGHTNING_ROD),
|
poiType -> poiType.is(PoiTypes.LIGHTNING_ROD),
|
||||||
blockPos -> blockPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockPos.getX(), blockPos.getZ()) - 1,
|
blockPos -> blockPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockPos.getX(), blockPos.getZ()) - 1,
|
||||||
pos,
|
pos,
|
||||||
@@ -153,7 +161,7 @@
|
|||||||
PoiManager.Occupancy.ANY
|
PoiManager.Occupancy.ANY
|
||||||
);
|
);
|
||||||
return optional.map(blockPos -> blockPos.above(1));
|
return optional.map(blockPos -> blockPos.above(1));
|
||||||
@@ -1119,8 +_,26 @@
|
@@ -1119,8 +1194,26 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
int i = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
|
int i = this.getGameRules().get(GameRules.PLAYERS_SLEEPING_PERCENTAGE);
|
||||||
Component component;
|
Component component;
|
||||||
if (this.sleepStatus.areEnoughSleeping(i)) {
|
if (this.sleepStatus.areEnoughSleeping(i)) {
|
||||||
@@ -180,7 +188,7 @@
|
|||||||
component = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(i));
|
component = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1275,6 +_,7 @@
|
@@ -1275,6 +1368,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public void resetWeatherCycle() {
|
public void resetWeatherCycle() {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -188,7 +196,7 @@
|
|||||||
this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
|
this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
|
||||||
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
||||||
// Not that everyone ever manages to get the whole server to sleep at the same time....
|
// Not that everyone ever manages to get the whole server to sleep at the same time....
|
||||||
@@ -1282,6 +_,7 @@
|
@@ -1282,6 +1376,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
this.serverLevelData.setRainTime(0);
|
this.serverLevelData.setRainTime(0);
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -196,7 +204,7 @@
|
|||||||
this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
|
this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
||||||
@@ -1954,7 +_,7 @@
|
@@ -1954,7 +2049,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
Explosion.BlockInteraction blockInteraction = switch (explosionInteraction) {
|
Explosion.BlockInteraction blockInteraction = switch (explosionInteraction) {
|
||||||
case NONE -> Explosion.BlockInteraction.KEEP;
|
case NONE -> Explosion.BlockInteraction.KEEP;
|
||||||
case BLOCK -> this.getDestroyType(GameRules.BLOCK_EXPLOSION_DROP_DECAY);
|
case BLOCK -> this.getDestroyType(GameRules.BLOCK_EXPLOSION_DROP_DECAY);
|
||||||
@@ -205,7 +213,7 @@
|
|||||||
? this.getDestroyType(GameRules.MOB_EXPLOSION_DROP_DECAY)
|
? this.getDestroyType(GameRules.MOB_EXPLOSION_DROP_DECAY)
|
||||||
: Explosion.BlockInteraction.KEEP;
|
: Explosion.BlockInteraction.KEEP;
|
||||||
case TNT -> this.getDestroyType(GameRules.TNT_EXPLOSION_DROP_DECAY);
|
case TNT -> this.getDestroyType(GameRules.TNT_EXPLOSION_DROP_DECAY);
|
||||||
@@ -2846,7 +_,7 @@
|
@@ -2846,7 +2941,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||||
// Spigot start
|
// Spigot start
|
||||||
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
|
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
|
||||||
// Paper start - Fix merchant inventory not closing on entity removal
|
// Paper start - Fix merchant inventory not closing on entity removal
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||||
|
index 79c804245c7f41a5a7f062e1c5e01760adde7d84..a16813766ad244c002a752b0c03779c550d39e75 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||||
@@ -433,6 +_,9 @@
|
@@ -433,6 +433,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
public boolean isRealPlayer; // Paper
|
public boolean isRealPlayer; // Paper
|
||||||
public com.destroystokyo.paper.event.entity.@Nullable PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
public com.destroystokyo.paper.event.entity.@Nullable PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
||||||
public org.bukkit.event.player.PlayerQuitEvent.@Nullable QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event
|
public org.bukkit.event.player.PlayerQuitEvent.@Nullable QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event
|
||||||
@@ -10,7 +18,7 @@
|
|||||||
|
|
||||||
// Paper start - rewrite chunk system
|
// Paper start - rewrite chunk system
|
||||||
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
||||||
@@ -506,6 +_,9 @@
|
@@ -506,6 +509,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
this.respawnConfig = input.read("respawn", ServerPlayer.RespawnConfig.CODEC).orElse(null);
|
this.respawnConfig = input.read("respawn", ServerPlayer.RespawnConfig.CODEC).orElse(null);
|
||||||
this.spawnExtraParticlesOnFall = input.getBooleanOr("spawn_extra_particles_on_fall", false);
|
this.spawnExtraParticlesOnFall = input.getBooleanOr("spawn_extra_particles_on_fall", false);
|
||||||
this.raidOmenPosition = input.read("raid_omen_position", BlockPos.CODEC).orElse(null);
|
this.raidOmenPosition = input.read("raid_omen_position", BlockPos.CODEC).orElse(null);
|
||||||
@@ -20,7 +28,7 @@
|
|||||||
// Paper start - Expand PlayerGameModeChangeEvent
|
// Paper start - Expand PlayerGameModeChangeEvent
|
||||||
this.loadGameTypes(input);
|
this.loadGameTypes(input);
|
||||||
}
|
}
|
||||||
@@ -547,6 +_,9 @@
|
@@ -547,6 +553,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
output.store("ShoulderEntityRight", CompoundTag.CODEC, this.getShoulderEntityRight());
|
output.store("ShoulderEntityRight", CompoundTag.CODEC, this.getShoulderEntityRight());
|
||||||
}
|
}
|
||||||
this.getBukkitEntity().setExtraData(output); // CraftBukkit
|
this.getBukkitEntity().setExtraData(output); // CraftBukkit
|
||||||
@@ -30,7 +38,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void saveParentVehicle(ValueOutput output) {
|
private void saveParentVehicle(ValueOutput output) {
|
||||||
@@ -1183,6 +_,7 @@
|
@@ -1183,6 +1192,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
// Paper - moved up to sendClientboundPlayerCombatKillPacket()
|
// Paper - moved up to sendClientboundPlayerCombatKillPacket()
|
||||||
sendClientboundPlayerCombatKillPacket(event.getShowDeathMessages(), deathScreenMessage); // Paper - Expand PlayerDeathEvent
|
sendClientboundPlayerCombatKillPacket(event.getShowDeathMessages(), deathScreenMessage); // Paper - Expand PlayerDeathEvent
|
||||||
Team team = this.getTeam();
|
Team team = this.getTeam();
|
||||||
@@ -38,7 +46,7 @@
|
|||||||
if (team == null || team.getDeathMessageVisibility() == Team.Visibility.ALWAYS) {
|
if (team == null || team.getDeathMessageVisibility() == Team.Visibility.ALWAYS) {
|
||||||
this.server.getPlayerList().broadcastSystemMessage(deathMessage, false);
|
this.server.getPlayerList().broadcastSystemMessage(deathMessage, false);
|
||||||
} else if (team.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) {
|
} else if (team.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) {
|
||||||
@@ -1290,6 +_,13 @@
|
@@ -1290,6 +1300,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
if (this.isInvulnerableTo(level, damageSource)) {
|
if (this.isInvulnerableTo(level, damageSource)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@@ -52,7 +60,7 @@
|
|||||||
Entity entity = damageSource.getEntity();
|
Entity entity = damageSource.getEntity();
|
||||||
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
|
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
|
||||||
!(entity instanceof Player player && !this.canHarmPlayer(player))
|
!(entity instanceof Player player && !this.canHarmPlayer(player))
|
||||||
@@ -1544,6 +_,7 @@
|
@@ -1544,6 +1561,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
|
|
||||||
profilerFiller.pop();
|
profilerFiller.pop();
|
||||||
profilerFiller.push("placing");
|
profilerFiller.push("placing");
|
||||||
@@ -60,7 +68,7 @@
|
|||||||
this.setServerLevel(level);
|
this.setServerLevel(level);
|
||||||
this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event
|
this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event
|
||||||
this.connection.resetPosition();
|
this.connection.resetPosition();
|
||||||
@@ -1652,7 +_,7 @@
|
@@ -1652,7 +1670,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
new AABB(vec3.x() - 8.0, vec3.y() - 5.0, vec3.z() - 8.0, vec3.x() + 8.0, vec3.y() + 5.0, vec3.z() + 8.0),
|
new AABB(vec3.x() - 8.0, vec3.y() - 5.0, vec3.z() - 8.0, vec3.x() + 8.0, vec3.y() + 5.0, vec3.z() + 8.0),
|
||||||
monster -> monster.isPreventingPlayerRest(this.level(), this)
|
monster -> monster.isPreventingPlayerRest(this.level(), this)
|
||||||
);
|
);
|
||||||
@@ -69,7 +77,7 @@
|
|||||||
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
|
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1692,8 +_,19 @@
|
@@ -1692,8 +1710,19 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
CriteriaTriggers.SLEPT_IN_BED.trigger(this);
|
CriteriaTriggers.SLEPT_IN_BED.trigger(this);
|
||||||
});
|
});
|
||||||
if (!this.level().canSleepThroughNights()) {
|
if (!this.level().canSleepThroughNights()) {
|
||||||
@@ -90,7 +98,7 @@
|
|||||||
|
|
||||||
this.level().updateSleepingPlayerList();
|
this.level().updateSleepingPlayerList();
|
||||||
return either;
|
return either;
|
||||||
@@ -1784,6 +_,7 @@
|
@@ -1784,6 +1813,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void openTextEdit(SignBlockEntity signEntity, boolean isFrontText) {
|
public void openTextEdit(SignBlockEntity signEntity, boolean isFrontText) {
|
||||||
@@ -98,7 +106,7 @@
|
|||||||
this.connection.send(new ClientboundBlockUpdatePacket(this.level(), signEntity.getBlockPos()));
|
this.connection.send(new ClientboundBlockUpdatePacket(this.level(), signEntity.getBlockPos()));
|
||||||
this.connection.send(new ClientboundOpenSignEditorPacket(signEntity.getBlockPos(), isFrontText));
|
this.connection.send(new ClientboundOpenSignEditorPacket(signEntity.getBlockPos(), isFrontText));
|
||||||
}
|
}
|
||||||
@@ -2121,6 +_,26 @@
|
@@ -2121,6 +2151,26 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
this.lastSentExp = -1; // CraftBukkit - Added to reset
|
this.lastSentExp = -1; // CraftBukkit - Added to reset
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +133,7 @@
|
|||||||
@Override
|
@Override
|
||||||
public void displayClientMessage(Component message, boolean overlay) {
|
public void displayClientMessage(Component message, boolean overlay) {
|
||||||
this.sendSystemMessage(message, overlay);
|
this.sendSystemMessage(message, overlay);
|
||||||
@@ -2355,6 +_,20 @@
|
@@ -2355,6 +2405,20 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,14 +154,13 @@
|
|||||||
public void sendSystemMessage(Component message) {
|
public void sendSystemMessage(Component message) {
|
||||||
this.sendSystemMessage(message, false);
|
this.sendSystemMessage(message, false);
|
||||||
}
|
}
|
||||||
@@ -2492,7 +_,67 @@
|
@@ -2492,8 +2556,68 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
|
|
||||||
public void resetLastActionTime() {
|
public void resetLastActionTime() {
|
||||||
this.lastActionTime = Util.getMillis();
|
this.lastActionTime = Util.getMillis();
|
||||||
- }
|
|
||||||
+ this.setAfk(false); // Purpur - AFK API
|
+ this.setAfk(false); // Purpur - AFK API
|
||||||
+ }
|
}
|
||||||
+
|
|
||||||
+ // Purpur start - AFK API
|
+ // Purpur start - AFK API
|
||||||
+ private boolean isAfk = false;
|
+ private boolean isAfk = false;
|
||||||
+
|
+
|
||||||
@@ -212,10 +219,11 @@
|
|||||||
+ return !this.isAfk() && super.canBeCollidedWith(entity);
|
+ return !this.isAfk() && super.canBeCollidedWith(entity);
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end - AFK API
|
+ // Purpur end - AFK API
|
||||||
|
+
|
||||||
public ServerStatsCounter getStats() {
|
public ServerStatsCounter getStats() {
|
||||||
return this.stats;
|
return this.stats;
|
||||||
@@ -3126,4 +_,65 @@
|
}
|
||||||
|
@@ -3126,4 +3250,65 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||||
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
|
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/level/ServerPlayerGameMode.java b/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||||
|
index 84d19d79e77cec6a5d64f59fbcce703e467b2407..9b9cdb23a55b82efbeea3ba68b8144c15791dff0 100644
|
||||||
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
|
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||||
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
|
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||||
@@ -365,6 +_,7 @@
|
@@ -365,6 +365,7 @@ public class ServerPlayerGameMode {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -8,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
@@ -490,6 +_,7 @@
|
@@ -490,6 +491,7 @@ public class ServerPlayerGameMode {
|
||||||
public InteractionHand interactHand;
|
public InteractionHand interactHand;
|
||||||
public ItemStack interactItemStack;
|
public ItemStack interactItemStack;
|
||||||
public InteractionResult useItemOn(ServerPlayer player, Level level, ItemStack stack, InteractionHand hand, BlockHitResult hitResult) {
|
public InteractionResult useItemOn(ServerPlayer player, Level level, ItemStack stack, InteractionHand hand, BlockHitResult hitResult) {
|
||||||
@@ -16,7 +24,7 @@
|
|||||||
BlockPos blockPos = hitResult.getBlockPos();
|
BlockPos blockPos = hitResult.getBlockPos();
|
||||||
BlockState blockState = level.getBlockState(blockPos);
|
BlockState blockState = level.getBlockState(blockPos);
|
||||||
boolean cancelledBlock = false;
|
boolean cancelledBlock = false;
|
||||||
@@ -538,7 +_,7 @@
|
@@ -538,7 +540,7 @@ public class ServerPlayerGameMode {
|
||||||
boolean flag = !player.getMainHandItem().isEmpty() || !player.getOffhandItem().isEmpty();
|
boolean flag = !player.getMainHandItem().isEmpty() || !player.getOffhandItem().isEmpty();
|
||||||
boolean flag1 = player.isSecondaryUseActive() && flag;
|
boolean flag1 = player.isSecondaryUseActive() && flag;
|
||||||
ItemStack itemStack = stack.copy();
|
ItemStack itemStack = stack.copy();
|
||||||
@@ -25,7 +33,7 @@
|
|||||||
InteractionResult interactionResult = blockState.useItemOn(player.getItemInHand(hand), level, player, hand, hitResult);
|
InteractionResult interactionResult = blockState.useItemOn(player.getItemInHand(hand), level, player, hand, hitResult);
|
||||||
if (interactionResult.consumesAction()) {
|
if (interactionResult.consumesAction()) {
|
||||||
CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger(player, blockPos, itemStack);
|
CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger(player, blockPos, itemStack);
|
||||||
@@ -584,4 +_,18 @@
|
@@ -584,4 +586,18 @@ public class ServerPlayerGameMode {
|
||||||
public void setLevel(ServerLevel level) {
|
public void setLevel(ServerLevel level) {
|
||||||
this.level = level;
|
this.level = level;
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/level/WorldGenRegion.java b/net/minecraft/server/level/WorldGenRegion.java
|
||||||
|
index bf5e460b89d7c0fcdcb8826ba693bd23761df430..04f06861cc84c00a71a165ecf59920b5b5900c69 100644
|
||||||
--- a/net/minecraft/server/level/WorldGenRegion.java
|
--- a/net/minecraft/server/level/WorldGenRegion.java
|
||||||
+++ b/net/minecraft/server/level/WorldGenRegion.java
|
+++ b/net/minecraft/server/level/WorldGenRegion.java
|
||||||
@@ -311,6 +_,7 @@
|
@@ -311,6 +311,7 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
// Paper start - Buffer OOB setBlock calls
|
// Paper start - Buffer OOB setBlock calls
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
|
index b8a4b4cc02a2fc6b70f4b840796eed501aad6239..02c6733ce1de543dab3bf558148879039e501257 100644
|
||||||
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||||
@@ -40,10 +_,11 @@
|
@@ -40,10 +40,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
public final Connection connection; // Paper
|
public final Connection connection; // Paper
|
||||||
private final boolean transferred;
|
private final boolean transferred;
|
||||||
//private long keepAliveTime; // Paper - improve keepalives
|
//private long keepAliveTime; // Paper - improve keepalives
|
||||||
@@ -13,7 +21,7 @@
|
|||||||
private volatile int latency; // Paper - improve keepalives - make volatile
|
private volatile int latency; // Paper - improve keepalives - make volatile
|
||||||
private final io.papermc.paper.util.KeepAlive keepAlive; // Paper - improve keepalives
|
private final io.papermc.paper.util.KeepAlive keepAlive; // Paper - improve keepalives
|
||||||
private volatile boolean suspendFlushingOnServerThread = false;
|
private volatile boolean suspendFlushingOnServerThread = false;
|
||||||
@@ -54,6 +_,10 @@
|
@@ -54,6 +55,10 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
public final java.util.Map<java.util.UUID, net.kyori.adventure.resource.ResourcePackCallback> packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks
|
public final java.util.Map<java.util.UUID, net.kyori.adventure.resource.ResourcePackCallback> packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks
|
||||||
private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit
|
private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit
|
||||||
protected static final net.minecraft.resources.Identifier MINECRAFT_BRAND = net.minecraft.resources.Identifier.withDefaultNamespace("brand"); // Paper - Brand support
|
protected static final net.minecraft.resources.Identifier MINECRAFT_BRAND = net.minecraft.resources.Identifier.withDefaultNamespace("brand"); // Paper - Brand support
|
||||||
@@ -24,7 +32,7 @@
|
|||||||
// Paper start - retain certain values
|
// Paper start - retain certain values
|
||||||
public @Nullable String playerBrand;
|
public @Nullable String playerBrand;
|
||||||
public final java.util.Set<String> pluginMessagerChannels;
|
public final java.util.Set<String> pluginMessagerChannels;
|
||||||
@@ -105,6 +_,18 @@
|
@@ -105,6 +110,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
// Paper start - improve keepalives
|
// Paper start - improve keepalives
|
||||||
long now = System.nanoTime();
|
long now = System.nanoTime();
|
||||||
io.papermc.paper.util.KeepAlive.PendingKeepAlive pending = this.keepAlive.pendingKeepAlives.peek();
|
io.papermc.paper.util.KeepAlive.PendingKeepAlive pending = this.keepAlive.pendingKeepAlives.peek();
|
||||||
@@ -43,7 +51,7 @@
|
|||||||
if (pending != null && pending.challengeId() == packet.getId()) {
|
if (pending != null && pending.challengeId() == packet.getId()) {
|
||||||
this.keepAlive.pendingKeepAlives.remove(pending);
|
this.keepAlive.pendingKeepAlives.remove(pending);
|
||||||
|
|
||||||
@@ -179,6 +_,12 @@
|
@@ -179,6 +196,12 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +64,7 @@
|
|||||||
if (identifier.equals(MINECRAFT_BRAND)) {
|
if (identifier.equals(MINECRAFT_BRAND)) {
|
||||||
this.playerBrand = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.wrappedBuffer(data)).readUtf(256);
|
this.playerBrand = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.wrappedBuffer(data)).readUtf(256);
|
||||||
}
|
}
|
||||||
@@ -264,6 +_,23 @@
|
@@ -264,6 +287,23 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||||
Profiler.get().push("keepAlive");
|
Profiler.get().push("keepAlive");
|
||||||
long millis = Util.getMillis();
|
long millis = Util.getMillis();
|
||||||
// Paper start - improve keepalives
|
// Paper start - improve keepalives
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
|
index e158d614abed8d16e80192c0c9abd8537c92b9dc..74f8f1c8a3d688fadcbc266bac126e13d9d93dc5 100644
|
||||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -346,6 +_,20 @@
|
@@ -346,6 +346,20 @@ public class ServerGamePacketListenerImpl
|
||||||
}
|
}
|
||||||
// Paper end - configuration phase API
|
// Paper end - configuration phase API
|
||||||
|
|
||||||
@@ -21,7 +29,7 @@
|
|||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
if (this.isDisconnected()) return; // Paper
|
if (this.isDisconnected()) return; // Paper
|
||||||
@@ -364,6 +_,12 @@
|
@@ -364,6 +378,12 @@ public class ServerGamePacketListenerImpl
|
||||||
&& this.server.playerIdleTimeout() > 0
|
&& this.server.playerIdleTimeout() > 0
|
||||||
&& Util.getMillis() - this.player.getLastActionTime() > TimeUnit.MINUTES.toMillis(this.server.playerIdleTimeout())
|
&& Util.getMillis() - this.player.getLastActionTime() > TimeUnit.MINUTES.toMillis(this.server.playerIdleTimeout())
|
||||||
&& !this.player.wonGame) {
|
&& !this.player.wonGame) {
|
||||||
@@ -34,7 +42,7 @@
|
|||||||
this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
|
this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -683,6 +_,8 @@
|
@@ -683,6 +703,8 @@ public class ServerGamePacketListenerImpl
|
||||||
this.lastYaw = to.getYaw();
|
this.lastYaw = to.getYaw();
|
||||||
this.lastPitch = to.getPitch();
|
this.lastPitch = to.getPitch();
|
||||||
|
|
||||||
@@ -43,7 +51,7 @@
|
|||||||
Location oldTo = to.clone();
|
Location oldTo = to.clone();
|
||||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||||
this.cserver.getPluginManager().callEvent(event);
|
this.cserver.getPluginManager().callEvent(event);
|
||||||
@@ -762,6 +_,7 @@
|
@@ -762,6 +784,7 @@ public class ServerGamePacketListenerImpl
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||||
if (packet.getId() == this.awaitingTeleport) {
|
if (packet.getId() == this.awaitingTeleport) {
|
||||||
if (this.awaitingPositionFromClient == null) {
|
if (this.awaitingPositionFromClient == null) {
|
||||||
@@ -51,7 +59,7 @@
|
|||||||
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
|
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1302,6 +_,10 @@
|
@@ -1302,6 +1325,10 @@ public class ServerGamePacketListenerImpl
|
||||||
final int maxBookPageSize = pageMax.intValue();
|
final int maxBookPageSize = pageMax.intValue();
|
||||||
final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
|
final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
|
||||||
long byteAllowed = maxBookPageSize;
|
long byteAllowed = maxBookPageSize;
|
||||||
@@ -62,7 +70,7 @@
|
|||||||
for (final String page : pageList) {
|
for (final String page : pageList) {
|
||||||
final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
|
final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
|
||||||
byteTotal += byteLength;
|
byteTotal += byteLength;
|
||||||
@@ -1326,7 +_,8 @@
|
@@ -1326,7 +1353,8 @@ public class ServerGamePacketListenerImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
if (byteTotal > byteAllowed) {
|
if (byteTotal > byteAllowed) {
|
||||||
@@ -72,7 +80,7 @@
|
|||||||
this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect
|
this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1345,31 +_,45 @@
|
@@ -1345,31 +1373,45 @@ public class ServerGamePacketListenerImpl
|
||||||
Optional<String> optional = packet.title();
|
Optional<String> optional = packet.title();
|
||||||
optional.ifPresent(list::add);
|
optional.ifPresent(list::add);
|
||||||
list.addAll(packet.pages());
|
list.addAll(packet.pages());
|
||||||
@@ -122,7 +130,7 @@
|
|||||||
itemStack.set(
|
itemStack.set(
|
||||||
DataComponents.WRITTEN_BOOK_CONTENT, new WrittenBookContent(this.filterableFromOutgoing(title), this.player.getPlainTextName(), 0, list, true)
|
DataComponents.WRITTEN_BOOK_CONTENT, new WrittenBookContent(this.filterableFromOutgoing(title), this.player.getPlainTextName(), 0, list, true)
|
||||||
);
|
);
|
||||||
@@ -1382,6 +_,16 @@
|
@@ -1382,6 +1424,16 @@ public class ServerGamePacketListenerImpl
|
||||||
return this.player.isTextFilteringEnabled() ? Filterable.passThrough(filteredText.filteredOrEmpty()) : Filterable.from(filteredText);
|
return this.player.isTextFilteringEnabled() ? Filterable.passThrough(filteredText.filteredOrEmpty()) : Filterable.from(filteredText);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +147,7 @@
|
|||||||
@Override
|
@Override
|
||||||
public void handleEntityTagQuery(ServerboundEntityTagQueryPacket packet) {
|
public void handleEntityTagQuery(ServerboundEntityTagQueryPacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||||
@@ -1421,7 +_,15 @@
|
@@ -1421,7 +1473,15 @@ public class ServerGamePacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
|
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||||
@@ -156,7 +164,7 @@
|
|||||||
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
|
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
|
||||||
} else {
|
} else {
|
||||||
ServerLevel serverLevel = this.player.level();
|
ServerLevel serverLevel = this.player.level();
|
||||||
@@ -1604,7 +_,7 @@
|
@@ -1604,7 +1664,7 @@ public class ServerGamePacketListenerImpl
|
||||||
movedWrongly = true;
|
movedWrongly = true;
|
||||||
if (event.getLogWarning())
|
if (event.getLogWarning())
|
||||||
// Paper end
|
// Paper end
|
||||||
@@ -165,7 +173,7 @@
|
|||||||
} // Paper
|
} // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1669,6 +_,8 @@
|
@@ -1669,6 +1729,8 @@ public class ServerGamePacketListenerImpl
|
||||||
this.lastYaw = to.getYaw();
|
this.lastYaw = to.getYaw();
|
||||||
this.lastPitch = to.getPitch();
|
this.lastPitch = to.getPitch();
|
||||||
|
|
||||||
@@ -174,7 +182,7 @@
|
|||||||
Location oldTo = to.clone();
|
Location oldTo = to.clone();
|
||||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||||
this.cserver.getPluginManager().callEvent(event);
|
this.cserver.getPluginManager().callEvent(event);
|
||||||
@@ -1724,6 +_,13 @@
|
@@ -1724,6 +1786,13 @@ public class ServerGamePacketListenerImpl
|
||||||
this.player.tryResetCurrentImpulseContext();
|
this.player.tryResetCurrentImpulseContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +196,7 @@
|
|||||||
this.player.checkMovementStatistics(this.player.getX() - x, this.player.getY() - y, this.player.getZ() - z);
|
this.player.checkMovementStatistics(this.player.getX() - x, this.player.getY() - y, this.player.getZ() - z);
|
||||||
this.lastGoodX = this.player.getX();
|
this.lastGoodX = this.player.getX();
|
||||||
this.lastGoodY = this.player.getY();
|
this.lastGoodY = this.player.getY();
|
||||||
@@ -1741,6 +_,17 @@
|
@@ -1741,6 +1810,17 @@ public class ServerGamePacketListenerImpl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +214,7 @@
|
|||||||
private boolean shouldCheckPlayerMovement(boolean isElytraMovement) {
|
private boolean shouldCheckPlayerMovement(boolean isElytraMovement) {
|
||||||
if (this.isSingleplayerOwner()) {
|
if (this.isSingleplayerOwner()) {
|
||||||
return false;
|
return false;
|
||||||
@@ -2169,6 +_,7 @@
|
@@ -2169,6 +2249,7 @@ public class ServerGamePacketListenerImpl
|
||||||
|
|
||||||
boolean cancelled;
|
boolean cancelled;
|
||||||
if (hitResult == null || hitResult.getType() != HitResult.Type.BLOCK) {
|
if (hitResult == null || hitResult.getType() != HitResult.Type.BLOCK) {
|
||||||
@@ -214,7 +222,7 @@
|
|||||||
org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemInHand, hand);
|
org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemInHand, hand);
|
||||||
cancelled = event.useItemInHand() == Event.Result.DENY;
|
cancelled = event.useItemInHand() == Event.Result.DENY;
|
||||||
} else {
|
} else {
|
||||||
@@ -2821,6 +_,7 @@
|
@@ -2821,6 +2902,7 @@ public class ServerGamePacketListenerImpl
|
||||||
|
|
||||||
AABB boundingBox = target.getBoundingBox();
|
AABB boundingBox = target.getBoundingBox();
|
||||||
if (packet.isWithinRange(this.player, boundingBox, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(3.0))) { // Paper - configurable lenience value for interact range
|
if (packet.isWithinRange(this.player, boundingBox, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(3.0))) { // Paper - configurable lenience value for interact range
|
||||||
@@ -222,7 +230,7 @@
|
|||||||
packet.dispatch(
|
packet.dispatch(
|
||||||
new ServerboundInteractPacket.Handler() {
|
new ServerboundInteractPacket.Handler() {
|
||||||
private void performInteraction(InteractionHand hand, ServerGamePacketListenerImpl.EntityInteraction entityInteraction, PlayerInteractEntityEvent event) { // CraftBukkit
|
private void performInteraction(InteractionHand hand, ServerGamePacketListenerImpl.EntityInteraction entityInteraction, PlayerInteractEntityEvent event) { // CraftBukkit
|
||||||
@@ -3581,7 +_,7 @@
|
@@ -3581,7 +3663,7 @@ public class ServerGamePacketListenerImpl
|
||||||
@Override
|
@Override
|
||||||
public void handleChangeGameMode(ServerboundChangeGameModePacket packet) {
|
public void handleChangeGameMode(ServerboundChangeGameModePacket packet) {
|
||||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
|
index 51a29ab542136e67741be10bbc5c6377715a207c..e16bb386ae500bc290970f8cba33c5999cf0a58d 100644
|
||||||
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||||
@@ -278,7 +_,7 @@
|
@@ -278,7 +278,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||||
ServerLoginPacketListenerImpl.LOGGER.warn("Failed to verify username but will let them in anyway!");
|
ServerLoginPacketListenerImpl.LOGGER.warn("Failed to verify username but will let them in anyway!");
|
||||||
ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(string1)); // Spigot
|
ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(string1)); // Spigot
|
||||||
} else {
|
} else {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||||
|
index 465559113071a47e706f77a5b0996597ee986b3d..1b966dc52b067cd9d1fa9f500b692e3f75f1cc90 100644
|
||||||
--- a/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
--- a/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||||
+++ b/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
+++ b/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||||
@@ -37,6 +_,7 @@
|
@@ -37,6 +37,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
||||||
} else {
|
} else {
|
||||||
this.hasRequestedStatus = true;
|
this.hasRequestedStatus = true;
|
||||||
// this.connection.send(new ClientboundStatusResponsePacket(this.status)); // Paper
|
// this.connection.send(new ClientboundStatusResponsePacket(this.status)); // Paper
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||||
|
index 989ac565c47a70c7947cb7315d0f5c2cfecd0363..646e16b3d69b5516e8f7c401828fec731378979c 100644
|
||||||
--- a/net/minecraft/server/players/PlayerList.java
|
--- a/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/net/minecraft/server/players/PlayerList.java
|
+++ b/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -311,6 +_,7 @@
|
@@ -311,6 +311,7 @@ public abstract class PlayerList {
|
||||||
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
|
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
|
||||||
}
|
}
|
||||||
// Paper end - Configurable player collision
|
// Paper end - Configurable player collision
|
||||||
@@ -8,7 +16,7 @@
|
|||||||
// CraftBukkit start - moved down
|
// CraftBukkit start - moved down
|
||||||
LOGGER.info(
|
LOGGER.info(
|
||||||
"{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", // CraftBukkit - add world name
|
"{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", // CraftBukkit - add world name
|
||||||
@@ -431,6 +_,7 @@
|
@@ -431,6 +432,7 @@ public abstract class PlayerList {
|
||||||
}
|
}
|
||||||
public net.kyori.adventure.text.@Nullable Component remove(ServerPlayer player, net.kyori.adventure.text.Component leaveMessage) {
|
public net.kyori.adventure.text.@Nullable Component remove(ServerPlayer player, net.kyori.adventure.text.Component leaveMessage) {
|
||||||
// Paper end - Fix kick event leave message not being sent
|
// Paper end - Fix kick event leave message not being sent
|
||||||
@@ -16,7 +24,7 @@
|
|||||||
ServerLevel serverLevel = player.level();
|
ServerLevel serverLevel = player.level();
|
||||||
player.awardStat(Stats.LEAVE_GAME);
|
player.awardStat(Stats.LEAVE_GAME);
|
||||||
// CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
|
// CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
|
||||||
@@ -770,6 +_,20 @@
|
@@ -770,6 +772,20 @@ public abstract class PlayerList {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +45,7 @@
|
|||||||
public void broadcastAll(Packet<?> packet, ResourceKey<Level> dimension) {
|
public void broadcastAll(Packet<?> packet, ResourceKey<Level> dimension) {
|
||||||
for (ServerPlayer serverPlayer : this.players) {
|
for (ServerPlayer serverPlayer : this.players) {
|
||||||
if (serverPlayer.level().dimension() == dimension) {
|
if (serverPlayer.level().dimension() == dimension) {
|
||||||
@@ -863,6 +_,7 @@
|
@@ -863,6 +879,7 @@ public abstract class PlayerList {
|
||||||
case ADMINS -> EntityEvent.PERMISSION_LEVEL_ADMINS;
|
case ADMINS -> EntityEvent.PERMISSION_LEVEL_ADMINS;
|
||||||
case OWNERS -> EntityEvent.PERMISSION_LEVEL_OWNERS;
|
case OWNERS -> EntityEvent.PERMISSION_LEVEL_OWNERS;
|
||||||
};
|
};
|
||||||
@@ -45,7 +53,7 @@
|
|||||||
player.connection.send(new ClientboundEntityEventPacket(player, b));
|
player.connection.send(new ClientboundEntityEventPacket(player, b));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -874,7 +_,7 @@
|
@@ -874,7 +891,7 @@ public abstract class PlayerList {
|
||||||
|
|
||||||
// Paper start - whitelist verify event / login event
|
// Paper start - whitelist verify event / login event
|
||||||
public LoginResult canBypassFullServerLogin(final NameAndId nameAndId, final LoginResult currentResult) {
|
public LoginResult canBypassFullServerLogin(final NameAndId nameAndId, final LoginResult currentResult) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/server/players/SleepStatus.java b/net/minecraft/server/players/SleepStatus.java
|
||||||
|
index 2a7ae521654ad5c9f392baa5562e64bb71b13097..3a3e6992563236141db687084aeec9684437a7db 100644
|
||||||
--- a/net/minecraft/server/players/SleepStatus.java
|
--- a/net/minecraft/server/players/SleepStatus.java
|
||||||
+++ b/net/minecraft/server/players/SleepStatus.java
|
+++ b/net/minecraft/server/players/SleepStatus.java
|
||||||
@@ -15,7 +_,7 @@
|
@@ -15,7 +15,7 @@ public class SleepStatus {
|
||||||
|
|
||||||
public boolean areEnoughDeepSleeping(int requiredSleepPercentage, List<ServerPlayer> sleepingPlayers) {
|
public boolean areEnoughDeepSleeping(int requiredSleepPercentage, List<ServerPlayer> sleepingPlayers) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
boolean anyDeepSleep = sleepingPlayers.stream().anyMatch(Player::isSleepingLongEnough);
|
boolean anyDeepSleep = sleepingPlayers.stream().anyMatch(Player::isSleepingLongEnough);
|
||||||
return anyDeepSleep && i >= this.sleepersNeeded(requiredSleepPercentage);
|
return anyDeepSleep && i >= this.sleepersNeeded(requiredSleepPercentage);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -43,7 +_,7 @@
|
@@ -43,7 +43,7 @@ public class SleepStatus {
|
||||||
for (ServerPlayer serverPlayer : players) {
|
for (ServerPlayer serverPlayer : players) {
|
||||||
if (!serverPlayer.isSpectator()) {
|
if (!serverPlayer.isSpectator()) {
|
||||||
this.activePlayers++;
|
this.activePlayers++;
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/stats/ServerRecipeBook.java b/net/minecraft/stats/ServerRecipeBook.java
|
||||||
|
index 736a52c23da313bec6b25a9d1abf08816462403c..2f4f90bf428deb682fe9ec8c1218ae31ebaeea7c 100644
|
||||||
--- a/net/minecraft/stats/ServerRecipeBook.java
|
--- a/net/minecraft/stats/ServerRecipeBook.java
|
||||||
+++ b/net/minecraft/stats/ServerRecipeBook.java
|
+++ b/net/minecraft/stats/ServerRecipeBook.java
|
||||||
@@ -106,6 +_,7 @@
|
@@ -106,6 +106,7 @@ public class ServerRecipeBook extends RecipeBook {
|
||||||
private void loadRecipes(List<ResourceKey<Recipe<?>>> recipes, Consumer<ResourceKey<Recipe<?>>> output, Predicate<ResourceKey<Recipe<?>>> isRecognized) {
|
private void loadRecipes(List<ResourceKey<Recipe<?>>> recipes, Consumer<ResourceKey<Recipe<?>>> output, Predicate<ResourceKey<Recipe<?>>> isRecognized) {
|
||||||
for (ResourceKey<Recipe<?>> resourceKey : recipes) {
|
for (ResourceKey<Recipe<?>> resourceKey : recipes) {
|
||||||
if (!isRecognized.test(resourceKey)) {
|
if (!isRecognized.test(resourceKey)) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/util/StringUtil.java b/net/minecraft/util/StringUtil.java
|
||||||
|
index bd57f9a4224fc236cccecfd13b03f27d20ed15e9..da0018214439511288a43ca665abec6f01441f47 100644
|
||||||
--- a/net/minecraft/util/StringUtil.java
|
--- a/net/minecraft/util/StringUtil.java
|
||||||
+++ b/net/minecraft/util/StringUtil.java
|
+++ b/net/minecraft/util/StringUtil.java
|
||||||
@@ -87,6 +_,7 @@
|
@@ -87,6 +87,7 @@ public class StringUtil {
|
||||||
|
|
||||||
// Paper start - Username validation
|
// Paper start - Username validation
|
||||||
public static boolean isReasonablePlayerName(final String name) {
|
public static boolean isReasonablePlayerName(final String name) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/damagesource/CombatRules.java b/net/minecraft/world/damagesource/CombatRules.java
|
||||||
|
index 5f8637dfe4703cb78f486fe49d2e81518cf48715..d27215349f63e73198d23e107a6b634ddef8f7ca 100644
|
||||||
--- a/net/minecraft/world/damagesource/CombatRules.java
|
--- a/net/minecraft/world/damagesource/CombatRules.java
|
||||||
+++ b/net/minecraft/world/damagesource/CombatRules.java
|
+++ b/net/minecraft/world/damagesource/CombatRules.java
|
||||||
@@ -15,7 +_,7 @@
|
@@ -15,7 +15,7 @@ public class CombatRules {
|
||||||
|
|
||||||
public static float getDamageAfterAbsorb(LivingEntity entity, float damageAmount, DamageSource damageSource, float armorValue, float armorToughness) {
|
public static float getDamageAfterAbsorb(LivingEntity entity, float damageAmount, DamageSource damageSource, float armorValue, float armorToughness) {
|
||||||
float f = 2.0F + armorToughness / 4.0F;
|
float f = 2.0F + armorToughness / 4.0F;
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
float f2 = f1 / 25.0F;
|
float f2 = f1 / 25.0F;
|
||||||
ItemStack weaponItem = damageSource.getWeaponItem();
|
ItemStack weaponItem = damageSource.getWeaponItem();
|
||||||
float f3;
|
float f3;
|
||||||
@@ -30,7 +_,7 @@
|
@@ -30,7 +30,7 @@ public class CombatRules {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float getDamageAfterMagicAbsorb(float damageAmount, float enchantModifiers) {
|
public static float getDamageAfterMagicAbsorb(float damageAmount, float enchantModifiers) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/damagesource/CombatTracker.java b/net/minecraft/world/damagesource/CombatTracker.java
|
||||||
|
index ffdfb4c4e3d6496ebdba6e4bad7146a9cbdcf5ec..30d0807d7adf46a6cd23b81b979e06f943a2bca1 100644
|
||||||
--- a/net/minecraft/world/damagesource/CombatTracker.java
|
--- a/net/minecraft/world/damagesource/CombatTracker.java
|
||||||
+++ b/net/minecraft/world/damagesource/CombatTracker.java
|
+++ b/net/minecraft/world/damagesource/CombatTracker.java
|
||||||
@@ -64,7 +_,7 @@
|
@@ -64,7 +64,7 @@ public class CombatTracker {
|
||||||
|
|
||||||
private Component getMessageForAssistedFall(Entity entity, Component entityDisplayName, String hasWeaponTranslationKey, String noWeaponTranslationKey) {
|
private Component getMessageForAssistedFall(Entity entity, Component entityDisplayName, String hasWeaponTranslationKey, String noWeaponTranslationKey) {
|
||||||
ItemStack itemStack = entity instanceof LivingEntity livingEntity ? livingEntity.getMainHandItem() : ItemStack.EMPTY;
|
ItemStack itemStack = entity instanceof LivingEntity livingEntity ? livingEntity.getMainHandItem() : ItemStack.EMPTY;
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
? Component.translatable(hasWeaponTranslationKey, this.mob.getDisplayName(), entityDisplayName, itemStack.getDisplayName())
|
? Component.translatable(hasWeaponTranslationKey, this.mob.getDisplayName(), entityDisplayName, itemStack.getDisplayName())
|
||||||
: Component.translatable(noWeaponTranslationKey, this.mob.getDisplayName(), entityDisplayName);
|
: Component.translatable(noWeaponTranslationKey, this.mob.getDisplayName(), entityDisplayName);
|
||||||
}
|
}
|
||||||
@@ -107,6 +_,15 @@
|
@@ -107,6 +107,15 @@ public class CombatTracker {
|
||||||
Component component = ComponentUtils.wrapInSquareBrackets(Component.translatable(string + ".link")).withStyle(INTENTIONAL_GAME_DESIGN_STYLE);
|
Component component = ComponentUtils.wrapInSquareBrackets(Component.translatable(string + ".link")).withStyle(INTENTIONAL_GAME_DESIGN_STYLE);
|
||||||
return Component.translatable(string + ".message", this.mob.getDisplayName(), component);
|
return Component.translatable(string + ".message", this.mob.getDisplayName(), component);
|
||||||
} else {
|
} else {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/damagesource/DamageSource.java b/net/minecraft/world/damagesource/DamageSource.java
|
||||||
|
index 4df37fcd42b8edf789ee8e99d61ee1fa6471288b..67318e32fa58a89ba9321a36627af07697aacea4 100644
|
||||||
--- a/net/minecraft/world/damagesource/DamageSource.java
|
--- a/net/minecraft/world/damagesource/DamageSource.java
|
||||||
+++ b/net/minecraft/world/damagesource/DamageSource.java
|
+++ b/net/minecraft/world/damagesource/DamageSource.java
|
||||||
@@ -24,6 +_,8 @@
|
@@ -24,6 +24,8 @@ public class DamageSource {
|
||||||
private org.bukkit.block.@Nullable Block eventBlockDamager; // Relevant block set. damageSourcePosition is only used for bad respawn point explosion or custom damage
|
private org.bukkit.block.@Nullable Block eventBlockDamager; // Relevant block set. damageSourcePosition is only used for bad respawn point explosion or custom damage
|
||||||
private org.bukkit.block.@Nullable BlockState fromBlockSnapshot; // Captured block snapshot when the eventBlockDamager is not relevant (e.g. for bad respawn point explosions the block is already removed)
|
private org.bukkit.block.@Nullable BlockState fromBlockSnapshot; // Captured block snapshot when the eventBlockDamager is not relevant (e.g. for bad respawn point explosions the block is already removed)
|
||||||
private boolean critical; // Supports arrows and sweeping damage
|
private boolean critical; // Supports arrows and sweeping damage
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
|
|
||||||
public DamageSource knownCause(final org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) {
|
public DamageSource knownCause(final org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) {
|
||||||
final DamageSource damageSource = this.copy();
|
final DamageSource damageSource = this.copy();
|
||||||
@@ -35,6 +_,30 @@
|
@@ -35,6 +37,30 @@ public class DamageSource {
|
||||||
return this.knownCause;
|
return this.knownCause;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +48,7 @@
|
|||||||
@Nullable
|
@Nullable
|
||||||
public Entity eventEntityDamager() {
|
public Entity eventEntityDamager() {
|
||||||
return this.eventEntityDamager;
|
return this.eventEntityDamager;
|
||||||
@@ -94,6 +_,8 @@
|
@@ -94,6 +120,8 @@ public class DamageSource {
|
||||||
damageSource.eventBlockDamager = this.eventBlockDamager;
|
damageSource.eventBlockDamager = this.eventBlockDamager;
|
||||||
damageSource.fromBlockSnapshot = this.fromBlockSnapshot;
|
damageSource.fromBlockSnapshot = this.fromBlockSnapshot;
|
||||||
damageSource.critical = this.critical;
|
damageSource.critical = this.critical;
|
||||||
@@ -49,7 +57,7 @@
|
|||||||
return damageSource;
|
return damageSource;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -157,11 +_,20 @@
|
@@ -157,12 +185,21 @@ public class DamageSource {
|
||||||
} else {
|
} else {
|
||||||
Component component = this.causingEntity == null ? this.directEntity.getDisplayName() : this.causingEntity.getDisplayName();
|
Component component = this.causingEntity == null ? this.directEntity.getDisplayName() : this.causingEntity.getDisplayName();
|
||||||
ItemStack itemStack = this.causingEntity instanceof LivingEntity livingEntity1 ? livingEntity1.getMainHandItem() : ItemStack.EMPTY;
|
ItemStack itemStack = this.causingEntity instanceof LivingEntity livingEntity1 ? livingEntity1.getMainHandItem() : ItemStack.EMPTY;
|
||||||
@@ -59,7 +67,7 @@
|
|||||||
: Component.translatable(string, livingEntity.getDisplayName(), component);
|
: Component.translatable(string, livingEntity.getDisplayName(), component);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+
|
|
||||||
+ // Purpur start - Component related conveniences
|
+ // Purpur start - Component related conveniences
|
||||||
+ public Component getLocalizedDeathMessage(String str, LivingEntity entity) {
|
+ public Component getLocalizedDeathMessage(String str, LivingEntity entity) {
|
||||||
+ net.kyori.adventure.text.Component name = io.papermc.paper.adventure.PaperAdventure.asAdventure(entity.getDisplayName());
|
+ net.kyori.adventure.text.Component name = io.papermc.paper.adventure.PaperAdventure.asAdventure(entity.getDisplayName());
|
||||||
@@ -68,6 +76,7 @@
|
|||||||
+ return io.papermc.paper.adventure.PaperAdventure.asVanilla(component);
|
+ return io.papermc.paper.adventure.PaperAdventure.asVanilla(component);
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end - Component related conveniences
|
+ // Purpur end - Component related conveniences
|
||||||
|
+
|
||||||
public String getMsgId() {
|
public String getMsgId() {
|
||||||
return this.type().msgId();
|
return this.type().msgId();
|
||||||
|
}
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/damagesource/DamageSources.java b/net/minecraft/world/damagesource/DamageSources.java
|
||||||
|
index e45891d10dfab44d3aa584cc7db3fbc3c7654af5..1e1b773d88917b251d71aad40b85fbc5fffce8c8 100644
|
||||||
--- a/net/minecraft/world/damagesource/DamageSources.java
|
--- a/net/minecraft/world/damagesource/DamageSources.java
|
||||||
+++ b/net/minecraft/world/damagesource/DamageSources.java
|
+++ b/net/minecraft/world/damagesource/DamageSources.java
|
||||||
@@ -42,6 +_,8 @@
|
@@ -42,6 +42,8 @@ public class DamageSources {
|
||||||
private final DamageSource stalagmite;
|
private final DamageSource stalagmite;
|
||||||
private final DamageSource outsideBorder;
|
private final DamageSource outsideBorder;
|
||||||
private final DamageSource genericKill;
|
private final DamageSource genericKill;
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
|
|
||||||
public DamageSources(RegistryAccess registry) {
|
public DamageSources(RegistryAccess registry) {
|
||||||
this.damageTypes = registry.lookupOrThrow(Registries.DAMAGE_TYPE);
|
this.damageTypes = registry.lookupOrThrow(Registries.DAMAGE_TYPE);
|
||||||
@@ -70,6 +_,8 @@
|
@@ -70,6 +72,8 @@ public class DamageSources {
|
||||||
this.stalagmite = this.source(DamageTypes.STALAGMITE);
|
this.stalagmite = this.source(DamageTypes.STALAGMITE);
|
||||||
this.outsideBorder = this.source(DamageTypes.OUTSIDE_BORDER);
|
this.outsideBorder = this.source(DamageTypes.OUTSIDE_BORDER);
|
||||||
this.genericKill = this.source(DamageTypes.GENERIC_KILL);
|
this.genericKill = this.source(DamageTypes.GENERIC_KILL);
|
||||||
@@ -18,11 +26,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private DamageSource source(ResourceKey<DamageType> damageTypeKey) {
|
private DamageSource source(ResourceKey<DamageType> damageTypeKey) {
|
||||||
@@ -83,6 +_,18 @@
|
@@ -84,6 +88,18 @@ public class DamageSources {
|
||||||
private DamageSource source(ResourceKey<DamageType> damageTypeKey, @Nullable Entity causingEntity, @Nullable Entity directEntity) {
|
|
||||||
return new DamageSource(this.damageTypes.getOrThrow(damageTypeKey), causingEntity, directEntity);
|
return new DamageSource(this.damageTypes.getOrThrow(damageTypeKey), causingEntity, directEntity);
|
||||||
}
|
}
|
||||||
+
|
|
||||||
+ // Purpur start - Dont run with scissor
|
+ // Purpur start - Dont run with scissor
|
||||||
+ public DamageSource scissors() {
|
+ public DamageSource scissors() {
|
||||||
+ return this.scissors;
|
+ return this.scissors;
|
||||||
@@ -34,6 +41,7 @@
|
|||||||
+ return this.stonecutter;
|
+ return this.stonecutter;
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end - Stonecutter damage
|
+ // Purpur end - Stonecutter damage
|
||||||
|
+
|
||||||
public DamageSource inFire() {
|
public DamageSource inFire() {
|
||||||
return this.inFire;
|
return this.inFire;
|
||||||
|
}
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/effect/HungerMobEffect.java b/net/minecraft/world/effect/HungerMobEffect.java
|
||||||
|
index 0890694ae96b6cd60079c34066e7a6e288f038e8..6c0e6bd2a171edc57dec71af178764454de73313 100644
|
||||||
--- a/net/minecraft/world/effect/HungerMobEffect.java
|
--- a/net/minecraft/world/effect/HungerMobEffect.java
|
||||||
+++ b/net/minecraft/world/effect/HungerMobEffect.java
|
+++ b/net/minecraft/world/effect/HungerMobEffect.java
|
||||||
@@ -12,7 +_,7 @@
|
@@ -12,7 +12,7 @@ class HungerMobEffect extends MobEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean applyEffectTick(ServerLevel level, LivingEntity entity, int amplifier) {
|
public boolean applyEffectTick(ServerLevel level, LivingEntity entity, int amplifier) {
|
||||||
if (entity instanceof Player player) {
|
if (entity instanceof Player player) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/effect/PoisonMobEffect.java b/net/minecraft/world/effect/PoisonMobEffect.java
|
||||||
|
index 75327fd96858fd508ea63a6983e5cbc655a8800f..73cfc61ac3f8e33e6b9f4fd08a292266c0adb535 100644
|
||||||
--- a/net/minecraft/world/effect/PoisonMobEffect.java
|
--- a/net/minecraft/world/effect/PoisonMobEffect.java
|
||||||
+++ b/net/minecraft/world/effect/PoisonMobEffect.java
|
+++ b/net/minecraft/world/effect/PoisonMobEffect.java
|
||||||
@@ -12,8 +_,8 @@
|
@@ -12,8 +12,8 @@ public class PoisonMobEffect extends MobEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applyEffectTick(ServerLevel level, LivingEntity entity, int amplifier) {
|
public boolean applyEffectTick(ServerLevel level, LivingEntity entity, int amplifier) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/effect/RegenerationMobEffect.java b/net/minecraft/world/effect/RegenerationMobEffect.java
|
||||||
|
index 76cffa4d4d18d6c04749d941dbdf5eb60aed4095..81481267a1577721dcc405f39a4c350bd59ac9a2 100644
|
||||||
--- a/net/minecraft/world/effect/RegenerationMobEffect.java
|
--- a/net/minecraft/world/effect/RegenerationMobEffect.java
|
||||||
+++ b/net/minecraft/world/effect/RegenerationMobEffect.java
|
+++ b/net/minecraft/world/effect/RegenerationMobEffect.java
|
||||||
@@ -11,7 +_,7 @@
|
@@ -11,7 +11,7 @@ class RegenerationMobEffect extends MobEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean applyEffectTick(ServerLevel level, LivingEntity entity, int amplifier) {
|
public boolean applyEffectTick(ServerLevel level, LivingEntity entity, int amplifier) {
|
||||||
if (entity.getHealth() < entity.getMaxHealth()) {
|
if (entity.getHealth() < entity.getMaxHealth()) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/effect/SaturationMobEffect.java b/net/minecraft/world/effect/SaturationMobEffect.java
|
||||||
|
index c192165910f6b139df6f604d0bce989061efa9cb..622c23f4570d07de8bee9623bf900aabb3331ded 100644
|
||||||
--- a/net/minecraft/world/effect/SaturationMobEffect.java
|
--- a/net/minecraft/world/effect/SaturationMobEffect.java
|
||||||
+++ b/net/minecraft/world/effect/SaturationMobEffect.java
|
+++ b/net/minecraft/world/effect/SaturationMobEffect.java
|
||||||
@@ -16,7 +_,8 @@
|
@@ -16,7 +16,8 @@ class SaturationMobEffect extends InstantenousMobEffect {
|
||||||
int oldFoodLevel = player.getFoodData().foodLevel;
|
int oldFoodLevel = player.getFoodData().foodLevel;
|
||||||
org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(player, amplifier + 1 + oldFoodLevel);
|
org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(player, amplifier + 1 + oldFoodLevel);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/effect/WitherMobEffect.java b/net/minecraft/world/effect/WitherMobEffect.java
|
||||||
|
index 1fc9e1ad541c46124183a401b2a7d99aea69cecf..881271f0bc77a8a8a7d31daad9a8188bebaca67b 100644
|
||||||
--- a/net/minecraft/world/effect/WitherMobEffect.java
|
--- a/net/minecraft/world/effect/WitherMobEffect.java
|
||||||
+++ b/net/minecraft/world/effect/WitherMobEffect.java
|
+++ b/net/minecraft/world/effect/WitherMobEffect.java
|
||||||
@@ -12,7 +_,7 @@
|
@@ -12,7 +12,7 @@ public class WitherMobEffect extends MobEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applyEffectTick(ServerLevel level, LivingEntity entity, int amplifier) {
|
public boolean applyEffectTick(ServerLevel level, LivingEntity entity, int amplifier) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||||
|
index 118ba985eff209ff97dd2c8b2749a75113f5ce43..5efb94bf1029fdbbd48937c1f3925421d6daacfd 100644
|
||||||
--- a/net/minecraft/world/entity/Entity.java
|
--- a/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/net/minecraft/world/entity/Entity.java
|
+++ b/net/minecraft/world/entity/Entity.java
|
||||||
@@ -153,6 +_,7 @@
|
@@ -153,6 +153,7 @@ import org.jspecify.annotations.Nullable;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
public abstract class Entity implements SyncedDataHolder, DebugValueSource, Nameable, ItemOwner, SlotProvider, EntityAccess, ScoreHolder, DataComponentGetter, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker
|
public abstract class Entity implements SyncedDataHolder, DebugValueSource, Nameable, ItemOwner, SlotProvider, EntityAccess, ScoreHolder, DataComponentGetter, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker
|
||||||
@@ -8,7 +16,7 @@
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
private static final int CURRENT_LEVEL = 2;
|
private static final int CURRENT_LEVEL = 2;
|
||||||
static boolean isLevelAtLeast(ValueInput input, int level) {
|
static boolean isLevelAtLeast(ValueInput input, int level) {
|
||||||
@@ -282,8 +_,9 @@
|
@@ -282,8 +283,9 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
public double xOld;
|
public double xOld;
|
||||||
public double yOld;
|
public double yOld;
|
||||||
public double zOld;
|
public double zOld;
|
||||||
@@ -19,7 +27,7 @@
|
|||||||
public int tickCount;
|
public int tickCount;
|
||||||
private int remainingFireTicks;
|
private int remainingFireTicks;
|
||||||
public boolean wasTouchingWater;
|
public boolean wasTouchingWater;
|
||||||
@@ -316,8 +_,8 @@
|
@@ -316,8 +318,8 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
public @Nullable PortalProcessor portalProcess;
|
public @Nullable PortalProcessor portalProcess;
|
||||||
public int portalCooldown;
|
public int portalCooldown;
|
||||||
private boolean invulnerable;
|
private boolean invulnerable;
|
||||||
@@ -30,7 +38,7 @@
|
|||||||
private boolean hasGlowingTag;
|
private boolean hasGlowingTag;
|
||||||
private final Set<String> tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl
|
private final Set<String> tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl
|
||||||
private final double[] pistonDeltas = new double[]{0.0, 0.0, 0.0};
|
private final double[] pistonDeltas = new double[]{0.0, 0.0, 0.0};
|
||||||
@@ -373,6 +_,7 @@
|
@@ -373,6 +375,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
public long activatedTick = Integer.MIN_VALUE;
|
public long activatedTick = Integer.MIN_VALUE;
|
||||||
public boolean isTemporarilyActive;
|
public boolean isTemporarilyActive;
|
||||||
public long activatedImmunityTick = Integer.MIN_VALUE;
|
public long activatedImmunityTick = Integer.MIN_VALUE;
|
||||||
@@ -38,7 +46,7 @@
|
|||||||
|
|
||||||
public void inactiveTick() {
|
public void inactiveTick() {
|
||||||
}
|
}
|
||||||
@@ -535,10 +_,22 @@
|
@@ -535,10 +538,22 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
}
|
}
|
||||||
// Paper end - optimise entity tracker
|
// Paper end - optimise entity tracker
|
||||||
|
|
||||||
@@ -61,7 +69,7 @@
|
|||||||
this.position = Vec3.ZERO;
|
this.position = Vec3.ZERO;
|
||||||
this.blockPosition = BlockPos.ZERO;
|
this.blockPosition = BlockPos.ZERO;
|
||||||
this.chunkPosition = ChunkPos.ZERO;
|
this.chunkPosition = ChunkPos.ZERO;
|
||||||
@@ -931,6 +_,7 @@
|
@@ -931,6 +946,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
&& this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
|
&& this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
|
||||||
&& (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
|
&& (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
|
||||||
// Paper end - Configurable nether ceiling damage
|
// Paper end - Configurable nether ceiling damage
|
||||||
@@ -69,7 +77,7 @@
|
|||||||
this.onBelowWorld();
|
this.onBelowWorld();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1960,7 +_,7 @@
|
@@ -1960,7 +1976,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean fireImmune() {
|
public boolean fireImmune() {
|
||||||
@@ -78,7 +86,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean causeFallDamage(double fallDistance, float damageMultiplier, DamageSource damageSource) {
|
public boolean causeFallDamage(double fallDistance, float damageMultiplier, DamageSource damageSource) {
|
||||||
@@ -2572,7 +_,7 @@
|
@@ -2572,7 +2588,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
output.putBoolean("Bukkit.invisible", this.persistentInvisibility);
|
output.putBoolean("Bukkit.invisible", this.persistentInvisibility);
|
||||||
}
|
}
|
||||||
// SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
// SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
||||||
@@ -87,7 +95,7 @@
|
|||||||
output.putInt("Bukkit.MaxAirSupply", this.getMaxAirSupply());
|
output.putInt("Bukkit.MaxAirSupply", this.getMaxAirSupply());
|
||||||
}
|
}
|
||||||
output.putInt("Spigot.ticksLived", this.totalEntityAge); // Paper
|
output.putInt("Spigot.ticksLived", this.totalEntityAge); // Paper
|
||||||
@@ -2659,6 +_,11 @@
|
@@ -2659,6 +2675,11 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
output.putBoolean("Paper.FreezeLock", true);
|
output.putBoolean("Paper.FreezeLock", true);
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
@@ -99,7 +107,7 @@
|
|||||||
} catch (Throwable var7) {
|
} catch (Throwable var7) {
|
||||||
CrashReport crashReport = CrashReport.forThrowable(var7, "Saving entity NBT");
|
CrashReport crashReport = CrashReport.forThrowable(var7, "Saving entity NBT");
|
||||||
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being saved");
|
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being saved");
|
||||||
@@ -2779,6 +_,9 @@
|
@@ -2779,6 +2800,9 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
}
|
}
|
||||||
freezeLocked = input.getBooleanOr("Paper.FreezeLock", false);
|
freezeLocked = input.getBooleanOr("Paper.FreezeLock", false);
|
||||||
// Paper end
|
// Paper end
|
||||||
@@ -109,7 +117,7 @@
|
|||||||
} catch (Throwable var7) {
|
} catch (Throwable var7) {
|
||||||
CrashReport crashReport = CrashReport.forThrowable(var7, "Loading entity NBT");
|
CrashReport crashReport = CrashReport.forThrowable(var7, "Loading entity NBT");
|
||||||
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being loaded");
|
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being loaded");
|
||||||
@@ -3042,6 +_,7 @@
|
@@ -3042,6 +3066,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
if (this.isAlive() && this instanceof Leashable leashable2) {
|
if (this.isAlive() && this instanceof Leashable leashable2) {
|
||||||
if (leashable2.getLeashHolder() == player) {
|
if (leashable2.getLeashHolder() == player) {
|
||||||
if (!this.level().isClientSide()) {
|
if (!this.level().isClientSide()) {
|
||||||
@@ -117,7 +125,7 @@
|
|||||||
// Paper start - EntityUnleashEvent
|
// Paper start - EntityUnleashEvent
|
||||||
if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerUnleashEntityEvent(
|
if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerUnleashEntityEvent(
|
||||||
leashable2, player, hand, !player.hasInfiniteMaterials(), true
|
leashable2, player, hand, !player.hasInfiniteMaterials(), true
|
||||||
@@ -3472,15 +_,18 @@
|
@@ -3472,15 +3497,18 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
return Vec3.directionFromRotation(this.getRotationVector());
|
return Vec3.directionFromRotation(this.getRotationVector());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,7 +145,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4220,7 +_,7 @@
|
@@ -4220,7 +4248,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUsePortal(boolean allowPassengers) {
|
public boolean canUsePortal(boolean allowPassengers) {
|
||||||
@@ -146,7 +154,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canTeleport(Level fromLevel, Level toLevel) {
|
public boolean canTeleport(Level fromLevel, Level toLevel) {
|
||||||
@@ -4739,6 +_,12 @@
|
@@ -4739,6 +4767,12 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
return Mth.lerp(partialTick, this.yRotO, this.yRot);
|
return Mth.lerp(partialTick, this.yRotO, this.yRot);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +167,7 @@
|
|||||||
// Paper start - optimise collisions
|
// Paper start - optimise collisions
|
||||||
public boolean updateFluidHeightAndDoFluidPushing(final TagKey<Fluid> fluid, final double flowScale) {
|
public boolean updateFluidHeightAndDoFluidPushing(final TagKey<Fluid> fluid, final double flowScale) {
|
||||||
if (this.touchingUnloadedChunk()) {
|
if (this.touchingUnloadedChunk()) {
|
||||||
@@ -5159,7 +_,7 @@
|
@@ -5159,7 +5193,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||||
}
|
}
|
||||||
|
|
||||||
public float maxUpStep() {
|
public float maxUpStep() {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/EntitySelector.java b/net/minecraft/world/entity/EntitySelector.java
|
||||||
|
index b9ca072041f5fec0010017877a2821cd650023c5..cd8e22171449049b23823da9b5be6ede2c3f38d0 100644
|
||||||
--- a/net/minecraft/world/entity/EntitySelector.java
|
--- a/net/minecraft/world/entity/EntitySelector.java
|
||||||
+++ b/net/minecraft/world/entity/EntitySelector.java
|
+++ b/net/minecraft/world/entity/EntitySelector.java
|
||||||
@@ -28,6 +_,8 @@
|
@@ -28,6 +28,8 @@ public final class EntitySelector {
|
||||||
return net.minecraft.util.Mth.clamp(serverPlayer.getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= playerInsomniaTicks;
|
return net.minecraft.util.Mth.clamp(serverPlayer.getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= playerInsomniaTicks;
|
||||||
};
|
};
|
||||||
// Paper end - Ability to control player's insomnia and phantoms
|
// Paper end - Ability to control player's insomnia and phantoms
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java
|
||||||
|
index a3cba4a65687c61fefbfcf3c35625ceed2e50bfb..f0731609fbfb06ea23baba2a8b3694003a470b7d 100644
|
||||||
--- a/net/minecraft/world/entity/EntityType.java
|
--- a/net/minecraft/world/entity/EntityType.java
|
||||||
+++ b/net/minecraft/world/entity/EntityType.java
|
+++ b/net/minecraft/world/entity/EntityType.java
|
||||||
@@ -1240,6 +_,16 @@
|
@@ -1240,6 +1240,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||||
return register(vanillaEntityId(key), builder);
|
return register(vanillaEntityId(key), builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17,7 +25,7 @@
|
|||||||
public static Identifier getKey(EntityType<?> entityType) {
|
public static Identifier getKey(EntityType<?> entityType) {
|
||||||
return BuiltInRegistries.ENTITY_TYPE.getKey(entityType);
|
return BuiltInRegistries.ENTITY_TYPE.getKey(entityType);
|
||||||
}
|
}
|
||||||
@@ -1467,6 +_,16 @@
|
@@ -1467,6 +1477,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||||
return this.category;
|
return this.category;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +42,7 @@
|
|||||||
public String getDescriptionId() {
|
public String getDescriptionId() {
|
||||||
return this.descriptionId;
|
return this.descriptionId;
|
||||||
}
|
}
|
||||||
@@ -1528,6 +_,7 @@
|
@@ -1528,6 +1548,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||||
// Paper start - Add logging for debugging entity tags with invalid ids
|
// Paper start - Add logging for debugging entity tags with invalid ids
|
||||||
() -> {
|
() -> {
|
||||||
LOGGER.warn("Skipping Entity with id {}", input.getStringOr("id", "[invalid]"));
|
LOGGER.warn("Skipping Entity with id {}", input.getStringOr("id", "[invalid]"));
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ExperienceOrb.java b/net/minecraft/world/entity/ExperienceOrb.java
|
||||||
|
index f2ec0bd8cca3c08d558790537e17a8a2f95f1953..c655689cdd2d4e655dfc872edd231dcdfb7c0995 100644
|
||||||
--- a/net/minecraft/world/entity/ExperienceOrb.java
|
--- a/net/minecraft/world/entity/ExperienceOrb.java
|
||||||
+++ b/net/minecraft/world/entity/ExperienceOrb.java
|
+++ b/net/minecraft/world/entity/ExperienceOrb.java
|
||||||
@@ -355,7 +_,7 @@
|
@@ -355,7 +355,7 @@ public class ExperienceOrb extends Entity {
|
||||||
public void playerTouch(Player entity) {
|
public void playerTouch(Player entity) {
|
||||||
if (entity instanceof ServerPlayer serverPlayer) {
|
if (entity instanceof ServerPlayer serverPlayer) {
|
||||||
if (entity.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(serverPlayer.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - PlayerPickupExperienceEvent
|
if (entity.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(serverPlayer.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - PlayerPickupExperienceEvent
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
entity.take(this, 1);
|
entity.take(this, 1);
|
||||||
int i = this.repairPlayerItems(serverPlayer, this.getValue());
|
int i = this.repairPlayerItems(serverPlayer, this.getValue());
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
@@ -371,7 +_,7 @@
|
@@ -371,7 +371,7 @@ public class ExperienceOrb extends Entity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int repairPlayerItems(ServerPlayer player, int value) {
|
private int repairPlayerItems(ServerPlayer player, int value) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||||
|
index 54f31965213309a2cd228b7211e96ae1b9c219d4..527db90fa6faa6f39a80e64db16e28f1d616ce4d 100644
|
||||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -447,6 +_,12 @@
|
@@ -447,6 +447,12 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
if (d < 0.0) {
|
if (d < 0.0) {
|
||||||
double damagePerBlock = serverLevel1.getWorldBorder().getDamagePerBlock();
|
double damagePerBlock = serverLevel1.getWorldBorder().getDamagePerBlock();
|
||||||
if (damagePerBlock > 0.0) {
|
if (damagePerBlock > 0.0) {
|
||||||
@@ -13,7 +21,7 @@
|
|||||||
this.hurtServer(serverLevel1, this.damageSources().outOfBorder(), Math.max(1, Mth.floor(-d * damagePerBlock)));
|
this.hurtServer(serverLevel1, this.damageSources().outOfBorder(), Math.max(1, Mth.floor(-d * damagePerBlock)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -462,7 +_,7 @@
|
@@ -462,7 +468,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
if (this.shouldTakeDrowningDamage()) {
|
if (this.shouldTakeDrowningDamage()) {
|
||||||
this.setAirSupply(0);
|
this.setAirSupply(0);
|
||||||
serverLevel1.broadcastEntityEvent(this, EntityEvent.DROWN_PARTICLES);
|
serverLevel1.broadcastEntityEvent(this, EntityEvent.DROWN_PARTICLES);
|
||||||
@@ -22,7 +30,7 @@
|
|||||||
}
|
}
|
||||||
} else if (this.getAirSupply() < this.getMaxAirSupply() && MobEffectUtil.shouldEffectsRefillAirsupply(this)) {
|
} else if (this.getAirSupply() < this.getMaxAirSupply() && MobEffectUtil.shouldEffectsRefillAirsupply(this)) {
|
||||||
this.setAirSupply(this.increaseAirSupply(this.getAirSupply()));
|
this.setAirSupply(this.increaseAirSupply(this.getAirSupply()));
|
||||||
@@ -522,7 +_,7 @@
|
@@ -522,7 +528,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean shouldTakeDrowningDamage() {
|
protected boolean shouldTakeDrowningDamage() {
|
||||||
@@ -31,7 +39,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1050,14 +_,32 @@
|
@@ -1050,15 +1056,33 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
if (lookingEntity != null) {
|
if (lookingEntity != null) {
|
||||||
ItemStack itemBySlot = this.getItemBySlot(EquipmentSlot.HEAD);
|
ItemStack itemBySlot = this.getItemBySlot(EquipmentSlot.HEAD);
|
||||||
EntityType<?> type = lookingEntity.getType();
|
EntityType<?> type = lookingEntity.getType();
|
||||||
@@ -41,8 +49,6 @@
|
|||||||
- || type == EntityType.PIGLIN_BRUTE && itemBySlot.is(Items.PIGLIN_HEAD)
|
- || type == EntityType.PIGLIN_BRUTE && itemBySlot.is(Items.PIGLIN_HEAD)
|
||||||
- || type == EntityType.CREEPER && itemBySlot.is(Items.CREEPER_HEAD)) {
|
- || type == EntityType.CREEPER && itemBySlot.is(Items.CREEPER_HEAD)) {
|
||||||
- d *= 0.5;
|
- d *= 0.5;
|
||||||
- }
|
|
||||||
- }
|
|
||||||
+ // Purpur start - Mob head visibility percent
|
+ // Purpur start - Mob head visibility percent
|
||||||
+ if (type == EntityType.SKELETON && itemBySlot.is(Items.SKELETON_SKULL)) {
|
+ if (type == EntityType.SKELETON && itemBySlot.is(Items.SKELETON_SKULL)) {
|
||||||
+ d *= lookingEntity.level().purpurConfig.skeletonHeadVisibilityPercent;
|
+ d *= lookingEntity.level().purpurConfig.skeletonHeadVisibilityPercent;
|
||||||
@@ -52,13 +58,13 @@
|
|||||||
+ }
|
+ }
|
||||||
+ else if ((type == EntityType.PIGLIN || type == EntityType.PIGLIN_BRUTE) && itemBySlot.is(Items.PIGLIN_HEAD)) {
|
+ else if ((type == EntityType.PIGLIN || type == EntityType.PIGLIN_BRUTE) && itemBySlot.is(Items.PIGLIN_HEAD)) {
|
||||||
+ d *= lookingEntity.level().purpurConfig.piglinHeadVisibilityPercent;
|
+ d *= lookingEntity.level().purpurConfig.piglinHeadVisibilityPercent;
|
||||||
+ }
|
}
|
||||||
+ else if (type == EntityType.CREEPER && itemBySlot.is(Items.CREEPER_HEAD)) {
|
+ else if (type == EntityType.CREEPER && itemBySlot.is(Items.CREEPER_HEAD)) {
|
||||||
+ d *= lookingEntity.level().purpurConfig.creeperHeadVisibilityPercent;
|
+ d *= lookingEntity.level().purpurConfig.creeperHeadVisibilityPercent;
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end - Mob head visibility percent
|
+ // Purpur end - Mob head visibility percent
|
||||||
+ }
|
}
|
||||||
+
|
|
||||||
+ // Purpur start - Configurable mob blindness
|
+ // Purpur start - Configurable mob blindness
|
||||||
+ if (lookingEntity instanceof LivingEntity entityliving) {
|
+ if (lookingEntity instanceof LivingEntity entityliving) {
|
||||||
+ if (entityliving.hasEffect(MobEffects.BLINDNESS)) {
|
+ if (entityliving.hasEffect(MobEffects.BLINDNESS)) {
|
||||||
@@ -69,10 +75,11 @@
|
|||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end - Configurable mob blindness
|
+ // Purpur end - Configurable mob blindness
|
||||||
|
+
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@@ -1104,6 +_,7 @@
|
|
||||||
|
@@ -1104,6 +1128,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
Iterator<MobEffectInstance> iterator = this.activeEffects.values().iterator();
|
Iterator<MobEffectInstance> iterator = this.activeEffects.values().iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
MobEffectInstance effect = iterator.next();
|
MobEffectInstance effect = iterator.next();
|
||||||
@@ -80,7 +87,7 @@
|
|||||||
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
|
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1436,6 +_,24 @@
|
@@ -1436,6 +1461,24 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
this.stopSleeping();
|
this.stopSleeping();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +112,7 @@
|
|||||||
this.noActionTime = 0;
|
this.noActionTime = 0;
|
||||||
if (amount < 0.0F) {
|
if (amount < 0.0F) {
|
||||||
amount = 0.0F;
|
amount = 0.0F;
|
||||||
@@ -1697,10 +_,10 @@
|
@@ -1697,10 +1740,10 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
protected @Nullable Player resolvePlayerResponsibleForDamage(DamageSource damageSource) {
|
protected @Nullable Player resolvePlayerResponsibleForDamage(DamageSource damageSource) {
|
||||||
Entity entity = damageSource.getEntity();
|
Entity entity = damageSource.getEntity();
|
||||||
if (entity instanceof Player player) {
|
if (entity instanceof Player player) {
|
||||||
@@ -118,7 +125,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.lastHurtByPlayer = null;
|
this.lastHurtByPlayer = null;
|
||||||
this.lastHurtByPlayerMemoryTime = 0;
|
this.lastHurtByPlayerMemoryTime = 0;
|
||||||
@@ -1751,6 +_,30 @@
|
@@ -1751,6 +1794,30 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +156,7 @@
|
|||||||
final org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
|
final org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
|
||||||
final EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
|
final EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
|
||||||
event.setCancelled(itemStack == null);
|
event.setCancelled(itemStack == null);
|
||||||
@@ -1932,6 +_,7 @@
|
@@ -1932,6 +1999,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
boolean flag = this.lastHurtByPlayerMemoryTime > 0;
|
boolean flag = this.lastHurtByPlayerMemoryTime > 0;
|
||||||
this.dropEquipment(level); // CraftBukkit - from below
|
this.dropEquipment(level); // CraftBukkit - from below
|
||||||
if (this.shouldDropLoot(level)) {
|
if (this.shouldDropLoot(level)) {
|
||||||
@@ -157,7 +164,7 @@
|
|||||||
this.dropFromLootTable(level, damageSource, flag);
|
this.dropFromLootTable(level, damageSource, flag);
|
||||||
// Paper start
|
// Paper start
|
||||||
final boolean prev = this.clearEquipmentSlots;
|
final boolean prev = this.clearEquipmentSlots;
|
||||||
@@ -1940,6 +_,7 @@
|
@@ -1940,6 +2008,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
// Paper end
|
// Paper end
|
||||||
this.dropCustomDeathLoot(level, damageSource, flag);
|
this.dropCustomDeathLoot(level, damageSource, flag);
|
||||||
this.clearEquipmentSlots = prev; // Paper
|
this.clearEquipmentSlots = prev; // Paper
|
||||||
@@ -165,7 +172,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
|
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
|
||||||
@@ -3214,6 +_,7 @@
|
@@ -3214,6 +3283,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
float f = (float)(d * 10.0 - 3.0);
|
float f = (float)(d * 10.0 - 3.0);
|
||||||
if (f > 0.0F) {
|
if (f > 0.0F) {
|
||||||
this.playSound(this.getFallDamageSound((int)f), 1.0F, 1.0F);
|
this.playSound(this.getFallDamageSound((int)f), 1.0F, 1.0F);
|
||||||
@@ -173,16 +180,16 @@
|
|||||||
this.hurt(this.damageSources().flyIntoWall(), f);
|
this.hurt(this.damageSources().flyIntoWall(), f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4679,6 +_,12 @@
|
@@ -4680,6 +4750,12 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||||
? slot == EquipmentSlot.MAINHAND && this.canUseSlot(EquipmentSlot.MAINHAND)
|
|
||||||
: slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.getType());
|
: slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.getType());
|
||||||
}
|
}
|
||||||
+
|
|
||||||
+ // Purpur start - Dispenser curse of binding protection
|
+ // Purpur start - Dispenser curse of binding protection
|
||||||
+ public @Nullable EquipmentSlot getEquipmentSlotForDispenserItem(ItemStack itemstack) {
|
+ public @Nullable EquipmentSlot getEquipmentSlotForDispenserItem(ItemStack itemstack) {
|
||||||
+ return EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.BINDING_CURSE, itemstack) > 0 ? null : this.getEquipmentSlotForItem(itemstack);
|
+ return EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.BINDING_CURSE, itemstack) > 0 ? null : this.getEquipmentSlotForItem(itemstack);
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end - Dispenser curse of binding protection
|
+ // Purpur end - Dispenser curse of binding protection
|
||||||
|
+
|
||||||
private static SlotAccess createEquipmentSlotAccess(LivingEntity entity, EquipmentSlot slot) {
|
private static SlotAccess createEquipmentSlotAccess(LivingEntity entity, EquipmentSlot slot) {
|
||||||
return slot != EquipmentSlot.HEAD && slot != EquipmentSlot.MAINHAND && slot != EquipmentSlot.OFFHAND
|
return slot != EquipmentSlot.HEAD && slot != EquipmentSlot.MAINHAND && slot != EquipmentSlot.OFFHAND
|
||||||
|
? SlotAccess.forEquipmentSlot(entity, slot, itemStack -> itemStack.isEmpty() || entity.getEquipmentSlotForItem(itemStack) == slot)
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||||
|
index 92175cc019750e829fcad7691a937024c2649882..cf2cbc3bf5e0000737ebeac3867f12d7e07bda01 100644
|
||||||
--- a/net/minecraft/world/entity/Mob.java
|
--- a/net/minecraft/world/entity/Mob.java
|
||||||
+++ b/net/minecraft/world/entity/Mob.java
|
+++ b/net/minecraft/world/entity/Mob.java
|
||||||
@@ -150,6 +_,7 @@
|
@@ -150,6 +150,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||||
private int homeRadius = -1;
|
private int homeRadius = -1;
|
||||||
public boolean aware = true; // CraftBukkit
|
public boolean aware = true; // CraftBukkit
|
||||||
public net.kyori.adventure.util.TriState despawnInPeacefulOverride = net.kyori.adventure.util.TriState.NOT_SET; // Paper - allow changing despawnInPeaceful
|
public net.kyori.adventure.util.TriState despawnInPeacefulOverride = net.kyori.adventure.util.TriState.NOT_SET; // Paper - allow changing despawnInPeaceful
|
||||||
@@ -8,7 +16,7 @@
|
|||||||
|
|
||||||
protected Mob(EntityType<? extends Mob> type, Level level) {
|
protected Mob(EntityType<? extends Mob> type, Level level) {
|
||||||
super(type, level);
|
super(type, level);
|
||||||
@@ -292,6 +_,7 @@
|
@@ -292,6 +293,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||||
target = null;
|
target = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,14 +24,13 @@
|
|||||||
this.target = target;
|
this.target = target;
|
||||||
return true;
|
return true;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -335,7 +_,27 @@
|
@@ -335,8 +337,28 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||||
}
|
}
|
||||||
|
|
||||||
profilerFiller.pop();
|
profilerFiller.pop();
|
||||||
- }
|
|
||||||
+ incrementTicksSinceLastInteraction(); // Purpur - Entity lifespan
|
+ incrementTicksSinceLastInteraction(); // Purpur - Entity lifespan
|
||||||
+ }
|
}
|
||||||
+
|
|
||||||
+ // Purpur start - Entity lifespan
|
+ // Purpur start - Entity lifespan
|
||||||
+ private void incrementTicksSinceLastInteraction() {
|
+ private void incrementTicksSinceLastInteraction() {
|
||||||
+ ++this.ticksSinceLastInteraction;
|
+ ++this.ticksSinceLastInteraction;
|
||||||
@@ -42,10 +49,11 @@
|
|||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ // Purpur end - Entity lifespan
|
+ // Purpur end - Entity lifespan
|
||||||
|
+
|
||||||
@Override
|
@Override
|
||||||
protected void playHurtSound(DamageSource damageSource) {
|
protected void playHurtSound(DamageSource damageSource) {
|
||||||
@@ -439,6 +_,7 @@
|
this.resetAmbientSoundTime();
|
||||||
|
@@ -439,6 +461,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||||
output.putString("Paper.DespawnInPeacefulOverride", this.despawnInPeacefulOverride.name());
|
output.putString("Paper.DespawnInPeacefulOverride", this.despawnInPeacefulOverride.name());
|
||||||
}
|
}
|
||||||
// Paper end - allow changing despawnInPeaceful
|
// Paper end - allow changing despawnInPeaceful
|
||||||
@@ -53,7 +61,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -466,6 +_,7 @@
|
@@ -466,6 +489,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||||
this.lootTableSeed = input.getLongOr("DeathLootTableSeed", 0L);
|
this.lootTableSeed = input.getLongOr("DeathLootTableSeed", 0L);
|
||||||
this.setNoAi(input.getBooleanOr("NoAI", false));
|
this.setNoAi(input.getBooleanOr("NoAI", false));
|
||||||
this.aware = input.getBooleanOr("Bukkit.Aware", true); // CraftBukkit
|
this.aware = input.getBooleanOr("Bukkit.Aware", true); // CraftBukkit
|
||||||
@@ -61,7 +69,7 @@
|
|||||||
// Paper start - allow changing despawnInPeaceful
|
// Paper start - allow changing despawnInPeaceful
|
||||||
this.despawnInPeacefulOverride = readDespawnInPeacefulOverride(input);
|
this.despawnInPeacefulOverride = readDespawnInPeacefulOverride(input);
|
||||||
}
|
}
|
||||||
@@ -1246,7 +_,7 @@
|
@@ -1246,7 +1270,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +78,7 @@
|
|||||||
return spawnGroupData;
|
return spawnGroupData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1597,6 +_,7 @@
|
@@ -1597,6 +1621,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lungeForwardMaybe();
|
this.lungeForwardMaybe();
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/attributes/RangedAttribute.java b/net/minecraft/world/entity/ai/attributes/RangedAttribute.java
|
||||||
|
index 0a0e5d9fd64182c1bed4c0aa6a40d8b2cdf8bc9d..353d571b4a2bf18414a08239abe2b079e3750d89 100644
|
||||||
|
--- a/net/minecraft/world/entity/ai/attributes/RangedAttribute.java
|
||||||
|
+++ b/net/minecraft/world/entity/ai/attributes/RangedAttribute.java
|
||||||
|
@@ -29,6 +29,7 @@ public class RangedAttribute extends Attribute {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double sanitizeValue(double value) {
|
||||||
|
+ if (!org.purpurmc.purpur.PurpurConfig.clampAttributes) return Double.isNaN(value) ? this.minValue : value; // Purpur - Add attribute clamping and armor limit config
|
||||||
|
return Double.isNaN(value) ? this.minValue : Mth.clamp(value, this.minValue, this.maxValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
|
index 278addb7dbe4f57e99fb91ce1cd1bf3559e239a3..3e0fd09a0c0047cfe100e878186471090f8909a0 100644
|
||||||
--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||||
@@ -85,7 +_,7 @@
|
@@ -85,7 +85,7 @@ public class AcquirePoi {
|
||||||
};
|
};
|
||||||
// Paper start - optimise POI access
|
// Paper start - optimise POI access
|
||||||
final java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
final java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java b/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java
|
||||||
|
index df185d375658d765b07648dfb42ea56c84be671e..5c845d78e8baee41809e0678e3d99523368a2882 100644
|
||||||
--- a/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java
|
--- a/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java
|
||||||
+++ b/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java
|
+++ b/net/minecraft/world/entity/ai/behavior/InteractWithDoor.java
|
||||||
@@ -55,7 +_,7 @@
|
@@ -55,7 +55,7 @@ public class InteractWithDoor {
|
||||||
Node nextNode = path.getNextNode();
|
Node nextNode = path.getNextNode();
|
||||||
BlockPos blockPos = previousNode.asBlockPos();
|
BlockPos blockPos = previousNode.asBlockPos();
|
||||||
BlockState blockState = level.getBlockState(blockPos);
|
BlockState blockState = level.getBlockState(blockPos);
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
DoorBlock doorBlock = (DoorBlock)blockState.getBlock();
|
DoorBlock doorBlock = (DoorBlock)blockState.getBlock();
|
||||||
if (!doorBlock.isOpen(blockState)) {
|
if (!doorBlock.isOpen(blockState)) {
|
||||||
// CraftBukkit start - entities opening doors
|
// CraftBukkit start - entities opening doors
|
||||||
@@ -72,7 +_,7 @@
|
@@ -72,7 +72,7 @@ public class InteractWithDoor {
|
||||||
|
|
||||||
BlockPos blockPos1 = nextNode.asBlockPos();
|
BlockPos blockPos1 = nextNode.asBlockPos();
|
||||||
BlockState blockState1 = level.getBlockState(blockPos1);
|
BlockState blockState1 = level.getBlockState(blockPos1);
|
||||||
@@ -18,7 +26,7 @@
|
|||||||
DoorBlock doorBlock1 = (DoorBlock)blockState1.getBlock();
|
DoorBlock doorBlock1 = (DoorBlock)blockState1.getBlock();
|
||||||
if (!doorBlock1.isOpen(blockState1)) {
|
if (!doorBlock1.isOpen(blockState1)) {
|
||||||
// CraftBukkit start - entities opening doors
|
// CraftBukkit start - entities opening doors
|
||||||
@@ -118,7 +_,7 @@
|
@@ -118,7 +118,7 @@ public class InteractWithDoor {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
} else {
|
} else {
|
||||||
BlockState blockState = level.getBlockState(blockPos);
|
BlockState blockState = level.getBlockState(blockPos);
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java b/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java
|
||||||
|
index 338f9850a9ee968ade1a5554936a10b8a3786fe5..8cac46b6fd025f7f10b17903579f021482ed4b18 100644
|
||||||
--- a/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java
|
--- a/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java
|
||||||
+++ b/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java
|
+++ b/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java
|
||||||
@@ -45,6 +_,7 @@
|
@@ -45,6 +45,7 @@ public class ShowTradesToPlayer extends Behavior<Villager> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canStillUse(ServerLevel level, Villager entity, long gameTime) {
|
public boolean canStillUse(ServerLevel level, Villager entity, long gameTime) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/behavior/TransportItemsBetweenContainers.java b/net/minecraft/world/entity/ai/behavior/TransportItemsBetweenContainers.java
|
||||||
|
index 3741e32fa1aa85e3b5b45c3b05fcb3a0a807a6e7..2a7cda7fbc400a13e7ab71a6a82496068d9c7ae6 100644
|
||||||
--- a/net/minecraft/world/entity/ai/behavior/TransportItemsBetweenContainers.java
|
--- a/net/minecraft/world/entity/ai/behavior/TransportItemsBetweenContainers.java
|
||||||
+++ b/net/minecraft/world/entity/ai/behavior/TransportItemsBetweenContainers.java
|
+++ b/net/minecraft/world/entity/ai/behavior/TransportItemsBetweenContainers.java
|
||||||
@@ -285,7 +_,7 @@
|
@@ -285,7 +285,7 @@ public class TransportItemsBetweenContainers extends Behavior<PathfinderMob> {
|
||||||
LevelChunk chunkNow = level.getChunkSource().getChunkNow(chunkPos.x, chunkPos.z);
|
LevelChunk chunkNow = level.getChunkSource().getChunkNow(chunkPos.x, chunkPos.z);
|
||||||
if (chunkNow != null) {
|
if (chunkNow != null) {
|
||||||
for (BlockEntity blockEntity : chunkNow.getBlockEntities().values()) {
|
for (BlockEntity blockEntity : chunkNow.getBlockEntities().values()) {
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
double d1 = chestBlockEntity.getBlockPos().distToCenterSqr(mob.position());
|
double d1 = chestBlockEntity.getBlockPos().distToCenterSqr(mob.position());
|
||||||
if (d1 < d) {
|
if (d1 < d) {
|
||||||
TransportItemsBetweenContainers.TransportItemTarget transportItemTarget1 = this.isTargetValidToPick(
|
TransportItemsBetweenContainers.TransportItemTarget transportItemTarget1 = this.isTargetValidToPick(
|
||||||
@@ -369,7 +_,11 @@
|
@@ -369,7 +369,11 @@ public class TransportItemsBetweenContainers extends Behavior<PathfinderMob> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTargetBlocked(Level level, TransportItemsBetweenContainers.TransportItemTarget target) {
|
private boolean isTargetBlocked(Level level, TransportItemsBetweenContainers.TransportItemTarget target) {
|
||||||
@@ -22,7 +30,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean targetHasNotChanged(Level level, TransportItemsBetweenContainers.TransportItemTarget target) {
|
private boolean targetHasNotChanged(Level level, TransportItemsBetweenContainers.TransportItemTarget target) {
|
||||||
@@ -446,7 +_,7 @@
|
@@ -446,7 +450,7 @@ public class TransportItemsBetweenContainers extends Behavior<PathfinderMob> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isWantedBlock(PathfinderMob mob, BlockState state) {
|
private boolean isWantedBlock(PathfinderMob mob, BlockState state) {
|
||||||
@@ -31,7 +39,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static double getInteractionRange(PathfinderMob mob) {
|
private static double getInteractionRange(PathfinderMob mob) {
|
||||||
@@ -488,6 +_,11 @@
|
@@ -488,6 +492,11 @@ public class TransportItemsBetweenContainers extends Behavior<PathfinderMob> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean matchesLeavingItemsRequirement(PathfinderMob mob, Container container) {
|
private static boolean matchesLeavingItemsRequirement(PathfinderMob mob, Container container) {
|
||||||
@@ -43,7 +51,7 @@
|
|||||||
return container.isEmpty() || hasItemMatchingHandItem(mob, container);
|
return container.isEmpty() || hasItemMatchingHandItem(mob, container);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,7 +_,7 @@
|
@@ -525,7 +534,7 @@ public class TransportItemsBetweenContainers extends Behavior<PathfinderMob> {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (ItemStack itemStack : container) {
|
for (ItemStack itemStack : container) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java b/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java
|
||||||
|
index 12a8326af5100d243983c101c5ba9e5f30fb0811..2a7c913aadd839ca90edaed4254d5ced260700ac 100644
|
||||||
--- a/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java
|
--- a/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java
|
||||||
+++ b/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java
|
+++ b/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java
|
||||||
@@ -22,6 +_,7 @@
|
@@ -22,6 +22,7 @@ public class LlamaFollowCaravanGoal extends Goal {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canUse() {
|
public boolean canUse() {
|
||||||
@@ -8,7 +16,7 @@
|
|||||||
if (!this.llama.isLeashed() && !this.llama.inCaravan()) {
|
if (!this.llama.isLeashed() && !this.llama.inCaravan()) {
|
||||||
List<Entity> entities = this.llama.level().getEntities(this.llama, this.llama.getBoundingBox().inflate(9.0, 4.0, 9.0), entity1 -> {
|
List<Entity> entities = this.llama.level().getEntities(this.llama, this.llama.getBoundingBox().inflate(9.0, 4.0, 9.0), entity1 -> {
|
||||||
EntityType<?> type = entity1.getType();
|
EntityType<?> type = entity1.getType();
|
||||||
@@ -71,6 +_,7 @@
|
@@ -71,6 +72,7 @@ public class LlamaFollowCaravanGoal extends Goal {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canContinueToUse() {
|
public boolean canContinueToUse() {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java b/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
||||||
|
index 722f378bb3726200b6fe88948bf1e1d3514a7b5c..e337e22c2cf82b0c1cab3fe0a9ff894c0c718716 100644
|
||||||
--- a/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
--- a/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
||||||
+++ b/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
+++ b/net/minecraft/world/entity/ai/goal/RangedBowAttackGoal.java
|
||||||
@@ -116,9 +_,9 @@
|
@@ -116,9 +116,9 @@ public class RangedBowAttackGoal<T extends Monster & RangedAttackMob> extends Go
|
||||||
}
|
}
|
||||||
|
|
||||||
this.mob.lookAt(target, 30.0F, 30.0F);
|
this.mob.lookAt(target, 30.0F, 30.0F);
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java b/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
|
||||||
|
index 5360b2137116ff76361dab29a4ef2a0bc0228a02..f67e762a50b85a95a3d466aff7572b48d0338e72 100644
|
||||||
--- a/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
|
--- a/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
|
||||||
+++ b/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
|
+++ b/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
|
||||||
@@ -59,7 +_,7 @@
|
@@ -59,7 +59,7 @@ public class RunAroundLikeCrazyGoal extends Goal {
|
||||||
if (firstPassenger instanceof Player player) {
|
if (firstPassenger instanceof Player player) {
|
||||||
int temper = this.horse.getTemper();
|
int temper = this.horse.getTemper();
|
||||||
int maxTemper = this.horse.getMaxTemper();
|
int maxTemper = this.horse.getMaxTemper();
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/goal/SwellGoal.java b/net/minecraft/world/entity/ai/goal/SwellGoal.java
|
||||||
|
index 2bc0c7f5973d5d5695ec291f404a836a78e8348e..ccbd344a49a568e97606c364082ab3f74ad5e6ed 100644
|
||||||
--- a/net/minecraft/world/entity/ai/goal/SwellGoal.java
|
--- a/net/minecraft/world/entity/ai/goal/SwellGoal.java
|
||||||
+++ b/net/minecraft/world/entity/ai/goal/SwellGoal.java
|
+++ b/net/minecraft/world/entity/ai/goal/SwellGoal.java
|
||||||
@@ -47,6 +_,14 @@
|
@@ -47,6 +47,14 @@ public class SwellGoal extends Goal {
|
||||||
this.creeper.setSwellDir(-1);
|
this.creeper.setSwellDir(-1);
|
||||||
} else {
|
} else {
|
||||||
this.creeper.setSwellDir(1);
|
this.creeper.setSwellDir(1);
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java b/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||||
|
index 066faa704338c573472381e1ebd063e0d52aaaa4..1f96fd5085bacb4c584576c7cb9f51e7898e9b03 100644
|
||||||
--- a/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
--- a/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||||
+++ b/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
+++ b/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||||
@@ -56,7 +_,7 @@
|
@@ -56,7 +56,7 @@ public class NearestBedSensor extends Sensor<Mob> {
|
||||||
// Paper start - optimise POI access
|
// Paper start - optimise POI access
|
||||||
java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
||||||
// don't ask me why it's unbounded. ask mojang.
|
// don't ask me why it's unbounded. ask mojang.
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/ai/targeting/TargetingConditions.java b/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||||
|
index e4beea8dcf9db2211ae838470daf060074dd8ec2..8307ed8d1c86ed0243c038420d2c44b02df21fe3 100644
|
||||||
--- a/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
--- a/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||||
+++ b/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
+++ b/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||||
@@ -63,6 +_,10 @@
|
@@ -63,6 +63,10 @@ public class TargetingConditions {
|
||||||
return false;
|
return false;
|
||||||
} else if (this.selector != null && !this.selector.test(target, level)) {
|
} else if (this.selector != null && !this.selector.test(target, level)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/animal/Animal.java b/net/minecraft/world/entity/animal/Animal.java
|
||||||
|
index 023b68549e3b185d8ad2f505f34bb59556bbf961..2e7e7c1913f5cbc20ce116c5ae3e185fc83094c0 100644
|
||||||
--- a/net/minecraft/world/entity/animal/Animal.java
|
--- a/net/minecraft/world/entity/animal/Animal.java
|
||||||
+++ b/net/minecraft/world/entity/animal/Animal.java
|
+++ b/net/minecraft/world/entity/animal/Animal.java
|
||||||
@@ -146,7 +_,7 @@
|
@@ -146,7 +146,7 @@ public abstract class Animal extends AgeableMob {
|
||||||
ItemStack itemInHand = player.getItemInHand(hand);
|
ItemStack itemInHand = player.getItemInHand(hand);
|
||||||
if (this.isFood(itemInHand)) {
|
if (this.isFood(itemInHand)) {
|
||||||
int age = this.getAge();
|
int age = this.getAge();
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
final ItemStack breedCopy = itemInHand.copy(); // Paper - Fix EntityBreedEvent copying
|
final ItemStack breedCopy = itemInHand.copy(); // Paper - Fix EntityBreedEvent copying
|
||||||
this.usePlayerItem(player, hand, itemInHand);
|
this.usePlayerItem(player, hand, itemInHand);
|
||||||
this.setInLove(serverPlayer, breedCopy); // Paper - Fix EntityBreedEvent copying
|
this.setInLove(serverPlayer, breedCopy); // Paper - Fix EntityBreedEvent copying
|
||||||
@@ -227,10 +_,20 @@
|
@@ -227,10 +227,20 @@ public abstract class Animal extends AgeableMob {
|
||||||
public void spawnChildFromBreeding(ServerLevel level, Animal partner) {
|
public void spawnChildFromBreeding(ServerLevel level, Animal partner) {
|
||||||
AgeableMob breedOffspring = this.getBreedOffspring(level, partner);
|
AgeableMob breedOffspring = this.getBreedOffspring(level, partner);
|
||||||
if (breedOffspring != null) {
|
if (breedOffspring != null) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/animal/bee/Bee.java b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||||
|
index 0cbcf23b6edba2305dfbbc95abb06a90a6edd42b..7b9280526af353c3ab1f32e5195499e773731352 100644
|
||||||
--- a/net/minecraft/world/entity/animal/bee/Bee.java
|
--- a/net/minecraft/world/entity/animal/bee/Bee.java
|
||||||
+++ b/net/minecraft/world/entity/animal/bee/Bee.java
|
+++ b/net/minecraft/world/entity/animal/bee/Bee.java
|
||||||
@@ -171,7 +_,7 @@
|
@@ -171,7 +171,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
// Paper end - Fix MC-167279
|
// Paper end - Fix MC-167279
|
||||||
this.lookControl = new Bee.BeeLookControl(this);
|
this.lookControl = new Bee.BeeLookControl(this);
|
||||||
this.setPathfindingMalus(PathType.DANGER_FIRE, -1.0F);
|
this.setPathfindingMalus(PathType.DANGER_FIRE, -1.0F);
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
this.setPathfindingMalus(PathType.WATER_BORDER, 16.0F);
|
this.setPathfindingMalus(PathType.WATER_BORDER, 16.0F);
|
||||||
this.setPathfindingMalus(PathType.COCOA, -1.0F);
|
this.setPathfindingMalus(PathType.COCOA, -1.0F);
|
||||||
this.setPathfindingMalus(PathType.FENCE, -1.0F);
|
this.setPathfindingMalus(PathType.FENCE, -1.0F);
|
||||||
@@ -360,13 +_,19 @@
|
@@ -360,13 +360,19 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
if (this.stayOutOfHiveCountdown <= 0 && !this.beePollinateGoal.isPollinating() && !this.hasStung() && this.getTarget() == null) {
|
if (this.stayOutOfHiveCountdown <= 0 && !this.beePollinateGoal.isPollinating() && !this.hasStung() && this.getTarget() == null) {
|
||||||
boolean flag = this.hasNectar()
|
boolean flag = this.hasNectar()
|
||||||
|| this.isTiredOfLookingForNectar()
|
|| this.isTiredOfLookingForNectar()
|
||||||
@@ -30,7 +38,7 @@
|
|||||||
public void setStayOutOfHiveCountdown(int stayOutOfHiveCountdown) {
|
public void setStayOutOfHiveCountdown(int stayOutOfHiveCountdown) {
|
||||||
this.stayOutOfHiveCountdown = stayOutOfHiveCountdown;
|
this.stayOutOfHiveCountdown = stayOutOfHiveCountdown;
|
||||||
}
|
}
|
||||||
@@ -387,7 +_,7 @@
|
@@ -387,7 +393,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
@Override
|
@Override
|
||||||
protected void customServerAiStep(ServerLevel level) {
|
protected void customServerAiStep(ServerLevel level) {
|
||||||
boolean hasStung = this.hasStung();
|
boolean hasStung = this.hasStung();
|
||||||
@@ -39,7 +47,7 @@
|
|||||||
this.underWaterTicks++;
|
this.underWaterTicks++;
|
||||||
} else {
|
} else {
|
||||||
this.underWaterTicks = 0;
|
this.underWaterTicks = 0;
|
||||||
@@ -397,6 +_,7 @@
|
@@ -397,6 +403,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
this.hurtServer(level, this.damageSources().drown(), 1.0F);
|
this.hurtServer(level, this.damageSources().drown(), 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +55,7 @@
|
|||||||
if (hasStung) {
|
if (hasStung) {
|
||||||
this.timeSinceSting++;
|
this.timeSinceSting++;
|
||||||
if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, 1, 1200)) == 0) {
|
if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, 1, 1200)) == 0) {
|
||||||
@@ -1130,6 +_,7 @@
|
@@ -1130,6 +1137,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
Bee.this.savedFlowerPos = optional.get();
|
Bee.this.savedFlowerPos = optional.get();
|
||||||
Bee.this.navigation
|
Bee.this.navigation
|
||||||
.moveTo(Bee.this.savedFlowerPos.getX() + 0.5, Bee.this.savedFlowerPos.getY() + 0.5, Bee.this.savedFlowerPos.getZ() + 0.5, 1.2F);
|
.moveTo(Bee.this.savedFlowerPos.getX() + 0.5, Bee.this.savedFlowerPos.getY() + 0.5, Bee.this.savedFlowerPos.getZ() + 0.5, 1.2F);
|
||||||
@@ -55,7 +63,7 @@
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60);
|
Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60);
|
||||||
@@ -1176,6 +_,7 @@
|
@@ -1176,6 +1184,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
this.pollinating = false;
|
this.pollinating = false;
|
||||||
Bee.this.navigation.stop();
|
Bee.this.navigation.stop();
|
||||||
Bee.this.remainingCooldownBeforeLocatingNewFlower = 200;
|
Bee.this.remainingCooldownBeforeLocatingNewFlower = 200;
|
||||||
@@ -63,7 +71,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1222,6 +_,7 @@
|
@@ -1222,6 +1231,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||||
this.setWantedPos();
|
this.setWantedPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/animal/cow/AbstractCow.java b/net/minecraft/world/entity/animal/cow/AbstractCow.java
|
||||||
|
index e10f7d1b264a85798de063b4387bab62621bf54b..f6f251227db315b58bee45f8011624a347eb8fea 100644
|
||||||
--- a/net/minecraft/world/entity/animal/cow/AbstractCow.java
|
--- a/net/minecraft/world/entity/animal/cow/AbstractCow.java
|
||||||
+++ b/net/minecraft/world/entity/animal/cow/AbstractCow.java
|
+++ b/net/minecraft/world/entity/animal/cow/AbstractCow.java
|
||||||
@@ -40,7 +_,7 @@
|
@@ -40,7 +40,7 @@ public abstract class AbstractCow extends Animal {
|
||||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||||
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0));
|
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0));
|
||||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
|
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
|
||||||
@@ -9,7 +17,7 @@
|
|||||||
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25));
|
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25));
|
||||||
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0));
|
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0));
|
||||||
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||||
@@ -96,6 +_,10 @@
|
@@ -96,6 +96,10 @@ public abstract class AbstractCow extends Animal {
|
||||||
ItemStack itemStack = ItemUtils.createFilledResult(itemInHand, player, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getItemStack())); // CraftBukkit
|
ItemStack itemStack = ItemUtils.createFilledResult(itemInHand, player, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getItemStack())); // CraftBukkit
|
||||||
player.setItemInHand(hand, itemStack);
|
player.setItemInHand(hand, itemStack);
|
||||||
return InteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
@@ -20,7 +28,7 @@
|
|||||||
} else {
|
} else {
|
||||||
return super.mobInteract(player, hand);
|
return super.mobInteract(player, hand);
|
||||||
}
|
}
|
||||||
@@ -105,4 +_,67 @@
|
@@ -105,4 +109,67 @@ public abstract class AbstractCow extends Animal {
|
||||||
public EntityDimensions getDefaultDimensions(Pose pose) {
|
public EntityDimensions getDefaultDimensions(Pose pose) {
|
||||||
return this.isBaby() ? BABY_DIMENSIONS : super.getDefaultDimensions(pose);
|
return this.isBaby() ? BABY_DIMENSIONS : super.getDefaultDimensions(pose);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/animal/cow/MushroomCow.java b/net/minecraft/world/entity/animal/cow/MushroomCow.java
|
||||||
|
index b4b59e3973f7a3fe8b94ff337e87cbe735b2285c..ea6299e728d7c7e7a52d7c65d759407ba27c8eac 100644
|
||||||
--- a/net/minecraft/world/entity/animal/cow/MushroomCow.java
|
--- a/net/minecraft/world/entity/animal/cow/MushroomCow.java
|
||||||
+++ b/net/minecraft/world/entity/animal/cow/MushroomCow.java
|
+++ b/net/minecraft/world/entity/animal/cow/MushroomCow.java
|
||||||
@@ -199,6 +_,13 @@
|
@@ -199,6 +199,13 @@ public class MushroomCow extends AbstractCow implements Shearable {
|
||||||
level.playSound(null, this, SoundEvents.MOOSHROOM_SHEAR, source, 1.0F, 1.0F);
|
level.playSound(null, this, SoundEvents.MOOSHROOM_SHEAR, source, 1.0F, 1.0F);
|
||||||
this.convertTo(EntityType.COW, ConversionParams.single(this, false, false), cow -> {
|
this.convertTo(EntityType.COW, ConversionParams.single(this, false, false), cow -> {
|
||||||
level.sendParticles(ParticleTypes.EXPLOSION, this.getX(), this.getY(0.5), this.getZ(), 1, 0.0, 0.0, 0.0, 0.0);
|
level.sendParticles(ParticleTypes.EXPLOSION, this.getX(), this.getY(0.5), this.getZ(), 1, 0.0, 0.0, 0.0, 0.0);
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/animal/dolphin/Dolphin.java b/net/minecraft/world/entity/animal/dolphin/Dolphin.java
|
||||||
|
index 3a3c9694d3a704aaaa241bd8601c7fd2439436cc..50b8abff1e20855ba8c8acb225c251a1223b8b58 100644
|
||||||
--- a/net/minecraft/world/entity/animal/dolphin/Dolphin.java
|
--- a/net/minecraft/world/entity/animal/dolphin/Dolphin.java
|
||||||
+++ b/net/minecraft/world/entity/animal/dolphin/Dolphin.java
|
+++ b/net/minecraft/world/entity/animal/dolphin/Dolphin.java
|
||||||
@@ -75,6 +_,7 @@
|
@@ -75,6 +75,7 @@ public class Dolphin extends AgeableWaterCreature {
|
||||||
public static final float BABY_SCALE = 0.65F;
|
public static final float BABY_SCALE = 0.65F;
|
||||||
private static final boolean DEFAULT_GOT_FISH = false;
|
private static final boolean DEFAULT_GOT_FISH = false;
|
||||||
@Nullable public BlockPos treasurePos;
|
@Nullable public BlockPos treasurePos;
|
||||||
@@ -8,7 +16,7 @@
|
|||||||
|
|
||||||
public Dolphin(EntityType<? extends Dolphin> type, Level level) {
|
public Dolphin(EntityType<? extends Dolphin> type, Level level) {
|
||||||
super(type, level);
|
super(type, level);
|
||||||
@@ -90,6 +_,7 @@
|
@@ -90,6 +91,7 @@ public class Dolphin extends AgeableWaterCreature {
|
||||||
this.setAirSupply(this.getMaxAirSupply());
|
this.setAirSupply(this.getMaxAirSupply());
|
||||||
this.setXRot(0.0F);
|
this.setXRot(0.0F);
|
||||||
SpawnGroupData spawnGroupData1 = Objects.requireNonNullElseGet(spawnGroupData, () -> new AgeableMob.AgeableMobGroupData(0.1F));
|
SpawnGroupData spawnGroupData1 = Objects.requireNonNullElseGet(spawnGroupData, () -> new AgeableMob.AgeableMobGroupData(0.1F));
|
||||||
@@ -16,7 +24,7 @@
|
|||||||
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData1);
|
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,17 +_,19 @@
|
@@ -155,17 +157,19 @@ public class Dolphin extends AgeableWaterCreature {
|
||||||
protected void registerGoals() {
|
protected void registerGoals() {
|
||||||
this.goalSelector.addGoal(0, new BreathAirGoal(this));
|
this.goalSelector.addGoal(0, new BreathAirGoal(this));
|
||||||
this.goalSelector.addGoal(0, new TryFindWaterGoal(this));
|
this.goalSelector.addGoal(0, new TryFindWaterGoal(this));
|
||||||
@@ -37,7 +45,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static AttributeSupplier.Builder createAttributes() {
|
public static AttributeSupplier.Builder createAttributes() {
|
||||||
@@ -392,6 +_,7 @@
|
@@ -392,6 +396,7 @@ public class Dolphin extends AgeableWaterCreature {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canUse() {
|
public boolean canUse() {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/animal/equine/Llama.java b/net/minecraft/world/entity/animal/equine/Llama.java
|
||||||
|
index 1522efc1e6937bc8a24a2df77d5421ae04a6642b..cceb66525a4d017b2db21bd301e63670c639223f 100644
|
||||||
--- a/net/minecraft/world/entity/animal/equine/Llama.java
|
--- a/net/minecraft/world/entity/animal/equine/Llama.java
|
||||||
+++ b/net/minecraft/world/entity/animal/equine/Llama.java
|
+++ b/net/minecraft/world/entity/animal/equine/Llama.java
|
||||||
@@ -76,6 +_,7 @@
|
@@ -76,6 +76,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
|
||||||
boolean didSpit;
|
boolean didSpit;
|
||||||
private @Nullable Llama caravanHead;
|
private @Nullable Llama caravanHead;
|
||||||
public @Nullable Llama caravanTail; // Paper - public
|
public @Nullable Llama caravanTail; // Paper - public
|
||||||
@@ -8,7 +16,7 @@
|
|||||||
|
|
||||||
public Llama(EntityType<? extends Llama> type, Level level) {
|
public Llama(EntityType<? extends Llama> type, Level level) {
|
||||||
super(type, level);
|
super(type, level);
|
||||||
@@ -105,6 +_,7 @@
|
@@ -105,6 +106,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
|
||||||
super.addAdditionalSaveData(output);
|
super.addAdditionalSaveData(output);
|
||||||
output.store("Variant", Llama.Variant.LEGACY_CODEC, this.getVariant());
|
output.store("Variant", Llama.Variant.LEGACY_CODEC, this.getVariant());
|
||||||
output.putInt("Strength", this.getStrength());
|
output.putInt("Strength", this.getStrength());
|
||||||
@@ -16,7 +24,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -112,6 +_,7 @@
|
@@ -112,6 +114,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
|
||||||
this.setStrength(input.getIntOr("Strength", 0));
|
this.setStrength(input.getIntOr("Strength", 0));
|
||||||
super.readAdditionalSaveData(input);
|
super.readAdditionalSaveData(input);
|
||||||
this.setVariant(input.read("Variant", Llama.Variant.LEGACY_CODEC).orElse(Llama.Variant.DEFAULT));
|
this.setVariant(input.read("Variant", Llama.Variant.LEGACY_CODEC).orElse(Llama.Variant.DEFAULT));
|
||||||
@@ -24,7 +32,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -388,6 +_,7 @@
|
@@ -388,6 +391,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
|
||||||
|
|
||||||
public void leaveCaravan() {
|
public void leaveCaravan() {
|
||||||
if (this.caravanHead != null) {
|
if (this.caravanHead != null) {
|
||||||
@@ -32,7 +40,7 @@
|
|||||||
this.caravanHead.caravanTail = null;
|
this.caravanHead.caravanTail = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,6 +_,7 @@
|
@@ -395,6 +399,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void joinCaravan(Llama caravanHead) {
|
public void joinCaravan(Llama caravanHead) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/animal/feline/Cat.java b/net/minecraft/world/entity/animal/feline/Cat.java
|
||||||
|
index f17d7a4ef7061d6ede9a755b5a77324a28c3eeaa..6acd39413ab4fed1eaf251d3b6d9b9e184060e5c 100644
|
||||||
--- a/net/minecraft/world/entity/animal/feline/Cat.java
|
--- a/net/minecraft/world/entity/animal/feline/Cat.java
|
||||||
+++ b/net/minecraft/world/entity/animal/feline/Cat.java
|
+++ b/net/minecraft/world/entity/animal/feline/Cat.java
|
||||||
@@ -354,6 +_,14 @@
|
@@ -354,6 +354,14 @@ public class Cat extends TamableAnimal {
|
||||||
return this.isTame() && otherAnimal instanceof Cat cat && cat.isTame() && super.canMate(otherAnimal);
|
return this.isTame() && otherAnimal instanceof Cat cat && cat.isTame() && super.canMate(otherAnimal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,7 +23,7 @@
|
|||||||
@Override
|
@Override
|
||||||
public @Nullable SpawnGroupData finalizeSpawn(
|
public @Nullable SpawnGroupData finalizeSpawn(
|
||||||
ServerLevelAccessor level, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData spawnGroupData
|
ServerLevelAccessor level, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData spawnGroupData
|
||||||
@@ -451,7 +_,7 @@
|
@@ -451,7 +459,7 @@ public class Cat extends TamableAnimal {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tryToTame(Player player) {
|
private void tryToTame(Player player) {
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/animal/feline/Ocelot.java b/net/minecraft/world/entity/animal/feline/Ocelot.java
|
||||||
|
index cf940de8767df6d07551d7a221a0e87df4e41785..94fdbae92dabf7505a7c7b518d4c07b4f68c8e9c 100644
|
||||||
--- a/net/minecraft/world/entity/animal/feline/Ocelot.java
|
--- a/net/minecraft/world/entity/animal/feline/Ocelot.java
|
||||||
+++ b/net/minecraft/world/entity/animal/feline/Ocelot.java
|
+++ b/net/minecraft/world/entity/animal/feline/Ocelot.java
|
||||||
@@ -234,7 +_,7 @@
|
@@ -234,7 +234,7 @@ public class Ocelot extends Animal {
|
||||||
public boolean checkSpawnObstruction(LevelReader level) {
|
public boolean checkSpawnObstruction(LevelReader level) {
|
||||||
if (level.isUnobstructed(this) && !level.containsAnyLiquid(this.getBoundingBox())) {
|
if (level.isUnobstructed(this) && !level.containsAnyLiquid(this.getBoundingBox())) {
|
||||||
BlockPos blockPos = this.blockPosition();
|
BlockPos blockPos = this.blockPosition();
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
|
From 56a0a83ddb1b7472dbc9762e2aca396605c62085 Mon Sep 17 00:00:00 2001
|
||||||
|
From: File <noreply+automated@papermc.io>
|
||||||
|
Date: Sun, 20 Apr 1997 05:37:42 -0800
|
||||||
|
Subject: [PATCH] purpur File Patches
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/net/minecraft/world/entity/animal/fish/WaterAnimal.java b/net/minecraft/world/entity/animal/fish/WaterAnimal.java
|
||||||
|
index 3965cb8ae6fdd8d9d0135e6695463e6bef624fe2..9ff11eb96bc8d0c9bd611c8d45d8799c67f1fb61 100644
|
||||||
--- a/net/minecraft/world/entity/animal/fish/WaterAnimal.java
|
--- a/net/minecraft/world/entity/animal/fish/WaterAnimal.java
|
||||||
+++ b/net/minecraft/world/entity/animal/fish/WaterAnimal.java
|
+++ b/net/minecraft/world/entity/animal/fish/WaterAnimal.java
|
||||||
@@ -76,8 +_,7 @@
|
@@ -76,8 +76,7 @@ public abstract class WaterAnimal extends PathfinderMob {
|
||||||
seaLevel = level.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.maximum.or(seaLevel);
|
seaLevel = level.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.maximum.or(seaLevel);
|
||||||
i = level.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.minimum.or(i);
|
i = level.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.minimum.or(i);
|
||||||
// Paper end - Make water animal spawn height configurable
|
// Paper end - Make water animal spawn height configurable
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user