mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 02:25:28 +01:00
[ci skip] Add more patch identifying comments, merge related patches
This commit is contained in:
parent
93a848c4b9
commit
f9fdedf2d7
@ -3,6 +3,8 @@ From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 18 Mar 2018 11:43:30 -0400
|
||||
Subject: [PATCH] Add more fields to AsyncPreLoginEvent
|
||||
|
||||
Co-authored-by: Connor Linfoot <connorlinfoot@me.com>
|
||||
Co-authored-by: MCMDEV <john-m.1@gmx.de>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
index 3432872303aa0df97b5d9090fe98b269ef3cb9f4..f8b69b52ec8efa103e4e78e1b5c6a015e73d2a75 100644
|
||||
|
@ -5,8 +5,25 @@ Subject: [PATCH] Add setting for proxy online mode status
|
||||
|
||||
TODO: Add isProxyOnlineMode check to Metrics
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 1ee3e38703175707dec6493a1785b1bbc5170793..73b398ffc86498151944bedb0ef12d63de35c603 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -584,7 +584,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
public boolean enforceSecureProfile() {
|
||||
DedicatedServerProperties dedicatedserverproperties = this.getProperties();
|
||||
|
||||
- return dedicatedserverproperties.enforceSecureProfile && dedicatedserverproperties.onlineMode && this.services.canValidateProfileKeys();
|
||||
+ // Paper start - Add setting for proxy online mode status
|
||||
+ return dedicatedserverproperties.enforceSecureProfile
|
||||
+ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
|
||||
+ && this.services.canValidateProfileKeys();
|
||||
+ // Paper end - Add setting for proxy online mode status
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
|
||||
index 0a2875f63523cc5eeec603e18eb62520587a8475..09de1ca3802e97442bc090db0cc87fd833ad3a9f 100644
|
||||
index 0a2875f63523cc5eeec603e18eb62520587a8475..64f7c3180a745a62bb5d71a42668cc67b5d56c3a 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
|
||||
@@ -89,7 +89,8 @@ public class GameProfileCache {
|
||||
@ -15,7 +32,7 @@ index 0a2875f63523cc5eeec603e18eb62520587a8475..09de1ca3802e97442bc090db0cc87fd8
|
||||
|
||||
- if (!org.apache.commons.lang3.StringUtils.isBlank(name)) // Paper - Don't lookup a profile with a blank name)
|
||||
+ if (!org.apache.commons.lang3.StringUtils.isBlank(name) // Paper - Don't lookup a profile with a blank name
|
||||
+ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) // Paper - only run in online mode - 100 COL
|
||||
+ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) // Paper - Add setting for proxy online mode status
|
||||
repository.findProfilesByNames(new String[]{name}, profilelookupcallback);
|
||||
GameProfile gameprofile = (GameProfile) atomicreference.get();
|
||||
|
||||
@ -24,12 +41,12 @@ index 0a2875f63523cc5eeec603e18eb62520587a8475..09de1ca3802e97442bc090db0cc87fd8
|
||||
|
||||
private static boolean usesAuthentication() {
|
||||
- return GameProfileCache.usesAuthentication;
|
||||
+ return io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode(); // Paper
|
||||
+ return io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode(); // Paper - Add setting for proxy online mode status
|
||||
}
|
||||
|
||||
public void add(GameProfile profile) {
|
||||
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
|
||||
index 78b11d6fd74fb0714a8013fdc78d096643c4f83c..6a64c58fff9bbed542bf29a029531996f2a50d00 100644
|
||||
index 78b11d6fd74fb0714a8013fdc78d096643c4f83c..14bd0b94ece3f826f822b4900c7250ebdc27d937 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
|
||||
@@ -66,7 +66,8 @@ public class OldUsersConverter {
|
||||
@ -38,12 +55,12 @@ index 78b11d6fd74fb0714a8013fdc78d096643c4f83c..6a64c58fff9bbed542bf29a029531996
|
||||
|
||||
- if (server.usesAuthentication() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
|
||||
+ if (server.usesAuthentication() ||
|
||||
+ (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now. // Paper - Handle via setting
|
||||
+ (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now. // Paper - Add setting for proxy online mode status
|
||||
server.getProfileRepository().findProfilesByNames(astring, callback);
|
||||
} else {
|
||||
String[] astring1 = astring;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index f8613718893c778cac3396fcedba1cf8144f0f0e..876c82e1f1e74417978fd974bd747562b9f8ccdd 100644
|
||||
index f8613718893c778cac3396fcedba1cf8144f0f0e..6d45d5f149211eaad9a07019290dac2c3d04084c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1821,7 +1821,7 @@ public final class CraftServer implements Server {
|
||||
@ -51,7 +68,7 @@ index f8613718893c778cac3396fcedba1cf8144f0f0e..876c82e1f1e74417978fd974bd747562
|
||||
GameProfile profile = null;
|
||||
// Only fetch an online UUID in online mode
|
||||
- if (this.getOnlineMode() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
|
||||
+ if (this.getOnlineMode() || io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) { // Paper - Handle via setting
|
||||
+ if (this.getOnlineMode() || io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) { // Paper - Add setting for proxy online mode status
|
||||
// This is potentially blocking :(
|
||||
profile = this.console.getProfileCache().get(name).orElse(null);
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ index ce113cc2bc52c1135799190a22e0be21744b58cc..9a25d351df1141e9218d37c0f90e2d67
|
||||
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
||||
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 36312e6ec95324c16a5e70f3cc8c66127653b965..9ddcca2c17c15c5c7d88046aeae8b5588ad4612d 100644
|
||||
index 5f4f993243f19f1e88b7f2bc5e40a6b2125fd819..c9cca6ba3500791485bf19155156c38c24f1c761 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -269,7 +269,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@ -253,7 +253,7 @@ index 36312e6ec95324c16a5e70f3cc8c66127653b965..9ddcca2c17c15c5c7d88046aeae8b558
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -774,7 +775,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -778,7 +779,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@Override
|
||||
public void stopServer() {
|
||||
super.stopServer();
|
||||
|
@ -1,48 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: JRoy <joshroy126@gmail.com>
|
||||
Date: Mon, 29 Jun 2020 17:03:06 -0400
|
||||
Subject: [PATCH] Remove some streams from structures
|
||||
|
||||
This showed up a lot in the spark profiler, should have a low-medium performance improvement.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
|
||||
index bb8d8edb47621665872a5e8fc01512ba40c1b913..5d721dc196a6bde511f46dbdedb2e1d98553ac52 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
|
||||
@@ -36,9 +36,10 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
|
||||
int j = pos.getMinBlockZ();
|
||||
ObjectList<Beardifier.Rigid> objectList = new ObjectArrayList<>(10);
|
||||
ObjectList<JigsawJunction> objectList2 = new ObjectArrayList<>(32);
|
||||
- world.startsForStructure(pos, (structure) -> {
|
||||
+ // Paper start - replace for each
|
||||
+ for (net.minecraft.world.level.levelgen.structure.StructureStart start : world.startsForStructure(pos, (structure) -> {
|
||||
return structure.terrainAdaptation() != TerrainAdjustment.NONE;
|
||||
- }).forEach((start) -> {
|
||||
+ })) { // Paper end
|
||||
TerrainAdjustment terrainAdjustment = start.getStructure().terrainAdaptation();
|
||||
|
||||
for(StructurePiece structurePiece : start.getPieces()) {
|
||||
@@ -51,9 +52,11 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
|
||||
}
|
||||
|
||||
for(JigsawJunction jigsawJunction : poolElementStructurePiece.getJunctions()) {
|
||||
- int i = jigsawJunction.getSourceX();
|
||||
- int j = jigsawJunction.getSourceZ();
|
||||
- if (i > i - 12 && j > j - 12 && i < i + 15 + 12 && j < j + 15 + 12) {
|
||||
+ // Paper start - decompile fix
|
||||
+ int i2 = jigsawJunction.getSourceX();
|
||||
+ int j2 = jigsawJunction.getSourceZ();
|
||||
+ if (i2 > i - 12 && j2 > j - 12 && i2 < i + 15 + 12 && j2 < j + 15 + 12) {
|
||||
+ // Paper end
|
||||
objectList2.add(jigsawJunction);
|
||||
}
|
||||
}
|
||||
@@ -63,7 +66,7 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
|
||||
}
|
||||
}
|
||||
|
||||
- });
|
||||
+ } // Paper
|
||||
return new Beardifier(objectList.iterator(), objectList2.iterator());
|
||||
}
|
||||
|
244
patches/server/0421-Remove-streams-from-hot-code.patch
Normal file
244
patches/server/0421-Remove-streams-from-hot-code.patch
Normal file
@ -0,0 +1,244 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: JRoy <joshroy126@gmail.com>
|
||||
Date: Wed, 1 Jul 2020 18:01:49 -0400
|
||||
Subject: [PATCH] Remove streams from hot code
|
||||
|
||||
Co-authored-by: Bjarne Koll <lynxplay101@gmail.com>
|
||||
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
index 419eadbe31b86b7192fd7a63268d547705e7c7ce..281b5cf91135984a37ad013614c910f7d4d2fee3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
@@ -52,7 +52,7 @@ public class GateBehavior<E extends LivingEntity> implements BehaviorControl<E>
|
||||
if (this.hasRequiredMemories(entity)) {
|
||||
this.status = Behavior.Status.RUNNING;
|
||||
this.orderPolicy.apply(this.behaviors);
|
||||
- this.runningPolicy.apply(this.behaviors.stream(), world, entity, time);
|
||||
+ this.runningPolicy.apply(this.behaviors, world, entity, time); // Paper - Perf: Remove streams from hot code
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -61,11 +61,13 @@ public class GateBehavior<E extends LivingEntity> implements BehaviorControl<E>
|
||||
|
||||
@Override
|
||||
public final void tickOrStop(ServerLevel world, E entity, long time) {
|
||||
- this.behaviors.stream().filter((task) -> {
|
||||
- return task.getStatus() == Behavior.Status.RUNNING;
|
||||
- }).forEach((task) -> {
|
||||
- task.tickOrStop(world, entity, time);
|
||||
- });
|
||||
+ // Paper start - Perf: Remove streams from hot code
|
||||
+ for (final BehaviorControl<? super E> task : this.behaviors) {
|
||||
+ if (task.getStatus() == Behavior.Status.RUNNING) {
|
||||
+ task.tickOrStop(world, entity, time);
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - Perf: Remove streams from hot code
|
||||
if (this.behaviors.stream().noneMatch((task) -> {
|
||||
return task.getStatus() == Behavior.Status.RUNNING;
|
||||
})) {
|
||||
@@ -77,12 +79,16 @@ public class GateBehavior<E extends LivingEntity> implements BehaviorControl<E>
|
||||
@Override
|
||||
public final void doStop(ServerLevel world, E entity, long time) {
|
||||
this.status = Behavior.Status.STOPPED;
|
||||
- this.behaviors.stream().filter((task) -> {
|
||||
- return task.getStatus() == Behavior.Status.RUNNING;
|
||||
- }).forEach((task) -> {
|
||||
- task.doStop(world, entity, time);
|
||||
- });
|
||||
- this.exitErasedMemories.forEach(entity.getBrain()::eraseMemory);
|
||||
+ // Paper start - Perf: Remove streams from hot code
|
||||
+ for (final BehaviorControl<? super E> task : this.behaviors) {
|
||||
+ if (task.getStatus() == Behavior.Status.RUNNING) {
|
||||
+ task.doStop(world, entity, time);
|
||||
+ }
|
||||
+ }
|
||||
+ for (final MemoryModuleType<?> exitErasedMemory : this.exitErasedMemories) {
|
||||
+ entity.getBrain().eraseMemory(exitErasedMemory);
|
||||
+ }
|
||||
+ // Paper end - Perf: Remove streams from hot code
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,26 +122,30 @@ public class GateBehavior<E extends LivingEntity> implements BehaviorControl<E>
|
||||
|
||||
public static enum RunningPolicy {
|
||||
RUN_ONE {
|
||||
+ // Paper start - Perf: Remove streams from hot code
|
||||
@Override
|
||||
- public <E extends LivingEntity> void apply(Stream<BehaviorControl<? super E>> tasks, ServerLevel world, E entity, long time) {
|
||||
- tasks.filter((task) -> {
|
||||
- return task.getStatus() == Behavior.Status.STOPPED;
|
||||
- }).filter((task) -> {
|
||||
- return task.tryStart(world, entity, time);
|
||||
- }).findFirst();
|
||||
+ public <E extends LivingEntity> void apply(ShufflingList<BehaviorControl<? super E>> tasks, ServerLevel world, E entity, long time) {
|
||||
+ for (final BehaviorControl<? super E> task : tasks) {
|
||||
+ if (task.getStatus() == Behavior.Status.STOPPED && task.tryStart(world, entity, time)) {
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - Perf: Remove streams from hot code
|
||||
}
|
||||
},
|
||||
TRY_ALL {
|
||||
+ // Paper start - Perf: Remove streams from hot code
|
||||
@Override
|
||||
- public <E extends LivingEntity> void apply(Stream<BehaviorControl<? super E>> tasks, ServerLevel world, E entity, long time) {
|
||||
- tasks.filter((task) -> {
|
||||
- return task.getStatus() == Behavior.Status.STOPPED;
|
||||
- }).forEach((task) -> {
|
||||
- task.tryStart(world, entity, time);
|
||||
- });
|
||||
+ public <E extends LivingEntity> void apply(ShufflingList<BehaviorControl<? super E>> tasks, ServerLevel world, E entity, long time) {
|
||||
+ for (final BehaviorControl<? super E> task : tasks) {
|
||||
+ if (task.getStatus() == Behavior.Status.STOPPED) {
|
||||
+ task.tryStart(world, entity, time);
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - Perf: Remove streams from hot code
|
||||
}
|
||||
};
|
||||
|
||||
- public abstract <E extends LivingEntity> void apply(Stream<BehaviorControl<? super E>> tasks, ServerLevel world, E entity, long time);
|
||||
+ public abstract <E extends LivingEntity> void apply(ShufflingList<BehaviorControl<? super E>> tasks, ServerLevel world, E entity, long time); // Paper - Perf: Remove streams from hot code
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
|
||||
index 76dffb2705e5207db96895f82f1c7c5638f817c6..7321ca0b2ae1443b57b9389f80a237225afa45ca 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
|
||||
@@ -61,8 +61,22 @@ public class GossipContainer {
|
||||
});
|
||||
}
|
||||
|
||||
+ // Paper start - Perf: Remove streams from hot code
|
||||
+ private List<GossipContainer.GossipEntry> decompress() {
|
||||
+ List<GossipContainer.GossipEntry> list = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>();
|
||||
+ for (Map.Entry<UUID, GossipContainer.EntityGossips> entry : this.gossips.entrySet()) {
|
||||
+ for (GossipContainer.GossipEntry cur : entry.getValue().decompress(entry.getKey())) {
|
||||
+ if (cur.weightedValue() != 0) {
|
||||
+ list.add(cur);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return list;
|
||||
+ }
|
||||
+ // Paper end - Perf: Remove streams from hot code
|
||||
+
|
||||
private Collection<GossipContainer.GossipEntry> selectGossipsForTransfer(RandomSource random, int count) {
|
||||
- List<GossipContainer.GossipEntry> list = this.unpack().toList();
|
||||
+ List<GossipContainer.GossipEntry> list = this.decompress(); // Paper - Perf: Remove streams from hot code
|
||||
if (list.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
} else {
|
||||
@@ -156,7 +170,7 @@ public class GossipContainer {
|
||||
}
|
||||
|
||||
public <T> T store(DynamicOps<T> ops) {
|
||||
- return GossipContainer.GossipEntry.LIST_CODEC.encodeStart(ops, this.unpack().toList()).resultOrPartial((error) -> {
|
||||
+ return GossipContainer.GossipEntry.LIST_CODEC.encodeStart(ops, this.decompress()).resultOrPartial((error) -> { // Paper - Perf: Remove streams from hot code
|
||||
LOGGER.warn("Failed to serialize gossips: {}", (Object)error);
|
||||
}).orElseGet(ops::emptyList);
|
||||
}
|
||||
@@ -184,11 +198,23 @@ public class GossipContainer {
|
||||
final Object2IntMap<GossipType> entries = new Object2IntOpenHashMap<>();
|
||||
|
||||
public int weightedValue(Predicate<GossipType> gossipTypeFilter) {
|
||||
- return this.entries.object2IntEntrySet().stream().filter((entry) -> {
|
||||
- return gossipTypeFilter.test(entry.getKey());
|
||||
- }).mapToInt((entry) -> {
|
||||
- return entry.getIntValue() * (entry.getKey()).weight;
|
||||
- }).sum();
|
||||
+ // Paper start - Perf: Remove streams from hot code
|
||||
+ int weight = 0;
|
||||
+ for (Object2IntMap.Entry<GossipType> entry : entries.object2IntEntrySet()) {
|
||||
+ if (gossipTypeFilter.test(entry.getKey())) {
|
||||
+ weight += entry.getIntValue() * entry.getKey().weight;
|
||||
+ }
|
||||
+ }
|
||||
+ return weight;
|
||||
+ }
|
||||
+
|
||||
+ public List<GossipContainer.GossipEntry> decompress(UUID uuid) {
|
||||
+ List<GossipContainer.GossipEntry> list = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>();
|
||||
+ for (Object2IntMap.Entry<GossipType> entry : entries.object2IntEntrySet()) {
|
||||
+ list.add(new GossipContainer.GossipEntry(uuid, entry.getKey(), entry.getIntValue()));
|
||||
+ }
|
||||
+ return list;
|
||||
+ // Paper end - Perf: Remove streams from hot code
|
||||
}
|
||||
|
||||
public Stream<GossipContainer.GossipEntry> unpack(UUID target) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestItemSensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/NearestItemSensor.java
|
||||
index a41c3365db8e9999b686f5bf4bd888458cee43a5..18e2fd705fe0db7cb9e3afe1ce7c8dcfaf93b1a5 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/NearestItemSensor.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/NearestItemSensor.java
|
||||
@@ -25,14 +25,18 @@ public class NearestItemSensor extends Sensor<Mob> {
|
||||
protected void doTick(ServerLevel world, Mob entity) {
|
||||
Brain<?> brain = entity.getBrain();
|
||||
List<ItemEntity> list = world.getEntitiesOfClass(ItemEntity.class, entity.getBoundingBox().inflate(32.0D, 16.0D, 32.0D), (itemEntity) -> {
|
||||
- return true;
|
||||
+ return itemEntity.closerThan(entity, MAX_DISTANCE_TO_WANTED_ITEM) && entity.wantsToPickUp(itemEntity.getItem()); // Paper - Perf: Move predicate into getEntities
|
||||
});
|
||||
list.sort(Comparator.comparingDouble(entity::distanceToSqr));
|
||||
- Optional<ItemEntity> optional = list.stream().filter((itemEntity) -> {
|
||||
- return entity.wantsToPickUp(itemEntity.getItem());
|
||||
- }).filter((itemEntity) -> {
|
||||
- return itemEntity.closerThan(entity, 32.0D);
|
||||
- }).filter(entity::hasLineOfSight).findFirst();
|
||||
- brain.setMemory(MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, optional);
|
||||
+ // Paper start - Perf: remove streams from hot code
|
||||
+ ItemEntity nearest = null;
|
||||
+ for (ItemEntity entityItem : list) {
|
||||
+ if (entity.hasLineOfSight(entityItem)) { // Paper - Perf: Move predicate into getEntities
|
||||
+ nearest = entityItem;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ brain.setMemory(MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, Optional.ofNullable(nearest));
|
||||
+ // Paper end - Perf: remove streams from hot code
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
|
||||
index bb8d8edb47621665872a5e8fc01512ba40c1b913..dcb62d768d234f60af77ffb589ac2011afcfae4b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
|
||||
@@ -36,9 +36,10 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
|
||||
int j = pos.getMinBlockZ();
|
||||
ObjectList<Beardifier.Rigid> objectList = new ObjectArrayList<>(10);
|
||||
ObjectList<JigsawJunction> objectList2 = new ObjectArrayList<>(32);
|
||||
- world.startsForStructure(pos, (structure) -> {
|
||||
+ // Paper start - Perf: Remove streams from hot code
|
||||
+ for (net.minecraft.world.level.levelgen.structure.StructureStart start : world.startsForStructure(pos, (structure) -> {
|
||||
return structure.terrainAdaptation() != TerrainAdjustment.NONE;
|
||||
- }).forEach((start) -> {
|
||||
+ })) { // Paper end - Perf: Remove streams from hot code
|
||||
TerrainAdjustment terrainAdjustment = start.getStructure().terrainAdaptation();
|
||||
|
||||
for(StructurePiece structurePiece : start.getPieces()) {
|
||||
@@ -51,9 +52,11 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
|
||||
}
|
||||
|
||||
for(JigsawJunction jigsawJunction : poolElementStructurePiece.getJunctions()) {
|
||||
- int i = jigsawJunction.getSourceX();
|
||||
- int j = jigsawJunction.getSourceZ();
|
||||
- if (i > i - 12 && j > j - 12 && i < i + 15 + 12 && j < j + 15 + 12) {
|
||||
+ // Paper start - decompile fix
|
||||
+ int i2 = jigsawJunction.getSourceX();
|
||||
+ int j2 = jigsawJunction.getSourceZ();
|
||||
+ if (i2 > i - 12 && j2 > j - 12 && i2 < i + 15 + 12 && j2 < j + 15 + 12) {
|
||||
+ // Paper end - decompile fix
|
||||
objectList2.add(jigsawJunction);
|
||||
}
|
||||
}
|
||||
@@ -63,7 +66,7 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
|
||||
}
|
||||
}
|
||||
|
||||
- });
|
||||
+ } // Paper - Perf: Remove streams from hot code
|
||||
return new Beardifier(objectList.iterator(), objectList2.iterator());
|
||||
}
|
||||
|
@ -1,72 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: JRoy <joshroy126@gmail.com>
|
||||
Date: Wed, 1 Jul 2020 18:01:49 -0400
|
||||
Subject: [PATCH] Remove streams from classes related villager gossip
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
|
||||
index 76dffb2705e5207db96895f82f1c7c5638f817c6..097007c1c25ba55d9916fc820dd1d1149d81f6f4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
|
||||
@@ -61,8 +61,22 @@ public class GossipContainer {
|
||||
});
|
||||
}
|
||||
|
||||
+ // Paper start - Remove streams from reputation
|
||||
+ private List<GossipContainer.GossipEntry> decompress() {
|
||||
+ List<GossipContainer.GossipEntry> list = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>();
|
||||
+ for (Map.Entry<UUID, GossipContainer.EntityGossips> entry : this.gossips.entrySet()) {
|
||||
+ for (GossipContainer.GossipEntry cur : entry.getValue().decompress(entry.getKey())) {
|
||||
+ if (cur.weightedValue() != 0) {
|
||||
+ list.add(cur);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return list;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
private Collection<GossipContainer.GossipEntry> selectGossipsForTransfer(RandomSource random, int count) {
|
||||
- List<GossipContainer.GossipEntry> list = this.unpack().toList();
|
||||
+ List<GossipContainer.GossipEntry> list = this.decompress(); // Paper - Remove streams from reputation
|
||||
if (list.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
} else {
|
||||
@@ -156,7 +170,7 @@ public class GossipContainer {
|
||||
}
|
||||
|
||||
public <T> T store(DynamicOps<T> ops) {
|
||||
- return GossipContainer.GossipEntry.LIST_CODEC.encodeStart(ops, this.unpack().toList()).resultOrPartial((error) -> {
|
||||
+ return GossipContainer.GossipEntry.LIST_CODEC.encodeStart(ops, this.decompress()).resultOrPartial((error) -> {
|
||||
LOGGER.warn("Failed to serialize gossips: {}", (Object)error);
|
||||
}).orElseGet(ops::emptyList);
|
||||
}
|
||||
@@ -184,11 +198,23 @@ public class GossipContainer {
|
||||
final Object2IntMap<GossipType> entries = new Object2IntOpenHashMap<>();
|
||||
|
||||
public int weightedValue(Predicate<GossipType> gossipTypeFilter) {
|
||||
- return this.entries.object2IntEntrySet().stream().filter((entry) -> {
|
||||
- return gossipTypeFilter.test(entry.getKey());
|
||||
- }).mapToInt((entry) -> {
|
||||
- return entry.getIntValue() * (entry.getKey()).weight;
|
||||
- }).sum();
|
||||
+ // Paper start - Remove streams from reputation
|
||||
+ int weight = 0;
|
||||
+ for (Object2IntMap.Entry<GossipType> entry : entries.object2IntEntrySet()) {
|
||||
+ if (gossipTypeFilter.test(entry.getKey())) {
|
||||
+ weight += entry.getIntValue() * entry.getKey().weight;
|
||||
+ }
|
||||
+ }
|
||||
+ return weight;
|
||||
+ }
|
||||
+
|
||||
+ public List<GossipContainer.GossipEntry> decompress(UUID uuid) {
|
||||
+ List<GossipContainer.GossipEntry> list = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>();
|
||||
+ for (Object2IntMap.Entry<GossipType> entry : entries.object2IntEntrySet()) {
|
||||
+ list.add(new GossipContainer.GossipEntry(uuid, entry.getKey(), entry.getIntValue()));
|
||||
+ }
|
||||
+ return list;
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
public Stream<GossipContainer.GossipEntry> unpack(UUID target) {
|
@ -8,7 +8,7 @@ public net.minecraft.world.entity.Entity isInRain()Z
|
||||
public net.minecraft.world.entity.Entity isInBubbleColumn()Z
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 4d71849e8330e6f758e10223fabdb5d6ed0e7221..3444051416632eb30ef2cb820767285718095497 100644
|
||||
index 3da7fbec0fb55fb590fc9ff4bd0f984a5cac9fba..c17bb16567ad2354dc80e710469730b1dbc55b08 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1023,5 +1023,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
@ -94,7 +94,7 @@ index 9c2fe69ced7a46bbd8b0fbe10fa67d0a39b0f375..70ecc3f673ebd56b65ad901e10f40c28
|
||||
|
||||
private void setupRecipeList(Container input, ItemStack stack) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index d0c267a79f262dafdd74a6c661a234b9301eddd2..31de936ece1391d75d41a00479a82f8dd0cbc850 100644
|
||||
index 90b93b7139f9a11028b0d78b109b478b8052e982..afccfcab4c1682c47bffe7e3c10a9ec60092e8a0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1714,26 +1714,53 @@ public class CraftEventFactory {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Don't check chunk for portal on world gen entity add
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 4b1366a456e7132d438fc99bd62e1dd77e35b35f..90c66f87e721ef34bf3f47b601456fece3064225 100644
|
||||
index 2fa60d96da53ca954dc1421745fafaeb2e806ed0..05fe4828af59e3cd894c9979ecb08ad0e1c6b2d3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3510,7 +3510,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@ -10,7 +10,7 @@ This fixes that by checking if the modified spawn location is
|
||||
still at a respawn anchor.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index ed686f82dfd264a6b5d0a89163786574525f043e..e9c19cb33ce1ca81b81dbf9dc927289a8ab0520d 100644
|
||||
index 62888ec5766806016545e34758da20884626697a..5f24db6b68b629812d90b7b5e2f06c21732ed098 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -808,6 +808,7 @@ public abstract class PlayerList {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix SPIGOT-5885 Unable to disable advancements
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 49553615418bcbb6f3e4be6f38a9ecd0a650502b..0cb453b03977e90addc26f71d0518f134af3c36a 100644
|
||||
index 6170ff19f44a93e99c6aece6ed456a6af912efbb..1c64c81980739bbf09b71e1d1dd6d86dbf924e0d 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -175,6 +175,7 @@ public class Main {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Brand support
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 14126f4f2f0c8d5ae06275fd735178a2c4d3efc0..f73988baef278bf603fc53a8a371514a094d9c37 100644
|
||||
index fddbd703071ec93d6e3a9ecc1ff17b3e74eb8986..8eb1d297ff0317ac679e85e03d0b4546fa1ed315 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -278,6 +278,7 @@ public class ServerPlayer extends Player {
|
||||
@ -57,7 +57,7 @@ index 44aa178968c87fa72023a2c0f33c1a8123f3db72..f489b207cd3b62a33723f2e9ed0f4602
|
||||
} catch (Exception ex) {
|
||||
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 196ece23104bc67a2df4e528851c0a2df8baaf5b..ff8bef2a88f04e4a333f90de05faddd66c69be20 100644
|
||||
index 49862c0338b84924003df85883760317d1ca7aec..e4068c64363a0769df7a01fbf8b04ac17df042fc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -3030,6 +3030,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 206aa969d1ea8831f4c30be11ab26ecd31fd433e..08c4b6e02c257cfbdaa0da6d65e531d4ed7be122 100644
|
||||
index 8a7dd236435b08e0857041641eec9edcef936503..307f2d8adae141cfb7f5fd3c08e68863ce3ed75f 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -2034,9 +2034,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@ -21,7 +21,7 @@ index 206aa969d1ea8831f4c30be11ab26ecd31fd433e..08c4b6e02c257cfbdaa0da6d65e531d4
|
||||
// if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add
|
||||
this.removeTicketsForSpawn(this.paperConfig().spawn.keepSpawnLoadedRange * 16, prevSpawn);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 8efc044e5a38766aa29cb62db553a8390de50139..52628759695a441ff21f3077cfe9f75a6e999456 100644
|
||||
index 36d7c41505d41443e6034dfc88ce177fe47d980f..6a6bdc23767d4b0413352eda860f3fd3076f492e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -262,12 +262,14 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add moon phase API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
index 954d7a92d9deaf2332ddcfbb7f53f425ada822b6..be0ca9e82b88518109eec88735e628b8de9ebe72 100644
|
||||
index 588d583201bdd850052bdd2beaf08fc9b5473689..0fb214ddd919b568da64541fd9b531c65caa5fad 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -499,4 +499,11 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
@ -7,7 +7,7 @@ Add a new event, BellRingEvent, to trigger whenever a player rings a
|
||||
village bell. Passes along the bell block and the player who rang it.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 31de936ece1391d75d41a00479a82f8dd0cbc850..e33dbade37e4763f838b6cd1267a4f0b9c1533b9 100644
|
||||
index afccfcab4c1682c47bffe7e3c10a9ec60092e8a0..6595c82741d5d7596fae982ac44461ae9086c064 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -366,10 +366,11 @@ public class CraftEventFactory {
|
@ -29,7 +29,7 @@ index 21aafb1ea51769659462d722aa318460b37cbc1c..5d7f092e966d5b0496f48bd5c9d27415
|
||||
this.connection.disconnect(ichatmutablecomponent);
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index 615fb00e50f3c434809f8e1b201d457b9beae8fd..faf1ae03a308ad07091e3e847370e9bda66288b2 100644
|
||||
index e9d94abb77693a845ea6318b7045bd61a7a46feb..e2c7fa3fd05ebb3b76388410d26b6493baf4f877 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -99,7 +99,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
@ -5,7 +5,7 @@ Subject: [PATCH] PortalCreateEvent needs to know its entity
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index e9df7ea1228603ee3ebf515b6419f668cbe3aef7..0dfa1ca78f747b2ea7e6b9f59d4561daad8bfcc8 100644
|
||||
index c5e36e7e96902fc0e8e9bb409907c6424cf223bd..761a46c21aaddcd43b4c33f477658605648127e9 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -478,7 +478,7 @@ public final class ItemStack {
|
||||
@ -79,7 +79,7 @@ index 8fce3ad36a6ee8166f4abd9e0e369b641d487af9..3fb197ee3bfd3f36881b7d67f7a37f03
|
||||
|
||||
private static int getFireTickDelay(RandomSource random) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index c64213fe3ec0bd34cd1b31ae18eff1fecbcf63d6..31dc96c371953eb7ca3d3b444b123ade1f24c909 100644
|
||||
index 79ff216e473ebc4bf7ab3ade42b0fa224f7e4c19..fb46c66d916931fd80a99c59030ca05e12d29953 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -43,6 +43,7 @@ import net.minecraft.world.item.DyeColor;
|
@ -10,7 +10,7 @@ public org.bukkit.craftbukkit.inventory.CraftMetaFirework getNBT(Lorg/bukkit/Fir
|
||||
Co-authored-by: MeFisto94 <MeFisto94@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
index d0b1a419c9bc73066d79459dc3e5998160f8038b..a7783474afef0a2bab7e99e475c6d130bb88b01c 100644
|
||||
index f041b5d80bff9c022b007e04ef1558e9116acc6b..a586442422a2b2c06b785af0d261d3e19eb1d59b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -669,5 +669,10 @@ public class CraftBlock implements Block {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add additional open container api to HumanEntity
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
index 2d0e861275a921ccb3aabcb76ae6eb31f67dd373..7406094fc58e5df4f5d553bb882c75ba6ef766a9 100644
|
||||
index dcc5947143dc39e8f629b29d3649174327783801..6d67df9ae039c7e803c3fe6207e59923bd7be218 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
@@ -461,6 +461,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
@ -6,7 +6,7 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 08c4b6e02c257cfbdaa0da6d65e531d4ed7be122..5bd212dcf32fcf3ad5c3dafbd3d413755a8cd934 100644
|
||||
index 307f2d8adae141cfb7f5fd3c08e68863ce3ed75f..902f3a7ae5ba9c15b634bb2f214be7d85c6d5a00 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1532,6 +1532,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@ -6,7 +6,7 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 452789dc47393580374bf438e6229b1e6cd3832b..e3275f09f48c9e69179fd17901d4294ddb68a435 100644
|
||||
index ec224193e9ca7734fe533d5cfc0e316d5eed2adb..03eee2a591a533ec9930a262ffd4af2023a07c91 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4493,4 +4493,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@ -5,7 +5,7 @@ Subject: [PATCH] Entity#isTicking
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index e3275f09f48c9e69179fd17901d4294ddb68a435..46637e6913e5f2aae0be6aa67b95f1fe604b021e 100644
|
||||
index 03eee2a591a533ec9930a262ffd4af2023a07c91..4a1245fb3ad821ee997b35f180390a07bc871982 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4498,5 +4498,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@ -19,7 +19,7 @@ index e3275f09f48c9e69179fd17901d4294ddb68a435..46637e6913e5f2aae0be6aa67b95f1fe
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index fdf22cb358040738a1b7fabf1cef47a5d33af832..58b591d047e88c00ea09b33ece9f16fde98d3208 100644
|
||||
index d5e8c8ed7528cdac203a7594ccf9576db0e5f019..6e302dff4c0b48694d234091b1637ff3b7b4b098 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1058,5 +1058,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
@ -7,7 +7,7 @@ if multiple threads from worldgen sort at same time, it will crash.
|
||||
So make a copy of the list for sorting purposes.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
index 419eadbe31b86b7192fd7a63268d547705e7c7ce..b45c4f50705f80163d44d9e588f86a5770f5be38 100644
|
||||
index 1fbe732e840d2018269361f7c9e7d3e4606dbff5..225af5abb839880dd6df15af28172bdc74f7b9e5 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
|
||||
@@ -17,7 +17,7 @@ public class GateBehavior<E extends LivingEntity> implements BehaviorControl<E>
|
@ -6,7 +6,7 @@ Subject: [PATCH] Fix for large move vectors crashing server
|
||||
Check movement distance also based on current position.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 0d4e641187b305c4b56782b4c70bca39efcaa69c..5ee4d04f9770672f451b8a87b65075432203e310 100644
|
||||
index 5550f60424d827616c935e3b0036f1b4f6144e5c..27b84c1db793af21c947ab31e7732a3b371da40a 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -473,9 +473,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@ -10,7 +10,7 @@ In general, look at making this logic more robust (i.e properly handling
|
||||
cases where a captured entry is overriden) - but for now this will do.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index d89b6c99e1cf4c6171ea6f2dad1e812760707603..f9b37892ca92f0fb4943088ad6c4f1f48db287c6 100644
|
||||
index a7fca2d662e013809fef088213cf0275b596629d..3588ad0b5e8510a00b1a65c73defec39ee7fb108 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -160,7 +160,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String)
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index ea2ca7a37d0bdcc1ccc1627e4246a8290e32d16f..95edbf365a916687d9a6a2e7598435fa1a32baf4 100644
|
||||
index 776b3d4d165303715e70c44689bb556541cb7582..8617abb738f311e2f7141ec98799f6cc8b4c6cf5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1909,6 +1909,28 @@ public final class CraftServer implements Server {
|
@ -3,7 +3,6 @@ From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 4 Aug 2020 22:24:15 +0200
|
||||
Subject: [PATCH] Optimize Pathfinder - Remove Streams / Optimized collections
|
||||
|
||||
1.17 Update: Please do this k thx bb
|
||||
I utilized the IDE to convert streams to non streams code, so shouldn't
|
||||
be any risk of behavior change. Only did minor optimization of the
|
||||
generated code set to remove unnecessary things.
|
@ -25,7 +25,7 @@ index 4df0342c38f8ff763a08a145ec94325bcd50689d..2db208427447b94cdfdb22b38b6dc669
|
||||
Connection.LOGGER.debug("Failed to sent packet", throwable);
|
||||
if (this.getSending() == PacketFlow.CLIENTBOUND) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 478abaffd1a80949b96f1c1774c98134be92e5ac..063742400f3065ace62b64b42d952517ae00ea1f 100644
|
||||
index 8eb1d297ff0317ac679e85e03d0b4546fa1ed315..ff75234d76e4f6a939841c982a6fc3e33b36ea61 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -279,6 +279,7 @@ public class ServerPlayer extends Player {
|
||||
@ -37,7 +37,7 @@ index 478abaffd1a80949b96f1c1774c98134be92e5ac..063742400f3065ace62b64b42d952517
|
||||
// Paper start - replace player chunk loader
|
||||
private final java.util.concurrent.atomic.AtomicReference<io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances> viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1));
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index e58e8fe05a6e826ef8bf6f04924e2aadba738d97..c07b0fcc62e8ce05ddfe9c6c9c9dd57d85e6683b 100644
|
||||
index f489b207cd3b62a33723f2e9ed0f46020d7f4fd1..0616a8e89931680602da2dbc640906708aebd5ca 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -315,6 +315,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@ -49,7 +49,7 @@ index e58e8fe05a6e826ef8bf6f04924e2aadba738d97..c07b0fcc62e8ce05ddfe9c6c9c9dd57d
|
||||
this.connection.disconnect(ichatbasecomponent);
|
||||
}));
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index e9c19cb33ce1ca81b81dbf9dc927289a8ab0520d..d101376e05abb72aa874c11fe820fdee469302b1 100644
|
||||
index 5f24db6b68b629812d90b7b5e2f06c21732ed098..e2669eb88b76460207f2283711b64e0d6fa8f942 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -579,7 +579,7 @@ public abstract class PlayerList {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Expose world spawn angle
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index d101376e05abb72aa874c11fe820fdee469302b1..3ae3d47f3b94b4626f37ffbca1d2d958931b3b71 100644
|
||||
index e2669eb88b76460207f2283711b64e0d6fa8f942..8cbcbf358b978c85ade7efdefc4e138c09f634ab 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -851,7 +851,7 @@ public abstract class PlayerList {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index ff8bef2a88f04e4a333f90de05faddd66c69be20..58731389c9b120395f4eb9e38c8e8584147fe9fd 100644
|
||||
index e4068c64363a0769df7a01fbf8b04ac17df042fc..ba30c5e17a294cee9f408fdd4e31849c0e5d28ed 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2593,7 +2593,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@ -8,7 +8,7 @@ public net.minecraft.world.entity.LightningBolt life
|
||||
public net.minecraft.world.entity.LightningBolt flashes
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
|
||||
index 849c7d1e4eabfaea491b6c9004f764307ad1b9c6..cd9bd7f06e55e970b7791e635610bb5e7491d102 100644
|
||||
index 0b2ba5c93355a5b7548d4634d964732e45477a34..6fed8075aa75e3852dc826a45ca44603c0446a56 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java
|
||||
@@ -66,4 +66,23 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike
|
@ -5,7 +5,7 @@ Subject: [PATCH] Limit recipe packets
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index d3b90fbdd198cdb82263a39561ee5392e32edf41..3b29de365044cf6d51903dd18b6c3ece04a5fff8 100644
|
||||
index 27b84c1db793af21c947ab31e7732a3b371da40a..3683e3b56da96e5528d63319892b5ec76075d86c 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -258,6 +258,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@ -18,7 +18,7 @@ index 4bac05cb48d81dc9776d90502b6f12285b92122b..2957b3929c1e92af1b1a2636b83b757a
|
||||
public boolean affectsSpawning = true;
|
||||
// Paper end
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
index 7406094fc58e5df4f5d553bb882c75ba6ef766a9..faaed968a3e771c1db3957e2b42acf6d87a38842 100644
|
||||
index 6d67df9ae039c7e803c3fe6207e59923bd7be218..cdbd8d7d1c23809a7345f0c3b0c7f9356be47900 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
@@ -126,6 +126,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add OBSTRUCTED reason to BedEnterResult
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index e33dbade37e4763f838b6cd1267a4f0b9c1533b9..0e0c64c9fad14ad77af784e719fe6f203479db14 100644
|
||||
index 6595c82741d5d7596fae982ac44461ae9086c064..5b047c46a4d3f0c7aca7ceb562f8e429e4f498fc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -301,6 +301,10 @@ public class CraftEventFactory {
|
@ -28,7 +28,7 @@ index 05ac41e136da43284fb24a6b698ebd36318278fb..33d9131e9c75ef23cd637f5d6c39a270
|
||||
|
||||
public Vec3 decode(long x, long y, long z) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 28d12ffb79a29be67b6476ae7fa87b557f55839f..a0c70b204007a906076d3a1f28c84521ad4471c4 100644
|
||||
index 82eb980dd463c423b2b30a3149166a227608bb96..5436949cd928303cf80b606c747f386f0189f774 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4269,6 +4269,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
@ -11,7 +11,7 @@ Subject: [PATCH] Fix interact event not being called sometimes
|
||||
Co-authored-by: Moulberry <james.jenour@protonmail.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 3b29de365044cf6d51903dd18b6c3ece04a5fff8..2c87b676290e4de8e119f3ba5fd4292af9d0654e 100644
|
||||
index 3683e3b56da96e5528d63319892b5ec76075d86c..48815e94a0eacbdd03ea8630ae4a53f1a4747520 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1765,7 +1765,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@ -64,7 +64,7 @@ index 334001cb749600c973c82391e1c11f0e40bd2dfb..2a480026c3bfb06e6556fe5b11d9712c
|
||||
|
||||
public int get() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 52628759695a441ff21f3077cfe9f75a6e999456..3fbc0ea59ac2e56e3f024104c7904614827c8e04 100644
|
||||
index 6a6bdc23767d4b0413352eda860f3fd3076f492e..b70239ff42f5c7f4754bae311385e4804891fd86 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1930,8 +1930,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
@ -32,7 +32,7 @@ index 913ed110d8402d377152753325901eb7f3ac82d6..675644974ae6fb5380a6496a2ac3ec4d
|
||||
} else {
|
||||
ItemStack itemstack = tileentitydispenser.getItem(i);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 0e0c64c9fad14ad77af784e719fe6f203479db14..8b2fda9c6cbb0872798ce3240d9a6d32cb61b82e 100644
|
||||
index 5b047c46a4d3f0c7aca7ceb562f8e429e4f498fc..5bd9efcf3bedf71a19674251271b9b72c39df444 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2040,4 +2040,12 @@ public class CraftEventFactory {
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user