-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
631 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Kevin Raneri <[email protected]> | ||
Date: Wed, 27 Sep 2023 09:35:56 +0000 | ||
Date: Wed, 27 Sep 2023 05:21:18 +0000 | ||
Subject: [PATCH] Pufferfish API Changes | ||
|
||
Original: Kevin Raneri <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: William Blake Galbreath <[email protected]> | ||
Date: Wed, 27 Sep 2023 09:45:16 +0000 | ||
Date: Wed, 27 Sep 2023 05:28:53 +0000 | ||
Subject: [PATCH] Purpur API Changes | ||
|
||
Original: PurpurMC | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Kevin Raneri <[email protected]> | ||
Date: Wed, 27 Sep 2023 09:35:56 +0000 | ||
Date: Wed, 27 Sep 2023 05:21:18 +0000 | ||
Subject: [PATCH] Pufferfish Server Changes | ||
|
||
Original: Kevin Raneri <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: William Blake Galbreath <[email protected]> | ||
Date: Wed, 27 Sep 2023 09:45:16 +0000 | ||
Date: Wed, 27 Sep 2023 05:28:53 +0000 | ||
Subject: [PATCH] Purpur Server Changes | ||
|
||
Original: PurpurMC | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
385 changes: 385 additions & 0 deletions
385
patches/server/0015-Reduce-create-random-instance.patch
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: AlphaKR93 <[email protected]> | ||
Date: Wed, 27 Sep 2023 22:11:15 +0900 | ||
Subject: [PATCH] Apply various optimizations | ||
|
||
[REFERENCE PATCHES] | ||
Akarin - Swaps the predicate order of collision | ||
|
||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java | ||
index 1ca91631b03c9690b4f661ecfb4d500d23cb47ec..4461dc1b76cc2939130680f8039b69af902aa050 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/Entity.java | ||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java | ||
@@ -2105,8 +2105,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { | ||
public void playerTouch(Player player) {} | ||
|
||
public void push(Entity entity) { | ||
+ if (entity.noPhysics || this.noPhysics) return; // Plazma | ||
if (!this.isPassengerOfSameVehicle(entity)) { | ||
- if (!entity.noPhysics && !this.noPhysics) { | ||
+ //if (!entity.noPhysics && !this.noPhysics) { // Plazma - moved up | ||
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper | ||
double d0 = entity.getX() - this.getX(); | ||
double d1 = entity.getZ() - this.getZ(); | ||
@@ -2135,7 +2136,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { | ||
} | ||
} | ||
|
||
- } | ||
+ //} // Plazma | ||
} | ||
} | ||
|
29 changes: 29 additions & 0 deletions
29
patches/server/0017-Avoid-double-I-O-operation-on-load-player-file.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: AlphaKR93 <[email protected]> | ||
Date: Wed, 27 Sep 2023 22:13:07 +0900 | ||
Subject: [PATCH] Avoid double I/O operation on load player file | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java | ||
index 36af81f0957d17e170d229059c66f4eb4539dfeb..b4b74bff0579b919266e91464b36c9381342b677 100644 | ||
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java | ||
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java | ||
@@ -56,7 +56,8 @@ public class PlayerDataStorage { | ||
File file = new File(this.playerDir, player.getStringUUID() + ".dat"); | ||
// Spigot Start | ||
boolean usingWrongFile = false; | ||
- if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first | ||
+ boolean isNormalFile = file.exists() && file.isFile(); // Plazma - Avoid double I/O operation | ||
+ if ( org.bukkit.Bukkit.getOnlineMode() && isNormalFile ) // Paper - Check online mode first // Plazma - Avoid double I/O operation | ||
{ | ||
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + player.getScoreboardName() ).getBytes( "UTF-8" ) ).toString() + ".dat"); | ||
if ( file.exists() ) | ||
@@ -67,7 +68,7 @@ public class PlayerDataStorage { | ||
} | ||
// Spigot End | ||
|
||
- if (file.exists() && file.isFile()) { | ||
+ if (isNormalFile) { // Plazma - Avoid double I/O operation | ||
nbttagcompound = NbtIo.readCompressed(file); | ||
} | ||
// Spigot Start |
30 changes: 30 additions & 0 deletions
30
patches/server/0018-Don-t-refresh-LootTable-for-non-player-interaction.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: AlphaKR93 <[email protected]> | ||
Date: Wed, 27 Sep 2023 22:15:39 +0900 | ||
Subject: [PATCH] Don't refresh LootTable for non player interaction | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java | ||
index 081691f9710ff1115e4308f79ed49fbc38941193..79a27755534384ab94e79e422c0a5e9ccecacd8c 100644 | ||
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java | ||
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java | ||
@@ -70,6 +70,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc | ||
} | ||
|
||
public void unpackLootTable(@Nullable Player player) { | ||
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.dontRefreshLootTableForNonPlayerInteraction && player == null) return; // Plazma | ||
if (this.lootableData.shouldReplenish(player) && this.level.getServer() != null) { // Paper | ||
LootTable lootTable = this.level.getServer().getLootData().getLootTable(this.lootTable); | ||
if (player instanceof ServerPlayer) { | ||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java | ||
index f4634cc41e1aabc1e656f6720700c580645c8709..b58d91e842c29a28e8c6cbb275f2906eb361626a 100644 | ||
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java | ||
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java | ||
@@ -26,6 +26,7 @@ public class GlobalConfiguration extends ConfigurationPart { | ||
|
||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE; | ||
public boolean suppressThreadSafeRandom = DO_OPTIMIZE; | ||
+ public boolean dontRefreshLootTableForNonPlayerInteraction = DO_OPTIMIZE; | ||
|
||
} | ||
|
36 changes: 36 additions & 0 deletions
36
patches/server/0019-Don-t-load-chunks-to-spawn-phantom.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: AlphaKR93 <[email protected]> | ||
Date: Wed, 27 Sep 2023 22:17:11 +0900 | ||
Subject: [PATCH] Don't load chunks to spawn phantom | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java | ||
index f74c5eda91a3d521763ec7bc33f23e0c62458cc2..e7a9683fe6bd72e9e7644770953506195567e03b 100644 | ||
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java | ||
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java | ||
@@ -71,6 +71,7 @@ public class PhantomSpawner implements CustomSpawner { | ||
|
||
if (randomsource.nextInt(j) >= world.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper | ||
BlockPos blockposition1 = blockposition.above(20 + randomsource.nextInt(15)).east(-10 + randomsource.nextInt(21)).south(-10 + randomsource.nextInt(21)); | ||
+ if (world.plazmaLevelConfiguration().entity.phantom.dontLoadChunksToSpawn && world.hasChunkAt(blockposition1)) continue; // Plazma | ||
BlockState iblockdata = world.getBlockState(blockposition1); | ||
FluidState fluid = world.getFluidState(blockposition1); | ||
|
||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java | ||
index 146af5bb54da67c134485dc67e8d9a569889434a..0a23900b18ec46ce2a7d47160dff013c7c8a8533 100644 | ||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java | ||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java | ||
@@ -33,6 +33,13 @@ public class LevelConfigurations extends ConfigurationPart { | ||
public Entity entity; | ||
public class Entity extends ConfigurationPart { | ||
|
||
+ public Phantom phantom; | ||
+ public class Phantom extends ConfigurationPart { | ||
+ | ||
+ public boolean dontLoadChunksToSpawn = DO_OPTIMIZE; | ||
+ | ||
+ } | ||
+ | ||
} | ||
|
||
public Structure structure; |
35 changes: 20 additions & 15 deletions
35
...-to-disable-moved-to-quickly-check-.patch → ...able-moved-to-quickly-check-for-spe.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,37 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: AlphaKR93 <[email protected]> | ||
Date: Sat, 25 Mar 2023 20:46:40 +0900 | ||
Subject: [PATCH] Add configuration to disable moved to quickly check for | ||
spectators | ||
Date: Wed, 27 Sep 2023 22:21:47 +0900 | ||
Subject: [PATCH] Add option to disable moved to quickly check for specific | ||
players | ||
|
||
|
||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java | ||
index 255b422078880b46dfa6f5140f6c92fef057d09e..6b6e7b8fbc0bb8a177affff0d7c7029d571faea2 100644 | ||
index e001787e40cc0a843e65b36582e9d6593d0fff0e..1af44c18724b2d2dc1d910f5af49254eb845feaf 100644 | ||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java | ||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java | ||
@@ -1566,7 +1566,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic | ||
@@ -1435,6 +1435,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl | ||
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) { | ||
float f2 = this.player.isFallFlying() ? 300.0F : 100.0F; | ||
|
||
- if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { | ||
+ if (!(this.player.level().plazmaLevelConfiguration().misc.checkSpectatorMovedToQuickly && this.player.isSpectator()) && d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // Plazma | ||
+ if (this.player.getBukkitEntity().hasPermission("plazma.bypass-moved-to-quickly-check") || !this.player.level().plazmaLevelConfiguration().entity.player.checkSpectatorMovecToQuickly && this.player.isSpectator()) return; // Plazma | ||
if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { | ||
// CraftBukkit end | ||
// Paper start - Add fail move event | ||
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY, | ||
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java | ||
index 504913e8e05869f8f0b88f0faaf684d39eb14ea7..61c06213b4ceb8e38e9aa41c3517f152d0d669ad 100644 | ||
index 0a23900b18ec46ce2a7d47160dff013c7c8a8533..414baade911fab3450430af9378feedc419868f3 100644 | ||
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java | ||
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java | ||
@@ -88,6 +88,7 @@ public class LevelConfigurations extends ConfigurationPart { | ||
public class Misc extends ConfigurationPart { | ||
@@ -33,6 +33,13 @@ public class LevelConfigurations extends ConfigurationPart { | ||
public Entity entity; | ||
public class Entity extends ConfigurationPart { | ||
|
||
public boolean reduceCreateRandomInstance = DO_OPTIMIZE; | ||
+ public boolean checkSpectatorMovedToQuickly = DO_OPTIMIZE; | ||
|
||
} | ||
+ public Player player; | ||
+ public class Player extends ConfigurationPart { | ||
+ | ||
+ public boolean checkSpectatorMovecToQuickly = !DO_OPTIMIZE; | ||
+ | ||
+ } | ||
+ | ||
public Phantom phantom; | ||
public class Phantom extends ConfigurationPart { | ||
|
Oops, something went wrong.