13
0
geforkt von Mirrors/Paper
Dieser Commit ist enthalten in:
Nassim Jahnke 2023-12-06 20:40:37 +01:00
Ursprung b7ab883a24
Commit 42a06e89bb
12 geänderte Dateien mit 58 neuen und 19 gelöschten Zeilen

Datei anzeigen

@ -12,15 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
EntityType entitytypes;
if (tileentity instanceof Spawner) {
+ if (!world.paperConfig().entities.spawning.disableMobSpawnerSpawnEggTransformation) { // Paper - add condition
+ if (world.paperConfig().entities.spawning.disableMobSpawnerSpawnEggTransformation) return InteractionResult.FAIL; // Paper
+
Spawner spawner = (Spawner) tileentity;
entitytypes = this.getType(itemstack.getTag());
@@ -0,0 +0,0 @@ public class SpawnEggItem extends Item {
world.gameEvent((Entity) context.getPlayer(), GameEvent.BLOCK_CHANGE, blockposition);
itemstack.shrink(1);
return InteractionResult.CONSUME;
+ } // Paper - end if
} else {
BlockPos blockposition1;

Datei anzeigen

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
return this.getHandle().clip(new net.minecraft.world.level.ClipContext(start, end, net.minecraft.world.level.ClipContext.Block.COLLIDER, net.minecraft.world.level.ClipContext.Fluid.NONE, null)).getType() == net.minecraft.world.phys.HitResult.Type.MISS;
return this.getHandle().clip(new net.minecraft.world.level.ClipContext(start, end, net.minecraft.world.level.ClipContext.Block.COLLIDER, net.minecraft.world.level.ClipContext.Fluid.NONE, net.minecraft.world.phys.shapes.CollisionContext.empty())).getType() == net.minecraft.world.phys.HitResult.Type.MISS;
}
+
+ @Override

Datei anzeigen

@ -58,7 +58,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ net.minecraft.network.chat.Component promptComponent = resourcePackPrompt != null ?
+ io.papermc.paper.adventure.PaperAdventure.asVanilla(resourcePackPrompt) :
+ null;
+ this.getHandle().connection.send(new ClientboundResourcePackPacket(url, hash, required, promptComponent));
+ this.getHandle().connection.send(new ClientboundResourcePackPushPacket(UUID.randomUUID(), url, hash, required, promptComponent));
+ }
+
+ @Override

Datei anzeigen

@ -91,7 +91,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Remove collideRule team if it exists
+ if (this.collideRuleTeamName != null) {
+ final Scoreboard scoreboard = this.getServer().getLevel(Level.OVERWORLD).getScoreboard();
+ final net.minecraft.world.scores.Scoreboard scoreboard = this.getServer().getLevel(Level.OVERWORLD).getScoreboard();
+ final PlayerTeam team = scoreboard.getPlayersTeam(this.collideRuleTeamName);
+ if (team != null) scoreboard.removePlayerTeam(team);
+ }

Datei anzeigen

@ -115,13 +115,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
ServerChunkCache.ChunkAndHolder chunkproviderserver_a = (ServerChunkCache.ChunkAndHolder) iterator1.next();
LevelChunk chunk1 = chunkproviderserver_a.chunk;
@@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource {
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
this.level.timings.doTickTiles.startTiming(); // Spigot
this.level.tickChunk(chunk1, l);
+ if ((chunksTicked++ & 1) == 0) net.minecraft.server.MinecraftServer.getServer().executeMidTickTasks(); // Paper
this.level.timings.doTickTiles.stopTiming(); // Spigot
}
}
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java

Datei anzeigen

@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
boolean flag = this.tickRateManager().runsNormally();
int tilesThisCycle = 0;
+ var toRemove = new it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet<TickingBlockEntity>(net.minecraft.Util.identityStrategy()); // Paper - use removeAll
+ var toRemove = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<TickingBlockEntity>(); // Paper - use removeAll
+ toRemove.add(null);
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;

Datei anzeigen

@ -76,3 +76,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
aiblockdata[k] = iblockdata2;
if (k == i) {
world.scheduleTick(pos, block, 10);
@@ -0,0 +0,0 @@ public class TripWireHookBlock extends Block {
// CraftBukkit end
TripWireHookBlock.emitState(world, pos, flag4, flag5, flag2, flag3);
- if (!flag) {
+ if (!beingRemoved) { // Paper
if (world.getBlockState(pos).getBlock() == Blocks.TRIPWIRE_HOOK) // Paper - validate
world.setBlock(pos, (BlockState) iblockdata3.setValue(TripWireHookBlock.FACING, enumdirection), 3);
if (flag1) {

Datei anzeigen

@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return false; // Return early if the distance is greater than 128 blocks
+ }
+
+ return this.getHandle().clip(new net.minecraft.world.level.ClipContext(start, end, net.minecraft.world.level.ClipContext.Block.COLLIDER, net.minecraft.world.level.ClipContext.Fluid.NONE, null)).getType() == net.minecraft.world.phys.HitResult.Type.MISS;
+ return this.getHandle().clip(new net.minecraft.world.level.ClipContext(start, end, net.minecraft.world.level.ClipContext.Block.COLLIDER, net.minecraft.world.level.ClipContext.Fluid.NONE, net.minecraft.world.phys.shapes.CollisionContext.empty())).getType() == net.minecraft.world.phys.HitResult.Type.MISS;
+ }
// Paper end
}

Datei anzeigen

@ -350,10 +350,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
+ if (true || this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) { // Paper - optimise chunk tick iteration
this.level.timings.doTickTiles.startTiming(); // Spigot
this.level.tickChunk(chunk1, l);
if ((chunksTicked++ & 1) == 0) net.minecraft.server.MinecraftServer.getServer().executeMidTickTasks(); // Paper
@@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource {
}
}
}

Datei anzeigen

@ -20102,6 +20102,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
@Override
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
CrashReportCategory crashreportsystemdetails = super.fillReportDetails(report);
crashreportsystemdetails.setDetail("Loaded entity count", () -> {
- return String.valueOf(this.entityManager.count());
+ return String.valueOf(this.entityLookup.getAllCopy().length); // Paper
});
return crashreportsystemdetails;
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java

Datei anzeigen

@ -24899,6 +24899,14 @@ diff --git a/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java
+++ b/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java
@@ -0,0 +0,0 @@ import com.mojang.datafixers.DataFixer;
import com.mojang.logging.LogUtils;
import com.mojang.serialization.DataResult;
import com.mojang.serialization.Dynamic;
+import com.mojang.serialization.DynamicOps;
import com.mojang.serialization.Lifecycle;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
@@ -0,0 +0,0 @@ public class LevelStorageSource {
static Dynamic<?> readLevelDataTagFixed(Path path, DataFixer dataFixer) throws IOException {
CompoundTag nbttagcompound = LevelStorageSource.readLevelDataTagRaw(path);
@ -24908,10 +24916,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
Dynamic<?> dynamic = DataFixTypes.LEVEL.updateToCurrentVersion(dataFixer, new Dynamic(NbtOps.INSTANCE, nbttagcompound1), i);
Dynamic<?> dynamic1 = dynamic.get("Player").orElseEmptyMap();
- Dynamic<?> dynamic2 = DataFixTypes.PLAYER.updateToCurrentVersion(dataFixer, dynamic1, i);
+ Dynamic<?> dynamic2 = ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.PLAYER, dynamic1, version, SharedConstants.getCurrentVersion().getDataVersion().getVersion()); // Paper
+ Dynamic<?> dynamic2 = LevelStorageSource.dank(dynamic1, version); // Paper
dynamic = dynamic.set("Player", dynamic2);
Dynamic<?> dynamic3 = dynamic.get("WorldGenSettings").orElseEmptyMap();
@@ -0,0 +0,0 @@ public class LevelStorageSource {
return dynamic;
}
+ // Paper start
+ private static <T> Dynamic<T> dank(final Dynamic<T> input, final int version) {
+ return new Dynamic<>(input.getOps(), (T) ca.spottedleaf.dataconverter.minecraft.MCDataConverter.convertTag(ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.PLAYER, (CompoundTag)input.getValue(), version, net.minecraft.SharedConstants.getCurrentVersion().getDataVersion().getVersion()));
+ }
+ // Paper end
+
private LevelSummary readLevelSummary(LevelStorageSource.LevelDirectory save, boolean locked) {
Path path = save.dataFile();
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java

Datei anzeigen

@ -1095,6 +1095,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.lastSpawnState = spawnercreature_d;
gameprofilerfiller.popPush("spawnAndTick");
@@ -0,0 +0,0 @@ public class ServerChunkCache extends ChunkSource {
}
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
- this.level.timings.doTickTiles.startTiming(); // Spigot
this.level.tickChunk(chunk1, l);
- this.level.timings.doTickTiles.stopTiming(); // Spigot
}
}
}
gameprofilerfiller.popPush("customSpawners");
if (flag) {