Update to Minecraft 1.21.1

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-08-09 07:00:00 +10:00
parent 59b86b9837
commit 921fbc5f60
10 changed files with 27 additions and 53 deletions

View File

@@ -19,7 +19,7 @@
private static final Logger LOGGER = LogUtils.getLogger();
private final TileEntityTypes<?> type;
@Nullable
@@ -62,7 +72,16 @@
@@ -75,7 +85,16 @@
return this.level != null;
}
@@ -37,7 +37,7 @@
public final void loadWithComponents(NBTTagCompound nbttagcompound, HolderLookup.a holderlookup_a) {
this.loadAdditional(nbttagcompound, holderlookup_a);
@@ -102,6 +121,11 @@
@@ -115,6 +134,11 @@
}).ifPresent((nbtbase) -> {
nbttagcompound.merge((NBTTagCompound) nbtbase);
});
@@ -49,7 +49,7 @@
return nbttagcompound;
}
@@ -260,12 +284,18 @@
@@ -276,12 +300,18 @@
}
public final void applyComponents(DataComponentMap datacomponentmap, DataComponentPatch datacomponentpatch) {
@@ -69,7 +69,7 @@
@Nullable
@Override
public <T> T get(DataComponentType<T> datacomponenttype) {
@@ -283,6 +313,10 @@
@@ -299,6 +329,10 @@
DataComponentPatch datacomponentpatch1 = datacomponentpatch.forget(set::contains);
this.components = datacomponentpatch1.split().added();
@@ -80,7 +80,7 @@
}
protected void collectImplicitComponents(DataComponentMap.a datacomponentmap_a) {}
@@ -317,6 +351,15 @@
@@ -333,6 +367,15 @@
}
}

View File

@@ -11,12 +11,8 @@
public class TileEntityBeehive extends TileEntity {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -52,9 +56,10 @@
private static final int MIN_TICKS_BEFORE_REENTERING_HIVE = 400;
private static final int MIN_OCCUPATION_TICKS_NECTAR = 2400;
public static final int MIN_OCCUPATION_TICKS_NECTARLESS = 600;
- private final List<TileEntityBeehive.HiveBee> stored = Lists.newArrayList();
+ private List<TileEntityBeehive.HiveBee> stored = Lists.newArrayList();
@@ -55,6 +59,7 @@
private List<TileEntityBeehive.HiveBee> stored = Lists.newArrayList();
@Nullable
public BlockPosition savedFlowerPos;
+ public int maxBees = 3; // CraftBukkit - allow setting max amount of bees a hive can hold

View File

@@ -1,27 +1,5 @@
--- a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
+++ b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawner.java
@@ -57,16 +57,16 @@
private static final int MAX_MOB_TRACKING_DISTANCE = 47;
private static final int MAX_MOB_TRACKING_DISTANCE_SQR = MathHelper.square(47);
private static final float SPAWNING_AMBIENT_SOUND_CHANCE = 0.02F;
- private final TrialSpawnerConfig normalConfig;
- private final TrialSpawnerConfig ominousConfig;
+ public TrialSpawnerConfig normalConfig; // PAIL - private->public, -final
+ public TrialSpawnerConfig ominousConfig; // PAIL - private->public, -final
private final TrialSpawnerData data;
- private final int requiredPlayerRange;
- private final int targetCooldownLength;
+ public int requiredPlayerRange; // PAIL - private->public, -final
+ public int targetCooldownLength; // PAIL - private->public, -final
public final TrialSpawner.b stateAccessor;
private PlayerDetector playerDetector;
private final PlayerDetector.a entitySelector;
private boolean overridePeacefulAndMobSpawnRule;
- private boolean isOminous;
+ public boolean isOminous; // PAIL - private->public
public Codec<TrialSpawner> codec() {
return RecordCodecBuilder.create((instance) -> {
@@ -219,13 +219,18 @@
}

View File

@@ -68,7 +68,7 @@
iblockdata.onPlace(this.level, blockposition, iblockdata1, flag);
}
@@ -340,7 +357,12 @@
@@ -345,7 +362,12 @@
@Nullable
public TileEntity getBlockEntity(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
@@ -82,7 +82,7 @@
if (tileentity == null) {
NBTTagCompound nbttagcompound = (NBTTagCompound) this.pendingBlockEntities.remove(blockposition);
@@ -412,6 +434,7 @@
@@ -417,6 +439,7 @@
if (!iblockdata.hasBlockEntity()) {
Chunk.LOGGER.warn("Trying to set block entity {} at position {}, but state {} does not allow it", new Object[]{tileentity, blockposition, iblockdata});
@@ -90,7 +90,7 @@
} else {
IBlockData iblockdata1 = tileentity.getBlockState();
@@ -465,6 +488,12 @@
@@ -470,6 +493,12 @@
if (this.isInLevel()) {
TileEntity tileentity = (TileEntity) this.blockEntities.remove(blockposition);
@@ -103,7 +103,7 @@
if (tileentity != null) {
World world = this.level;
@@ -518,6 +547,57 @@
@@ -523,6 +552,57 @@
}
@@ -161,7 +161,7 @@
public boolean isEmpty() {
return false;
}
@@ -713,7 +793,7 @@
@@ -718,7 +798,7 @@
private <T extends TileEntity> void updateBlockEntityTicker(T t0) {
IBlockData iblockdata = t0.getBlockState();
@@ -170,7 +170,7 @@
if (blockentityticker == null) {
this.removeBlockEntityTicker(t0.getBlockPos());
@@ -798,7 +878,7 @@
@@ -803,7 +883,7 @@
private boolean loggedInvalidBlockState;
a(final TileEntity tileentity, final BlockEntityTicker blockentityticker) {