fix allowPermanentBlockBreakExploits config

This commit is contained in:
Lulu13022002 2024-12-18 23:35:47 +01:00
parent c71ada60db
commit 5922e6334b
No known key found for this signature in database
GPG key ID: 491C8F0B8ACDEB01
18 changed files with 31 additions and 50 deletions

View file

@ -786,7 +786,7 @@ index 7c0862c50b44555fb27ce7dc46f4ec95a3eb0022..774ca9e0b56fd175ae246051de762d0c
public void tick() { public void tick() {
super.tick(); super.tick();
diff --git a/net/minecraft/world/entity/vehicle/MinecartHopper.java b/net/minecraft/world/entity/vehicle/MinecartHopper.java diff --git a/net/minecraft/world/entity/vehicle/MinecartHopper.java b/net/minecraft/world/entity/vehicle/MinecartHopper.java
index c553cf0592dfa606dbbb1e6854d3377b9feb5efb..dec705ec57e4f63ef2ccaa87c5400c116aee9b35 100644 index c553cf0592dfa606dbbb1e6854d3377b9feb5efb..8341e7f01606fca90e69384c16fc19bb9e20d1b7 100644
--- a/net/minecraft/world/entity/vehicle/MinecartHopper.java --- a/net/minecraft/world/entity/vehicle/MinecartHopper.java
+++ b/net/minecraft/world/entity/vehicle/MinecartHopper.java +++ b/net/minecraft/world/entity/vehicle/MinecartHopper.java
@@ -47,6 +47,7 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper @@ -47,6 +47,7 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper

View file

@ -7,7 +7,7 @@ Inline bit operations and reduce instruction count to make these hot
operations faster operations faster
diff --git a/net/minecraft/core/BlockPos.java b/net/minecraft/core/BlockPos.java diff --git a/net/minecraft/core/BlockPos.java b/net/minecraft/core/BlockPos.java
index 98f0b1cf19d7a035849a9a2fa25e2be3a4c5a980..0822a0faf7af9e746e7936ac17597b1f51e40a92 100644 index 98f0b1cf19d7a035849a9a2fa25e2be3a4c5a980..a81694a22e94cca6f7110f7d5b205d1303f4e071 100644
--- a/net/minecraft/core/BlockPos.java --- a/net/minecraft/core/BlockPos.java
+++ b/net/minecraft/core/BlockPos.java +++ b/net/minecraft/core/BlockPos.java
@@ -51,15 +51,17 @@ public class BlockPos extends Vec3i { @@ -51,15 +51,17 @@ public class BlockPos extends Vec3i {

View file

@ -25,7 +25,7 @@
Direction direction = state.getValue(FACING); Direction direction = state.getValue(FACING);
+ // Paper start - Protect Bedrock and End Portal/Frames from being destroyed; prevent retracting when we're facing the wrong way (we were replaced before retraction could occur) + // Paper start - Protect Bedrock and End Portal/Frames from being destroyed; prevent retracting when we're facing the wrong way (we were replaced before retraction could occur)
+ Direction directionQueuedAs = Direction.from3DDataValue(param & 7); // Paper - copied from below + Direction directionQueuedAs = Direction.from3DDataValue(param & 7); // Paper - copied from below
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowPermanentBlockBreakExploits && directionQueuedAs != directionQueuedAs) { + if (!io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowPermanentBlockBreakExploits && direction != directionQueuedAs) {
+ return false; + return false;
+ } + }
+ // Paper end - Protect Bedrock and End Portal/Frames from being destroyed + // Paper end - Protect Bedrock and End Portal/Frames from being destroyed

View file

@ -82,7 +82,7 @@
+ long featurePopulationSeed = l; + long featurePopulationSeed = l;
+ final long configFeatureSeed = level.getMinecraftWorld().paperConfig().featureSeeds.features.getLong(placedFeature.feature()); + final long configFeatureSeed = level.getMinecraftWorld().paperConfig().featureSeeds.features.getLong(placedFeature.feature());
+ if (configFeatureSeed != -1) { + if (configFeatureSeed != -1) {
+ featurePopulationSeed = worldgenRandom.setDecorationSeed(configFeatureSeed, blockPos.getX(), blockPos.getZ()); // See seededrandom.setDecorationSeed from above + featurePopulationSeed = worldgenRandom.setDecorationSeed(configFeatureSeed, blockPos.getX(), blockPos.getZ()); // See WorldgenRandom.setDecorationSeed from above
+ } + }
+ worldgenRandom.setFeatureSeed(featurePopulationSeed, i3, i); + worldgenRandom.setFeatureSeed(featurePopulationSeed, i3, i);
+ // Paper end - Configurable feature seeds + // Paper end - Configurable feature seeds

View file

@ -265,7 +265,7 @@
public boolean isEmpty() { public boolean isEmpty() {
return false; return false;
} }
@@ -711,23 +_,25 @@ @@ -711,23 +_,24 @@
if (this.blockEntity.getType().isValid(blockState)) { if (this.blockEntity.getType().isValid(blockState)) {
this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), blockState, this.blockEntity); this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), blockState, this.blockEntity);
this.loggedInvalidBlockState = false; this.loggedInvalidBlockState = false;
@ -278,17 +278,15 @@
- LogUtils.defer(this::getPos), - LogUtils.defer(this::getPos),
- blockState - blockState
- ); - );
- }
+ // Paper start - Remove the Block Entity if it's invalid + // Paper start - Remove the Block Entity if it's invalid
+ } else { + } else {
+ LevelChunk.this.removeBlockEntity(this.getPos()); + LevelChunk.this.removeBlockEntity(this.getPos());
+ if (!this.loggedInvalidBlockState) { + if (!this.loggedInvalidBlockState) {
+ this.loggedInvalidBlockState = true; + this.loggedInvalidBlockState = true;
+ LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new Object[]{LogUtils.defer(this::getType), LogUtils.defer(this::getPos), blockState}); + LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", LogUtils.defer(this::getType), LogUtils.defer(this::getPos), blockState);
+ } + }
+ // Paper end - Remove the Block Entity if it's invalid + // Paper end - Remove the Block Entity if it's invalid
+ } }
+
profilerFiller.pop(); profilerFiller.pop();
} catch (Throwable var5) { } catch (Throwable var5) {

View file

@ -1,13 +1,5 @@
--- a/net/minecraft/world/level/levelgen/structure/structures/MineshaftPieces.java --- a/net/minecraft/world/level/levelgen/structure/structures/MineshaftPieces.java
+++ b/net/minecraft/world/level/levelgen/structure/structures/MineshaftPieces.java +++ b/net/minecraft/world/level/levelgen/structure/structures/MineshaftPieces.java
@@ -8,6 +_,7 @@
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtOps;
+import net.minecraft.nbt.Tag;
import net.minecraft.resources.ResourceKey;
import net.minecraft.tags.BiomeTags;
import net.minecraft.util.RandomSource;
@@ -401,10 +_,13 @@ @@ -401,10 +_,13 @@
BlockPos worldPos = this.getWorldPos(1, 0, i8); BlockPos worldPos = this.getWorldPos(1, 0, i8);
if (box.isInside(worldPos) && this.isInterior(level, 1, 0, i8, box)) { if (box.isInside(worldPos) && this.isInterior(level, 1, 0, i8, box)) {

View file

@ -1,13 +1,5 @@
--- a/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java --- a/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
+++ b/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java +++ b/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
@@ -25,6 +_,7 @@
import net.minecraft.nbt.IntTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.NbtUtils;
+import net.minecraft.nbt.Tag;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.RandomSource;
import net.minecraft.world.Clearable;
@@ -54,6 +_,10 @@ @@ -54,6 +_,10 @@
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.BitSetDiscreteVoxelShape; import net.minecraft.world.phys.shapes.BitSetDiscreteVoxelShape;
@ -143,15 +135,14 @@
return NbtUtils.addCurrentDataVersion(tag); return NbtUtils.addCurrentDataVersion(tag);
} }
@@ -720,6 +_,13 @@ @@ -720,6 +_,12 @@
this.entityInfoList.add(new StructureTemplate.StructureEntityInfo(vec3, blockPos, compound1)); this.entityInfoList.add(new StructureTemplate.StructureEntityInfo(vec3, blockPos, compound1));
} }
} }
+ +
+ // CraftBukkit start - PDC + // CraftBukkit start - PDC
+ Tag base = tag.get("BukkitValues"); + if (tag.get("BukkitValues") instanceof CompoundTag compoundTag) {
+ if (base instanceof CompoundTag) { + this.persistentDataContainer.putAll(compoundTag);
+ this.persistentDataContainer.putAll((CompoundTag) base);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }