Some patch organisation

Also dropped a patch that I think was kinda unnecessary.
This commit is contained in:
Ivan Pekov 2020-10-22 14:37:58 +03:00
parent a1d3528c22
commit ab975588e5
No known key found for this signature in database
GPG Key ID: BC975C392D9CA3A3
16 changed files with 110 additions and 52 deletions

View File

@ -58,7 +58,6 @@ # Patches
| server | Fix LightEngineThreaded memory leak | Ivan Pekov | |
| server | Fix exp drop of zombie pigmen (MC-56653) | Phoenix616 | |
| server | Fix lead fall dmg config | tr7zw | |
| server | Fix merging spawning values | Mariell Hoversholm | |
| server | Fix the dead lagging the server | William Blake Galbreath | |
| server | Global Eula file | tr7zw | |
| server | Heavily optimize furnance fuel and recipe lookups | tr7zw | Mykyta Komarn |
@ -81,13 +80,15 @@ # Patches
| server | Optimize Villagers | Ivan Pekov | |
| server | Optimize advancement loading | Ivan Pekov | |
| server | Optimize inventory API item handling | Phoenix616 | |
| server | Optimize player loops around weather | MrIvanPlays | |
| server | Optimize some stuff in WorldServer ticking | MrIvanPlays | |
| server | Optimize whitelist command for multiple additions / removals | Ivan Pekov | |
| server | Option for simpler Villagers | tr7zw | |
| server | Option to toggle milk curing bad omen | William Blake Galbreath | |
| server | Origami Server Config | Phoenix616 | |
| server | PaperPR - Add hex color code support for console logging | Esophose | |
| server | PaperPR: Fix harming potion dupe | PepperCode1 | |
| server | PaperPR: Fix merging spawning values | Mariell Hoversholm | |
| server | PaperPR: Use block distance in portal search radius | Patrick Hemmer | |
| server | Per entity (type) collision settings | MrIvanPlays | tr7zw |
| server | Persistent TileEntity Lore and DisplayName | jmp | |
| api | PlayerAttackEntityEvent | Ivan Pekov | |
@ -98,7 +99,6 @@ # Patches
| server | Redirect Configs | tr7zw | |
| server | Remove some streams and object allocations | Phoenix616 | |
| server | Remove vanilla profiler callers | Sotr | |
| server | Replace some hot streams | Ivan Pekov | |
| server | Respect PlayerKickEvent leaveMessage | Ivan Pekov | |
| server | Respect rotation when respawning | Ivan Pekov | |
| server | Send more packets immediately | MrIvanPlays | |
@ -113,7 +113,6 @@ # Patches
| server | Use Glue List as delegate for NonNullList | Mykyta Komarn | |
| server | Use Glue List in WeightedList | Ivan Pekov | |
| server | Use GlueList for some list initialisations in packets | Ivan Pekov | |
| server | Use block distance in portal search radius | Patrick Hemmer | |
| server | Use faster block collision check for entity suffocation check | Mykyta Komarn | |
| server | Use offline uuids if we need to | Ivan Pekov | |
| api | Yatopia API Bundle | Bud Gidiere | |

View File

@ -1,39 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrIvanPlays <ivan@mrivanplays.com>
Date: Sun, 9 Aug 2020 16:58:18 -0500
Subject: [PATCH] Optimize player loops around weather
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 7c60ad59e7dbb2fd4089f762c9bbe1cb5f7b6054..274b7e04ff09e459cd63040b1c29e3d197aafe72 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -821,12 +821,17 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.i, this.thunderLevel));
}
// */
- for (int idx = 0; idx < this.players.size(); ++idx) {
- if (((EntityPlayer) this.players.get(idx)).world == this) {
- ((EntityPlayer) this.players.get(idx)).tickWeather();
+ // Yatopia start
+ for (EntityPlayer player : players) {
+ if (player.world == this) {
+ player.tickWeather();
+ if (flag != this.isRaining()) player.setPlayerWeather((!flag ? WeatherType.DOWNFALL : WeatherType.CLEAR), false);
+ player.updateWeather(this.lastRainLevel, this.rainLevel, this.lastThunderLevel, this.thunderLevel);
+ // Yatopia end
}
}
+ /* // Yatopia start - moved up
if (flag != this.isRaining()) {
// Only send weather packets to those affected
for (int idx = 0; idx < this.players.size(); ++idx) {
@@ -841,6 +846,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
}
// CraftBukkit end
+ */ // Yatopia end
if (this.everyoneSleeping && this.players.stream().noneMatch((entityplayer) -> {
return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping; // CraftBukkit

View File

@ -0,0 +1,95 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrIvanPlays <ivan@mrivanplays.com>
Date: Sun, 9 Aug 2020 16:58:18 -0500
Subject: [PATCH] Optimize some stuff in WorldServer ticking
Replaced some streams and some array lists with glue lists
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 7c60ad59e7dbb2fd4089f762c9bbe1cb5f7b6054..57b1152cdedce9a2c566ca59dfbf52a20bbabe70 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -60,11 +60,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
public final Int2ObjectMap<Entity> entitiesById = new Int2ObjectLinkedOpenHashMap(); final com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<Entity> entitiesForIteration = new com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet<>(2048, 0.5f, 2048, 0.2, true); // Tuinity - make removing entities while ticking safe
private final Map<UUID, Entity> entitiesByUUID = Maps.newHashMap();
private final Queue<Entity> entitiesToAdd = Queues.newArrayDeque();
- public final List<EntityPlayer> players = Lists.newArrayList(); // Paper - private -> public
+ public final List<EntityPlayer> players = new net.yatopia.server.list.GlueList<>(); // Paper - private -> public // Yatopia
public final ChunkProviderServer chunkProvider; // Paper - public
boolean tickingEntities;
// Paper start
- List<java.lang.Runnable> afterEntityTickingTasks = Lists.newArrayList();
+ List<java.lang.Runnable> afterEntityTickingTasks = new net.yatopia.server.list.GlueList<>(); // Yatopia
public void doIfNotEntityTicking(java.lang.Runnable run) {
if (tickingEntities) {
afterEntityTickingTasks.add(run);
@@ -821,12 +821,21 @@ public class WorldServer extends World implements GeneratorAccessSeed {
this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.i, this.thunderLevel));
}
// */
- for (int idx = 0; idx < this.players.size(); ++idx) {
- if (((EntityPlayer) this.players.get(idx)).world == this) {
- ((EntityPlayer) this.players.get(idx)).tickWeather();
+ // Yatopia start
+ boolean sleepyMatch = true;
+ for (EntityPlayer player : players) {
+ if (player.world == this) {
+ player.tickWeather();
+ if (flag != this.isRaining()) player.setPlayerWeather((!flag ? WeatherType.DOWNFALL : WeatherType.CLEAR), false);
+ player.updateWeather(this.lastRainLevel, this.rainLevel, this.lastThunderLevel, this.thunderLevel);
}
+ if (sleepyMatch && !player.isSpectator() && !player.isDeeplySleeping() && !player.fauxSleeping) {
+ sleepyMatch = false;
+ }
+ // Yatopia end
}
+ /* // Yatopia start - moved up
if (flag != this.isRaining()) {
// Only send weather packets to those affected
for (int idx = 0; idx < this.players.size(); ++idx) {
@@ -841,10 +850,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
}
// CraftBukkit end
+ */ // Yatopia end
- if (this.everyoneSleeping && this.players.stream().noneMatch((entityplayer) -> {
- return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping; // CraftBukkit
- })) {
+ if (this.everyoneSleeping && sleepyMatch) { // Yatopia
// CraftBukkit start
long l = this.worldData.getDayTime() + 24000L;
TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (l - l % 24000L) - this.getDayTime());
@@ -1014,9 +1022,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
private void wakeupPlayers() {
- (this.players.stream().filter(EntityLiving::isSleeping).collect(Collectors.toList())).forEach((entityplayer) -> { // CraftBukkit - decompile error
+ for (EntityPlayer entityplayer : players) { if (entityplayer.isSleeping()) { // Yatopia
entityplayer.wakeup(false, false);
- });
+ }} // Yatopia
}
// Paper start - optimise random block ticking
@@ -1781,8 +1789,9 @@ public class WorldServer extends World implements GeneratorAccessSeed {
// Spigot start
if ( entity instanceof EntityHuman )
{
- this.getMinecraftServer().worldServer.values().stream().map( WorldServer::getWorldPersistentData ).forEach( (worldData) ->
+ for ( WorldServer worldServer : getMinecraftServer().worldServer.values() ) // Yatopia
{
+ WorldPersistentData worldData = worldServer.getWorldPersistentData(); // Yatopia
for (Object o : worldData.data.values() )
{
if ( o instanceof WorldMap )
@@ -1799,7 +1808,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
}
}
- } );
+ } // Yatopia
}
// Spigot end
// Spigot Start

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Patrick Hemmer <patrick.hemmer@gmail.com>
Date: Tue, 11 Aug 2020 22:11:53 +0300
Subject: [PATCH] Use block distance in portal search radius
Subject: [PATCH] PaperPR: Use block distance in portal search radius
Original author: Patrick Hemmer <patrick.hemmer@gmail.com>

View File

@ -1088,7 +1088,7 @@ index 4bdadffee07c54f6f538ba09db72d562d05cb337..eb358d4453fce1de7f15f38b32e594fa
} else if (shape instanceof VoxelShapeArray) {
VoxelShapeArray shapeCasted = (VoxelShapeArray)shape;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 274b7e04ff09e459cd63040b1c29e3d197aafe72..97db7999968bceb2f069eb449c64e7da874d787f 100644
index 57b1152cdedce9a2c566ca59dfbf52a20bbabe70..1c9368951044fe92a284bd94a743178613100028 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -656,8 +656,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@ -1106,7 +1106,7 @@ index 274b7e04ff09e459cd63040b1c29e3d197aafe72..97db7999968bceb2f069eb449c64e7da
}
@Override
@@ -1730,12 +1736,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1732,12 +1738,12 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
// Spigot End
this.tileEntityListUnload.addAll(chunk.getTileEntities().values());

View File

@ -18,10 +18,10 @@ index 2f9c97dd4e1d705a87772d18c7ab4883a876af08..f3494ac1ad659352ca5595adf9e6919b
return this.size == 0 && this.pendingTasks.isEmpty();
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 97db7999968bceb2f069eb449c64e7da874d787f..b739e19cb50e4f86f1cb100b88cf91fbbbf796b4 100644
index 1c9368951044fe92a284bd94a743178613100028..11cb25dca79d2db50170252397e9a63223b2e2a5 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1772,6 +1772,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@@ -1774,6 +1774,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
// Paper end

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mariell Hoversholm <proximyst@proximyst.com>
Date: Mon, 28 Sep 2020 16:25:34 +0300
Subject: [PATCH] Fix merging spawning values
Subject: [PATCH] PaperPR: Fix merging spawning values
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java

View File

@ -5,7 +5,7 @@ Subject: [PATCH] PaperPR: Fix harming potion dupe
diff --git a/src/main/java/net/minecraft/server/ItemPotion.java b/src/main/java/net/minecraft/server/ItemPotion.java
index 7862b63a245222d9a3d0896bdb2741b0e5e7ac40..105665d6688e860a30fe52980419818ee8ef5a2c 100644
index 7862b63a245222d9a3d0896bdb2741b0e5e7ac40..47a6e8428f5a9dd19514ee0ad487bcb16dc34214 100644
--- a/src/main/java/net/minecraft/server/ItemPotion.java
+++ b/src/main/java/net/minecraft/server/ItemPotion.java
@@ -22,6 +22,8 @@ public class ItemPotion extends Item {
@ -26,14 +26,17 @@ index 7862b63a245222d9a3d0896bdb2741b0e5e7ac40..105665d6688e860a30fe52980419818e
} else {
entityliving.addEffect(new MobEffect(mobeffect), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.POTION_DRINK); // CraftBukkit
}
@@ -44,7 +46,21 @@ public class ItemPotion extends Item {
@@ -44,7 +46,24 @@ public class ItemPotion extends Item {
}
}
+ // Yatopia start - fix harming potion dupe
+ if (!world.isClientSide) {
+ for (MobEffect mobeffect : instantLater) {
+ int len = instantLater.size();
+ while (len > 0) {
+ MobEffect mobeffect = instantLater.remove(0);
+ mobeffect.getMobEffect().applyInstantEffect(entityhuman, entityhuman, entityliving, mobeffect.getAmplifier(), 1.0D);
+ len--;
+ }
+ }
+ // Yatopia end