mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
prep for 1.21.11 update
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
@@ -23,6 +_,18 @@
|
||||
@@ -22,6 +_,18 @@
|
||||
minecraftVersion = providers.gradleProperty("mcVersion")
|
||||
gitFilePatches = false
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
+ // Purpur end - Rebrand
|
||||
+
|
||||
spigot {
|
||||
enabled = true
|
||||
enabled = false
|
||||
buildDataRef = "42d18d4c4653ffc549778dbe223f6994a031d69e"
|
||||
@@ -104,7 +_,21 @@
|
||||
}
|
||||
@@ -70,7 +70,7 @@
|
||||
// Deps that were previously in the API but have now been moved here for backwards compat, eventually to be removed
|
||||
runtimeOnly("commons-lang:commons-lang:2.6")
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.49.1.0")
|
||||
@@ -197,14 +_,14 @@
|
||||
@@ -198,14 +_,14 @@
|
||||
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
|
||||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
@@ -90,7 +90,7 @@
|
||||
"Build-Number" to (build ?: ""),
|
||||
"Build-Time" to buildTime.toString(),
|
||||
"Git-Branch" to gitBranch,
|
||||
@@ -263,7 +_,7 @@
|
||||
@@ -264,7 +_,7 @@
|
||||
jvmArgumentProviders.add(provider)
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
idea {
|
||||
module {
|
||||
generatedSourceDirs.add(generatedDir.toFile())
|
||||
@@ -355,7 +_,7 @@
|
||||
@@ -356,7 +_,7 @@
|
||||
mainClass.set(null as String?)
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
project("paper")
|
||||
versionFamily(paperweight.minecraftVersion.map { it.split(".", "-").takeWhile { part -> part.toIntOrNull() != null }.take(2).joinToString(".") })
|
||||
version(paperweight.minecraftVersion)
|
||||
@@ -370,4 +_,44 @@
|
||||
@@ -371,4 +_,44 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/net/minecraft/gametest/framework/GameTestHelper.java
|
||||
+++ b/net/minecraft/gametest/framework/GameTestHelper.java
|
||||
@@ -312,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,10 +0,0 @@
|
||||
--- a/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
+++ b/net/minecraft/world/inventory/AbstractContainerMenu.java
|
||||
@@ -65,6 +_,7 @@
|
||||
@Nullable
|
||||
private ContainerSynchronizer synchronizer;
|
||||
private boolean suppressRemoteUpdates;
|
||||
+ @Nullable protected ItemStack activeQuickItem = null; // Purpur - Anvil API
|
||||
// CraftBukkit start
|
||||
public boolean checkReachable = true;
|
||||
public abstract org.bukkit.inventory.InventoryView getBukkitView();
|
||||
@@ -1,12 +0,0 @@
|
||||
--- a/net/minecraft/world/inventory/ItemCombinerMenu.java
|
||||
+++ b/net/minecraft/world/inventory/ItemCombinerMenu.java
|
||||
@@ -155,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
|
||||
@@ -254,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
|
||||
@@ -72,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 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 ae2bb9a73106febfe5f0d090abd4252bbb5fd27e..ca21597263cb430e2a5ae07e8cecfb0d53a270d2 100644
|
||||
--- a/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;
|
||||
}
|
||||
|
||||
@@ -9,7 +17,7 @@
|
||||
final int worldHeight = world.getHeight();
|
||||
ActivationRange.maxBB = player.getBoundingBox().inflate(maxRange, worldHeight, maxRange);
|
||||
ActivationType.MISC.boundingBox = player.getBoundingBox().inflate(miscActivationRange, worldHeight, miscActivationRange);
|
||||
@@ -288,6 +_,7 @@
|
||||
@@ -288,6 +290,7 @@ public final class ActivationRange {
|
||||
* @return
|
||||
*/
|
||||
public static boolean checkIfActive(final Entity entity) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 3e0e88afcf010d9a3d46e48bca5cbdf98fe97544..394443d00e661715439be1e56dddc129947699a4 100644
|
||||
--- a/net/minecraft/CrashReport.java
|
||||
+++ b/net/minecraft/CrashReport.java
|
||||
@@ -30,6 +_,7 @@
|
||||
@@ -30,6 +30,7 @@ public class CrashReport {
|
||||
private boolean trackingStackTrace = true;
|
||||
private StackTraceElement[] uncategorizedStackTrace = new StackTraceElement[0];
|
||||
private final SystemReport systemReport = new SystemReport();
|
||||
@@ -8,7 +16,7 @@
|
||||
|
||||
public CrashReport(String title, Throwable exception) {
|
||||
io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(exception); // Paper
|
||||
@@ -130,7 +_,7 @@
|
||||
@@ -130,7 +131,7 @@ public class CrashReport {
|
||||
}
|
||||
|
||||
public String getFriendlyReport(ReportType type) {
|
||||
@@ -17,7 +25,7 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -161,7 +_,7 @@
|
||||
@@ -161,7 +162,7 @@ public class CrashReport {
|
||||
}
|
||||
|
||||
public boolean saveToFile(Path path, ReportType type) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 be42e2bd05a7468911698e53a33d87abf4a1080b..d3d967cd922a6e5129546cad9d8fa5565960f6a5 100644
|
||||
--- a/net/minecraft/commands/CommandSourceStack.java
|
||||
+++ b/net/minecraft/commands/CommandSourceStack.java
|
||||
@@ -447,6 +_,19 @@
|
||||
@@ -447,6 +447,19 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -20,11 +28,10 @@
|
||||
public Vec3 getPosition() {
|
||||
return this.worldPosition;
|
||||
}
|
||||
@@ -531,6 +_,30 @@
|
||||
}
|
||||
@@ -532,6 +545,30 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
||||
}
|
||||
}
|
||||
+
|
||||
|
||||
+ // Purpur start - Purpur config files
|
||||
+ public void sendSuccess(@Nullable String message) {
|
||||
+ sendSuccess(message, false);
|
||||
@@ -48,6 +55,7 @@
|
||||
+ sendSuccess(() -> io.papermc.paper.adventure.PaperAdventure.asVanilla(message), broadcastToOps);
|
||||
+ }
|
||||
+ // Purpur end - Purpur config files
|
||||
|
||||
+
|
||||
public void sendSuccess(Supplier<Component> messageSupplier, boolean allowLogging) {
|
||||
boolean flag = this.source.acceptsSuccess() && !this.silent;
|
||||
boolean flag1 = allowLogging && this.source.shouldInformAdmins() && !this.silent;
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 83f05b042630891d43cfb567e98666831df80f6e..9aa09e11032f539952edeeed119f7705c330db0a 100644
|
||||
--- a/net/minecraft/commands/Commands.java
|
||||
+++ b/net/minecraft/commands/Commands.java
|
||||
@@ -255,11 +_,11 @@
|
||||
@@ -255,11 +255,11 @@ public class Commands {
|
||||
JfrCommand.register(this.dispatcher);
|
||||
}
|
||||
|
||||
@@ -14,7 +22,7 @@
|
||||
RaidCommand.register(this.dispatcher, context);
|
||||
DebugPathCommand.register(this.dispatcher);
|
||||
DebugMobSpawningCommand.register(this.dispatcher);
|
||||
@@ -287,6 +_,14 @@
|
||||
@@ -287,6 +287,14 @@ public class Commands {
|
||||
StopCommand.register(this.dispatcher);
|
||||
TransferCommand.register(this.dispatcher);
|
||||
WhitelistCommand.register(this.dispatcher);
|
||||
@@ -29,7 +37,7 @@
|
||||
}
|
||||
|
||||
if (selection.includeIntegrated) {
|
||||
@@ -511,6 +_,7 @@
|
||||
@@ -511,6 +519,7 @@ public class Commands {
|
||||
private void runSync(ServerPlayer player, java.util.Collection<String> bukkit, RootCommandNode<CommandSourceStack> rootCommandNode) {
|
||||
// Paper end - Perf: Async command map building
|
||||
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));
|
||||
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
||||
|
||||
@@ -521,6 +_,8 @@
|
||||
@@ -521,6 +530,8 @@ public class Commands {
|
||||
}
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 d438e31a082b675d7eb0eead7067a0b92363a9f9..a65ca0b1a44f8c993fad7f230a9c0b11a474e358 100644
|
||||
--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
+++ b/net/minecraft/commands/arguments/selector/EntitySelector.java
|
||||
@@ -193,26 +_,27 @@
|
||||
@@ -193,26 +193,27 @@ public class EntitySelector {
|
||||
this.checkPermissions(source);
|
||||
if (this.playerName != null) {
|
||||
ServerPlayer playerByName = source.getServer().getPlayerList().getPlayerByName(this.playerName);
|
||||
@@ -32,7 +40,7 @@
|
||||
players.add(serverPlayer1);
|
||||
if (players.size() >= resultLimit) {
|
||||
return players;
|
||||
@@ -271,4 +_,10 @@
|
||||
@@ -271,4 +272,10 @@ public class EntitySelector {
|
||||
public static Component joinNames(List<? extends Entity> names) {
|
||||
return ComponentUtils.formatList(names, Entity::getDisplayName);
|
||||
}
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 5083959b61ec88868c0ede65a46087608e22983a..0ae78eecdb6556ff85018d49af4c183da5276c2d 100644
|
||||
--- a/net/minecraft/core/BlockPos.java
|
||||
+++ b/net/minecraft/core/BlockPos.java
|
||||
@@ -64,6 +_,12 @@
|
||||
@@ -64,6 +64,12 @@ public class BlockPos extends Vec3i {
|
||||
public static final int MAX_HORIZONTAL_COORDINATE = 33554431;
|
||||
// Paper end - Optimize Bit Operations by inlining
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 ef72c5d1b6196582cadb87944f3416881f56c8df..5d0eb3893a0cca99ef53c2095b7b36a145dc15be 100644
|
||||
--- a/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
+++ b/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||
@@ -746,5 +_,22 @@
|
||||
@@ -746,5 +746,22 @@ public interface DispenseItemBehavior {
|
||||
DispenserBlock.registerBehavior(Items.TNT_MINECART, new MinecartDispenseItemBehavior(EntityType.TNT_MINECART));
|
||||
DispenserBlock.registerBehavior(Items.HOPPER_MINECART, new MinecartDispenseItemBehavior(EntityType.HOPPER_MINECART));
|
||||
DispenserBlock.registerBehavior(Items.COMMAND_BLOCK_MINECART, new MinecartDispenseItemBehavior(EntityType.COMMAND_BLOCK_MINECART));
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ b/net/minecraft/core/dispenser/EquipmentDispenseItemBehavior.java
|
||||
@@ -32,7 +_,7 @@
|
||||
@@ -32,7 +32,7 @@ public class EquipmentDispenseItemBehavior extends DefaultDispenseItemBehavior {
|
||||
return false;
|
||||
} else {
|
||||
LivingEntity livingEntity = entitiesOfClass.getFirst();
|
||||
@@ -0,0 +1,19 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 be306c0b3346d1226e2c6d70ebfd83120f4bc124..6c452f195055afb489f828bfac9f23217ba7653d 100644
|
||||
--- a/net/minecraft/gametest/framework/GameTestHelper.java
|
||||
+++ b/net/minecraft/gametest/framework/GameTestHelper.java
|
||||
@@ -312,6 +312,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 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 f2c97bb3c849dce59964d51633c47a982d1aa164..32338e6b2e5066b22111fab618a7205139a66536 100644
|
||||
--- a/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 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 14addbaf68b7ad80490187d12d9c9b00891e2ce1..35b6f8365f4568da7bc0f4e47c39cb3690292aaf 100644
|
||||
--- a/net/minecraft/network/Connection.java
|
||||
+++ b/net/minecraft/network/Connection.java
|
||||
@@ -578,11 +_,20 @@
|
||||
@@ -578,11 +578,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 int joinAttemptsThisTick; // Paper - Buffer joins to world
|
||||
private static int currTick; // Paper - Buffer joins to world
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 f6eed34b2fd72ab74cc9dc4b99ca184d512c0a66..a3e211edd348c0936757de33a74b9456248b3bd2 100644
|
||||
--- a/net/minecraft/network/chat/SignedMessageChain.java
|
||||
+++ b/net/minecraft/network/chat/SignedMessageChain.java
|
||||
@@ -45,7 +_,7 @@
|
||||
@@ -45,7 +45,7 @@ public class SignedMessageChain {
|
||||
SignedMessageLink signedMessageLink = SignedMessageChain.this.nextLink;
|
||||
if (signedMessageLink == null) {
|
||||
throw new SignedMessageChain.DecodeException(SignedMessageChain.DecodeException.CHAIN_BROKEN);
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 2de7072c8ccc005e514673bba494b64d42e95a15..42841fdc7e64311ba9217789a3dc758a351cf674 100644
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -107,6 +_,13 @@
|
||||
@@ -107,6 +107,13 @@ public class Main {
|
||||
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 f63a5567a2e845de904c2dacfbb875049e3e0c65..9337f3fa2daa224d04499fd2bb0fef9c1283ba27 100644
|
||||
--- a/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/net/minecraft/server/MinecraftServer.java
|
||||
@@ -286,6 +_,7 @@
|
||||
@@ -286,6 +286,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public joptsimple.OptionSet options;
|
||||
public org.bukkit.command.ConsoleCommandSender console;
|
||||
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 int autosavePeriod;
|
||||
// Paper - don't store the vanilla dispatcher
|
||||
@@ -302,6 +_,8 @@
|
||||
@@ -302,6 +303,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
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
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
@@ -17,7 +25,7 @@
|
||||
// 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 tickTimes5s = new ca.spottedleaf.moonrise.common.time.TickData(java.util.concurrent.TimeUnit.SECONDS.toNanos(5L));
|
||||
@@ -371,6 +_,7 @@
|
||||
@@ -371,6 +374,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public double[] computeTPS() {
|
||||
final long interval = this.tickRateManager().nanosecondsPerTick();
|
||||
return new double[] {
|
||||
@@ -25,7 +33,7 @@
|
||||
getTPS(this.tickTimes1m, interval),
|
||||
getTPS(this.tickTimes5m, interval),
|
||||
getTPS(this.tickTimes15m, interval)
|
||||
@@ -1013,6 +_,15 @@
|
||||
@@ -1013,6 +1017,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
@@ -41,7 +49,7 @@
|
||||
// CraftBukkit start
|
||||
if (this.server != null) {
|
||||
this.server.spark.disable(); // Paper - spark
|
||||
@@ -1111,6 +_,8 @@
|
||||
@@ -1111,6 +1124,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.safeShutdown(waitForShutdown, false);
|
||||
}
|
||||
public void safeShutdown(boolean waitForShutdown, boolean isRestarting) {
|
||||
@@ -50,7 +58,7 @@
|
||||
this.isRestarting = isRestarting;
|
||||
this.hasLoggedStop = true; // Paper - Debugging
|
||||
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
|
||||
@@ -1288,6 +_,16 @@
|
||||
@@ -1288,6 +1303,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// Paper end - Add onboarding message for initial server start
|
||||
|
||||
@@ -67,19 +75,20 @@
|
||||
while (this.running) {
|
||||
final long tickStart = System.nanoTime(); // Paper - improve tick loop
|
||||
long l; // Paper - improve tick loop - diff on change, expect this to be tick interval
|
||||
@@ -1301,8 +_,10 @@
|
||||
@@ -1301,9 +1326,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
final long ticksBehind = Math.max(1L, this.tickSchedule.getPeriodsAhead(l, tickStart));
|
||||
final long catchup = (long)Math.max(
|
||||
1,
|
||||
- 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
|
||||
);
|
||||
+
|
||||
+ 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
|
||||
if (ticksBehind > catchup) {
|
||||
@@ -1773,7 +_,7 @@
|
||||
final long difference = ticksBehind - catchup;
|
||||
@@ -1773,7 +1800,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
long worldTime = level.getGameTime();
|
||||
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
|
||||
for (Player entityhuman : level.players()) {
|
||||
@@ -88,7 +97,7 @@
|
||||
continue;
|
||||
}
|
||||
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
|
||||
@@ -1945,7 +_,7 @@
|
||||
@@ -1945,7 +1972,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 fdeca41d40705f28864ce4443d01cd872c9d51b0..10e5469df1800bcdfb3f8cb4045ee25a4bafc58c 100644
|
||||
--- a/net/minecraft/server/PlayerAdvancements.java
|
||||
+++ b/net/minecraft/server/PlayerAdvancements.java
|
||||
@@ -147,6 +_,7 @@
|
||||
@@ -147,6 +147,7 @@ public class PlayerAdvancements {
|
||||
AdvancementHolder advancementHolder = advancementManager.get(path);
|
||||
if (advancementHolder == null) {
|
||||
if (!path.getNamespace().equals(ResourceLocation.DEFAULT_NAMESPACE)) return; // CraftBukkit
|
||||
@@ -8,7 +16,7 @@
|
||||
LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", path, this.playerSavePath);
|
||||
} else {
|
||||
this.startProgress(advancementHolder, progress);
|
||||
@@ -194,6 +_,7 @@
|
||||
@@ -194,6 +195,7 @@ public class PlayerAdvancements {
|
||||
advancement.value().display().ifPresent(displayInfo -> {
|
||||
// Paper start - Add Adventure message to PlayerAdvancementDoneEvent
|
||||
if (event.message() != null && this.player.level().getGameRules().getBoolean(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 6f4fcee9fdba2248227708fcced1ce0f40aff6af..13f1dbd0d09428e9e0a42f99d0553283e0065f6f 100644
|
||||
--- a/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 {
|
||||
Enchantment enchantment1 = enchantment.value();
|
||||
@@ -9,7 +17,7 @@
|
||||
throw ERROR_LEVEL_TOO_HIGH.create(level, enchantment1.getMaxLevel());
|
||||
} else {
|
||||
int i = 0;
|
||||
@@ -80,7 +_,7 @@
|
||||
@@ -80,7 +80,7 @@ public class EnchantCommand {
|
||||
ItemStack mainHandItem = livingEntity.getMainHandItem();
|
||||
if (!mainHandItem.isEmpty()) {
|
||||
if (enchantment1.canEnchant(mainHandItem)
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 99b9408a025a0edb054aa2db3b743df4498c4f97..b56d990b172db5be8633f1fb3d8aaef1f69390b8 100644
|
||||
--- a/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) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 4f56cdcf658234b1ca92d38c3df3d31e9be34a15..945d7c0b31fe9ac029e518af92eebd6e8018a69f 100644
|
||||
--- a/net/minecraft/server/commands/GiveCommand.java
|
||||
+++ b/net/minecraft/server/commands/GiveCommand.java
|
||||
@@ -69,6 +_,7 @@
|
||||
@@ -69,6 +69,7 @@ public class GiveCommand {
|
||||
i1 -= min;
|
||||
ItemStack itemStack1 = item.createItemStack(min, false);
|
||||
boolean flag = serverPlayer.getInventory().add(itemStack1);
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 354b48c88b113c4048e258f2402aad2647d3c364..e728611fc4148f88d5c4f964af6f17a7b7ee9581 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -198,6 +_,7 @@
|
||||
@@ -198,6 +198,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
public void run() {
|
||||
if (!org.bukkit.craftbukkit.Main.useConsole) return; // CraftBukkit
|
||||
// Paper start - Use TerminalConsoleAppender
|
||||
@@ -8,7 +16,7 @@
|
||||
new com.destroystokyo.paper.console.PaperConsole(DedicatedServer.this).start();
|
||||
/*
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in, StandardCharsets.UTF_8));
|
||||
@@ -276,6 +_,15 @@
|
||||
@@ -276,6 +277,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
||||
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||
@@ -24,7 +32,7 @@
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||
|
||||
// this.worldData.setGameType(properties.gameMode.get()); // CraftBukkit - moved to world loading
|
||||
@@ -318,6 +_,30 @@
|
||||
@@ -318,6 +328,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
|
||||
return false;
|
||||
}
|
||||
@@ -55,13 +63,13 @@
|
||||
|
||||
// CraftBukkit start
|
||||
this.server.loadPlugins();
|
||||
@@ -392,6 +_,9 @@
|
||||
MinecraftServerStatistics.registerJmxMonitoring(this);
|
||||
@@ -393,6 +427,9 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
LOGGER.info("JMX monitoring enabled");
|
||||
}
|
||||
+
|
||||
|
||||
+ 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
|
||||
|
||||
+
|
||||
this.notificationManager().serverStarted();
|
||||
return true;
|
||||
}
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 e352a29c4a45fd3f397d1cf4586c5f149b4ba0d0..a9cd61f0a7bde931e59f1496191f1f8d465aec5e 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
||||
@@ -55,6 +_,7 @@
|
||||
@@ -55,6 +55,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
|
||||
public final boolean onlineMode = this.get("online-mode", true);
|
||||
public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
|
||||
public final String serverIp = this.get("server-ip", "");
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ b/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
@@ -39,6 +_,11 @@
|
||||
@@ -39,6 +39,11 @@ public class MinecraftServerGui extends JComponent {
|
||||
private Thread logAppenderThread;
|
||||
private final Collection<Runnable> finalizers = Lists.newArrayList();
|
||||
final AtomicBoolean isClosing = new AtomicBoolean();
|
||||
@@ -12,7 +20,7 @@
|
||||
|
||||
public static MinecraftServerGui showFrameFor(final DedicatedServer server) {
|
||||
try {
|
||||
@@ -46,7 +_,7 @@
|
||||
@@ -46,7 +51,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
} catch (Exception var3) {
|
||||
}
|
||||
|
||||
@@ -21,7 +29,7 @@
|
||||
final MinecraftServerGui minecraftServerGui = new MinecraftServerGui(server);
|
||||
jFrame.setDefaultCloseOperation(2);
|
||||
jFrame.add(minecraftServerGui);
|
||||
@@ -54,7 +_,7 @@
|
||||
@@ -54,7 +59,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
jFrame.setLocationRelativeTo(null);
|
||||
jFrame.setVisible(true);
|
||||
// Paper start - Improve ServerGUI
|
||||
@@ -30,7 +38,7 @@
|
||||
try {
|
||||
jFrame.setIconImage(javax.imageio.ImageIO.read(java.util.Objects.requireNonNull(MinecraftServerGui.class.getClassLoader().getResourceAsStream("logo.png"))));
|
||||
} catch (java.io.IOException ignore) {
|
||||
@@ -64,7 +_,7 @@
|
||||
@@ -64,7 +69,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent event) {
|
||||
if (!minecraftServerGui.isClosing.getAndSet(true)) {
|
||||
@@ -39,7 +47,7 @@
|
||||
server.halt(true);
|
||||
minecraftServerGui.runFinalizers();
|
||||
}
|
||||
@@ -112,7 +_,7 @@
|
||||
@@ -112,7 +117,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
|
||||
private JComponent buildChatPanel() {
|
||||
JPanel jPanel = new JPanel(new BorderLayout());
|
||||
@@ -48,7 +56,7 @@
|
||||
JScrollPane jScrollPane = new JScrollPane(jTextArea, 22, 30);
|
||||
jTextArea.setEditable(false);
|
||||
jTextArea.setFont(MONOSPACED);
|
||||
@@ -121,10 +_,43 @@
|
||||
@@ -121,10 +126,43 @@ public class MinecraftServerGui extends JComponent {
|
||||
String trimmed = jTextField.getText().trim();
|
||||
if (!trimmed.isEmpty()) {
|
||||
this.server.handleConsoleInput(trimmed, this.server.createCommandSourceStack());
|
||||
@@ -92,7 +100,7 @@
|
||||
jTextArea.addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
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
|
||||
@@ -101,7 +109,7 @@
|
||||
if (!SwingUtilities.isEventDispatchThread()) {
|
||||
SwingUtilities.invokeLater(() -> this.print(textArea, scrollPane, line));
|
||||
} else {
|
||||
@@ -170,16 +_,29 @@
|
||||
@@ -170,10 +208,11 @@ public class MinecraftServerGui extends JComponent {
|
||||
flag = verticalScrollBar.getValue() + verticalScrollBar.getSize().getHeight() + MONOSPACED.getSize() * 4 > verticalScrollBar.getMaximum();
|
||||
}
|
||||
|
||||
@@ -115,10 +123,10 @@
|
||||
|
||||
if (flag) {
|
||||
verticalScrollBar.setValue(Integer.MAX_VALUE);
|
||||
}
|
||||
@@ -181,6 +220,18 @@ public class MinecraftServerGui extends JComponent {
|
||||
}
|
||||
}
|
||||
+
|
||||
|
||||
+ // Purpur start - GUI Improvements
|
||||
+ public static class CommandHistory extends java.util.LinkedList<String> {
|
||||
+ @Override
|
||||
@@ -130,6 +138,7 @@
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - GUI Improvements
|
||||
|
||||
+
|
||||
// Paper start - Add onboarding message for initial server start
|
||||
private JComponent buildOnboardingPanel() {
|
||||
String onboardingLink = "https://docs.papermc.io/paper/next-steps";
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 35fd539eb2bfe60ad17ab1e558a01273666acc54..103ff139dae918c991413ce9df61da3e22ee458a 100644
|
||||
--- a/net/minecraft/server/gui/StatsComponent.java
|
||||
+++ b/net/minecraft/server/gui/StatsComponent.java
|
||||
@@ -43,7 +_,7 @@
|
||||
@@ -43,7 +43,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[1] = "Avg tick: " + DECIMAL_FORMAT.format((double)this.server.getAverageTickTimeNanos() / TimeUtil.NANOSECONDS_PER_MILLISECOND) + " ms";
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 c0ed4e023b35a076b554fa387e9a2324166b2fae..a70c9f9343a5497392d804eb8014b8789c14bafd 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -212,6 +_,8 @@
|
||||
@@ -212,6 +212,8 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
private final StructureManager structureManager;
|
||||
private final StructureCheck structureCheck;
|
||||
private final boolean tickTime;
|
||||
@@ -9,7 +17,7 @@
|
||||
private final RandomSequences randomSequences;
|
||||
final LevelDebugSynchronizers debugSynchronizers = new LevelDebugSynchronizers(this);
|
||||
|
||||
@@ -616,8 +_,25 @@
|
||||
@@ -616,8 +618,25 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
// CraftBukkit end
|
||||
this.tickTime = tickTime;
|
||||
this.server = server;
|
||||
@@ -36,7 +44,7 @@
|
||||
ChunkGenerator chunkGenerator = levelStem.generator();
|
||||
// CraftBukkit start
|
||||
this.serverLevelData.setWorld(this);
|
||||
@@ -699,6 +_,7 @@
|
||||
@@ -699,6 +718,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);
|
||||
// Paper end - rewrite chunk system
|
||||
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
|
||||
@@ -44,7 +52,7 @@
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -745,7 +_,7 @@
|
||||
@@ -745,7 +765,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
}
|
||||
|
||||
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
@@ -53,7 +61,7 @@
|
||||
// Paper start - create time skip event - move up calculations
|
||||
final long newDayTime = this.levelData.getDayTime() + 24000L;
|
||||
org.bukkit.event.world.TimeSkipEvent event = new org.bukkit.event.world.TimeSkipEvent(
|
||||
@@ -879,6 +_,13 @@
|
||||
@@ -879,6 +899,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
this.serverLevelData.getScheduledEvents().tick(this.server, l);
|
||||
Profiler.get().pop();
|
||||
if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
|
||||
@@ -67,7 +75,7 @@
|
||||
this.setDayTime(this.levelData.getDayTime() + 1L);
|
||||
}
|
||||
}
|
||||
@@ -886,6 +_,20 @@
|
||||
@@ -886,6 +913,20 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
|
||||
public void setDayTime(long time) {
|
||||
this.serverLevelData.setDayTime(time);
|
||||
@@ -88,7 +96,7 @@
|
||||
}
|
||||
|
||||
public void tickCustomSpawners(boolean spawnEnemies) {
|
||||
@@ -990,9 +_,17 @@
|
||||
@@ -990,9 +1031,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.getBlockState(blockPos.below()).is(BlockTags.LIGHTNING_RODS);
|
||||
if (flag) {
|
||||
@@ -108,7 +116,7 @@
|
||||
skeletonHorse.setAge(0);
|
||||
skeletonHorse.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
||||
this.addFreshEntity(skeletonHorse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
@@ -1027,9 +_,35 @@
|
||||
@@ -1027,9 +1076,35 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
if (blockState.is(Blocks.SNOW)) {
|
||||
int layersValue = blockState.getValue(SnowLayerBlock.LAYERS);
|
||||
if (layersValue < Math.min(_int, 8)) {
|
||||
@@ -144,7 +152,7 @@
|
||||
}
|
||||
} else {
|
||||
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, heightmapPos, Blocks.SNOW.defaultBlockState(), 3, null); // CraftBukkit
|
||||
@@ -1050,7 +_,7 @@
|
||||
@@ -1050,7 +1125,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
poiType -> poiType.is(PoiTypes.LIGHTNING_ROD),
|
||||
pos1 -> pos1.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, pos1.getX(), pos1.getZ()) - 1,
|
||||
pos,
|
||||
@@ -153,7 +161,7 @@
|
||||
PoiManager.Occupancy.ANY
|
||||
);
|
||||
return optional.map(pos1 -> pos1.above(1));
|
||||
@@ -1099,8 +_,26 @@
|
||||
@@ -1099,8 +1174,26 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
Component component;
|
||||
if (this.sleepStatus.areEnoughSleeping(_int)) {
|
||||
@@ -180,7 +188,7 @@
|
||||
component = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(_int));
|
||||
}
|
||||
|
||||
@@ -1237,6 +_,7 @@
|
||||
@@ -1237,6 +1330,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@VisibleForTesting
|
||||
public void resetWeatherCycle() {
|
||||
// CraftBukkit start
|
||||
@@ -188,7 +196,7 @@
|
||||
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.
|
||||
// Not that everyone ever manages to get the whole server to sleep at the same time....
|
||||
@@ -1244,6 +_,7 @@
|
||||
@@ -1244,6 +1338,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
this.serverLevelData.setRainTime(0);
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -196,7 +204,7 @@
|
||||
this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
|
||||
// CraftBukkit start
|
||||
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
||||
@@ -1917,7 +_,7 @@
|
||||
@@ -1917,7 +2012,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
Explosion.BlockInteraction blockInteraction = switch (explosionInteraction) {
|
||||
case NONE -> Explosion.BlockInteraction.KEEP;
|
||||
case BLOCK -> this.getDestroyType(GameRules.RULE_BLOCK_EXPLOSION_DROP_DECAY);
|
||||
@@ -205,7 +213,7 @@
|
||||
? this.getDestroyType(GameRules.RULE_MOB_EXPLOSION_DROP_DECAY)
|
||||
: Explosion.BlockInteraction.KEEP;
|
||||
case TNT -> this.getDestroyType(GameRules.RULE_TNT_EXPLOSION_DROP_DECAY);
|
||||
@@ -2794,7 +_,7 @@
|
||||
@@ -2794,7 +2889,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
// Spigot start
|
||||
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
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 b4a996ac6c570e988b38237a32f90ec5042cbc17..d4b57465b7d49f8000de31f75c49f3f7ed333419 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -443,6 +_,9 @@
|
||||
@@ -443,6 +443,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
public boolean isRealPlayer; // Paper
|
||||
public @Nullable com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
||||
public @Nullable org.bukkit.event.player.PlayerQuitEvent.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
|
||||
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
|
||||
@@ -516,6 +_,9 @@
|
||||
@@ -516,6 +519,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.respawnConfig = input.read("respawn", ServerPlayer.RespawnConfig.CODEC).orElse(null);
|
||||
this.spawnExtraParticlesOnFall = input.getBooleanOr("spawn_extra_particles_on_fall", false);
|
||||
this.raidOmenPosition = input.read("raid_omen_position", BlockPos.CODEC).orElse(null);
|
||||
@@ -20,7 +28,7 @@
|
||||
// Paper start - Expand PlayerGameModeChangeEvent
|
||||
this.loadGameTypes(input);
|
||||
}
|
||||
@@ -557,6 +_,9 @@
|
||||
@@ -557,6 +563,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
output.store("ShoulderEntityRight", CompoundTag.CODEC, this.getShoulderEntityRight());
|
||||
}
|
||||
this.getBukkitEntity().setExtraData(output); // CraftBukkit
|
||||
@@ -30,7 +38,7 @@
|
||||
}
|
||||
|
||||
private void saveParentVehicle(ValueOutput output) {
|
||||
@@ -1186,6 +_,7 @@
|
||||
@@ -1186,6 +1195,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
// Paper - moved up to sendClientboundPlayerCombatKillPacket()
|
||||
sendClientboundPlayerCombatKillPacket(event.getShowDeathMessages(), deathScreenMessage); // Paper - Expand PlayerDeathEvent
|
||||
Team team = this.getTeam();
|
||||
@@ -38,7 +46,7 @@
|
||||
if (team == null || team.getDeathMessageVisibility() == Team.Visibility.ALWAYS) {
|
||||
this.server.getPlayerList().broadcastSystemMessage(deathMessage, false);
|
||||
} else if (team.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) {
|
||||
@@ -1293,6 +_,13 @@
|
||||
@@ -1293,6 +1303,13 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
if (this.isInvulnerableTo(level, damageSource)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -52,7 +60,7 @@
|
||||
Entity entity = damageSource.getEntity();
|
||||
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))
|
||||
@@ -1546,6 +_,7 @@
|
||||
@@ -1546,6 +1563,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
|
||||
profilerFiller.pop();
|
||||
profilerFiller.push("placing");
|
||||
@@ -60,7 +68,7 @@
|
||||
this.setServerLevel(level);
|
||||
this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event
|
||||
this.connection.resetPosition();
|
||||
@@ -1647,7 +_,7 @@
|
||||
@@ -1647,7 +1665,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),
|
||||
monster -> monster.isPreventingPlayerRest(this.level(), this)
|
||||
);
|
||||
@@ -69,7 +77,7 @@
|
||||
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
|
||||
}
|
||||
}
|
||||
@@ -1684,7 +_,19 @@
|
||||
@@ -1684,7 +1702,19 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
CriteriaTriggers.SLEPT_IN_BED.trigger(this);
|
||||
});
|
||||
if (!this.level().canSleepThroughNights()) {
|
||||
@@ -90,7 +98,7 @@
|
||||
}
|
||||
|
||||
this.level().updateSleepingPlayerList();
|
||||
@@ -1776,6 +_,7 @@
|
||||
@@ -1776,6 +1806,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
|
||||
@Override
|
||||
public void openTextEdit(SignBlockEntity signEntity, boolean isFrontText) {
|
||||
@@ -98,7 +106,7 @@
|
||||
this.connection.send(new ClientboundBlockUpdatePacket(this.level(), signEntity.getBlockPos()));
|
||||
this.connection.send(new ClientboundOpenSignEditorPacket(signEntity.getBlockPos(), isFrontText));
|
||||
}
|
||||
@@ -2085,6 +_,26 @@
|
||||
@@ -2085,6 +2116,26 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
this.lastSentExp = -1; // CraftBukkit - Added to reset
|
||||
}
|
||||
|
||||
@@ -125,7 +133,7 @@
|
||||
@Override
|
||||
public void displayClientMessage(Component message, boolean overlay) {
|
||||
this.sendSystemMessage(message, overlay);
|
||||
@@ -2319,6 +_,20 @@
|
||||
@@ -2319,6 +2370,20 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
);
|
||||
}
|
||||
|
||||
@@ -146,11 +154,10 @@
|
||||
public void sendSystemMessage(Component message) {
|
||||
this.sendSystemMessage(message, false);
|
||||
}
|
||||
@@ -2457,7 +_,67 @@
|
||||
@@ -2457,7 +2522,67 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
|
||||
public void resetLastActionTime() {
|
||||
this.lastActionTime = Util.getMillis();
|
||||
- }
|
||||
+ this.setAfk(false); // Purpur - AFK API
|
||||
+ }
|
||||
+
|
||||
@@ -210,12 +217,12 @@
|
||||
+ @Override
|
||||
+ public boolean canBeCollidedWith(Entity entity) {
|
||||
+ return !this.isAfk() && super.canBeCollidedWith(entity);
|
||||
+ }
|
||||
}
|
||||
+ // Purpur end - AFK API
|
||||
|
||||
public ServerStatsCounter getStats() {
|
||||
return this.stats;
|
||||
@@ -3098,4 +_,65 @@
|
||||
@@ -3098,4 +3223,65 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 7166889bce8065508030ecd5b1400ee9be031bf3..fad600f343ee0983efc183f083b1507648987575 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -368,6 +_,7 @@
|
||||
@@ -368,6 +368,7 @@ public class ServerPlayerGameMode {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -8,7 +16,7 @@
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -485,6 +_,7 @@
|
||||
@@ -485,6 +486,7 @@ public class ServerPlayerGameMode {
|
||||
public InteractionHand interactHand;
|
||||
public ItemStack interactItemStack;
|
||||
public InteractionResult useItemOn(ServerPlayer player, Level level, ItemStack stack, InteractionHand hand, BlockHitResult hitResult) {
|
||||
@@ -16,7 +24,7 @@
|
||||
BlockPos blockPos = hitResult.getBlockPos();
|
||||
BlockState blockState = level.getBlockState(blockPos);
|
||||
boolean cancelledBlock = false;
|
||||
@@ -527,7 +_,7 @@
|
||||
@@ -527,7 +529,7 @@ public class ServerPlayerGameMode {
|
||||
boolean flag = !player.getMainHandItem().isEmpty() || !player.getOffhandItem().isEmpty();
|
||||
boolean flag1 = player.isSecondaryUseActive() && flag;
|
||||
ItemStack itemStack = stack.copy();
|
||||
@@ -25,7 +33,7 @@
|
||||
InteractionResult interactionResult = blockState.useItemOn(player.getItemInHand(hand), level, player, hand, hitResult);
|
||||
if (interactionResult.consumesAction()) {
|
||||
CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger(player, blockPos, itemStack);
|
||||
@@ -573,4 +_,18 @@
|
||||
@@ -573,4 +575,18 @@ public class ServerPlayerGameMode {
|
||||
public void setLevel(ServerLevel level) {
|
||||
this.level = level;
|
||||
}
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 b8be39ae633e466d764f329f614620f1a2e1ef3f..75f3f8e033c1ef3ed6790dabaf9565b9f08d0ef2 100644
|
||||
--- a/net/minecraft/server/level/WorldGenRegion.java
|
||||
+++ b/net/minecraft/server/level/WorldGenRegion.java
|
||||
@@ -314,6 +_,7 @@
|
||||
@@ -314,6 +314,7 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
return true;
|
||||
} else {
|
||||
// Paper start - Buffer OOB setBlock calls
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 c6db2c96db96453daaf49779f588f75f7c3d3d60..e98400719a4ab43dc0ce90cdca19ba86e4849720 100644
|
||||
--- a/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
|
||||
private final boolean transferred;
|
||||
//private long keepAliveTime; // Paper - improve keepalives
|
||||
@@ -13,7 +21,7 @@
|
||||
private volatile int latency; // Paper - improve keepalives - make volatile
|
||||
private final io.papermc.paper.util.KeepAlive keepAlive; // Paper - improve keepalives
|
||||
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
|
||||
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.ResourceLocation MINECRAFT_BRAND = net.minecraft.resources.ResourceLocation.withDefaultNamespace("brand"); // Paper - Brand support
|
||||
@@ -24,7 +32,7 @@
|
||||
// Paper start - retain certain values
|
||||
public @Nullable String playerBrand;
|
||||
public final java.util.Set<String> pluginMessagerChannels;
|
||||
@@ -105,6 +_,18 @@
|
||||
@@ -105,6 +110,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
// Paper start - improve keepalives
|
||||
long now = System.nanoTime();
|
||||
io.papermc.paper.util.KeepAlive.PendingKeepAlive pending = this.keepAlive.pendingKeepAlives.peek();
|
||||
@@ -43,7 +51,7 @@
|
||||
if (pending != null && pending.challengeId() == packet.getId()) {
|
||||
this.keepAlive.pendingKeepAlives.remove(pending);
|
||||
|
||||
@@ -179,6 +_,12 @@
|
||||
@@ -179,6 +196,12 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -56,7 +64,7 @@
|
||||
if (identifier.equals(MINECRAFT_BRAND)) {
|
||||
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");
|
||||
long millis = Util.getMillis();
|
||||
// Paper start - improve keepalives
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 ef7d44ea1c1582bbf1d544819825778c414fe40d..caae7fc98d13ad92d17b6869b1fe86a79a1f5ba6 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -341,6 +_,20 @@
|
||||
@@ -341,6 +341,20 @@ public class ServerGamePacketListenerImpl
|
||||
}
|
||||
// Paper end - configuration phase API
|
||||
|
||||
@@ -21,7 +29,7 @@
|
||||
@Override
|
||||
public void tick() {
|
||||
if (this.ackBlockChangesUpTo > -1) {
|
||||
@@ -358,6 +_,12 @@
|
||||
@@ -358,6 +372,12 @@ public class ServerGamePacketListenerImpl
|
||||
&& this.server.playerIdleTimeout() > 0
|
||||
&& Util.getMillis() - this.player.getLastActionTime() > TimeUnit.MINUTES.toMillis(this.server.playerIdleTimeout())
|
||||
&& !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
|
||||
}
|
||||
}
|
||||
@@ -672,6 +_,8 @@
|
||||
@@ -672,6 +692,8 @@ public class ServerGamePacketListenerImpl
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
@@ -43,7 +51,7 @@
|
||||
Location oldTo = to.clone();
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
@@ -751,6 +_,7 @@
|
||||
@@ -751,6 +773,7 @@ public class ServerGamePacketListenerImpl
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
if (packet.getId() == this.awaitingTeleport) {
|
||||
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
|
||||
return;
|
||||
}
|
||||
@@ -1284,6 +_,10 @@
|
||||
@@ -1284,6 +1307,10 @@ public class ServerGamePacketListenerImpl
|
||||
final int maxBookPageSize = pageMax.intValue();
|
||||
final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
|
||||
long byteAllowed = maxBookPageSize;
|
||||
@@ -62,7 +70,7 @@
|
||||
for (final String page : pageList) {
|
||||
final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
|
||||
byteTotal += byteLength;
|
||||
@@ -1308,7 +_,8 @@
|
||||
@@ -1308,7 +1335,8 @@ public class ServerGamePacketListenerImpl
|
||||
}
|
||||
|
||||
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
|
||||
return;
|
||||
}
|
||||
@@ -1327,31 +_,45 @@
|
||||
@@ -1327,31 +1355,45 @@ public class ServerGamePacketListenerImpl
|
||||
Optional<String> optional = packet.title();
|
||||
optional.ifPresent(list::add);
|
||||
list.addAll(packet.pages());
|
||||
@@ -122,7 +130,7 @@
|
||||
itemStack.set(
|
||||
DataComponents.WRITTEN_BOOK_CONTENT, new WrittenBookContent(this.filterableFromOutgoing(title), this.player.getPlainTextName(), 0, list, true)
|
||||
);
|
||||
@@ -1364,6 +_,16 @@
|
||||
@@ -1364,6 +1406,16 @@ public class ServerGamePacketListenerImpl
|
||||
return this.player.isTextFilteringEnabled() ? Filterable.passThrough(filteredText.filteredOrEmpty()) : Filterable.from(filteredText);
|
||||
}
|
||||
|
||||
@@ -139,7 +147,7 @@
|
||||
@Override
|
||||
public void handleEntityTagQuery(ServerboundEntityTagQueryPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
@@ -1403,7 +_,15 @@
|
||||
@@ -1403,7 +1455,15 @@ public class ServerGamePacketListenerImpl
|
||||
@Override
|
||||
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
|
||||
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
|
||||
} else {
|
||||
ServerLevel serverLevel = this.player.level();
|
||||
@@ -1585,7 +_,7 @@
|
||||
@@ -1585,7 +1645,7 @@ public class ServerGamePacketListenerImpl
|
||||
movedWrongly = true;
|
||||
if (event.getLogWarning())
|
||||
// Paper end
|
||||
@@ -165,7 +173,7 @@
|
||||
} // Paper
|
||||
}
|
||||
|
||||
@@ -1650,6 +_,8 @@
|
||||
@@ -1650,6 +1710,8 @@ public class ServerGamePacketListenerImpl
|
||||
this.lastYaw = to.getYaw();
|
||||
this.lastPitch = to.getPitch();
|
||||
|
||||
@@ -174,7 +182,7 @@
|
||||
Location oldTo = to.clone();
|
||||
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
@@ -1705,6 +_,13 @@
|
||||
@@ -1705,6 +1767,13 @@ public class ServerGamePacketListenerImpl
|
||||
this.player.tryResetCurrentImpulseContext();
|
||||
}
|
||||
|
||||
@@ -188,7 +196,7 @@
|
||||
this.player.checkMovementStatistics(this.player.getX() - x, this.player.getY() - y, this.player.getZ() - z);
|
||||
this.lastGoodX = this.player.getX();
|
||||
this.lastGoodY = this.player.getY();
|
||||
@@ -1722,6 +_,17 @@
|
||||
@@ -1722,6 +1791,17 @@ public class ServerGamePacketListenerImpl
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +214,7 @@
|
||||
private boolean shouldCheckPlayerMovement(boolean isElytraMovement) {
|
||||
if (this.isSingleplayerOwner()) {
|
||||
return false;
|
||||
@@ -2121,6 +_,7 @@
|
||||
@@ -2121,6 +2201,7 @@ public class ServerGamePacketListenerImpl
|
||||
|
||||
boolean cancelled;
|
||||
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);
|
||||
cancelled = event.useItemInHand() == Event.Result.DENY;
|
||||
} else {
|
||||
@@ -2768,6 +_,7 @@
|
||||
@@ -2768,6 +2849,7 @@ public class ServerGamePacketListenerImpl
|
||||
|
||||
AABB boundingBox = target.getBoundingBox();
|
||||
if (this.player.canInteractWithEntity(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(
|
||||
new ServerboundInteractPacket.Handler() {
|
||||
private void performInteraction(InteractionHand hand, ServerGamePacketListenerImpl.EntityInteraction entityInteraction, PlayerInteractEntityEvent event) { // CraftBukkit
|
||||
@@ -3509,7 +_,7 @@
|
||||
@@ -3509,7 +3591,7 @@ public class ServerGamePacketListenerImpl
|
||||
@Override
|
||||
public void handleChangeGameMode(ServerboundChangeGameModePacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 c5d071c591c844b11667013131d1d3bae8e3bac6..ace65f36d6562988665c530dd3fdbfaa5d2e2071 100644
|
||||
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -276,7 +_,7 @@
|
||||
@@ -276,7 +276,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
ServerLoginPacketListenerImpl.LOGGER.warn("Failed to verify username but will let them in anyway!");
|
||||
ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(string1)); // Spigot
|
||||
} else {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ b/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
|
||||
@@ -37,6 +_,7 @@
|
||||
@@ -37,6 +37,7 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
|
||||
} else {
|
||||
this.hasRequestedStatus = true;
|
||||
// this.connection.send(new ClientboundStatusResponsePacket(this.status)); // Paper
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 cc5d1e8007e2ea32605bd68d0a73683e8fb6886e..0c3451caa323ce2553c0d7ee00e7bf8cc8766b2c 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -305,6 +_,7 @@
|
||||
@@ -305,6 +305,7 @@ public abstract class PlayerList {
|
||||
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
|
||||
}
|
||||
// Paper end - Configurable player collision
|
||||
@@ -8,7 +16,7 @@
|
||||
// CraftBukkit start - moved down
|
||||
LOGGER.info(
|
||||
"{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", // CraftBukkit - add world name
|
||||
@@ -425,6 +_,7 @@
|
||||
@@ -425,6 +426,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
public @Nullable net.kyori.adventure.text.Component remove(ServerPlayer player, net.kyori.adventure.text.Component leaveMessage) {
|
||||
// Paper end - Fix kick event leave message not being sent
|
||||
@@ -16,7 +24,7 @@
|
||||
ServerLevel serverLevel = player.level();
|
||||
player.awardStat(Stats.LEAVE_GAME);
|
||||
// CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
|
||||
@@ -764,6 +_,20 @@
|
||||
@@ -764,6 +766,20 @@ public abstract class PlayerList {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +45,7 @@
|
||||
public void broadcastAll(Packet<?> packet, ResourceKey<Level> dimension) {
|
||||
for (ServerPlayer serverPlayer : this.players) {
|
||||
if (serverPlayer.level().dimension() == dimension) {
|
||||
@@ -852,12 +_,13 @@
|
||||
@@ -852,12 +868,13 @@ public abstract class PlayerList {
|
||||
if (player.connection != null) {
|
||||
byte b;
|
||||
if (permLevel <= 0) {
|
||||
@@ -53,7 +61,7 @@
|
||||
|
||||
player.connection.send(new ClientboundEntityEventPacket(player, b));
|
||||
}
|
||||
@@ -870,7 +_,7 @@
|
||||
@@ -870,7 +887,7 @@ public abstract class PlayerList {
|
||||
|
||||
// Paper start - whitelist verify event / login event
|
||||
public LoginResult canBypassFullServerLogin(final NameAndId nameAndId, final LoginResult currentResult) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ 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) {
|
||||
// CraftBukkit start
|
||||
@@ -9,7 +17,7 @@
|
||||
boolean anyDeepSleep = sleepingPlayers.stream().anyMatch(Player::isSleepingLongEnough);
|
||||
return anyDeepSleep && i >= this.sleepersNeeded(requiredSleepPercentage);
|
||||
// CraftBukkit end
|
||||
@@ -43,7 +_,7 @@
|
||||
@@ -43,7 +43,7 @@ public class SleepStatus {
|
||||
for (ServerPlayer serverPlayer : players) {
|
||||
if (!serverPlayer.isSpectator()) {
|
||||
this.activePlayers++;
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ 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) {
|
||||
for (ResourceKey<Recipe<?>> resourceKey : recipes) {
|
||||
if (!isRecognized.test(resourceKey)) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 62fdb8c215552a897c67dd97a302a86afee6d44f..3c5769e0f29d6b3295df568dc461ed521cb04378 100644
|
||||
--- a/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
|
||||
public static boolean isReasonablePlayerName(final String name) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ 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) {
|
||||
float f = 2.0F + armorToughness / 4.0F;
|
||||
@@ -9,7 +17,7 @@
|
||||
float f2 = f1 / 25.0F;
|
||||
ItemStack weaponItem = damageSource.getWeaponItem();
|
||||
float f3;
|
||||
@@ -30,7 +_,7 @@
|
||||
@@ -30,7 +30,7 @@ public class CombatRules {
|
||||
}
|
||||
|
||||
public static float getDamageAfterMagicAbsorb(float damageAmount, float enchantModifiers) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 4cec197634fac341cca1ed108f1ecb0561f72461..aa6213ca382e4901363317df1e30332c5166f271 100644
|
||||
--- a/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) {
|
||||
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(noWeaponTranslationKey, this.mob.getDisplayName(), entityDisplayName);
|
||||
}
|
||||
@@ -108,6 +_,15 @@
|
||||
@@ -108,6 +108,15 @@ public class CombatTracker {
|
||||
Component component = ComponentUtils.wrapInSquareBrackets(Component.translatable(string + ".link")).withStyle(INTENTIONAL_GAME_DESIGN_STYLE);
|
||||
return Component.translatable(string + ".message", this.mob.getDisplayName(), component);
|
||||
} else {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 bb021fc9de91f8c4f79e6a753d57fa157efbbda7..5fa92eef9c6b88cf96d3fe427e4d4f16953e8094 100644
|
||||
--- a/net/minecraft/world/damagesource/DamageSource.java
|
||||
+++ b/net/minecraft/world/damagesource/DamageSource.java
|
||||
@@ -30,6 +_,8 @@
|
||||
@@ -30,6 +30,8 @@ public class DamageSource {
|
||||
@Nullable
|
||||
private org.bukkit.block.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
|
||||
@@ -9,7 +17,7 @@
|
||||
|
||||
public DamageSource knownCause(final org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) {
|
||||
final DamageSource damageSource = this.copy();
|
||||
@@ -42,6 +_,30 @@
|
||||
@@ -42,6 +44,30 @@ public class DamageSource {
|
||||
return this.knownCause;
|
||||
}
|
||||
|
||||
@@ -40,7 +48,7 @@
|
||||
@Nullable
|
||||
public Entity eventEntityDamager() {
|
||||
return this.eventEntityDamager;
|
||||
@@ -103,6 +_,8 @@
|
||||
@@ -103,6 +129,8 @@ public class DamageSource {
|
||||
damageSource.eventBlockDamager = this.eventBlockDamager;
|
||||
damageSource.fromBlockSnapshot = this.fromBlockSnapshot;
|
||||
damageSource.critical = this.critical;
|
||||
@@ -49,7 +57,7 @@
|
||||
return damageSource;
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -169,11 +_,20 @@
|
||||
@@ -169,12 +197,21 @@ public class DamageSource {
|
||||
} else {
|
||||
Component component = this.causingEntity == null ? this.directEntity.getDisplayName() : this.causingEntity.getDisplayName();
|
||||
ItemStack itemStack = this.causingEntity instanceof LivingEntity livingEntity1 ? livingEntity1.getMainHandItem() : ItemStack.EMPTY;
|
||||
@@ -59,7 +67,7 @@
|
||||
: Component.translatable(string, livingEntity.getDisplayName(), component);
|
||||
}
|
||||
}
|
||||
+
|
||||
|
||||
+ // Purpur start - Component related conveniences
|
||||
+ public Component getLocalizedDeathMessage(String str, LivingEntity entity) {
|
||||
+ 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);
|
||||
+ }
|
||||
+ // Purpur end - Component related conveniences
|
||||
|
||||
+
|
||||
public String getMsgId() {
|
||||
return this.type().msgId();
|
||||
}
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 cc206ecff2d95f0398ca424c178a336ad80cc396..7afad362801082e5f2e3aceda864ad2a7d4e5ebb 100644
|
||||
--- a/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 outsideBorder;
|
||||
private final DamageSource genericKill;
|
||||
@@ -9,7 +17,7 @@
|
||||
|
||||
public DamageSources(RegistryAccess registry) {
|
||||
this.damageTypes = registry.lookupOrThrow(Registries.DAMAGE_TYPE);
|
||||
@@ -70,6 +_,8 @@
|
||||
@@ -70,6 +72,8 @@ public class DamageSources {
|
||||
this.stalagmite = this.source(DamageTypes.STALAGMITE);
|
||||
this.outsideBorder = this.source(DamageTypes.OUTSIDE_BORDER);
|
||||
this.genericKill = this.source(DamageTypes.GENERIC_KILL);
|
||||
@@ -18,11 +26,10 @@
|
||||
}
|
||||
|
||||
private DamageSource source(ResourceKey<DamageType> damageTypeKey) {
|
||||
@@ -83,6 +_,18 @@
|
||||
private DamageSource source(ResourceKey<DamageType> damageTypeKey, @Nullable Entity causingEntity, @Nullable Entity directEntity) {
|
||||
@@ -84,6 +88,18 @@ public class DamageSources {
|
||||
return new DamageSource(this.damageTypes.getOrThrow(damageTypeKey), causingEntity, directEntity);
|
||||
}
|
||||
+
|
||||
|
||||
+ // Purpur start - Dont run with scissor
|
||||
+ public DamageSource scissors() {
|
||||
+ return this.scissors;
|
||||
@@ -34,6 +41,7 @@
|
||||
+ return this.stonecutter;
|
||||
+ }
|
||||
+ // Purpur end - Stonecutter damage
|
||||
|
||||
+
|
||||
public DamageSource inFire() {
|
||||
return this.inFire;
|
||||
}
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ b/net/minecraft/world/effect/HungerMobEffect.java
|
||||
@@ -12,7 +_,7 @@
|
||||
@@ -12,7 +12,7 @@ class HungerMobEffect extends MobEffect {
|
||||
@Override
|
||||
public boolean applyEffectTick(ServerLevel level, LivingEntity entity, int amplifier) {
|
||||
if (entity instanceof Player player) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ b/net/minecraft/world/effect/PoisonMobEffect.java
|
||||
@@ -12,8 +_,8 @@
|
||||
@@ -12,8 +12,8 @@ public class PoisonMobEffect extends MobEffect {
|
||||
|
||||
@Override
|
||||
public boolean applyEffectTick(ServerLevel level, LivingEntity entity, int amplifier) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ b/net/minecraft/world/effect/RegenerationMobEffect.java
|
||||
@@ -11,7 +_,7 @@
|
||||
@@ -11,7 +11,7 @@ class RegenerationMobEffect extends MobEffect {
|
||||
@Override
|
||||
public boolean applyEffectTick(ServerLevel level, LivingEntity entity, int amplifier) {
|
||||
if (entity.getHealth() < entity.getMaxHealth()) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ b/net/minecraft/world/effect/SaturationMobEffect.java
|
||||
@@ -16,7 +_,8 @@
|
||||
@@ -16,7 +16,8 @@ class SaturationMobEffect extends InstantenousMobEffect {
|
||||
int oldFoodLevel = player.getFoodData().foodLevel;
|
||||
org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(player, amplifier + 1 + oldFoodLevel);
|
||||
if (!event.isCancelled()) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ b/net/minecraft/world/effect/WitherMobEffect.java
|
||||
@@ -12,7 +_,7 @@
|
||||
@@ -12,7 +12,7 @@ public class WitherMobEffect extends MobEffect {
|
||||
|
||||
@Override
|
||||
public boolean applyEffectTick(ServerLevel level, LivingEntity entity, int amplifier) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 8939cc4ab9612f132aec0a6d0175cc0d40de073e..96320494c8c738d86d33820c4acfb504291dc58c 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -150,6 +_,7 @@
|
||||
@@ -150,6 +150,7 @@ import org.jetbrains.annotations.Contract;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public abstract class Entity implements SyncedDataHolder, DebugValueSource, Nameable, ItemOwner, 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
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
static boolean isLevelAtLeast(ValueInput input, int level) {
|
||||
@@ -281,8 +_,9 @@
|
||||
@@ -281,8 +282,9 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
public double xOld;
|
||||
public double yOld;
|
||||
public double zOld;
|
||||
@@ -19,7 +27,7 @@
|
||||
public int tickCount;
|
||||
private int remainingFireTicks;
|
||||
public boolean wasTouchingWater;
|
||||
@@ -316,8 +_,8 @@
|
||||
@@ -316,8 +318,8 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
public PortalProcessor portalProcess;
|
||||
public int portalCooldown;
|
||||
private boolean invulnerable;
|
||||
@@ -30,7 +38,7 @@
|
||||
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 double[] pistonDeltas = new double[]{0.0, 0.0, 0.0};
|
||||
@@ -372,6 +_,7 @@
|
||||
@@ -372,6 +374,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
public long activatedTick = Integer.MIN_VALUE;
|
||||
public boolean isTemporarilyActive;
|
||||
public long activatedImmunityTick = Integer.MIN_VALUE;
|
||||
@@ -38,7 +46,7 @@
|
||||
|
||||
public void inactiveTick() {
|
||||
}
|
||||
@@ -534,10 +_,21 @@
|
||||
@@ -534,10 +537,21 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
}
|
||||
// Paper end - optimise entity tracker
|
||||
|
||||
@@ -60,7 +68,7 @@
|
||||
this.position = Vec3.ZERO;
|
||||
this.blockPosition = BlockPos.ZERO;
|
||||
this.chunkPosition = ChunkPos.ZERO;
|
||||
@@ -916,6 +_,7 @@
|
||||
@@ -916,6 +930,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
&& this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
|
||||
&& (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
|
||||
// Paper end - Configurable nether ceiling damage
|
||||
@@ -68,7 +76,7 @@
|
||||
this.onBelowWorld();
|
||||
}
|
||||
}
|
||||
@@ -1941,7 +_,7 @@
|
||||
@@ -1941,7 +1956,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
}
|
||||
|
||||
public boolean fireImmune() {
|
||||
@@ -77,7 +85,7 @@
|
||||
}
|
||||
|
||||
public boolean causeFallDamage(double fallDistance, float damageMultiplier, DamageSource damageSource) {
|
||||
@@ -2634,6 +_,11 @@
|
||||
@@ -2634,6 +2649,11 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
output.putBoolean("Paper.FreezeLock", true);
|
||||
}
|
||||
// Paper end
|
||||
@@ -89,7 +97,7 @@
|
||||
} catch (Throwable var7) {
|
||||
CrashReport crashReport = CrashReport.forThrowable(var7, "Saving entity NBT");
|
||||
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being saved");
|
||||
@@ -2754,6 +_,9 @@
|
||||
@@ -2754,6 +2774,9 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
}
|
||||
freezeLocked = input.getBooleanOr("Paper.FreezeLock", false);
|
||||
// Paper end
|
||||
@@ -99,7 +107,7 @@
|
||||
} catch (Throwable var7) {
|
||||
CrashReport crashReport = CrashReport.forThrowable(var7, "Loading entity NBT");
|
||||
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being loaded");
|
||||
@@ -3026,6 +_,7 @@
|
||||
@@ -3026,6 +3049,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
if (this.isAlive() && this instanceof Leashable leashable2) {
|
||||
if (leashable2.getLeashHolder() == player) {
|
||||
if (!this.level().isClientSide()) {
|
||||
@@ -107,7 +115,7 @@
|
||||
// Paper start - EntityUnleashEvent
|
||||
if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerUnleashEntityEvent(
|
||||
leashable2, player, hand, !player.hasInfiniteMaterials(), true
|
||||
@@ -3450,15 +_,18 @@
|
||||
@@ -3450,15 +3474,18 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
return Vec3.directionFromRotation(this.getRotationVector());
|
||||
}
|
||||
|
||||
@@ -127,7 +135,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3663,7 +_,7 @@
|
||||
@@ -3663,7 +3690,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
}
|
||||
|
||||
public int getMaxAirSupply() {
|
||||
@@ -136,7 +144,7 @@
|
||||
}
|
||||
|
||||
public int getAirSupply() {
|
||||
@@ -4200,7 +_,7 @@
|
||||
@@ -4200,7 +4227,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
}
|
||||
|
||||
public boolean canUsePortal(boolean allowPassengers) {
|
||||
@@ -145,7 +153,7 @@
|
||||
}
|
||||
|
||||
public boolean canTeleport(Level fromLevel, Level toLevel) {
|
||||
@@ -4715,6 +_,12 @@
|
||||
@@ -4715,6 +4742,12 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
return Mth.lerp(partialTick, this.yRotO, this.yRot);
|
||||
}
|
||||
|
||||
@@ -158,7 +166,7 @@
|
||||
// Paper start - optimise collisions
|
||||
public boolean updateFluidHeightAndDoFluidPushing(final TagKey<Fluid> fluid, final double flowScale) {
|
||||
if (this.touchingUnloadedChunk()) {
|
||||
@@ -5132,7 +_,7 @@
|
||||
@@ -5132,7 +5165,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
|
||||
}
|
||||
|
||||
public float maxUpStep() {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 67d95236e135c2b44845cfd5cbfb7e553b8e31f2..b94b3a5aabd44b0158d535c7a4dc006e6f6f4689 100644
|
||||
--- a/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;
|
||||
};
|
||||
// Paper end - Ability to control player's insomnia and phantoms
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 4af1d61a514c487b035f76ef4ae37536dc08ed67..d6f7d96dbdff908c91fbe43432313d2221b57afc 100644
|
||||
--- a/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/net/minecraft/world/entity/EntityType.java
|
||||
@@ -1214,6 +_,16 @@
|
||||
@@ -1214,6 +1214,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
return register(vanillaEntityId(key), builder);
|
||||
}
|
||||
|
||||
@@ -17,7 +25,7 @@
|
||||
public static ResourceLocation getKey(EntityType<?> entityType) {
|
||||
return BuiltInRegistries.ENTITY_TYPE.getKey(entityType);
|
||||
}
|
||||
@@ -1445,6 +_,16 @@
|
||||
@@ -1445,6 +1455,16 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
return this.category;
|
||||
}
|
||||
|
||||
@@ -34,7 +42,7 @@
|
||||
public String getDescriptionId() {
|
||||
return this.descriptionId;
|
||||
}
|
||||
@@ -1507,6 +_,7 @@
|
||||
@@ -1507,6 +1527,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
// Paper start - Add logging for debugging entity tags with invalid ids
|
||||
() -> {
|
||||
LOGGER.warn("Skipping Entity with id {}", input.getStringOr("id", "[invalid]"));
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 85c5a8497ee45de232a87c3f152e7ca67c1821ee..189488367329df837f4a98cda5af2c80d8847b96 100644
|
||||
--- a/net/minecraft/world/entity/ExperienceOrb.java
|
||||
+++ b/net/minecraft/world/entity/ExperienceOrb.java
|
||||
@@ -358,7 +_,7 @@
|
||||
@@ -358,7 +358,7 @@ public class ExperienceOrb extends Entity {
|
||||
public void playerTouch(Player entity) {
|
||||
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
|
||||
@@ -9,7 +17,7 @@
|
||||
entity.take(this, 1);
|
||||
int i = this.repairPlayerItems(serverPlayer, this.getValue());
|
||||
if (i > 0) {
|
||||
@@ -374,7 +_,7 @@
|
||||
@@ -374,7 +374,7 @@ public class ExperienceOrb extends Entity {
|
||||
}
|
||||
|
||||
private int repairPlayerItems(ServerPlayer player, int value) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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/GlowSquid.java b/net/minecraft/world/entity/GlowSquid.java
|
||||
index ae11fa15dc14f2b828cde4e3abfac330828c597e..70790f4e813bb950e103314644bd1d767edb4123 100644
|
||||
--- a/net/minecraft/world/entity/GlowSquid.java
|
||||
+++ b/net/minecraft/world/entity/GlowSquid.java
|
||||
@@ -27,6 +_,13 @@
|
||||
@@ -27,6 +27,13 @@ public class GlowSquid extends Squid {
|
||||
super(type, level);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 6fa946c4ff8e1499a421e50d7e246bb669341d97..679073e7cd4e96a018b9bc6598b2c6fb385f1688 100644
|
||||
--- a/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) {
|
||||
double damagePerBlock = serverLevel1.getWorldBorder().getDamagePerBlock();
|
||||
if (damagePerBlock > 0.0) {
|
||||
@@ -13,7 +21,7 @@
|
||||
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()) {
|
||||
this.setAirSupply(0);
|
||||
serverLevel1.broadcastEntityEvent(this, EntityEvent.DROWN_PARTICLES);
|
||||
@@ -22,7 +30,7 @@
|
||||
}
|
||||
} else if (this.getAirSupply() < this.getMaxAirSupply()) {
|
||||
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() {
|
||||
@@ -31,7 +39,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1046,14 +_,32 @@
|
||||
@@ -1046,15 +1052,33 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
if (lookingEntity != null) {
|
||||
ItemStack itemBySlot = this.getItemBySlot(EquipmentSlot.HEAD);
|
||||
EntityType<?> type = lookingEntity.getType();
|
||||
@@ -41,15 +49,13 @@
|
||||
- || type == EntityType.PIGLIN_BRUTE && itemBySlot.is(Items.PIGLIN_HEAD)
|
||||
- || type == EntityType.CREEPER && itemBySlot.is(Items.CREEPER_HEAD)) {
|
||||
- d *= 0.5;
|
||||
- }
|
||||
- }
|
||||
+ // Purpur start - Mob head visibility percent
|
||||
+ if (type == EntityType.SKELETON && itemBySlot.is(Items.SKELETON_SKULL)) {
|
||||
+ d *= lookingEntity.level().purpurConfig.skeletonHeadVisibilityPercent;
|
||||
+ }
|
||||
+ else if (type == EntityType.ZOMBIE && itemBySlot.is(Items.ZOMBIE_HEAD)) {
|
||||
+ d *= lookingEntity.level().purpurConfig.zombieHeadVisibilityPercent;
|
||||
+ }
|
||||
}
|
||||
+ else if ((type == EntityType.PIGLIN || type == EntityType.PIGLIN_BRUTE) && itemBySlot.is(Items.PIGLIN_HEAD)) {
|
||||
+ d *= lookingEntity.level().purpurConfig.piglinHeadVisibilityPercent;
|
||||
+ }
|
||||
@@ -57,8 +63,8 @@
|
||||
+ d *= lookingEntity.level().purpurConfig.creeperHeadVisibilityPercent;
|
||||
+ }
|
||||
+ // Purpur end - Mob head visibility percent
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
+ // Purpur start - Configurable mob blindness
|
||||
+ if (lookingEntity instanceof LivingEntity entityliving) {
|
||||
+ if (entityliving.hasEffect(MobEffects.BLINDNESS)) {
|
||||
@@ -69,10 +75,11 @@
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Configurable mob blindness
|
||||
|
||||
+
|
||||
return d;
|
||||
}
|
||||
@@ -1100,6 +_,7 @@
|
||||
|
||||
@@ -1100,6 +1124,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
Iterator<MobEffectInstance> iterator = this.activeEffects.values().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
MobEffectInstance effect = iterator.next();
|
||||
@@ -80,7 +87,7 @@
|
||||
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
|
||||
if (event.isCancelled()) {
|
||||
continue;
|
||||
@@ -1424,6 +_,24 @@
|
||||
@@ -1424,6 +1449,24 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
this.stopSleeping();
|
||||
}
|
||||
|
||||
@@ -105,7 +112,7 @@
|
||||
this.noActionTime = 0;
|
||||
if (amount < 0.0F) {
|
||||
amount = 0.0F;
|
||||
@@ -1686,10 +_,10 @@
|
||||
@@ -1686,10 +1729,10 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
protected Player resolvePlayerResponsibleForDamage(DamageSource damageSource) {
|
||||
Entity entity = damageSource.getEntity();
|
||||
if (entity instanceof Player player) {
|
||||
@@ -118,7 +125,7 @@
|
||||
} else {
|
||||
this.lastHurtByPlayer = null;
|
||||
this.lastHurtByPlayerMemoryTime = 0;
|
||||
@@ -1740,6 +_,18 @@
|
||||
@@ -1740,6 +1783,18 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +144,7 @@
|
||||
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);
|
||||
event.setCancelled(itemStack == null);
|
||||
@@ -1921,6 +_,7 @@
|
||||
@@ -1921,6 +1976,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
boolean flag = this.lastHurtByPlayerMemoryTime > 0;
|
||||
this.dropEquipment(level); // CraftBukkit - from below
|
||||
if (this.shouldDropLoot(level)) {
|
||||
@@ -145,7 +152,7 @@
|
||||
this.dropFromLootTable(level, damageSource, flag);
|
||||
// Paper start
|
||||
final boolean prev = this.clearEquipmentSlots;
|
||||
@@ -1929,6 +_,7 @@
|
||||
@@ -1929,6 +1985,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
// Paper end
|
||||
this.dropCustomDeathLoot(level, damageSource, flag);
|
||||
this.clearEquipmentSlots = prev; // Paper
|
||||
@@ -153,7 +160,7 @@
|
||||
}
|
||||
|
||||
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
|
||||
@@ -3149,6 +_,7 @@
|
||||
@@ -3149,6 +3206,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
float f = (float)(d * 10.0 - 3.0);
|
||||
if (f > 0.0F) {
|
||||
this.playSound(this.getFallDamageSound((int)f), 1.0F, 1.0F);
|
||||
@@ -161,16 +168,16 @@
|
||||
this.hurt(this.damageSources().flyIntoWall(), f);
|
||||
}
|
||||
}
|
||||
@@ -4548,6 +_,12 @@
|
||||
? slot == EquipmentSlot.MAINHAND && this.canUseSlot(EquipmentSlot.MAINHAND)
|
||||
@@ -4549,6 +4607,12 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
: slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.getType());
|
||||
}
|
||||
+
|
||||
|
||||
+ // Purpur start - Dispenser curse of binding protection
|
||||
+ public @Nullable EquipmentSlot getEquipmentSlotForDispenserItem(ItemStack 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
|
||||
|
||||
+
|
||||
private static SlotAccess createEquipmentSlotAccess(LivingEntity entity, EquipmentSlot slot) {
|
||||
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 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 f2a321d94ddc9247a3820d42f4a04290ea3ce6f6..7d98c5aaf29d2204ed43f221f95913ac749419db 100644
|
||||
--- a/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;
|
||||
public boolean aware = true; // CraftBukkit
|
||||
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) {
|
||||
super(type, level);
|
||||
@@ -295,6 +_,7 @@
|
||||
@@ -295,6 +296,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
target = null;
|
||||
}
|
||||
}
|
||||
@@ -16,14 +24,13 @@
|
||||
this.target = target;
|
||||
return true;
|
||||
// CraftBukkit end
|
||||
@@ -338,7 +_,27 @@
|
||||
@@ -338,8 +340,28 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
}
|
||||
|
||||
profilerFiller.pop();
|
||||
- }
|
||||
+ incrementTicksSinceLastInteraction(); // Purpur - Entity lifespan
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
+ // Purpur start - Entity lifespan
|
||||
+ private void incrementTicksSinceLastInteraction() {
|
||||
+ ++this.ticksSinceLastInteraction;
|
||||
@@ -42,10 +49,11 @@
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Entity lifespan
|
||||
|
||||
+
|
||||
@Override
|
||||
protected void playHurtSound(DamageSource damageSource) {
|
||||
@@ -443,6 +_,7 @@
|
||||
this.resetAmbientSoundTime();
|
||||
@@ -443,6 +465,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
output.putString("Paper.DespawnInPeacefulOverride", this.despawnInPeacefulOverride.name());
|
||||
}
|
||||
// Paper end - allow changing despawnInPeaceful
|
||||
@@ -53,7 +61,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -470,6 +_,7 @@
|
||||
@@ -470,6 +493,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
this.lootTableSeed = input.getLongOr("DeathLootTableSeed", 0L);
|
||||
this.setNoAi(input.getBooleanOr("NoAI", false));
|
||||
this.aware = input.getBooleanOr("Bukkit.Aware", true); // CraftBukkit
|
||||
@@ -61,7 +69,7 @@
|
||||
// Paper start - allow changing despawnInPeaceful
|
||||
this.despawnInPeacefulOverride = readDespawnInPeacefulOverride(input);
|
||||
}
|
||||
@@ -1210,7 +_,7 @@
|
||||
@@ -1210,7 +1234,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
);
|
||||
}
|
||||
|
||||
@@ -70,7 +78,7 @@
|
||||
return spawnGroupData;
|
||||
}
|
||||
|
||||
@@ -1557,6 +_,7 @@
|
||||
@@ -1557,6 +1581,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
this.playAttackSound();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 ffc960a4e66ed03a358b363a4ce1dcee0b29ac36..21046cde1bd1ede8e7851eb4ea414e33628aa4a9 100644
|
||||
--- a/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
|
||||
final java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 296ecffbbce931b42c67ea523373a61cea23acf4..b2eec24be3635f2c19da9b147211fe6cb454c780 100644
|
||||
--- a/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();
|
||||
BlockPos blockPos = previousNode.asBlockPos();
|
||||
BlockState blockState = level.getBlockState(blockPos);
|
||||
@@ -9,7 +17,7 @@
|
||||
DoorBlock doorBlock = (DoorBlock)blockState.getBlock();
|
||||
if (!doorBlock.isOpen(blockState)) {
|
||||
// CraftBukkit start - entities opening doors
|
||||
@@ -72,7 +_,7 @@
|
||||
@@ -72,7 +72,7 @@ public class InteractWithDoor {
|
||||
|
||||
BlockPos blockPos1 = nextNode.asBlockPos();
|
||||
BlockState blockState1 = level.getBlockState(blockPos1);
|
||||
@@ -18,7 +26,7 @@
|
||||
DoorBlock doorBlock1 = (DoorBlock)blockState1.getBlock();
|
||||
if (!doorBlock1.isOpen(blockState1)) {
|
||||
// CraftBukkit start - entities opening doors
|
||||
@@ -118,7 +_,7 @@
|
||||
@@ -118,7 +118,7 @@ public class InteractWithDoor {
|
||||
iterator.remove();
|
||||
} else {
|
||||
BlockState blockState = level.getBlockState(blockPos);
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 400e6d49144b3e5803901938dcd2ac4e52e9c131..45c45afeffcfba3558bdf46cbe39ff60004ffc01 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/ShowTradesToPlayer.java
|
||||
@@ -46,6 +_,7 @@
|
||||
@@ -46,6 +46,7 @@ public class ShowTradesToPlayer extends Behavior<Villager> {
|
||||
|
||||
@Override
|
||||
public boolean canStillUse(ServerLevel level, Villager entity, long gameTime) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 6d815c3c28b76b1001ad197c6bb1f64620bb32fe..1408aaad39eb72996ea9e3ad6de217407e63d204 100644
|
||||
--- a/net/minecraft/world/entity/ai/behavior/TransportItemsBetweenContainers.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/TransportItemsBetweenContainers.java
|
||||
@@ -287,7 +_,7 @@
|
||||
@@ -287,7 +287,7 @@ public class TransportItemsBetweenContainers extends Behavior<PathfinderMob> {
|
||||
LevelChunk chunkNow = level.getChunkSource().getChunkNow(chunkPos.x, chunkPos.z);
|
||||
if (chunkNow != null) {
|
||||
for (BlockEntity blockEntity : chunkNow.getBlockEntities().values()) {
|
||||
@@ -9,7 +17,7 @@
|
||||
double d1 = chestBlockEntity.getBlockPos().distToCenterSqr(mob.position());
|
||||
if (d1 < d) {
|
||||
TransportItemsBetweenContainers.TransportItemTarget transportItemTarget1 = this.isTargetValidToPick(
|
||||
@@ -372,7 +_,11 @@
|
||||
@@ -372,7 +372,11 @@ public class TransportItemsBetweenContainers extends Behavior<PathfinderMob> {
|
||||
}
|
||||
|
||||
private boolean isTargetBlocked(Level level, TransportItemsBetweenContainers.TransportItemTarget target) {
|
||||
@@ -22,7 +30,7 @@
|
||||
}
|
||||
|
||||
private boolean targetHasNotChanged(Level level, TransportItemsBetweenContainers.TransportItemTarget target) {
|
||||
@@ -449,7 +_,7 @@
|
||||
@@ -449,7 +453,7 @@ public class TransportItemsBetweenContainers extends Behavior<PathfinderMob> {
|
||||
}
|
||||
|
||||
private boolean isWantedBlock(PathfinderMob mob, BlockState state) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 6eaf0bd944349cd0c6084462ac385fa2caafe933..be59d0c27a83b329ec3f97c029cfb9c114e22472 100644
|
||||
--- a/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
|
||||
public boolean canUse() {
|
||||
@@ -8,7 +16,7 @@
|
||||
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 -> {
|
||||
EntityType<?> type = entity1.getType();
|
||||
@@ -71,6 +_,7 @@
|
||||
@@ -71,6 +72,7 @@ public class LlamaFollowCaravanGoal extends Goal {
|
||||
|
||||
@Override
|
||||
public boolean canContinueToUse() {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ 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);
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 ffa69c974320279ec31b17e66bfab52c3e194e1b..800f8eb0066a83324abac5998848f99f7e45529d 100644
|
||||
--- a/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) {
|
||||
int temper = this.horse.getTemper();
|
||||
int maxTemper = this.horse.getMaxTemper();
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 243a552f6f0c8c2bd25c0209c95e3bca08734711..38fd0196a0f5a90e39fa4eb8592f89bf6b88ccf5 100644
|
||||
--- a/net/minecraft/world/entity/ai/goal/SwellGoal.java
|
||||
+++ b/net/minecraft/world/entity/ai/goal/SwellGoal.java
|
||||
@@ -55,6 +_,14 @@
|
||||
@@ -55,6 +55,14 @@ public class SwellGoal extends Goal {
|
||||
this.creeper.setSwellDir(-1);
|
||||
} else {
|
||||
this.creeper.setSwellDir(1);
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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
|
||||
+++ 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
|
||||
java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
||||
// don't ask me why it's unbounded. ask mojang.
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 8e536b1029b1e8f134c316f49df5d76d154d125a..95ad69396d740fbd1b990c6a1382a6e22065dea4 100644
|
||||
--- a/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||
+++ b/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
|
||||
@@ -64,6 +_,10 @@
|
||||
@@ -64,6 +64,10 @@ public class TargetingConditions {
|
||||
return false;
|
||||
} else if (this.selector != null && !this.selector.test(target, level)) {
|
||||
return false;
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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/ambient/Bat.java b/net/minecraft/world/entity/ambient/Bat.java
|
||||
index c0198c0b6d00667c9591a5cd254b0bfedc3fb627..acb402027bbb16a1b590415b2358cf03147119c0 100644
|
||||
--- a/net/minecraft/world/entity/ambient/Bat.java
|
||||
+++ b/net/minecraft/world/entity/ambient/Bat.java
|
||||
@@ -234,7 +_,7 @@
|
||||
@@ -234,7 +234,7 @@ public class Bat extends AmbientCreature {
|
||||
} else {
|
||||
int maxLocalRawBrightness = level.getMaxLocalRawBrightness(pos);
|
||||
int i = 4;
|
||||
@@ -9,7 +17,7 @@
|
||||
i = 7;
|
||||
} else if (randomSource.nextBoolean()) {
|
||||
return false;
|
||||
@@ -246,6 +_,7 @@
|
||||
@@ -246,6 +246,7 @@ public class Bat extends AmbientCreature {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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/AbstractCow.java b/net/minecraft/world/entity/animal/AbstractCow.java
|
||||
index 1bedc350a6625adc12359d9c9290a01e44fa638f..439d0dfabf9263bfbfb727b87dba17e848f6e66c 100644
|
||||
--- a/net/minecraft/world/entity/animal/AbstractCow.java
|
||||
+++ b/net/minecraft/world/entity/animal/AbstractCow.java
|
||||
@@ -39,7 +_,7 @@
|
||||
@@ -39,7 +39,7 @@ public abstract class AbstractCow extends Animal {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
this.goalSelector.addGoal(1, new PanicGoal(this, 2.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(5, new WaterAvoidingRandomStrollGoal(this, 1.0));
|
||||
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
|
||||
@@ -95,6 +_,10 @@
|
||||
@@ -95,6 +95,10 @@ public abstract class AbstractCow extends Animal {
|
||||
ItemStack itemStack = ItemUtils.createFilledResult(itemInHand, player, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getItemStack())); // CraftBukkit
|
||||
player.setItemInHand(hand, itemStack);
|
||||
return InteractionResult.SUCCESS;
|
||||
@@ -20,7 +28,7 @@
|
||||
} else {
|
||||
return super.mobInteract(player, hand);
|
||||
}
|
||||
@@ -104,4 +_,67 @@
|
||||
@@ -104,4 +108,67 @@ public abstract class AbstractCow extends Animal {
|
||||
public EntityDimensions getDefaultDimensions(Pose pose) {
|
||||
return this.isBaby() ? BABY_DIMENSIONS : super.getDefaultDimensions(pose);
|
||||
}
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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 384cf7e65cf6a802ba58d5327e971ac033e23962..8ccab236d1b8b00485eb6608778c43c5581641bd 100644
|
||||
--- a/net/minecraft/world/entity/animal/Animal.java
|
||||
+++ b/net/minecraft/world/entity/animal/Animal.java
|
||||
@@ -142,7 +_,7 @@
|
||||
@@ -142,7 +142,7 @@ public abstract class Animal extends AgeableMob {
|
||||
ItemStack itemInHand = player.getItemInHand(hand);
|
||||
if (this.isFood(itemInHand)) {
|
||||
int age = this.getAge();
|
||||
@@ -9,7 +17,7 @@
|
||||
final ItemStack breedCopy = itemInHand.copy(); // Paper - Fix EntityBreedEvent copying
|
||||
this.usePlayerItem(player, hand, itemInHand);
|
||||
this.setInLove(serverPlayer, breedCopy); // Paper - Fix EntityBreedEvent copying
|
||||
@@ -224,10 +_,20 @@
|
||||
@@ -224,10 +224,20 @@ public abstract class Animal extends AgeableMob {
|
||||
public void spawnChildFromBreeding(ServerLevel level, Animal partner) {
|
||||
AgeableMob breedOffspring = this.getBreedOffspring(level, partner);
|
||||
if (breedOffspring != null) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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.java b/net/minecraft/world/entity/animal/Bee.java
|
||||
index e94c6c1ee969a7d0953b933fb0633cebb510a68c..3988a8e8ba319e5e80a9fba916b62bdb4996e08f 100644
|
||||
--- a/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -171,7 +_,7 @@
|
||||
@@ -171,7 +171,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
// Paper end - Fix MC-167279
|
||||
this.lookControl = new Bee.BeeLookControl(this);
|
||||
this.setPathfindingMalus(PathType.DANGER_FIRE, -1.0F);
|
||||
@@ -9,7 +17,7 @@
|
||||
this.setPathfindingMalus(PathType.WATER_BORDER, 16.0F);
|
||||
this.setPathfindingMalus(PathType.COCOA, -1.0F);
|
||||
this.setPathfindingMalus(PathType.FENCE, -1.0F);
|
||||
@@ -367,7 +_,7 @@
|
||||
@@ -367,7 +367,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
}
|
||||
|
||||
public static boolean isNightOrRaining(Level level) {
|
||||
@@ -18,7 +26,7 @@
|
||||
}
|
||||
|
||||
public void setStayOutOfHiveCountdown(int stayOutOfHiveCountdown) {
|
||||
@@ -390,7 +_,7 @@
|
||||
@@ -390,7 +390,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@Override
|
||||
protected void customServerAiStep(ServerLevel level) {
|
||||
boolean hasStung = this.hasStung();
|
||||
@@ -27,7 +35,7 @@
|
||||
this.underWaterTicks++;
|
||||
} else {
|
||||
this.underWaterTicks = 0;
|
||||
@@ -400,6 +_,7 @@
|
||||
@@ -400,6 +400,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
this.hurtServer(level, this.damageSources().drown(), 1.0F);
|
||||
}
|
||||
|
||||
@@ -35,7 +43,7 @@
|
||||
if (hasStung) {
|
||||
this.timeSinceSting++;
|
||||
if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, 1, 1200)) == 0) {
|
||||
@@ -1139,6 +_,7 @@
|
||||
@@ -1139,6 +1140,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
Bee.this.savedFlowerPos = optional.get();
|
||||
Bee.this.navigation
|
||||
.moveTo(Bee.this.savedFlowerPos.getX() + 0.5, Bee.this.savedFlowerPos.getY() + 0.5, Bee.this.savedFlowerPos.getZ() + 0.5, 1.2F);
|
||||
@@ -43,7 +51,7 @@
|
||||
return true;
|
||||
} else {
|
||||
Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60);
|
||||
@@ -1185,6 +_,7 @@
|
||||
@@ -1185,6 +1187,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
this.pollinating = false;
|
||||
Bee.this.navigation.stop();
|
||||
Bee.this.remainingCooldownBeforeLocatingNewFlower = 200;
|
||||
@@ -51,7 +59,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1231,6 +_,7 @@
|
||||
@@ -1231,6 +1234,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
this.setWantedPos();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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/Cat.java b/net/minecraft/world/entity/animal/Cat.java
|
||||
index e1f12787a83458fd51dae6a907bbb81e3e522254..f6912836026638900fa5929b9550386a004fef11 100644
|
||||
--- a/net/minecraft/world/entity/animal/Cat.java
|
||||
+++ b/net/minecraft/world/entity/animal/Cat.java
|
||||
@@ -355,6 +_,14 @@
|
||||
@@ -355,6 +355,14 @@ public class Cat extends TamableAnimal {
|
||||
return this.isTame() && otherAnimal instanceof Cat cat && cat.isTame() && super.canMate(otherAnimal);
|
||||
}
|
||||
|
||||
@@ -15,7 +23,7 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public SpawnGroupData finalizeSpawn(
|
||||
@@ -453,7 +_,7 @@
|
||||
@@ -453,7 +461,7 @@ public class Cat extends TamableAnimal {
|
||||
}
|
||||
|
||||
private void tryToTame(Player player) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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.java b/net/minecraft/world/entity/animal/Dolphin.java
|
||||
index 91ee1423557d7287de9f4adc8376b0b7ee8c94ac..487a0e850d1d4f4c2e9c1175708712146f809a68 100644
|
||||
--- a/net/minecraft/world/entity/animal/Dolphin.java
|
||||
+++ b/net/minecraft/world/entity/animal/Dolphin.java
|
||||
@@ -75,6 +_,7 @@
|
||||
@@ -75,6 +75,7 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
private static final boolean DEFAULT_GOT_FISH = false;
|
||||
@Nullable
|
||||
public BlockPos treasurePos;
|
||||
@@ -8,7 +16,7 @@
|
||||
|
||||
public Dolphin(EntityType<? extends Dolphin> type, Level level) {
|
||||
super(type, level);
|
||||
@@ -91,6 +_,7 @@
|
||||
@@ -91,6 +92,7 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
this.setAirSupply(this.getMaxAirSupply());
|
||||
this.setXRot(0.0F);
|
||||
SpawnGroupData spawnGroupData1 = Objects.requireNonNullElseGet(spawnGroupData, () -> new AgeableMob.AgeableMobGroupData(0.1F));
|
||||
@@ -16,7 +24,7 @@
|
||||
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData1);
|
||||
}
|
||||
|
||||
@@ -157,17 +_,19 @@
|
||||
@@ -157,17 +159,19 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
protected void registerGoals() {
|
||||
this.goalSelector.addGoal(0, new BreathAirGoal(this));
|
||||
this.goalSelector.addGoal(0, new TryFindWaterGoal(this));
|
||||
@@ -37,7 +45,7 @@
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
@@ -400,6 +_,7 @@
|
||||
@@ -400,6 +404,7 @@ public class Dolphin extends AgeableWaterCreature {
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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/Fox.java b/net/minecraft/world/entity/animal/Fox.java
|
||||
index 849ae9efc0d1e01ff1be36cc873e69530ea30691..30a781b28fc4c78ca581fba405fae66f5b72251e 100644
|
||||
--- a/net/minecraft/world/entity/animal/Fox.java
|
||||
+++ b/net/minecraft/world/entity/animal/Fox.java
|
||||
@@ -348,6 +_,11 @@
|
||||
@@ -348,6 +348,11 @@ public class Fox extends Animal {
|
||||
}
|
||||
|
||||
private void setTargetGoals() {
|
||||
@@ -12,7 +20,7 @@
|
||||
if (this.getVariant() == Fox.Variant.RED) {
|
||||
this.targetSelector.addGoal(4, this.landTargetGoal);
|
||||
this.targetSelector.addGoal(4, this.turtleEggTargetGoal);
|
||||
@@ -375,6 +_,7 @@
|
||||
@@ -375,6 +380,7 @@ public class Fox extends Animal {
|
||||
|
||||
public void setVariant(Fox.Variant variant) {
|
||||
this.entityData.set(DATA_TYPE_ID, variant.getId());
|
||||
@@ -20,11 +28,10 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -704,6 +_,29 @@
|
||||
return slot == EquipmentSlot.MAINHAND;
|
||||
@@ -705,6 +711,29 @@ public class Fox extends Animal {
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
|
||||
+ // Purpur start - Tulips change fox type
|
||||
+ @Override
|
||||
+ public net.minecraft.world.InteractionResult mobInteract(Player player, net.minecraft.world.InteractionHand hand) {
|
||||
@@ -47,6 +54,7 @@
|
||||
+ return super.mobInteract(player, hand);
|
||||
+ }
|
||||
+ // Purpur end - Tulips change fox type
|
||||
|
||||
+
|
||||
@Override
|
||||
// Paper start - Cancellable death event
|
||||
protected org.bukkit.event.entity.EntityDeathEvent dropAllDeathLoot(ServerLevel level, DamageSource damageSource) {
|
||||
@@ -1,6 +1,14 @@
|
||||
From 73b67b6fc4ab1a46cb7c1113a4648915bf072f56 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/IronGolem.java b/net/minecraft/world/entity/animal/IronGolem.java
|
||||
index 6ba3d1f1019af2b2dde3804635a278e8d2c33dc8..838cc49d1a8b1b9758121c07de9e483966eef245 100644
|
||||
--- a/net/minecraft/world/entity/animal/IronGolem.java
|
||||
+++ b/net/minecraft/world/entity/animal/IronGolem.java
|
||||
@@ -59,13 +_,26 @@
|
||||
@@ -59,13 +59,26 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
||||
private int remainingPersistentAngerTime;
|
||||
@Nullable
|
||||
private UUID persistentAngerTarget;
|
||||
@@ -27,7 +35,7 @@
|
||||
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0, true));
|
||||
this.goalSelector.addGoal(2, new MoveTowardsTargetGoal(this, 0.9, 32.0F));
|
||||
this.goalSelector.addGoal(2, new MoveBackToVillageGoal(this, 0.6, false));
|
||||
@@ -143,6 +_,7 @@
|
||||
@@ -143,6 +156,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
||||
protected void addAdditionalSaveData(ValueOutput output) {
|
||||
super.addAdditionalSaveData(output);
|
||||
output.putBoolean("PlayerCreated", this.isPlayerCreated());
|
||||
@@ -35,7 +43,7 @@
|
||||
this.addPersistentAngerSaveData(output);
|
||||
}
|
||||
|
||||
@@ -150,6 +_,7 @@
|
||||
@@ -150,6 +164,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
||||
protected void readAdditionalSaveData(ValueInput input) {
|
||||
super.readAdditionalSaveData(input);
|
||||
this.setPlayerCreated(input.getBooleanOr("PlayerCreated", false));
|
||||
@@ -43,7 +51,7 @@
|
||||
this.readPersistentAngerSaveData(this.level(), input);
|
||||
}
|
||||
|
||||
@@ -269,6 +_,7 @@
|
||||
@@ -269,6 +284,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
|
||||
float f = 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F;
|
||||
this.playSound(SoundEvents.IRON_GOLEM_REPAIR, 1.0F, f);
|
||||
itemInHand.consume(1, player);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user