mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-02 06:57:30 +01:00
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: d25437bc Update to Minecraft 1.18-pre8 CraftBukkit Changes: 5a39a236 Update to Minecraft 1.18-pre8 Spigot Changes: 7840c2af Update to Minecraft 1.18-pre8
This commit is contained in:
parent
2253e953c6
commit
60caeea54e
34 changed files with 147 additions and 139 deletions
build.gradle.ktsgradle.propertiestodo.txt
patches
api
server
Add-configurable-portal-search-radius.patchAllow-Saving-of-Oversized-Chunks.patchAsynchronous-chunk-IO-and-loading.patchAvoid-hopper-searches-if-there-are-no-items.patchBound-Treasure-Maps-to-World-Border.patchCustom-replacement-for-eaten-items.patchDon-t-allow-null-UUID-s-for-chat.patchFix-PlayerItemConsumeEvent-cancelling-properly.patchFix-World-isChunkGenerated-calls.patchFix-piston-physics-inconsistency-MC-188840.patchImproved-Watchdog-Support.patchMC-Dev-fixes.patchMC-Utils.patchMob-Spawner-API-Enhancements.patchOptimise-BlockState-s-hashCode-equals.patchOptimize-Collision-to-not-load-chunks.patchOptimize-MappedRegistry.patchOptimize-NibbleArray-to-use-pooled-buffers.patchOptimize-Pathfinder-Remove-Streams-Optimized-collect.patchPortalCreateEvent-needs-to-know-its-entity.patchPrevent-consuming-the-wrong-itemstack.patchProtect-Bedrock-and-End-Portal-Frames-from-being-des.patchRemap-fixes.patchSetup-Gradle-project.patchTimings-v2.patchadd-more-information-to-Entity.toString.patch
work
|
@ -46,7 +46,7 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
paramMappings("net.fabricmc:yarn:1.18-pre5+build.4:mergedv2")
|
paramMappings("net.fabricmc:yarn:1.18-pre8+build.4:mergedv2")
|
||||||
remapper("net.fabricmc:tiny-remapper:0.7.0:fat")
|
remapper("net.fabricmc:tiny-remapper:0.7.0:fat")
|
||||||
decompiler("net.minecraftforge:forgeflower:1.5.498.22")
|
decompiler("net.minecraftforge:forgeflower:1.5.498.22")
|
||||||
paperclip("io.papermc:paperclip:2.0.1")
|
paperclip("io.papermc:paperclip:2.0.1")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
group=io.papermc.paper
|
group=io.papermc.paper
|
||||||
version=1.18-pre5-R0.1-SNAPSHOT
|
version=1.18-pre8-R0.1-SNAPSHOT
|
||||||
|
|
||||||
mcVersion=1.18-pre5
|
mcVersion=1.18-pre8
|
||||||
|
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
|
|
|
@ -112,7 +112,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
-
|
-
|
||||||
- <groupId>org.spigotmc</groupId>
|
- <groupId>org.spigotmc</groupId>
|
||||||
- <artifactId>spigot-api</artifactId>
|
- <artifactId>spigot-api</artifactId>
|
||||||
- <version>1.18-pre5-R0.1-SNAPSHOT</version>
|
- <version>1.18-pre8-R0.1-SNAPSHOT</version>
|
||||||
- <packaging>jar</packaging>
|
- <packaging>jar</packaging>
|
||||||
-
|
-
|
||||||
- <name>Spigot-API</name>
|
- <name>Spigot-API</name>
|
||||||
|
|
|
@ -47,10 +47,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java
|
||||||
@@ -0,0 +0,0 @@ public class PortalForcer {
|
@@ -0,0 +0,0 @@ public class PortalForcer {
|
||||||
|
|
||||||
public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos blockposition, boolean destIsNether, WorldBorder worldborder) {
|
public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos pos, boolean destIsNether, WorldBorder worldBorder) {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
- return this.findPortalAround(blockposition, worldborder, destIsNether ? 16 : 128); // Search Radius
|
- return this.findPortalAround(pos, worldBorder, destIsNether ? 16 : 128); // Search Radius
|
||||||
+ return this.findPortalAround(blockposition, worldborder, destIsNether ? level.paperConfig.portalCreateRadius : level.paperConfig.portalSearchRadius); // Search Radius // Paper - search Radius
|
+ return this.findPortalAround(pos, worldBorder, destIsNether ? level.paperConfig.portalCreateRadius : level.paperConfig.portalSearchRadius); // Search Radius // Paper - search Radius
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos blockposition, WorldBorder worldborder, int i) {
|
public Optional<BlockUtil.FoundRectangle> findPortalAround(BlockPos blockposition, WorldBorder worldborder, int i) {
|
||||||
|
|
|
@ -55,8 +55,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
public final java.util.concurrent.locks.ReentrantLock fileLock = new java.util.concurrent.locks.ReentrantLock(true); // Paper
|
public final java.util.concurrent.locks.ReentrantLock fileLock = new java.util.concurrent.locks.ReentrantLock(true); // Paper
|
||||||
+ public final Path regionFile; // Paper
|
+ public final Path regionFile; // Paper
|
||||||
|
|
||||||
public RegionFile(Path path, Path path1, boolean dsync) throws IOException {
|
public RegionFile(Path file, Path directory, boolean dsync) throws IOException {
|
||||||
this(path, path1, RegionFileVersion.VERSION_DEFLATE, dsync);
|
this(file, directory, RegionFileVersion.VERSION_DEFLATE, dsync);
|
||||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||||
|
|
||||||
public RegionFile(Path file, Path directory, RegionFileVersion outputChunkStreamVersion, boolean dsync) throws IOException {
|
public RegionFile(Path file, Path directory, RegionFileVersion outputChunkStreamVersion, boolean dsync) throws IOException {
|
||||||
|
|
|
@ -2336,8 +2336,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ //this.flushWorker(); // Paper - nuke IOWorker
|
+ //this.flushWorker(); // Paper - nuke IOWorker
|
||||||
+ this.level.asyncChunkTaskManager.flush(); // Paper - flush to preserve behavior compat with pre-async behaviour
|
+ this.level.asyncChunkTaskManager.flush(); // Paper - flush to preserve behavior compat with pre-async behaviour
|
||||||
} else {
|
} else {
|
||||||
this.visibleChunkMap.values().stream().filter(ChunkHolder::wasAccessibleSinceLastSave).forEach((playerchunk) -> {
|
this.visibleChunkMap.values().forEach(this::saveChunkIfNeeded);
|
||||||
ChunkAccess ichunkaccess = (ChunkAccess) playerchunk.getChunkToSave().getNow(null); // CraftBukkit - decompile error
|
}
|
||||||
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
protected void tick(BooleanSupplier shouldKeepTicking) {
|
protected void tick(BooleanSupplier shouldKeepTicking) {
|
||||||
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
||||||
|
@ -2462,7 +2462,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
|
|
||||||
private void markPositionReplaceable(ChunkPos pos) {
|
private void markPositionReplaceable(ChunkPos pos) {
|
||||||
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||||
return this.tickingGenerated.get();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+ // Paper start - async chunk save for unload
|
+ // Paper start - async chunk save for unload
|
||||||
|
@ -3287,8 +3287,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
protected final RegionBitmap usedSectors;
|
protected final RegionBitmap usedSectors;
|
||||||
+ public final java.util.concurrent.locks.ReentrantLock fileLock = new java.util.concurrent.locks.ReentrantLock(true); // Paper
|
+ public final java.util.concurrent.locks.ReentrantLock fileLock = new java.util.concurrent.locks.ReentrantLock(true); // Paper
|
||||||
|
|
||||||
public RegionFile(Path path, Path path1, boolean dsync) throws IOException {
|
public RegionFile(Path file, Path directory, boolean dsync) throws IOException {
|
||||||
this(path, path1, RegionFileVersion.VERSION_DEFLATE, dsync);
|
this(file, directory, RegionFileVersion.VERSION_DEFLATE, dsync);
|
||||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||||
return (byteCount + 4096 - 1) / 4096;
|
return (byteCount + 4096 - 1) / 4096;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,32 +44,32 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
@@ -0,0 +0,0 @@ public class EntitySection<T extends EntityAccess> {
|
@@ -0,0 +0,0 @@ public class EntitySection<T extends EntityAccess> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(T entityAccess) {
|
public void add(T entity) {
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ if (entityAccess instanceof net.minecraft.world.entity.item.ItemEntity) {
|
+ if (entity instanceof net.minecraft.world.entity.item.ItemEntity) {
|
||||||
+ this.itemCount++;
|
+ this.itemCount++;
|
||||||
+ } else if (entityAccess instanceof net.minecraft.world.Container) {
|
+ } else if (entity instanceof net.minecraft.world.Container) {
|
||||||
+ this.inventoryEntityCount++;
|
+ this.inventoryEntityCount++;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
this.storage.add(entityAccess);
|
this.storage.add(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean remove(T entityAccess) {
|
public boolean remove(T entity) {
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ if (entityAccess instanceof net.minecraft.world.entity.item.ItemEntity) {
|
+ if (entity instanceof net.minecraft.world.entity.item.ItemEntity) {
|
||||||
+ this.itemCount--;
|
+ this.itemCount--;
|
||||||
+ } else if (entityAccess instanceof net.minecraft.world.Container) {
|
+ } else if (entity instanceof net.minecraft.world.Container) {
|
||||||
+ this.inventoryEntityCount--;
|
+ this.inventoryEntityCount--;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
return this.storage.remove(entityAccess);
|
return this.storage.remove(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class EntitySection<T extends EntityAccess> {
|
@@ -0,0 +0,0 @@ public class EntitySection<T extends EntityAccess> {
|
||||||
for(T entityAccess : collection) {
|
for(T entityAccess : collection) {
|
||||||
U entityAccess2 = (U)((EntityAccess)type.tryCast(entityAccess));
|
U entityAccess2 = (U)((EntityAccess)type.tryCast(entityAccess));
|
||||||
if (entityAccess2 != null && entityAccess.getBoundingBox().intersects(aABB)) {
|
if (entityAccess2 != null && entityAccess.getBoundingBox().intersects(box)) {
|
||||||
- action.accept((T)entityAccess2);
|
- action.accept((T)entityAccess2);
|
||||||
+ action.accept(entityAccess2); // Paper - decompile fixes
|
+ action.accept(entityAccess2); // Paper - decompile fixes
|
||||||
}
|
}
|
||||||
|
@ -84,20 +84,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
|
|
||||||
public void getEntities(AABB box, Consumer<T> action) {
|
public void getEntities(AABB box, Consumer<T> action) {
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ this.getEntities(box, action, false);
|
|
||||||
+ }
|
+ }
|
||||||
+ public void getEntities(AABB box, Consumer<T> action, boolean isContainerSearch) {
|
+ public void getEntities(AABB box, Consumer<T> action, boolean isContainerSearch) {
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
this.forEachAccessibleNonEmptySection(box, (entitySection) -> {
|
this.forEachAccessibleNonEmptySection(box, (section) -> {
|
||||||
+ if (isContainerSearch && entitySection.inventoryEntityCount <= 0) return; // Paper
|
+ if (isContainerSearch && section.inventoryEntityCount <= 0) return; // Paper
|
||||||
entitySection.getEntities(box, action);
|
section.getEntities(box, action);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public <U extends T> void getEntities(EntityTypeTest<T, U> filter, AABB box, Consumer<U> action) {
|
public <U extends T> void getEntities(EntityTypeTest<T, U> filter, AABB box, Consumer<U> action) {
|
||||||
this.forEachAccessibleNonEmptySection(box, (entitySection) -> {
|
this.forEachAccessibleNonEmptySection(box, (section) -> {
|
||||||
+ if (filter.getBaseClass() == net.minecraft.world.entity.item.ItemEntity.class && entitySection.itemCount <= 0) return; // Paper
|
+ if (filter.getBaseClass() == net.minecraft.world.entity.item.ItemEntity.class && section.itemCount <= 0) return; // Paper
|
||||||
entitySection.getEntities(filter, box, action);
|
section.getEntities(filter, box, action);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/entity/LevelEntityGetter.java b/src/main/java/net/minecraft/world/level/entity/LevelEntityGetter.java
|
diff --git a/src/main/java/net/minecraft/world/level/entity/LevelEntityGetter.java b/src/main/java/net/minecraft/world/level/entity/LevelEntityGetter.java
|
||||||
|
|
|
@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
int o = j + i * m;
|
int o = j + i * m;
|
||||||
int p = k + i * n;
|
int p = k + i * n;
|
||||||
ChunkPos chunkPos = this.getPotentialFeatureChunk(config, worldSeed, o, p);
|
ChunkPos chunkPos = this.getPotentialFeatureChunk(config, worldSeed, o, p);
|
||||||
+ if (!levelReader.getWorldBorder().isChunkInBounds(chunkPos.x, chunkPos.z)) { continue; } // Paper
|
+ if (!world.getWorldBorder().isChunkInBounds(chunkPos.x, chunkPos.z)) { continue; } // Paper
|
||||||
StructureCheckResult structureCheckResult = structureAccessor.checkStructurePresence(chunkPos, this, skipExistingChunks);
|
StructureCheckResult structureCheckResult = structureAccessor.checkStructurePresence(chunkPos, this, skipExistingChunks);
|
||||||
if (structureCheckResult != StructureCheckResult.START_NOT_PRESENT) {
|
if (structureCheckResult != StructureCheckResult.START_NOT_PRESENT) {
|
||||||
if (!skipExistingChunks && structureCheckResult == StructureCheckResult.START_PRESENT) {
|
if (!skipExistingChunks && structureCheckResult == StructureCheckResult.START_PRESENT) {
|
||||||
|
|
|
@ -9,21 +9,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||||
this.triggerItemUseEffects(this.useItem, 16);
|
this.triggerItemUseEffects(this.useItem, 16);
|
||||||
// CraftBukkit start - fire PlayerItemConsumeEvent
|
// CraftBukkit start - fire PlayerItemConsumeEvent
|
||||||
ItemStack itemstack;
|
ItemStack itemstack;
|
||||||
+ PlayerItemConsumeEvent event = null; // Paper
|
+ PlayerItemConsumeEvent event = null; // Paper
|
||||||
if (this instanceof ServerPlayer) {
|
if (this instanceof ServerPlayer) {
|
||||||
org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.useItem);
|
org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(this.useItem);
|
||||||
- PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem);
|
- PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem);
|
||||||
+ event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem); // Paper
|
+ event = new PlayerItemConsumeEvent((Player) this.getBukkitEntity(), craftItem); // Paper
|
||||||
level.getCraftServer().getPluginManager().callEvent(event);
|
level.getCraftServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||||
} else {
|
} else {
|
||||||
itemstack = this.useItem.finishUsingItem(this.level, this);
|
itemstack = this.useItem.finishUsingItem(this.level, this);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ // Paper start - save the default replacement item and change it if necessary
|
+ // Paper start - save the default replacement item and change it if necessary
|
||||||
+ final ItemStack defaultReplacement = itemstack;
|
+ final ItemStack defaultReplacement = itemstack;
|
||||||
|
@ -31,18 +31,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ itemstack = CraftItemStack.asNMSCopy(event.getReplacement());
|
+ itemstack = CraftItemStack.asNMSCopy(event.getReplacement());
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
if (itemstack != this.useItem) {
|
if (itemstack != this.useItem) {
|
||||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.stopUsingItem();
|
this.stopUsingItem();
|
||||||
+ // Paper start - if the replacement is anything but the default, update the client inventory
|
+ // Paper start - if the replacement is anything but the default, update the client inventory
|
||||||
+ if (this instanceof ServerPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {
|
+ if (this instanceof ServerPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {
|
||||||
+ ((ServerPlayer) this).getBukkitEntity().updateInventory();
|
+ ((ServerPlayer) this).getBukkitEntity().updateInventory();
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,9 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java
|
||||||
+++ b/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> {
|
@@ -0,0 +0,0 @@ public class ClientboundChatPacket implements Packet<ClientGamePacketListener> {
|
||||||
public ClientboundChatPacket(Component message, ChatType location, UUID sender) {
|
public ClientboundChatPacket(Component message, ChatType type, UUID sender) {
|
||||||
this.message = message;
|
this.message = message;
|
||||||
this.type = location;
|
this.type = type;
|
||||||
- this.sender = sender;
|
- this.sender = sender;
|
||||||
+ this.sender = sender != null ? sender : net.minecraft.Util.NIL_UUID;
|
+ this.sender = sender != null ? sender : net.minecraft.Util.NIL_UUID;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||||
level.getCraftServer().getPluginManager().callEvent(event);
|
level.getCraftServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
if (event.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
+ this.stopUsingItem(); // Paper - event is using an item, clear active item to reset its use
|
+ this.stopUsingItem(); // Paper - event is using an item, clear active item to reset its use
|
||||||
// Update client
|
// Update client
|
||||||
((ServerPlayer) this).getBukkitEntity().updateInventory();
|
((ServerPlayer) this).getBukkitEntity().updateInventory();
|
||||||
((ServerPlayer) this).getBukkitEntity().updateScaledHealth();
|
((ServerPlayer) this).getBukkitEntity().updateScaledHealth();
|
||||||
|
|
|
@ -164,8 +164,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
public RegionFile(Path path, Path path1, boolean dsync) throws IOException {
|
public RegionFile(Path file, Path directory, boolean dsync) throws IOException {
|
||||||
this(path, path1, RegionFileVersion.VERSION_DEFLATE, dsync);
|
this(file, directory, RegionFileVersion.VERSION_DEFLATE, dsync);
|
||||||
}
|
}
|
||||||
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
|
||||||
return this.getOffset(pos) != 0;
|
return this.getOffset(pos) != 0;
|
||||||
|
|
|
@ -87,7 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
|
||||||
@@ -0,0 +0,0 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
@@ -0,0 +0,0 @@ public class PistonMovingBlockEntity extends BlockEntity {
|
||||||
if (blockEntity.movedState != null && world.getBlockState(pos).is(Blocks.MOVING_PISTON)) {
|
if (world.getBlockState(pos).is(Blocks.MOVING_PISTON)) {
|
||||||
BlockState blockState = Block.updateFromNeighbourShapes(blockEntity.movedState, world, pos);
|
BlockState blockState = Block.updateFromNeighbourShapes(blockEntity.movedState, world, pos);
|
||||||
if (blockState.isAir()) {
|
if (blockState.isAir()) {
|
||||||
- world.setBlock(pos, blockEntity.movedState, 84);
|
- world.setBlock(pos, blockEntity.movedState, 84);
|
||||||
|
|
|
@ -296,8 +296,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
} catch (Exception var3) {
|
} catch (Exception var3) {
|
||||||
+ if (var3.getCause() instanceof ThreadDeath) throw var3; // Paper
|
+ if (var3.getCause() instanceof ThreadDeath) throw var3; // Paper
|
||||||
LOGGER.fatal("Error executing task on {}", this.name(), var3);
|
LOGGER.fatal("Error executing task on {}", this.name(), var3);
|
||||||
|
throw var3;
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
|
|
|
@ -39,6 +39,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
diff --git a/src/main/java/net/minecraft/core/MappedRegistry.java b/src/main/java/net/minecraft/core/MappedRegistry.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/core/MappedRegistry.java
|
||||||
|
+++ b/src/main/java/net/minecraft/core/MappedRegistry.java
|
||||||
|
@@ -0,0 +0,0 @@ public class MappedRegistry<T> extends WritableRegistry<T> {
|
||||||
|
}
|
||||||
|
|
||||||
|
static record RegistryEntry<T>(ResourceKey<T> key, int id, T value) {
|
||||||
|
- RegistryEntry(ResourceKey<T> key, int rawId, T entry) {
|
||||||
|
- this.key = key;
|
||||||
|
- this.id = rawId;
|
||||||
|
- this.value = entry;
|
||||||
|
- }
|
||||||
|
}
|
||||||
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
|
diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/nbt/ListTag.java
|
--- a/src/main/java/net/minecraft/nbt/ListTag.java
|
||||||
|
@ -126,15 +141,7 @@ diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLoginP
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLoginPacket.java
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLoginPacket.java
|
||||||
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLoginPacket.java
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLoginPacket.java
|
||||||
@@ -0,0 +0,0 @@ import net.minecraft.world.level.GameType;
|
@@ -0,0 +0,0 @@ public record ClientboundLoginPacket(int playerId, boolean hardcore, GameType ga
|
||||||
import net.minecraft.world.level.Level;
|
|
||||||
import net.minecraft.world.level.dimension.DimensionType;
|
|
||||||
|
|
||||||
-public record ClientboundLoginPacket(int playerId, boolean hardcore, GameType gameType, GameType previousGameType, Set<ResourceKey<Level>> levels, RegistryAccess.RegistryHolder registryHolder, DimensionType dimensionType, ResourceKey<Level> dimension, long seed, int maxPlayers, int chunkRadius, int simulationDistance, boolean reducedDebugInfo, boolean showDeathScreen, boolean isDebug, boolean isFlat) implements Packet {
|
|
||||||
+public record ClientboundLoginPacket(int playerId, boolean hardcore, GameType gameType, GameType previousGameType, Set<ResourceKey<Level>> levels, RegistryAccess.RegistryHolder registryHolder, DimensionType dimensionType, ResourceKey<Level> dimension, long seed, int maxPlayers, int chunkRadius, int simulationDistance, boolean reducedDebugInfo, boolean showDeathScreen, boolean isDebug, boolean isFlat) implements Packet<ClientGamePacketListener> { // Paper - fix missing generic
|
|
||||||
public ClientboundLoginPacket(FriendlyByteBuf buf) {
|
|
||||||
this(buf.readInt(), buf.readBoolean(), GameType.byId(buf.readByte()), GameType.byNullableId(buf.readByte()), buf.readCollection(Sets::newHashSetWithExpectedSize, (b) -> {
|
|
||||||
return ResourceKey.create(Registry.DIMENSION_REGISTRY, b.readResourceLocation());
|
|
||||||
}), buf.readWithCodec(RegistryAccess.RegistryHolder.NETWORK_CODEC), buf.readWithCodec(DimensionType.CODEC).get(), ResourceKey.create(Registry.DIMENSION_REGISTRY, buf.readResourceLocation()), buf.readLong(), buf.readVarInt(), buf.readVarInt(), buf.readVarInt(), buf.readBoolean(), buf.readBoolean(), buf.readBoolean(), buf.readBoolean());
|
}), buf.readWithCodec(RegistryAccess.RegistryHolder.NETWORK_CODEC), buf.readWithCodec(DimensionType.CODEC).get(), ResourceKey.create(Registry.DIMENSION_REGISTRY, buf.readResourceLocation()), buf.readLong(), buf.readVarInt(), buf.readVarInt(), buf.readVarInt(), buf.readBoolean(), buf.readBoolean(), buf.readBoolean(), buf.readBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,8 +230,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
- return (entry1.getValue()); // CraftBukkit
|
- return (entry1.getValue()); // CraftBukkit
|
||||||
+ return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* // todo: is this needed anymore?
|
+ return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* // todo: is this needed anymore?
|
||||||
}));
|
}));
|
||||||
|
this.byName = Maps.newHashMap(builder.build()); // CraftBukkit
|
||||||
RecipeManager.LOGGER.info("Loaded {} recipes", map1.size());
|
RecipeManager.LOGGER.info("Loaded {} recipes", map1.size());
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
|
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
|
||||||
|
|
|
@ -5450,18 +5450,15 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/sr
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||||
@@ -0,0 +0,0 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana
|
@@ -0,0 +0,0 @@ import net.minecraft.world.level.storage.LevelData;
|
||||||
import net.minecraft.world.level.storage.DimensionDataStorage;
|
|
||||||
import net.minecraft.world.level.storage.LevelData;
|
|
||||||
import net.minecraft.world.level.storage.LevelStorageSource;
|
import net.minecraft.world.level.storage.LevelStorageSource;
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
+import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper
|
+import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper
|
||||||
+import java.util.function.Function; // Paper
|
+import java.util.function.Function; // Paper
|
||||||
|
|
||||||
public class ServerChunkCache extends ChunkSource {
|
public class ServerChunkCache extends ChunkSource {
|
||||||
+ public static final org.apache.logging.log4j.Logger LOGGER = org.apache.logging.log4j.LogManager.getLogger(); // Paper
|
|
||||||
|
|
||||||
public static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.getStatusList();
|
|
||||||
private final DistanceManager distanceManager;
|
|
||||||
@@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource {
|
@@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource {
|
||||||
@Nullable
|
@Nullable
|
||||||
@VisibleForDebug
|
@VisibleForDebug
|
||||||
|
@ -6480,8 +6477,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
- protected final ChunkPos chunkPos;
|
- protected final ChunkPos chunkPos;
|
||||||
+ protected final ChunkPos chunkPos; public final long coordinateKey; public final int locX; public final int locZ; // Paper - cache coordinate key
|
+ protected final ChunkPos chunkPos; public final long coordinateKey; public final int locX; public final int locZ; // Paper - cache coordinate key
|
||||||
private long inhabitedTime;
|
private long inhabitedTime;
|
||||||
|
/** @deprecated */
|
||||||
@Nullable
|
@Nullable
|
||||||
@Deprecated
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
|
@@ -0,0 +0,0 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
|
||||||
protected final LevelChunkSection[] sections;
|
protected final LevelChunkSection[] sections;
|
||||||
|
|
||||||
|
|
|
@ -43,27 +43,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
@@ -0,0 +0,0 @@ public abstract class BaseSpawner {
|
@@ -0,0 +0,0 @@ public abstract class BaseSpawner {
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompoundTag save(CompoundTag nbttagcompound) {
|
public CompoundTag save(CompoundTag nbt) {
|
||||||
- nbttagcompound.putShort("Delay", (short) this.spawnDelay);
|
- nbt.putShort("Delay", (short) this.spawnDelay);
|
||||||
- nbttagcompound.putShort("MinSpawnDelay", (short) this.minSpawnDelay);
|
- nbt.putShort("MinSpawnDelay", (short) this.minSpawnDelay);
|
||||||
- nbttagcompound.putShort("MaxSpawnDelay", (short) this.maxSpawnDelay);
|
- nbt.putShort("MaxSpawnDelay", (short) this.maxSpawnDelay);
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ if (spawnDelay > Short.MAX_VALUE) {
|
+ if (spawnDelay > Short.MAX_VALUE) {
|
||||||
+ nbttagcompound.putInt("Paper.Delay", this.spawnDelay);
|
+ nbt.putInt("Paper.Delay", this.spawnDelay);
|
||||||
+ }
|
+ }
|
||||||
+ nbttagcompound.putShort("Delay", (short) Math.min(Short.MAX_VALUE, this.spawnDelay));
|
+ nbt.putShort("Delay", (short) Math.min(Short.MAX_VALUE, this.spawnDelay));
|
||||||
+
|
+
|
||||||
+ if (minSpawnDelay > Short.MAX_VALUE || maxSpawnDelay > Short.MAX_VALUE) {
|
+ if (minSpawnDelay > Short.MAX_VALUE || maxSpawnDelay > Short.MAX_VALUE) {
|
||||||
+ nbttagcompound.putInt("Paper.MinSpawnDelay", this.minSpawnDelay);
|
+ nbt.putInt("Paper.MinSpawnDelay", this.minSpawnDelay);
|
||||||
+ nbttagcompound.putInt("Paper.MaxSpawnDelay", this.maxSpawnDelay);
|
+ nbt.putInt("Paper.MaxSpawnDelay", this.maxSpawnDelay);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ nbttagcompound.putShort("MinSpawnDelay", (short) Math.min(Short.MAX_VALUE, this.minSpawnDelay));
|
+ nbt.putShort("MinSpawnDelay", (short) Math.min(Short.MAX_VALUE, this.minSpawnDelay));
|
||||||
+ nbttagcompound.putShort("MaxSpawnDelay", (short) Math.min(Short.MAX_VALUE, this.maxSpawnDelay));
|
+ nbt.putShort("MaxSpawnDelay", (short) Math.min(Short.MAX_VALUE, this.maxSpawnDelay));
|
||||||
+ // Paper end
|
+ // Paper nbt
|
||||||
nbttagcompound.putShort("SpawnCount", (short) this.spawnCount);
|
nbt.putShort("SpawnCount", (short) this.spawnCount);
|
||||||
nbttagcompound.putShort("MaxNearbyEntities", (short) this.maxNearbyEntities);
|
nbt.putShort("MaxNearbyEntities", (short) this.maxNearbyEntities);
|
||||||
nbttagcompound.putShort("RequiredPlayerRange", (short) this.requiredPlayerRange);
|
nbt.putShort("RequiredPlayerRange", (short) this.requiredPlayerRange);
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
||||||
|
|
|
@ -55,19 +55,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
|
--- a/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
|
+++ b/src/main/java/net/minecraft/world/level/block/state/properties/Property.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Property<T extends Comparable<T>> {
|
@@ -0,0 +0,0 @@ public abstract class Property<T extends Comparable<T>> {
|
||||||
}
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals(Object object) {
|
public boolean equals(Object object) {
|
||||||
- if (this == object) {
|
- if (this == object) {
|
||||||
- return true;
|
- return true;
|
||||||
- } else if (!(object instanceof Property)) {
|
- } else if (!(object instanceof Property)) {
|
||||||
- return false;
|
- return false;
|
||||||
- } else {
|
- } else {
|
||||||
- Property<?> iblockstate = (Property) object;
|
- Property<?> property = (Property)object;
|
||||||
-
|
- return this.clazz.equals(property.clazz) && this.name.equals(property.name);
|
||||||
- return this.clazz.equals(iblockstate.clazz) && this.name.equals(iblockstate.name);
|
|
||||||
- }
|
- }
|
||||||
+ return this == object; // Paper
|
+ return this == object; // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
public final int hashCode() {
|
@Override
|
||||||
|
|
|
@ -109,17 +109,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
|
|
||||||
if (!this.getEntityCollisions(entity, box).isEmpty()) {
|
if (!this.getEntityCollisions(entity, box).isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
|
||||||
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
|
||||||
@@ -0,0 +0,0 @@ public final class Shapes {
|
|
||||||
|
|
||||||
if (s < 3) {
|
|
||||||
mutableBlockPos.set(axisCycle, q, r, p);
|
|
||||||
- BlockState blockState = world.getBlockState(mutableBlockPos);
|
|
||||||
+ BlockState blockState = world.getTypeIfLoaded(mutableBlockPos); // Paper
|
|
||||||
+ if (blockState == null) return 0.0D; // Paper
|
|
||||||
if ((s != 1 || blockState.hasLargeCollisionShape()) && (s != 2 || blockState.is(Blocks.MOVING_PISTON))) {
|
|
||||||
initial = blockState.getCollisionShape(world, mutableBlockPos, context).collide(axis3, box.move((double)(-mutableBlockPos.getX()), (double)(-mutableBlockPos.getY()), (double)(-mutableBlockPos.getZ())), initial);
|
|
||||||
if (Math.abs(initial) < 1.0E-7D) {
|
|
||||||
|
|
|
@ -11,16 +11,18 @@ diff --git a/src/main/java/net/minecraft/core/MappedRegistry.java b/src/main/jav
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/core/MappedRegistry.java
|
--- a/src/main/java/net/minecraft/core/MappedRegistry.java
|
||||||
+++ b/src/main/java/net/minecraft/core/MappedRegistry.java
|
+++ b/src/main/java/net/minecraft/core/MappedRegistry.java
|
||||||
@@ -0,0 +0,0 @@ public class MappedRegistry<T> extends WritableRegistry<T> {
|
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
public class MappedRegistry<T> extends WritableRegistry<T> {
|
||||||
protected static final Logger LOGGER = LogManager.getLogger();
|
protected static final Logger LOGGER = LogManager.getLogger();
|
||||||
private final ObjectList<T> byId = new ObjectArrayList(256);
|
- private final ObjectList<T> byId = new ObjectArrayList<>(256);
|
||||||
- private final Object2IntMap<T> toId = (Object2IntMap) Util.make(new Object2IntOpenCustomHashMap(Util.identityStrategy()), (object2intopencustomhashmap) -> {
|
- private final Object2IntMap<T> toId = Util.make(new Object2IntOpenCustomHashMap<>(Util.identityStrategy()), (object2IntOpenCustomHashMap) -> {
|
||||||
- object2intopencustomhashmap.defaultReturnValue(-1);
|
- object2IntOpenCustomHashMap.defaultReturnValue(-1);
|
||||||
- });
|
- });
|
||||||
- private final BiMap<ResourceLocation, T> storage = HashBiMap.create();
|
- private final BiMap<ResourceLocation, T> storage = HashBiMap.create();
|
||||||
- private final BiMap<ResourceKey<T>, T> keyStorage = HashBiMap.create();
|
- private final BiMap<ResourceKey<T>, T> keyStorage = HashBiMap.create();
|
||||||
- private final Map<T, Lifecycle> lifecycles = Maps.newIdentityHashMap();
|
- private final Map<T, Lifecycle> lifecycles = Maps.newIdentityHashMap();
|
||||||
|
+ private final ObjectList<T> byId = new ObjectArrayList(256);
|
||||||
+ private final it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap<T> toId = new it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap<T>(2048);// Paper - use bigger expected size to reduce collisions and direct intent for FastUtil to be identity map
|
+ private final it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap<T> toId = new it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap<T>(2048);// Paper - use bigger expected size to reduce collisions and direct intent for FastUtil to be identity map
|
||||||
+ private final BiMap<ResourceLocation, T> storage = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions
|
+ private final BiMap<ResourceLocation, T> storage = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions
|
||||||
+ private final BiMap<ResourceKey<T>, T> keyStorage = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions
|
+ private final BiMap<ResourceKey<T>, T> keyStorage = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions
|
||||||
|
|
|
@ -45,7 +45,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
+
|
||||||
public ClientboundLevelChunkWithLightPacket(LevelChunk chunk, LevelLightEngine lightProvider, @Nullable BitSet bitSet, @Nullable BitSet bitSet2, boolean bl) {
|
public ClientboundLevelChunkWithLightPacket(LevelChunk chunk, LevelLightEngine lightProvider, @Nullable BitSet skyBits, @Nullable BitSet blockBits, boolean nonEdge) {
|
||||||
ChunkPos chunkPos = chunk.getPos();
|
ChunkPos chunkPos = chunk.getPos();
|
||||||
this.x = chunkPos.x;
|
this.x = chunkPos.x;
|
||||||
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLightUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLightUpdatePacket.java
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLightUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLightUpdatePacket.java
|
||||||
|
|
|
@ -24,8 +24,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
this.openSet.clear();
|
this.openSet.clear();
|
||||||
this.nodeEvaluator.prepare(world, mob);
|
this.nodeEvaluator.prepare(world, mob);
|
||||||
Node node = this.nodeEvaluator.getStart();
|
Node node = this.nodeEvaluator.getStart();
|
||||||
- Map<Target, BlockPos> map = positions.stream().collect(Collectors.toMap((blockPos) -> {
|
- Map<Target, BlockPos> map = positions.stream().collect(Collectors.toMap((pos) -> {
|
||||||
- return this.nodeEvaluator.getGoal((double)blockPos.getX(), (double)blockPos.getY(), (double)blockPos.getZ());
|
- return this.nodeEvaluator.getGoal((double)pos.getX(), (double)pos.getY(), (double)pos.getZ());
|
||||||
- }, Function.identity()));
|
- }, Function.identity()));
|
||||||
+ // Paper start - remove streams - and optimize collection
|
+ // Paper start - remove streams - and optimize collection
|
||||||
+ List<Map.Entry<Target, BlockPos>> map = Lists.newArrayList();
|
+ List<Map.Entry<Target, BlockPos>> map = Lists.newArrayList();
|
||||||
|
|
|
@ -100,9 +100,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ this.onPlace(iblockdata, world, blockposition, iblockdata1, flag);
|
+ this.onPlace(iblockdata, world, blockposition, iblockdata1, flag);
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
|
/** @deprecated */
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
|
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
|
||||||
org.spigotmc.AsyncCatcher.catchOp("block onPlace"); // Spigot
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
|
||||||
|
|
|
@ -25,17 +25,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
this.useItemRemaining = itemstack.getUseDuration();
|
this.useItemRemaining = itemstack.getUseDuration();
|
||||||
if (!this.level.isClientSide) {
|
if (!this.level.isClientSide) {
|
||||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||||
this.releaseUsingItem();
|
this.releaseUsingItem();
|
||||||
} else {
|
} else {
|
||||||
if (!this.useItem.isEmpty() && this.isUsingItem()) {
|
if (!this.useItem.isEmpty() && this.isUsingItem()) {
|
||||||
+ this.startUsingItem(this.getUsedItemHand(), true); // Paper
|
+ this.startUsingItem(this.getUsedItemHand(), true); // Paper
|
||||||
this.triggerItemUseEffects(this.useItem, 16);
|
this.triggerItemUseEffects(this.useItem, 16);
|
||||||
// CraftBukkit start - fire PlayerItemConsumeEvent
|
// CraftBukkit start - fire PlayerItemConsumeEvent
|
||||||
ItemStack itemstack;
|
ItemStack itemstack;
|
||||||
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.stopUsingItem();
|
this.stopUsingItem();
|
||||||
- // Paper start - if the replacement is anything but the default, update the client inventory
|
- // Paper start - if the replacement is anything but the default, update the client inventory
|
||||||
- if (this instanceof ServerPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {
|
- if (this instanceof ServerPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) {
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
|
|
|
@ -139,14 +139,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour {
|
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour {
|
||||||
|
/** @deprecated */
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public boolean canBeReplaced(BlockState state, BlockPlaceContext context) {
|
public boolean canBeReplaced(BlockState state, BlockPlaceContext context) {
|
||||||
- return this.material.isReplaceable() && (context.getItemInHand().isEmpty() || !context.getItemInHand().is(this.asItem()));
|
- return this.material.isReplaceable() && (context.getItemInHand().isEmpty() || !context.getItemInHand().is(this.asItem()));
|
||||||
+ return this.material.isReplaceable() && (context.getItemInHand().isEmpty() || !context.getItemInHand().is(this.asItem())) && (state.isDestroyable() || (context.getPlayer() != null && context.getPlayer().getAbilities().instabuild)); // Paper
|
+ return this.material.isReplaceable() && (context.getItemInHand().isEmpty() || !context.getItemInHand().is(this.asItem())) && (state.isDestroyable() || (context.getPlayer() != null && context.getPlayer().getAbilities().instabuild)); // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
/** @deprecated */
|
||||||
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour {
|
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour {
|
||||||
public Block getBlock() {
|
public Block getBlock() {
|
||||||
return (Block) this.owner;
|
return (Block) this.owner;
|
||||||
|
|
|
@ -82,14 +82,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||||
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
||||||
@@ -0,0 +0,0 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
@@ -0,0 +0,0 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
||||||
Map<RecipeType<?>, Object2ObjectLinkedOpenHashMap<ResourceLocation, Recipe<?>>> map = Maps.newHashMap(); // CraftBukkit
|
Builder<ResourceLocation, Recipe<?>> builder = ImmutableMap.builder();
|
||||||
|
|
||||||
recipes.forEach((irecipe) -> {
|
recipes.forEach((irecipe) -> {
|
||||||
- Map<ResourceLocation, Recipe<?>> map1 = (Map) map.computeIfAbsent(irecipe.getType(), (recipes) -> {
|
- Map<ResourceLocation, Recipe<?>> map1 = (Map) map.computeIfAbsent(irecipe.getType(), (recipes) -> {
|
||||||
+ Map<ResourceLocation, Recipe<?>> map1 = (Map) map.computeIfAbsent(irecipe.getType(), (recipes_) -> { // Paper - remap fix
|
+ Map<ResourceLocation, Recipe<?>> map1 = (Map) map.computeIfAbsent(irecipe.getType(), (recipes_) -> { // Paper - remap fix
|
||||||
return new Object2ObjectLinkedOpenHashMap<>(); // CraftBukkit
|
return new Object2ObjectLinkedOpenHashMap<>(); // CraftBukkit
|
||||||
});
|
});
|
||||||
Recipe<?> irecipe1 = (Recipe) map1.put(irecipe.getId(), irecipe);
|
ResourceLocation minecraftkey = irecipe.getId();
|
||||||
diff --git a/src/test/java/org/bukkit/DyeColorsTest.java b/src/test/java/org/bukkit/DyeColorsTest.java
|
diff --git a/src/test/java/org/bukkit/DyeColorsTest.java b/src/test/java/org/bukkit/DyeColorsTest.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/test/java/org/bukkit/DyeColorsTest.java
|
--- a/src/test/java/org/bukkit/DyeColorsTest.java
|
||||||
|
|
|
@ -194,7 +194,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
- <groupId>org.spigotmc</groupId>
|
- <groupId>org.spigotmc</groupId>
|
||||||
- <artifactId>spigot</artifactId>
|
- <artifactId>spigot</artifactId>
|
||||||
- <packaging>jar</packaging>
|
- <packaging>jar</packaging>
|
||||||
- <version>1.18-pre5-R0.1-SNAPSHOT</version>
|
- <version>1.18-pre8-R0.1-SNAPSHOT</version>
|
||||||
- <name>Spigot</name>
|
- <name>Spigot</name>
|
||||||
- <url>https://www.spigotmc.org/</url>
|
- <url>https://www.spigotmc.org/</url>
|
||||||
-
|
-
|
||||||
|
@ -552,6 +552,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
- <algorithms>
|
- <algorithms>
|
||||||
- <algorithm>SHA-256</algorithm>
|
- <algorithm>SHA-256</algorithm>
|
||||||
- </algorithms>
|
- </algorithms>
|
||||||
|
- <quiet>true</quiet>
|
||||||
- <scopes>
|
- <scopes>
|
||||||
- <scope>compile</scope>
|
- <scope>compile</scope>
|
||||||
- <scope>runtime</scope>
|
- <scope>runtime</scope>
|
||||||
|
|
|
@ -1315,7 +1315,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||||
|
|
||||||
if (!flag1) {
|
if (!savingDisabled) {
|
||||||
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit
|
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit
|
||||||
+ try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper
|
+ try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper
|
||||||
if (progressListener != null) {
|
if (progressListener != null) {
|
||||||
|
|
|
@ -10,11 +10,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
- return String.format(Locale.ROOT, "%s['%s'/%d, l='%s', x=%.2f, y=%.2f, z=%.2f]", this.getClass().getSimpleName(), this.getName().getString(), this.id, this.level == null ? "~NULL~" : this.level.toString(), this.getX(), this.getY(), this.getZ());
|
String s = this.level == null ? "~NULL~" : this.level.toString();
|
||||||
+ return String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cpos=%s, tl=%d, v=%b, rR=%s]", new Object[] { this.getClass().getSimpleName(), this.getName().getString(), Integer.valueOf(this.id), this.uuid.toString(), this.level == null ? "~NULL~" : this.level.toString(), Double.valueOf(this.getX()), Double.valueOf(this.getY()), Double.valueOf(this.getZ()), this.chunkPosition(), this.tickCount, this.valid, this.removalReason}); // Paper - add more information
|
|
||||||
|
- return this.removalReason != null ? String.format(Locale.ROOT, "%s['%s'/%d, l='%s', x=%.2f, y=%.2f, z=%.2f, removed=%s]", this.getClass().getSimpleName(), this.getName().getString(), this.id, s, this.getX(), this.getY(), this.getZ(), this.removalReason) : String.format(Locale.ROOT, "%s['%s'/%d, l='%s', x=%.2f, y=%.2f, z=%.2f]", this.getClass().getSimpleName(), this.getName().getString(), this.id, s, this.getX(), this.getY(), this.getZ());
|
||||||
|
+ return this.removalReason != null ? String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cpos=%s, tl=%d, v=%b, removed=%s]", this.getClass().getSimpleName(), this.getName().getString(), this.id, this.uuid, s, this.getX(), this.getY(), this.getZ(), this.chunkPosition(), this.tickCount, this.valid, this.removalReason) : String.format(Locale.ROOT, "%s['%s'/%d, uuid='%s', l='%s', x=%.2f, y=%.2f, z=%.2f, cpos=%s, tl=%d, v=%b]", this.getClass().getSimpleName(), this.getName().getString(), this.id, this.uuid, s, this.getX(), this.getY(), this.getZ(), this.chunkPosition(), this.tickCount, this.valid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInvulnerableTo(DamageSource damageSource) {
|
public boolean isInvulnerableTo(DamageSource damageSource) {
|
||||||
|
|
17
todo.txt
17
todo.txt
|
@ -6,3 +6,20 @@ Improve Server Thread Pool and Thread Priorities: mojang added a max thread coun
|
||||||
Use Vanilla Minecart Speeds: is this needed?
|
Use Vanilla Minecart Speeds: is this needed?
|
||||||
Handle Oversized Tile Entities: make sure impl is correct
|
Handle Oversized Tile Entities: make sure impl is correct
|
||||||
0467-Optimize-WorldBorder-collision-checks-and-air check first hunk that has been removed
|
0467-Optimize-WorldBorder-collision-checks-and-air check first hunk that has been removed
|
||||||
|
|
||||||
|
Not sure where this needs to go, if anywhere
|
||||||
|
diff --git a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
|
+++ b/src/main/java/net/minecraft/world/phys/shapes/Shapes.java
|
||||||
|
@@ -0,0 +0,0 @@ public final class Shapes {
|
||||||
|
|
||||||
|
if (s < 3) {
|
||||||
|
mutableBlockPos.set(axisCycle, q, r, p);
|
||||||
|
- BlockState blockState = world.getBlockState(mutableBlockPos);
|
||||||
|
+ BlockState blockState = world.getTypeIfLoaded(mutableBlockPos); // Paper
|
||||||
|
+ if (blockState == null) return 0.0D; // Paper
|
||||||
|
if ((s != 1 || blockState.hasLargeCollisionShape()) && (s != 2 || blockState.is(Blocks.MOVING_PISTON))) {
|
||||||
|
initial = blockState.getCollisionShape(world, mutableBlockPos, context).collide(axis3, box.move((double)(-mutableBlockPos.getX()), (double)(-mutableBlockPos.getY()), (double)(-mutableBlockPos.getZ())), initial);
|
||||||
|
if (Math.abs(initial) < 1.0E-7D) {
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8581e449a3490934f8bfa8b36d45842393dc8a20
|
Subproject commit 09c3da501e40b5090cbd93cc91c8e5c49ce053b7
|
|
@ -1 +1 @@
|
||||||
Subproject commit ea30a299e948f5545b0ad042bd8e11716aeaa7f2
|
Subproject commit d25437bce34e0cb0b7c895867183dc949ea41667
|
|
@ -1 +1 @@
|
||||||
Subproject commit a58fde42cc9cd946db4c502a91dfe5cdf314fade
|
Subproject commit 5a39a236c11b6a5a19f8d26b4c5af1f59f16d447
|
|
@ -1 +1 @@
|
||||||
Subproject commit c07753b057d92ef6c0f9ad8e8446f51bcc37604d
|
Subproject commit 7840c2af5f487981d5a2eab4f9e832fdd7cfb298
|
Loading…
Add table
Reference in a new issue