geforkt von Mirrors/Paper
bunch o' patches
Dieser Commit ist enthalten in:
Ursprung
9596c37668
Commit
294026345e
@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
this.createResult();
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, 2); // Paper
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper
|
||||
}
|
||||
|
||||
public int getCost() {
|
||||
@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.setupResultSlot(itemstack, itemstack1, itemstack2);
|
||||
}
|
||||
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, 2); // Paper
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper
|
||||
}
|
||||
|
||||
private void setupResultSlot(ItemStack map, ItemStack item, ItemStack oldResult) {
|
||||
@ -39,7 +39,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
super.slotsChanged(inventory);
|
||||
if (inventory == this.repairSlots) {
|
||||
this.createResult();
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, 2); // Paper
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper
|
||||
}
|
||||
|
||||
}
|
||||
@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
super.slotsChanged(inventory);
|
||||
if (inventory == this.inputSlots) {
|
||||
this.createResult();
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, 2); // Paper
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper
|
||||
}
|
||||
|
||||
}
|
||||
@ -60,15 +60,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/world/inventory/LoomMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/LoomMenu.java
|
||||
@@ -0,0 +0,0 @@ public class LoomMenu extends AbstractContainerMenu {
|
||||
}
|
||||
this.resultSlot.set(ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
this.setupResultSlot();
|
||||
- this.broadcastChanges();
|
||||
+ //this.c(); // Paper - done below
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, 3); // Paper
|
||||
}
|
||||
|
||||
public void registerUpdateListener(Runnable inventoryChangeListener) {
|
||||
- this.broadcastChanges();
|
||||
+ // this.broadcastChanges(); // Paper - done below
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, 3); // Paper
|
||||
} else {
|
||||
this.resultSlot.set(ItemStack.EMPTY);
|
||||
this.selectablePatterns = List.of();
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/SmithingMenu.java b/src/main/java/net/minecraft/world/inventory/SmithingMenu.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/SmithingMenu.java
|
||||
@ -77,7 +77,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, 2); // Paper
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -89,7 +89,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.setupRecipeList(inventory, itemstack);
|
||||
}
|
||||
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, 1); // Paper
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper
|
||||
}
|
||||
|
||||
private void setupRecipeList(Container input, ItemStack stack) {
|
22
patches/server/Don-t-allow-null-UUID-s-for-chat.patch
Normale Datei
22
patches/server/Don-t-allow-null-UUID-s-for-chat.patch
Normale Datei
@ -0,0 +1,22 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 28 Jun 2020 19:36:55 -0400
|
||||
Subject: [PATCH] Don't allow null UUID's for chat
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/chat/ChatSender.java b/src/main/java/net/minecraft/network/chat/ChatSender.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/network/chat/ChatSender.java
|
||||
+++ b/src/main/java/net/minecraft/network/chat/ChatSender.java
|
||||
@@ -0,0 +0,0 @@ public record ChatSender(UUID uuid, Component name, @Nullable Component teamName
|
||||
public ChatSender(FriendlyByteBuf buf) {
|
||||
this(buf.readUUID(), buf.readComponent(), buf.readNullable(FriendlyByteBuf::readComponent));
|
||||
}
|
||||
+ // Paper start
|
||||
+ public ChatSender {
|
||||
+ com.google.common.base.Preconditions.checkNotNull(uuid, "uuid cannot be null");
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
public static ChatSender system(Component name) {
|
||||
return new ChatSender(Util.NIL_UUID, name);
|
@ -0,0 +1,50 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 10 Jul 2020 13:12:33 -0500
|
||||
Subject: [PATCH] Fix SPIGOT-5824 Bukkit world-container is not used
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -0,0 +0,0 @@ public class Main {
|
||||
return;
|
||||
}
|
||||
|
||||
- File file = (File) optionset.valueOf("universe"); // CraftBukkit
|
||||
- Services services = Services.create(new com.destroystokyo.paper.profile.PaperAuthenticationService(Proxy.NO_PROXY), file); // Paper
|
||||
+ // Paper start - fix SPIGOT-5824
|
||||
+ File file;
|
||||
+ File userCacheFile = new File(Services.USERID_CACHE_FILE);
|
||||
+ if (optionset.has("universe")) {
|
||||
+ file = (File) optionset.valueOf("universe"); // CraftBukkit
|
||||
+ userCacheFile = new File(file, Services.USERID_CACHE_FILE);
|
||||
+ } else {
|
||||
+ file = new File(bukkitConfiguration.getString("settings.world-container", "."));
|
||||
+ }
|
||||
+ // Paper end - fix SPIGOT-5824
|
||||
+ Services services = Services.create(new com.destroystokyo.paper.profile.PaperAuthenticationService(Proxy.NO_PROXY), file, userCacheFile); // Paper
|
||||
// CraftBukkit start
|
||||
String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName);
|
||||
LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath());
|
||||
diff --git a/src/main/java/net/minecraft/server/Services.java b/src/main/java/net/minecraft/server/Services.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Services.java
|
||||
+++ b/src/main/java/net/minecraft/server/Services.java
|
||||
@@ -0,0 +0,0 @@ import net.minecraft.server.players.GameProfileCache;
|
||||
import net.minecraft.util.SignatureValidator;
|
||||
|
||||
public record Services(MinecraftSessionService sessionService, SignatureValidator serviceSignatureValidator, GameProfileRepository profileRepository, GameProfileCache profileCache) {
|
||||
- private static final String USERID_CACHE_FILE = "usercache.json";
|
||||
+ public static final String USERID_CACHE_FILE = "usercache.json"; // Paper - private -> public
|
||||
|
||||
- public static Services create(YggdrasilAuthenticationService authenticationService, File rootDirectory) {
|
||||
+ public static Services create(YggdrasilAuthenticationService authenticationService, File rootDirectory, File userCacheFile) { // Paper
|
||||
MinecraftSessionService minecraftSessionService = authenticationService.createMinecraftSessionService();
|
||||
GameProfileRepository gameProfileRepository = authenticationService.createProfileRepository();
|
||||
- GameProfileCache gameProfileCache = new GameProfileCache(gameProfileRepository, new File(rootDirectory, "usercache.json"));
|
||||
+ GameProfileCache gameProfileCache = new GameProfileCache(gameProfileRepository, userCacheFile); // Paper
|
||||
SignatureValidator signatureValidator = SignatureValidator.from(authenticationService.getServicesKey());
|
||||
return new Services(minecraftSessionService, signatureValidator, gameProfileRepository, gameProfileCache);
|
||||
}
|
@ -13,14 +13,6 @@ diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/ma
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.biome.BiomeManager;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
+import net.minecraft.world.level.block.RespawnAnchorBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.border.BorderChangeListener;
|
||||
import net.minecraft.world.level.border.WorldBorder;
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
// Paper start
|
||||
boolean isBedSpawn = false;
|
||||
@ -57,12 +49,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
// entityplayer1.initInventoryMenu();
|
||||
entityplayer1.setHealth(entityplayer1.getHealth());
|
||||
- if (flag2) {
|
||||
- entityplayer1.connection.send(new ClientboundSoundPacket(SoundEvents.RESPAWN_ANCHOR_DEPLETE, SoundSource.BLOCKS, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), 1.0F, 1.0F));
|
||||
- entityplayer1.connection.send(new ClientboundSoundPacket(SoundEvents.RESPAWN_ANCHOR_DEPLETE, SoundSource.BLOCKS, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), 1.0F, 1.0F, worldserver1.getRandom().nextLong()));
|
||||
+ // Paper start - Fix SPIGOT-5989
|
||||
+ if (flag2 && !isLocAltered) {
|
||||
+ BlockState data = worldserver1.getBlockState(blockposition);
|
||||
+ worldserver1.setBlock(blockposition, data.setValue(RespawnAnchorBlock.CHARGE, data.getValue(RespawnAnchorBlock.CHARGE) - 1), 3);
|
||||
+ entityplayer1.connection.send(new ClientboundSoundPacket(SoundEvents.RESPAWN_ANCHOR_DEPLETE, SoundSource.BLOCKS, (double) location.getX(), (double) location.getY(), (double) location.getZ(), 1.0F, 1.0F));
|
||||
+ worldserver1.setBlock(blockposition, data.setValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE, data.getValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE) - 1), 3);
|
||||
+ entityplayer1.connection.send(new ClientboundSoundPacket(SoundEvents.RESPAWN_ANCHOR_DEPLETE, SoundSource.BLOCKS, (double) location.getX(), (double) location.getY(), (double) location.getZ(), 1.0F, 1.0F, worldserver1.getRandom().nextLong()));
|
||||
+ // Paper end
|
||||
}
|
||||
// Added from changeDimension
|
@ -369,11 +369,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
private final BlockableEventLoop<Runnable> mainThreadExecutor;
|
||||
+ final java.util.concurrent.Executor mainInvokingExecutor; // Paper
|
||||
public ChunkGenerator generator;
|
||||
private RandomState randomState;
|
||||
public final Supplier<DimensionDataStorage> overworldDataStorage;
|
||||
private final PoiManager poiManager;
|
||||
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
this.level = world;
|
||||
this.generator = chunkGenerator;
|
||||
}
|
||||
|
||||
this.mainThreadExecutor = mainThreadExecutor;
|
||||
+ // Paper start
|
||||
+ this.mainInvokingExecutor = (run) -> {
|
||||
@ -468,7 +468,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ // Paper - revert 1.17 chunk system changes
|
||||
|
||||
if (optional.isPresent() && ((ChunkAccess) optional.get()).getStatus().isOrAfter(requiredStatus)) {
|
||||
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = requiredStatus.load(this.level, this.structureManager, this.lightEngine, (ichunkaccess) -> {
|
||||
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = requiredStatus.load(this.level, this.structureTemplateManager, this.lightEngine, (ichunkaccess) -> {
|
||||
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
} else {
|
||||
return this.scheduleChunkGeneration(holder, requiredStatus);
|
||||
@ -505,7 +505,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
+ this.level.asyncChunkTaskManager.raisePriority(pos.x, pos.z, priority); // Paper
|
||||
return ret;
|
||||
// Paper end
|
||||
// Paper end - Async chunk io
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
this.releaseLightTicket(chunkcoordintpair);
|
@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
if (!entity.canAttack(entityliving)) {
|
||||
- this.clearAttackTarget(entity);
|
||||
+ this.clearAttackTarget(entity, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_INVALID); // Paper
|
||||
} else if (StopAttackingIfTargetInvalid.isTiredOfTryingToReachTarget(entity)) {
|
||||
} else if (this.canGrowTiredOfTryingToReachTarget && StopAttackingIfTargetInvalid.isTiredOfTryingToReachTarget(entity)) {
|
||||
- this.clearAttackTarget(entity);
|
||||
+ this.clearAttackTarget(entity, org.bukkit.event.entity.EntityTargetEvent.TargetReason.FORGOT_TARGET); // Paper
|
||||
} else if (this.isCurrentTargetDeadOrRemoved(entity)) {
|
||||
@ -41,20 +41,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- LivingEntity old = entity.getBrain().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null);
|
||||
- EntityTargetEvent event = CraftEventFactory.callEntityTargetLivingEvent(entity, null, (old != null && !old.isAlive()) ? EntityTargetEvent.TargetReason.TARGET_DIED : EntityTargetEvent.TargetReason.FORGOT_TARGET);
|
||||
+ // Paper start - fix this event
|
||||
+ //EntityLiving old = e0.getBehaviorController().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null);
|
||||
+ // LivingEntity old = entity.getBrain().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null);
|
||||
+ EntityTargetEvent event = CraftEventFactory.callEntityTargetLivingEvent(entity, null, reason);
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
- if (event.getTarget() != null) {
|
||||
- entity.getBrain().setMemory(MemoryModuleType.ATTACK_TARGET, ((CraftLivingEntity) event.getTarget()).getHandle());
|
||||
+ // comment out, bad logic - bad
|
||||
+ /*if (event.getTarget() != null) {
|
||||
+ e0.getBehaviorController().setMemory(MemoryModuleType.ATTACK_TARGET, ((CraftLivingEntity) event.getTarget()).getHandle());
|
||||
entity.getBrain().setMemory(MemoryModuleType.ATTACK_TARGET, ((CraftLivingEntity) event.getTarget()).getHandle());
|
||||
return;
|
||||
- }
|
||||
+ }*/
|
||||
+ // Paper end
|
||||
// CraftBukkit end
|
||||
this.onTargetErased.accept(entity);
|
||||
this.onTargetErased.accept(entity, this.getAttackTarget(entity));
|
||||
entity.getBrain().eraseMemory(MemoryModuleType.ATTACK_TARGET);
|
33
patches/server/Remove-some-streams-from-structures.patch
Normale Datei
33
patches/server/Remove-some-streams-from-structures.patch
Normale Datei
@ -0,0 +1,33 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Roy <10731363+JRoy@users.noreply.github.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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
|
||||
@@ -0,0 +0,0 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
|
||||
int j = chunkPos.getMinBlockZ();
|
||||
ObjectList<Beardifier.Rigid> objectList = new ObjectArrayList<>(10);
|
||||
ObjectList<JigsawJunction> objectList2 = new ObjectArrayList<>(32);
|
||||
- structureManager.startsForStructure(chunkPos, (structure) -> {
|
||||
+ // Paper start - replace for each
|
||||
+ for (net.minecraft.world.level.levelgen.structure.StructureStart structureStart : structureManager.startsForStructure(chunkPos, (structure) -> {
|
||||
return structure.terrainAdaptation() != TerrainAdjustment.NONE;
|
||||
- }).forEach((structureStart) -> {
|
||||
+ })) {
|
||||
TerrainAdjustment terrainAdjustment = structureStart.getStructure().terrainAdaptation();
|
||||
|
||||
for(StructurePiece structurePiece : structureStart.getPieces()) {
|
||||
@@ -0,0 +0,0 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
|
||||
}
|
||||
}
|
||||
|
||||
- });
|
||||
+ } // Paper
|
||||
return new Beardifier(objectList.iterator(), objectList2.iterator());
|
||||
}
|
||||
|
@ -8,21 +8,13 @@ diff --git a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
|
||||
@@ -0,0 +0,0 @@ import com.mojang.serialization.Dynamic;
|
||||
import com.mojang.serialization.DynamicOps;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
||||
+import it.unimi.dsi.fastutil.objects.ObjectArrayList; // Paper
|
||||
import it.unimi.dsi.fastutil.objects.ObjectIterator;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@@ -0,0 +0,0 @@ public class GossipContainer {
|
||||
});
|
||||
}
|
||||
|
||||
+ // Paper start - Remove streams from reputation
|
||||
+ private List<GossipContainer.GossipEntry> decompress() {
|
||||
+ List<GossipContainer.GossipEntry> list = new ObjectArrayList<>();
|
||||
+ List<GossipContainer.GossipEntry> list = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>();
|
||||
+ for (Map.Entry<UUID, GossipContainer.EntityGossips> entry : getReputations().entrySet()) {
|
||||
+ for (GossipContainer.GossipEntry cur : entry.getValue().decompress(entry.getKey())) {
|
||||
+ if (cur.weightedValue() != 0)
|
||||
@ -33,25 +25,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
private Collection<GossipContainer.GossipEntry> selectGossipsForTransfer(Random random, int count) {
|
||||
private Collection<GossipContainer.GossipEntry> selectGossipsForTransfer(RandomSource random, int count) {
|
||||
- List<GossipContainer.GossipEntry> list = this.unpack().collect(Collectors.toList());
|
||||
+ List<GossipContainer.GossipEntry> list = decompress(); // Paper - Remove streams from reputation
|
||||
+ List<GossipContainer.GossipEntry> list = this.decompress(); // Paper - Remove streams from reputation
|
||||
if (list.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
} else {
|
||||
@@ -0,0 +0,0 @@ public class GossipContainer {
|
||||
|
||||
}
|
||||
|
||||
- public <T> Dynamic<T> store(DynamicOps<T> dynamicOps) {
|
||||
public <T> Dynamic<T> store(DynamicOps<T> dynamicOps) {
|
||||
- return new Dynamic<>(dynamicOps, dynamicOps.createList(this.unpack().map((gossipEntry) -> {
|
||||
- return gossipEntry.store(dynamicOps);
|
||||
+ public <T> Dynamic<T> store(DynamicOps<T> dynamicops) {
|
||||
+ return new Dynamic(dynamicops, dynamicops.createList(this.decompress().stream().map((reputation_b) -> {
|
||||
+ return reputation_b.store(dynamicops);
|
||||
+ return new Dynamic<>(dynamicOps, dynamicOps.createList(this.decompress().stream().map((gossipEntry) -> {
|
||||
return gossipEntry.store(dynamicOps);
|
||||
}).map(Dynamic::getValue)));
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class GossipContainer {
|
||||
final Object2IntMap<GossipType> entries = new Object2IntOpenHashMap<>();
|
||||
|
||||
@ -72,7 +60,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ public List<GossipContainer.GossipEntry> decompress(UUID uuid) {
|
||||
+ List<GossipContainer.GossipEntry> list = new ObjectArrayList<>();
|
||||
+ 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()));
|
||||
+ }
|
@ -50,8 +50,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
||||
@@ -0,0 +0,0 @@ public final class NbtUtils {
|
||||
if (compound.contains("Name", 8)) {
|
||||
string = compound.getString("Name");
|
||||
if (nbt.contains("Name", 8)) {
|
||||
string = nbt.getString("Name");
|
||||
}
|
||||
+ // Paper start - support string UUID's
|
||||
+ if (compound.contains("Id", 8)) {
|
||||
@ -59,5 +59,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
if (compound.hasUUID("Id")) {
|
||||
uUID = compound.getUUID("Id");
|
||||
if (nbt.hasUUID("Id")) {
|
||||
uUID = nbt.getUUID("Id");
|
@ -30,9 +30,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
@@ -0,0 +0,0 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
|
||||
private final ResultConsumer<CommandSourceStack> consumer;
|
||||
private final EntityAnchorArgument.Anchor anchor;
|
||||
private final Vec2 rotation;
|
||||
private final CommandSigningContext signingContext;
|
||||
- public volatile CommandNode currentCommand; // CraftBukkit
|
||||
+ public java.util.Map<Thread, CommandNode> currentCommand = new java.util.concurrent.ConcurrentHashMap<>(); // CraftBukkit // Paper
|
||||
|
@ -168,7 +168,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/j
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -0,0 +0,0 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana
|
||||
@@ -0,0 +0,0 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemp
|
||||
import net.minecraft.world.level.storage.DimensionDataStorage;
|
||||
import net.minecraft.world.level.storage.LevelStorageSource;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
@ -400,8 +400,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
+ public void setLastSaved(long ticks) {} // Paper
|
||||
|
||||
// CraftBukkit start - decompile error
|
||||
public static record TicksToSave(SerializableTickContainer<Block> blocks, SerializableTickContainer<Fluid> fluids) {
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 28 Jun 2020 19:36:55 -0400
|
||||
Subject: [PATCH] Don't allow null UUID's for chat
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java
|
||||
@@ -0,0 +0,0 @@ public class ClientboundChatPacket implements Packet<ClientGamePacketListener> {
|
||||
public ClientboundChatPacket(Component message, ChatType type, UUID sender) {
|
||||
this.message = message;
|
||||
this.type = type;
|
||||
- this.sender = sender;
|
||||
+ this.sender = sender != null ? sender : net.minecraft.Util.NIL_UUID;
|
||||
}
|
||||
|
||||
public ClientboundChatPacket(FriendlyByteBuf buf) {
|
@ -1,33 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 10 Jul 2020 13:12:33 -0500
|
||||
Subject: [PATCH] Fix SPIGOT-5824 Bukkit world-container is not used
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/Main.java
|
||||
+++ b/src/main/java/net/minecraft/server/Main.java
|
||||
@@ -0,0 +0,0 @@ public class Main {
|
||||
return;
|
||||
}
|
||||
|
||||
- File file = (File) optionset.valueOf("universe"); // CraftBukkit
|
||||
+ // Paper start - fix SPIGOT-5824
|
||||
+ File file;
|
||||
+ File userCacheFile = new File("usercache.json");
|
||||
+ if (optionset.has("universe")) {
|
||||
+ file = (File) optionset.valueOf("universe"); // CraftBukkit
|
||||
+ userCacheFile = new File(file, "usercache.json");
|
||||
+ } else {
|
||||
+ file = new File(bukkitConfiguration.getString("settings.world-container", "."));
|
||||
+ }
|
||||
+ // Paper end - fix SPIGOT-5824
|
||||
YggdrasilAuthenticationService yggdrasilauthenticationservice = new com.destroystokyo.paper.profile.PaperAuthenticationService(Proxy.NO_PROXY); // Paper
|
||||
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
|
||||
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
|
||||
- GameProfileCache usercache = new GameProfileCache(gameprofilerepository, new File(file, MinecraftServer.USERID_CACHE_FILE.getName()));
|
||||
+ GameProfileCache usercache = new GameProfileCache(gameprofilerepository, userCacheFile); // Paper - only move usercache.json into folder if --universe is used, not world-container
|
||||
// CraftBukkit start
|
||||
String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName);
|
||||
LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath());
|
@ -1,43 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Wed, 15 Jul 2020 19:34:11 -0700
|
||||
Subject: [PATCH] Move range check for block placing up
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
}
|
||||
// Spigot end
|
||||
|
||||
+ // Paper start
|
||||
+ private static final int SURVIVAL_PLACE_DISTANCE_SQUARED = 6 * 6;
|
||||
+ private static final int CREATIVE_PLACE_DISTANCE_SQUARED = 7 * 7;
|
||||
+ private boolean isOutsideOfReach(double x, double y, double z) {
|
||||
+ Location eyeLoc = this.getCraftPlayer().getEyeLocation();
|
||||
+ double reachDistance = org.bukkit.util.NumberConversions.square(eyeLoc.getX() - x) + org.bukkit.util.NumberConversions.square(eyeLoc.getY() - y) + org.bukkit.util.NumberConversions.square(eyeLoc.getZ() - z);
|
||||
+ return reachDistance > (this.getCraftPlayer().getGameMode() == org.bukkit.GameMode.CREATIVE ? CREATIVE_PLACE_DISTANCE_SQUARED : SURVIVAL_PLACE_DISTANCE_SQUARED);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public void handleUseItemOn(ServerboundUseItemOnPacket packet) {
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
||||
BlockPos blockposition = movingobjectpositionblock.getBlockPos();
|
||||
Vec3 vec3d1 = vec3d.subtract(Vec3.atCenterOf(blockposition));
|
||||
|
||||
+ // Paper start - improve distance check
|
||||
+ final Vec3 clickedLocation = movingobjectpositionblock.getLocation();
|
||||
+ if (isOutsideOfReach(blockposition.getX() + 0.5D, blockposition.getY() + 0.5D, blockposition.getZ() + 0.5D)
|
||||
+ || !Double.isFinite(clickedLocation.x) || !Double.isFinite(clickedLocation.y) || !Double.isFinite(clickedLocation.z)
|
||||
+ || isOutsideOfReach(clickedLocation.x, clickedLocation.y, clickedLocation.z)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
if (this.player.level.getServer() != null && this.player.chunkPosition().getChessboardDistance(new ChunkPos(blockposition)) < this.player.level.spigotConfig.viewDistance) { // Spigot
|
||||
double d0 = 1.0000001D;
|
||||
|
@ -1,41 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Roy <10731363+JRoy@users.noreply.github.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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
|
||||
@@ -0,0 +0,0 @@ import net.minecraft.world.level.levelgen.feature.NoiseEffect;
|
||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||
import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece;
|
||||
import net.minecraft.world.level.levelgen.structure.StructurePiece;
|
||||
+import net.minecraft.world.level.levelgen.structure.StructureStart;
|
||||
import net.minecraft.world.level.levelgen.structure.pools.JigsawJunction;
|
||||
import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool;
|
||||
|
||||
@@ -0,0 +0,0 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
|
||||
int j = chunkPos.getMinBlockZ();
|
||||
this.junctions = new ObjectArrayList<>(32);
|
||||
this.rigids = new ObjectArrayList<>(10);
|
||||
- structureAccessor.startsForFeature(SectionPos.bottomOf(chunk), (configuredStructureFeature) -> {
|
||||
+ // Paper start - replace for each
|
||||
+ for (StructureStart start : structureAccessor.startsForFeature(SectionPos.bottomOf(chunk), (configuredStructureFeature) -> {
|
||||
return configuredStructureFeature.adaptNoise;
|
||||
- }).forEach((start) -> {
|
||||
+ })) { // Paper end
|
||||
for(StructurePiece structurePiece : start.getPieces()) {
|
||||
if (structurePiece.isCloseToChunk(chunkPos, 12)) {
|
||||
if (structurePiece instanceof PoolElementStructurePiece) {
|
||||
@@ -0,0 +0,0 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
|
||||
}
|
||||
}
|
||||
|
||||
- });
|
||||
+ } // Paper
|
||||
this.pieceIterator = this.rigids.iterator();
|
||||
this.junctionIterator = this.junctions.iterator();
|
||||
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren