mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 02:25:28 +01:00
694
This commit is contained in:
parent
fc5c0dae7f
commit
90095cd7c4
@ -6,7 +6,7 @@ Subject: [PATCH] Implement regenerateChunk
|
||||
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 5d5e5e811d065411e5def069533e8f9ab974ed55..558d95381bca2f950824748b05e59e4ced7347c3 100644
|
||||
index 5b404c9f923fd4f1822dbb2ff25b24157c0a8fe5..2c7b94719fb815025f73e8cf98cb0323b9375923 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -151,6 +151,7 @@ import org.jetbrains.annotations.Nullable;
|
@ -8,10 +8,10 @@ snow bucket didn't revert grass that became snowy because of the
|
||||
placement.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index d5ee83e6538fbd067388272fa9895e17859be642..a8f1953da3a5684079fb0cdb88cb3caf72d43646 100644
|
||||
index 29a463ebceabf2d7ae22c26178f969cf1c1e5a21..2616a8fedcf67b395f1a7c9ef26ab7a34e38bb41 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -380,7 +380,7 @@ public final class ItemStack {
|
||||
@@ -393,7 +393,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
int oldCount = this.getCount();
|
||||
ServerLevel world = (ServerLevel) context.getLevel();
|
||||
|
||||
@ -20,7 +20,7 @@ index d5ee83e6538fbd067388272fa9895e17859be642..a8f1953da3a5684079fb0cdb88cb3caf
|
||||
world.captureBlockStates = true;
|
||||
// special case bonemeal
|
||||
if (item == Items.BONE_MEAL) {
|
||||
@@ -440,7 +440,7 @@ public final class ItemStack {
|
||||
@@ -453,7 +453,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
world.capturedBlockStates.clear();
|
||||
if (blocks.size() > 1) {
|
||||
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
@ -6,10 +6,10 @@ Subject: [PATCH] Add missing Validate calls to CraftServer#getSpawnLimit
|
||||
Copies appropriate checks from CraftWorld#getSpawnLimit
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 76b9f6c0c754be69c1369aa3c13f7ca1f56e9e13..a64109dfa8f33812c243ad50c673a5ef043559c0 100644
|
||||
index ab031edcac3865b85637cc9d5b8a939acdc904e4..09f2b0351e4a43ad6bf5a0fa94e092f5343c5eb3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2294,6 +2294,8 @@ public final class CraftServer implements Server {
|
||||
@@ -2306,6 +2306,8 @@ public final class CraftServer implements Server {
|
||||
@Override
|
||||
public int getSpawnLimit(SpawnCategory spawnCategory) {
|
||||
// Paper start - Add mobcaps commands
|
@ -46,10 +46,10 @@ index 0000000000000000000000000000000000000000..e7d9fd2702a1ce96596580fff8f5ee4f
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index a64109dfa8f33812c243ad50c673a5ef043559c0..ddf3ce680bc8c69647a89ee46fd1547e566a61b8 100644
|
||||
index 09f2b0351e4a43ad6bf5a0fa94e092f5343c5eb3..aa386074cf4ea6cc47e591d4611bfb1fbf9644b9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2715,6 +2715,15 @@ public final class CraftServer implements Server {
|
||||
@@ -2732,6 +2732,15 @@ public final class CraftServer implements Server {
|
||||
return (org.bukkit.Tag<T>) new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey);
|
||||
}
|
||||
}
|
||||
@ -65,7 +65,7 @@ index a64109dfa8f33812c243ad50c673a5ef043559c0..ddf3ce680bc8c69647a89ee46fd1547e
|
||||
default -> throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
@@ -2747,6 +2756,13 @@ public final class CraftServer implements Server {
|
||||
@@ -2764,6 +2773,13 @@ public final class CraftServer implements Server {
|
||||
net.minecraft.core.Registry<EntityType<?>> entityTags = BuiltInRegistries.ENTITY_TYPE;
|
||||
return entityTags.getTags().map(pair -> (org.bukkit.Tag<T>) new CraftEntityTag(entityTags, pair.getFirst())).collect(ImmutableList.toImmutableList());
|
||||
}
|
@ -9,10 +9,10 @@ This might result in chunks loading far slower in the nether,
|
||||
for example.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index e367711dc3ef96280fe672f02e2ce99e43a5cd3c..f32bddb777082e7db307c4691b88e037926174b5 100644
|
||||
index 3832033003dbf5f5b43b9786b5fd4c965764cc9f..6036939ff03516a16aecf67ec9cf2260531ad83b 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1296,6 +1296,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1346,6 +1346,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
if (super.pollTask()) {
|
||||
return true;
|
||||
} else {
|
||||
@ -20,7 +20,7 @@ index e367711dc3ef96280fe672f02e2ce99e43a5cd3c..f32bddb777082e7db307c4691b88e037
|
||||
if (this.tickRateManager.isSprinting() || this.haveTime()) {
|
||||
Iterator iterator = this.getAllLevels().iterator();
|
||||
|
||||
@@ -1303,12 +1304,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1353,12 +1354,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
ServerLevel worldserver = (ServerLevel) iterator.next();
|
||||
|
||||
if (worldserver.getChunkSource().pollTask()) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Furnace RecipesUsed API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
|
||||
index f98cf44e929d326037e1089dafe4f82c6f6d8647..e48208d511353913b96d81e0960e56deaadff11a 100644
|
||||
index ddbbf977c8f536a156ff6b2462353f7be5ab5742..677d8bc8fcfbb987378b4fbe1a57935786b612fb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java
|
||||
@@ -100,5 +100,37 @@ public abstract class CraftFurnace<T extends AbstractFurnaceBlockEntity> extends
|
||||
@@ -104,5 +104,37 @@ public abstract class CraftFurnace<T extends AbstractFurnaceBlockEntity> extends
|
||||
snapshot.cookSpeedMultiplier = multiplier;
|
||||
snapshot.cookingTotalTime = AbstractFurnaceBlockEntity.getTotalCookTime(this.isPlaced() ? this.world.getHandle() : null, snapshot.recipeType, snapshot, snapshot.cookSpeedMultiplier); // Update the snapshot's current total cook time to scale with the newly set multiplier
|
||||
}
|
@ -7,10 +7,10 @@ Subject: [PATCH] Configurable sculk sensor listener range
|
||||
public-f net.minecraft.world.level.gameevent.vibrations.VibrationListener listenerRange
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/CalibratedSculkSensorBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CalibratedSculkSensorBlockEntity.java
|
||||
index 4c9c35131e9bd37a48f6c4beb2bbcaf7988069c5..cf865dcfde2ae6c0ae72a8e7469be2dd3e1bc679 100644
|
||||
index 41ccbee5fc7767a7d5e1cdca0ec7d9a17ee80a90..1d28f117965da22694b12018923a5f1347905085 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/CalibratedSculkSensorBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/CalibratedSculkSensorBlockEntity.java
|
||||
@@ -19,6 +19,12 @@ public class CalibratedSculkSensorBlockEntity extends SculkSensorBlockEntity {
|
||||
@@ -20,6 +20,12 @@ public class CalibratedSculkSensorBlockEntity extends SculkSensorBlockEntity {
|
||||
public VibrationSystem.User createVibrationUser() {
|
||||
return new CalibratedSculkSensorBlockEntity.VibrationUser(this.getBlockPos());
|
||||
}
|
||||
@ -22,8 +22,8 @@ index 4c9c35131e9bd37a48f6c4beb2bbcaf7988069c5..cf865dcfde2ae6c0ae72a8e7469be2dd
|
||||
+ // Paper end - Configurable sculk sensor listener range
|
||||
|
||||
protected class VibrationUser extends SculkSensorBlockEntity.VibrationUser {
|
||||
public VibrationUser(BlockPos pos) {
|
||||
@@ -27,6 +33,7 @@ public class CalibratedSculkSensorBlockEntity extends SculkSensorBlockEntity {
|
||||
public VibrationUser(final BlockPos pos) {
|
||||
@@ -28,6 +34,7 @@ public class CalibratedSculkSensorBlockEntity extends SculkSensorBlockEntity {
|
||||
|
||||
@Override
|
||||
public int getListenerRadius() {
|
||||
@ -32,10 +32,10 @@ index 4c9c35131e9bd37a48f6c4beb2bbcaf7988069c5..cf865dcfde2ae6c0ae72a8e7469be2dd
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java
|
||||
index fd791916336032e29aae83a2ff5d956bc18f2938..a08a59192cd01789b4aff9af6d0f1d4c27bb4fe1 100644
|
||||
index afef108d11b4ed9ad9ce6069dd0d549720f3cb27..0c25d8b107b95e36e25f48dd82321b0961e468ea 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java
|
||||
@@ -23,6 +23,7 @@ public class SculkSensorBlockEntity extends BlockEntity implements GameEventList
|
||||
@@ -25,6 +25,7 @@ public class SculkSensorBlockEntity extends BlockEntity implements GameEventList
|
||||
private final VibrationSystem.Listener vibrationListener;
|
||||
private final VibrationSystem.User vibrationUser = this.createVibrationUser();
|
||||
public int lastVibrationFrequency;
|
||||
@ -43,7 +43,7 @@ index fd791916336032e29aae83a2ff5d956bc18f2938..a08a59192cd01789b4aff9af6d0f1d4c
|
||||
|
||||
protected SculkSensorBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
|
||||
super(type, pos, state);
|
||||
@@ -48,8 +49,16 @@ public class SculkSensorBlockEntity extends BlockEntity implements GameEventList
|
||||
@@ -50,8 +51,16 @@ public class SculkSensorBlockEntity extends BlockEntity implements GameEventList
|
||||
.resultOrPartial(LOGGER::error)
|
||||
.ifPresent(listener -> this.vibrationData = listener);
|
||||
}
|
||||
@ -58,9 +58,9 @@ index fd791916336032e29aae83a2ff5d956bc18f2938..a08a59192cd01789b4aff9af6d0f1d4c
|
||||
|
||||
+ protected static final String PAPER_LISTENER_RANGE_NBT_KEY = "Paper.ListenerRange"; // Paper - Configurable sculk sensor listener range
|
||||
@Override
|
||||
protected void saveAdditional(CompoundTag nbt) {
|
||||
super.saveAdditional(nbt);
|
||||
@@ -58,7 +67,13 @@ public class SculkSensorBlockEntity extends BlockEntity implements GameEventList
|
||||
protected void saveAdditional(CompoundTag nbt, HolderLookup.Provider registryLookup) {
|
||||
super.saveAdditional(nbt, registryLookup);
|
||||
@@ -60,7 +69,13 @@ public class SculkSensorBlockEntity extends BlockEntity implements GameEventList
|
||||
.encodeStart(NbtOps.INSTANCE, this.vibrationData)
|
||||
.resultOrPartial(LOGGER::error)
|
||||
.ifPresent(listenerNbt -> nbt.put("listener", listenerNbt));
|
||||
@ -74,7 +74,7 @@ index fd791916336032e29aae83a2ff5d956bc18f2938..a08a59192cd01789b4aff9af6d0f1d4c
|
||||
|
||||
@Override
|
||||
public VibrationSystem.Data getVibrationData() {
|
||||
@@ -95,6 +110,7 @@ public class SculkSensorBlockEntity extends BlockEntity implements GameEventList
|
||||
@@ -97,6 +112,7 @@ public class SculkSensorBlockEntity extends BlockEntity implements GameEventList
|
||||
|
||||
@Override
|
||||
public int getListenerRadius() {
|
||||
@ -83,12 +83,12 @@ index fd791916336032e29aae83a2ff5d956bc18f2938..a08a59192cd01789b4aff9af6d0f1d4c
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSculkSensor.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSculkSensor.java
|
||||
index 0e5e316b6c76c3929cca037eddf52120767862ff..c796a1754385edabe115088ebb5aa2f44cfa657a 100644
|
||||
index 70d85dbfcaae7ee632a4f541334302b46615a254..6ba229afb0219ff229fd794c59d7585f010742ee 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSculkSensor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSculkSensor.java
|
||||
@@ -30,4 +30,17 @@ public class CraftSculkSensor<T extends SculkSensorBlockEntity> extends CraftBlo
|
||||
public CraftSculkSensor<T> copy() {
|
||||
return new CraftSculkSensor<>(this);
|
||||
@@ -36,4 +36,17 @@ public class CraftSculkSensor<T extends SculkSensorBlockEntity> extends CraftBlo
|
||||
public CraftSculkSensor<T> copy(Location location) {
|
||||
return new CraftSculkSensor<>(this, location);
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
@ -10,13 +10,13 @@ just looking at the LevelStem key, look at the DimensionType key which
|
||||
is one level below that. Defaults to off to keep vanilla behavior.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index f32bddb777082e7db307c4691b88e037926174b5..3255929982ef8e494d654144753a54d3a76229d9 100644
|
||||
index 6036939ff03516a16aecf67ec9cf2260531ad83b..644f178438863295754c2b72339ce7f9066674b9 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -617,7 +617,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -628,7 +628,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.commandStorage = new CommandStorage(worldpersistentdata);
|
||||
} else {
|
||||
ChunkProgressListener worldloadlistener = this.progressListenerFactory.create(11);
|
||||
ChunkProgressListener worldloadlistener = this.progressListenerFactory.create(this.worldData.getGameRules().getInt(GameRules.RULE_SPAWN_CHUNK_RADIUS));
|
||||
- world = new ServerLevel(this, this.executor, worldSession, iworlddataserver, worldKey, worlddimension, worldloadlistener, flag, j, ImmutableList.of(), true, this.overworld().getRandomSequences(), org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider);
|
||||
+ // Paper start - option to use the dimension_type to check if spawners should be added. I imagine mojang will add some datapack-y way of managing this in the future.
|
||||
+ final List<CustomSpawner> spawners;
|
@ -7,10 +7,10 @@ Some parts of legacy conversion will need the overworld
|
||||
to get the legacy structure data storage
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 3255929982ef8e494d654144753a54d3a76229d9..041ba5fd85748b3183e12e7a8e10fca77eb35bf5 100644
|
||||
index 644f178438863295754c2b72339ce7f9066674b9..ea442883eda28e5673cef9470145d5c40ac66159 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -629,9 +629,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -640,9 +640,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
|
||||
@ -23,10 +23,10 @@ index 3255929982ef8e494d654144753a54d3a76229d9..041ba5fd85748b3183e12e7a8e10fca7
|
||||
|
||||
if (worlddata.getCustomBossEvents() != null) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index ddf3ce680bc8c69647a89ee46fd1547e566a61b8..f629991fa998d4dab89ed5c3d26b1b7a4f85b5cb 100644
|
||||
index aa386074cf4ea6cc47e591d4611bfb1fbf9644b9..489fe1078a954ae7dd7133938bfd338d5fdeea5b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1295,10 +1295,11 @@ public final class CraftServer implements Server {
|
||||
@@ -1301,10 +1301,11 @@ public final class CraftServer implements Server {
|
||||
return null;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ This excludes hanging entities, as this fix caused problematic behavior due to t
|
||||
position field.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index d2c2075fb0378fd7ec148281d37d886c77a78ce8..40949825392281c2f7c756007781c672ec24665d 100644
|
||||
index 19a7d0ab2ee5494149dfb0503b7c69784b7bee8b..f355dd986bf861da3edb90d7e05f901e19686fef 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -171,7 +171,7 @@ public class ServerEntity {
|
Loading…
Reference in New Issue
Block a user