Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@c7714bbf Update PlayerPostRespawnEvent to include full location data (#13237)
PaperMC/Paper@9d427a5e [ci/skip] Enable unpick (#13241)
PaperMC/Paper@13e9c107 [ci/skip] Update mache for new unpick definitions
PaperMC/Paper@9934c173 Set chunk loading radius to 0 in PlayerSpawnFinder
This commit is contained in:
granny
2025-10-30 21:48:23 -07:00
parent ffe2f809fe
commit 3d61a21422
65 changed files with 714 additions and 706 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -446,6 +_,12 @@
@@ -447,6 +_,12 @@
if (d < 0.0) {
double damagePerBlock = serverLevel1.getWorldBorder().getDamagePerBlock();
if (damagePerBlock > 0.0) {
@@ -13,16 +13,16 @@
this.hurtServer(serverLevel1, this.damageSources().outOfBorder(), Math.max(1, Mth.floor(-d * damagePerBlock)));
}
}
@@ -461,7 +_,7 @@
@@ -462,7 +_,7 @@
if (this.shouldTakeDrowningDamage()) {
this.setAirSupply(0);
serverLevel1.broadcastEntityEvent(this, (byte)67);
serverLevel1.broadcastEntityEvent(this, EntityEvent.DROWN_PARTICLES);
- this.hurtServer(serverLevel1, this.damageSources().drown(), 2.0F);
+ this.hurtServer(serverLevel1, this.damageSources().drown(), (float) this.level().purpurConfig.damageFromDrowning); // Purpur - Drowning Settings
}
} else if (this.getAirSupply() < this.getMaxAirSupply()) {
this.setAirSupply(this.increaseAirSupply(this.getAirSupply()));
@@ -521,7 +_,7 @@
@@ -522,7 +_,7 @@
}
protected boolean shouldTakeDrowningDamage() {
@@ -31,7 +31,7 @@
}
@Override
@@ -1045,14 +_,32 @@
@@ -1046,14 +_,32 @@
if (lookingEntity != null) {
ItemStack itemBySlot = this.getItemBySlot(EquipmentSlot.HEAD);
EntityType<?> type = lookingEntity.getType();
@@ -72,7 +72,7 @@
return d;
}
@@ -1099,6 +_,7 @@
@@ -1100,6 +_,7 @@
Iterator<MobEffectInstance> iterator = this.activeEffects.values().iterator();
while (iterator.hasNext()) {
MobEffectInstance effect = iterator.next();
@@ -80,7 +80,7 @@
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
if (event.isCancelled()) {
continue;
@@ -1423,6 +_,24 @@
@@ -1424,6 +_,24 @@
this.stopSleeping();
}
@@ -105,7 +105,7 @@
this.noActionTime = 0;
if (amount < 0.0F) {
amount = 0.0F;
@@ -1685,10 +_,10 @@
@@ -1686,10 +_,10 @@
protected Player resolvePlayerResponsibleForDamage(DamageSource damageSource) {
Entity entity = damageSource.getEntity();
if (entity instanceof Player player) {
@@ -118,7 +118,7 @@
} else {
this.lastHurtByPlayer = null;
this.lastHurtByPlayerMemoryTime = 0;
@@ -1739,6 +_,18 @@
@@ -1740,6 +_,18 @@
}
}
@@ -137,7 +137,7 @@
final org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
final EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
event.setCancelled(itemStack == null);
@@ -1920,6 +_,7 @@
@@ -1921,6 +_,7 @@
boolean flag = this.lastHurtByPlayerMemoryTime > 0;
this.dropEquipment(level); // CraftBukkit - from below
if (this.shouldDropLoot(level)) {
@@ -145,7 +145,7 @@
this.dropFromLootTable(level, damageSource, flag);
// Paper start
final boolean prev = this.clearEquipmentSlots;
@@ -1928,6 +_,7 @@
@@ -1929,6 +_,7 @@
// Paper end
this.dropCustomDeathLoot(level, damageSource, flag);
this.clearEquipmentSlots = prev; // Paper
@@ -153,7 +153,7 @@
}
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
@@ -3146,6 +_,7 @@
@@ -3149,6 +_,7 @@
float f = (float)(d * 10.0 - 3.0);
if (f > 0.0F) {
this.playSound(this.getFallDamageSound((int)f), 1.0F, 1.0F);
@@ -161,7 +161,7 @@
this.hurt(this.damageSources().flyIntoWall(), f);
}
}
@@ -4545,6 +_,12 @@
@@ -4548,6 +_,12 @@
? slot == EquipmentSlot.MAINHAND && this.canUseSlot(EquipmentSlot.MAINHAND)
: slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.getType());
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
+++ b/net/minecraft/world/entity/ai/goal/RunAroundLikeCrazyGoal.java
@@ -58,7 +_,7 @@
@@ -59,7 +_,7 @@
if (firstPassenger instanceof Player player) {
int temper = this.horse.getTemper();
int maxTemper = this.horse.getMaxTemper();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/ambient/Bat.java
+++ b/net/minecraft/world/entity/ambient/Bat.java
@@ -233,7 +_,7 @@
@@ -234,7 +_,7 @@
} else {
int maxLocalRawBrightness = level.getMaxLocalRawBrightness(pos);
int i = 4;
@@ -9,7 +9,7 @@
i = 7;
} else if (randomSource.nextBoolean()) {
return false;
@@ -245,6 +_,7 @@
@@ -246,6 +_,7 @@
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/Animal.java
+++ b/net/minecraft/world/entity/animal/Animal.java
@@ -141,7 +_,7 @@
@@ -142,7 +_,7 @@
ItemStack itemInHand = player.getItemInHand(hand);
if (this.isFood(itemInHand)) {
int age = this.getAge();
@@ -9,7 +9,7 @@
final ItemStack breedCopy = itemInHand.copy(); // Paper - Fix EntityBreedEvent copying
this.usePlayerItem(player, hand, itemInHand);
this.setInLove(serverPlayer, breedCopy); // Paper - Fix EntityBreedEvent copying
@@ -223,10 +_,20 @@
@@ -224,10 +_,20 @@
public void spawnChildFromBreeding(ServerLevel level, Animal partner) {
AgeableMob breedOffspring = this.getBreedOffspring(level, partner);
if (breedOffspring != null) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/Bee.java
+++ b/net/minecraft/world/entity/animal/Bee.java
@@ -170,7 +_,7 @@
@@ -171,7 +_,7 @@
// Paper end - Fix MC-167279
this.lookControl = new Bee.BeeLookControl(this);
this.setPathfindingMalus(PathType.DANGER_FIRE, -1.0F);
@@ -9,7 +9,7 @@
this.setPathfindingMalus(PathType.WATER_BORDER, 16.0F);
this.setPathfindingMalus(PathType.COCOA, -1.0F);
this.setPathfindingMalus(PathType.FENCE, -1.0F);
@@ -366,7 +_,7 @@
@@ -367,7 +_,7 @@
}
public static boolean isNightOrRaining(Level level) {
@@ -18,7 +18,7 @@
}
public void setStayOutOfHiveCountdown(int stayOutOfHiveCountdown) {
@@ -389,7 +_,7 @@
@@ -390,7 +_,7 @@
@Override
protected void customServerAiStep(ServerLevel level) {
boolean hasStung = this.hasStung();
@@ -27,7 +27,7 @@
this.underWaterTicks++;
} else {
this.underWaterTicks = 0;
@@ -399,6 +_,7 @@
@@ -400,6 +_,7 @@
this.hurtServer(level, this.damageSources().drown(), 1.0F);
}
@@ -35,7 +35,7 @@
if (hasStung) {
this.timeSinceSting++;
if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, 1, 1200)) == 0) {
@@ -1138,6 +_,7 @@
@@ -1139,6 +_,7 @@
Bee.this.savedFlowerPos = optional.get();
Bee.this.navigation
.moveTo(Bee.this.savedFlowerPos.getX() + 0.5, Bee.this.savedFlowerPos.getY() + 0.5, Bee.this.savedFlowerPos.getZ() + 0.5, 1.2F);
@@ -43,7 +43,7 @@
return true;
} else {
Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60);
@@ -1184,6 +_,7 @@
@@ -1185,6 +_,7 @@
this.pollinating = false;
Bee.this.navigation.stop();
Bee.this.remainingCooldownBeforeLocatingNewFlower = 200;
@@ -51,7 +51,7 @@
}
@Override
@@ -1230,6 +_,7 @@
@@ -1231,6 +_,7 @@
this.setWantedPos();
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/Cat.java
+++ b/net/minecraft/world/entity/animal/Cat.java
@@ -354,6 +_,14 @@
@@ -355,6 +_,14 @@
return this.isTame() && otherAnimal instanceof Cat cat && cat.isTame() && super.canMate(otherAnimal);
}
@@ -15,7 +15,7 @@
@Nullable
@Override
public SpawnGroupData finalizeSpawn(
@@ -452,7 +_,7 @@
@@ -453,7 +_,7 @@
}
private void tryToTame(Player player) {
@@ -23,4 +23,4 @@
+ if (((this.level().purpurConfig.alwaysTameInCreative && player.hasInfiniteMaterials()) || this.random.nextInt(3) == 0) && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) { // CraftBukkit // Purpur - Config to always tame in Creative
this.tame(player);
this.setOrderedToSit(true);
this.level().broadcastEntityEvent(this, (byte)7);
this.level().broadcastEntityEvent(this, EntityEvent.TAMING_SUCCEEDED);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/Dolphin.java
+++ b/net/minecraft/world/entity/animal/Dolphin.java
@@ -74,6 +_,7 @@
@@ -75,6 +_,7 @@
private static final boolean DEFAULT_GOT_FISH = false;
@Nullable
public BlockPos treasurePos;
@@ -8,7 +8,7 @@
public Dolphin(EntityType<? extends Dolphin> type, Level level) {
super(type, level);
@@ -90,6 +_,7 @@
@@ -91,6 +_,7 @@
this.setAirSupply(this.getMaxAirSupply());
this.setXRot(0.0F);
SpawnGroupData spawnGroupData1 = Objects.requireNonNullElseGet(spawnGroupData, () -> new AgeableMob.AgeableMobGroupData(0.1F));
@@ -16,7 +16,7 @@
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData1);
}
@@ -156,17 +_,19 @@
@@ -157,17 +_,19 @@
protected void registerGoals() {
this.goalSelector.addGoal(0, new BreathAirGoal(this));
this.goalSelector.addGoal(0, new TryFindWaterGoal(this));
@@ -37,7 +37,7 @@
}
public static AttributeSupplier.Builder createAttributes() {
@@ -399,6 +_,7 @@
@@ -400,6 +_,7 @@
@Override
public boolean canUse() {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/Fox.java
+++ b/net/minecraft/world/entity/animal/Fox.java
@@ -346,6 +_,11 @@
@@ -348,6 +_,11 @@
}
private void setTargetGoals() {
@@ -12,7 +12,7 @@
if (this.getVariant() == Fox.Variant.RED) {
this.targetSelector.addGoal(4, this.landTargetGoal);
this.targetSelector.addGoal(4, this.turtleEggTargetGoal);
@@ -373,6 +_,7 @@
@@ -375,6 +_,7 @@
public void setVariant(Fox.Variant variant) {
this.entityData.set(DATA_TYPE_ID, variant.getId());
@@ -20,7 +20,7 @@
}
@Nullable
@@ -702,6 +_,29 @@
@@ -704,6 +_,29 @@
return slot == EquipmentSlot.MAINHAND;
}
// Paper end

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/IronGolem.java
+++ b/net/minecraft/world/entity/animal/IronGolem.java
@@ -58,13 +_,26 @@
@@ -59,13 +_,26 @@
private int remainingPersistentAngerTime;
@Nullable
private UUID persistentAngerTarget;
@@ -27,7 +27,7 @@
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0, true));
this.goalSelector.addGoal(2, new MoveTowardsTargetGoal(this, 0.9, 32.0F));
this.goalSelector.addGoal(2, new MoveBackToVillageGoal(this, 0.6, false));
@@ -142,6 +_,7 @@
@@ -143,6 +_,7 @@
protected void addAdditionalSaveData(ValueOutput output) {
super.addAdditionalSaveData(output);
output.putBoolean("PlayerCreated", this.isPlayerCreated());
@@ -35,7 +35,7 @@
this.addPersistentAngerSaveData(output);
}
@@ -149,6 +_,7 @@
@@ -150,6 +_,7 @@
protected void readAdditionalSaveData(ValueInput input) {
super.readAdditionalSaveData(input);
this.setPlayerCreated(input.getBooleanOr("PlayerCreated", false));
@@ -43,7 +43,7 @@
this.readPersistentAngerSaveData(this.level(), input);
}
@@ -268,6 +_,7 @@
@@ -269,6 +_,7 @@
float f = 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F;
this.playSound(SoundEvents.IRON_GOLEM_REPAIR, 1.0F, f);
itemInHand.consume(1, player);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/Ocelot.java
+++ b/net/minecraft/world/entity/animal/Ocelot.java
@@ -234,7 +_,7 @@
@@ -235,7 +_,7 @@
public boolean checkSpawnObstruction(LevelReader level) {
if (level.isUnobstructed(this) && !level.containsAnyLiquid(this.getBoundingBox())) {
BlockPos blockPos = this.blockPosition();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/Parrot.java
+++ b/net/minecraft/world/entity/animal/Parrot.java
@@ -159,6 +_,7 @@
@@ -160,6 +_,7 @@
protected void registerGoals() {
this.goalSelector.addGoal(0, new TamableAnimal.TamableAnimalPanicGoal(1.25));
this.goalSelector.addGoal(0, new FloatGoal(this));
@@ -8,16 +8,16 @@
this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(2, new SitWhenOrderedToGoal(this));
this.goalSelector.addGoal(2, new FollowOwnerGoal(this, 1.0, 5.0F, 1.0F));
@@ -264,7 +_,7 @@
@@ -265,7 +_,7 @@
}
if (!this.level().isClientSide()) {
- if (this.random.nextInt(10) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) { // CraftBukkit
+ if (((this.level().purpurConfig.alwaysTameInCreative && player.hasInfiniteMaterials()) || this.random.nextInt(10) == 0) && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) { // CraftBukkit // Purpur - Config to always tame in Creative
this.tame(player);
this.level().broadcastEntityEvent(this, (byte)7);
this.level().broadcastEntityEvent(this, EntityEvent.TAMING_SUCCEEDED);
} else {
@@ -272,6 +_,7 @@
@@ -273,6 +_,7 @@
}
}
@@ -25,7 +25,7 @@
return InteractionResult.SUCCESS;
} else if (!itemInHand.is(ItemTags.PARROT_POISONOUS_FOOD)) {
if (!this.isFlying() && this.isTame() && this.isOwnedBy(player)) {
@@ -296,7 +_,7 @@
@@ -297,7 +_,7 @@
@Override
public boolean isFood(ItemStack stack) {
@@ -34,7 +34,7 @@
}
public static boolean checkParrotSpawnRules(
@@ -311,13 +_,13 @@
@@ -312,13 +_,13 @@
@Override
public boolean canMate(Animal otherAnimal) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/Rabbit.java
+++ b/net/minecraft/world/entity/animal/Rabbit.java
@@ -404,10 +_,23 @@
@@ -406,10 +_,23 @@
}
this.setVariant(randomRabbitVariant);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/Squid.java
+++ b/net/minecraft/world/entity/animal/Squid.java
@@ -46,10 +_,29 @@
@@ -47,10 +_,29 @@
public Squid(EntityType<? extends Squid> type, Level level) {
super(type, level);
@@ -31,7 +31,7 @@
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new Squid.SquidRandomMovementGoal(this));
@@ -127,6 +_,7 @@
@@ -128,6 +_,7 @@
}
if (this.isInWater()) {
@@ -39,7 +39,7 @@
if (this.tentacleMovement < (float) Math.PI) {
float f = this.tentacleMovement / (float) Math.PI;
this.tentacleAngle = Mth.sin(f * f * (float) Math.PI) * (float) Math.PI * 0.25F;
@@ -308,7 +_,7 @@
@@ -309,7 +_,7 @@
int noActionTime = this.squid.getNoActionTime();
if (noActionTime > 100) {
this.squid.movementVector = Vec3.ZERO;

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/coppergolem/CopperGolem.java
+++ b/net/minecraft/world/entity/animal/coppergolem/CopperGolem.java
@@ -84,6 +_,7 @@
@@ -86,6 +_,7 @@
private final AnimationState interactionDropItemAnimationState = new AnimationState();
private final AnimationState interactionDropNoItemAnimationState = new AnimationState();
public static final EquipmentSlot EQUIPMENT_SLOT_ANTENNA = EquipmentSlot.SADDLE;
@@ -8,7 +8,7 @@
public CopperGolem(EntityType<? extends AbstractGolem> type, Level level) {
super(type, level);
@@ -97,6 +_,17 @@
@@ -99,6 +_,17 @@
this.getBrain().setMemory(MemoryModuleType.TRANSPORT_ITEMS_COOLDOWN_TICKS, this.getRandom().nextInt(60, 100));
}
@@ -26,7 +26,7 @@
public static AttributeSupplier.Builder createAttributes() {
return Mob.createMobAttributes().add(Attributes.MOVEMENT_SPEED, 0.2F).add(Attributes.STEP_HEIGHT, 1.0).add(Attributes.MAX_HEALTH, 12.0);
}
@@ -172,6 +_,7 @@
@@ -174,6 +_,7 @@
super.addAdditionalSaveData(output);
output.putLong("next_weather_age", this.nextWeatheringTick);
output.store("weather_state", WeatheringCopper.WeatherState.CODEC, this.getWeatherState());
@@ -34,7 +34,7 @@
}
@Override
@@ -179,6 +_,7 @@
@@ -181,6 +_,7 @@
super.readAdditionalSaveData(input);
this.nextWeatheringTick = input.getLongOr("next_weather_age", -1L);
this.setWeatherState(input.read("weather_state", WeatheringCopper.WeatherState.CODEC).orElse(WeatheringCopper.WeatherState.UNAFFECTED));

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
@@ -389,6 +_,7 @@
@@ -390,6 +_,7 @@
// Paper start - Goat ram API
public void ram(net.minecraft.world.entity.LivingEntity entity) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/wolf/Wolf.java
+++ b/net/minecraft/world/entity/animal/wolf/Wolf.java
@@ -99,6 +_,37 @@
@@ -100,6 +_,37 @@
EntityType<?> type = entity.getType();
return type == EntityType.SHEEP || type == EntityType.RABBIT || type == EntityType.FOX;
};
@@ -38,7 +38,7 @@
private static final float START_HEALTH = 8.0F;
private static final float TAME_HEALTH = 40.0F;
private static final float ARMOR_REPAIR_UNIT = 0.125F;
@@ -121,12 +_,47 @@
@@ -122,12 +_,47 @@
this.setPathfindingMalus(PathType.DANGER_POWDER_SNOW, -1.0F);
}
@@ -86,7 +86,7 @@
this.goalSelector.addGoal(4, new LeapAtTargetGoal(this, 0.4F));
this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1.0, true));
this.goalSelector.addGoal(6, new FollowOwnerGoal(this, 1.0, 10.0F, 2.0F));
@@ -139,7 +_,7 @@
@@ -140,7 +_,7 @@
this.targetSelector.addGoal(2, new OwnerHurtTargetGoal(this));
this.targetSelector.addGoal(3, new HurtByTargetGoal(this).setAlertOthers());
this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt));
@@ -95,7 +95,7 @@
this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR));
this.targetSelector.addGoal(7, new NearestAttackableTargetGoal<>(this, AbstractSkeleton.class, false));
this.targetSelector.addGoal(8, new ResetUniversalAngerTargetGoal<>(this, true));
@@ -230,6 +_,7 @@
@@ -231,6 +_,7 @@
protected void addAdditionalSaveData(ValueOutput output) {
super.addAdditionalSaveData(output);
output.store("CollarColor", DyeColor.LEGACY_ID_CODEC, this.getCollarColor());
@@ -103,7 +103,7 @@
VariantUtils.writeVariant(output, this.getVariant());
this.addPersistentAngerSaveData(output);
this.getSoundVariant()
@@ -244,6 +_,10 @@
@@ -245,6 +_,10 @@
super.readAdditionalSaveData(input);
VariantUtils.readVariant(input, Registries.WOLF_VARIANT).ifPresent(this::setVariant);
this.setCollarColor(input.read("CollarColor", DyeColor.LEGACY_ID_CODEC).orElse(DEFAULT_COLLAR_COLOR));
@@ -114,7 +114,7 @@
this.readPersistentAngerSaveData(this.level(), input);
input.read("sound_variant", ResourceKey.codec(Registries.WOLF_SOUND_VARIANT))
.flatMap(resourceKey -> this.registryAccess().lookupOrThrow(Registries.WOLF_SOUND_VARIANT).get((ResourceKey<WolfSoundVariant>)resourceKey))
@@ -268,6 +_,10 @@
@@ -269,6 +_,10 @@
}
this.setSoundVariant(WolfSoundVariants.pickRandomSoundVariant(this.registryAccess(), level.getRandom()));
@@ -125,7 +125,7 @@
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData);
}
@@ -318,6 +_,11 @@
@@ -319,6 +_,11 @@
public void tick() {
super.tick();
if (this.isAlive()) {
@@ -137,7 +137,7 @@
this.interestedAngleO = this.interestedAngle;
if (this.isInterested()) {
this.interestedAngle = this.interestedAngle + (1.0F - this.interestedAngle) * 0.4F;
@@ -519,13 +_,27 @@
@@ -520,13 +_,27 @@
itemInHand.consume(1, player);
this.tryToTame(player);
return InteractionResult.SUCCESS_SERVER;

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -961,6 +_,7 @@
@@ -962,6 +_,7 @@
@Override
protected boolean canRide(Entity entity) {
@@ -8,7 +8,7 @@
return false;
}
@@ -996,7 +_,7 @@
@@ -997,7 +_,7 @@
boolean flag = level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT);
int i = 500;

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/net/minecraft/world/entity/boss/wither/WitherBoss.java
@@ -79,6 +_,7 @@
@@ -80,6 +_,7 @@
private static final TargetingConditions.Selector LIVING_ENTITY_SELECTOR = (entity, level) -> !entity.getType().is(EntityTypeTags.WITHER_FRIENDS)
&& entity.attackable();
private static final TargetingConditions TARGETING_CONDITIONS = TargetingConditions.forCombat().range(20.0).selector(LIVING_ENTITY_SELECTOR);
@@ -8,7 +8,7 @@
public WitherBoss(EntityType<? extends WitherBoss> type, Level level) {
super(type, level);
@@ -87,6 +_,17 @@
@@ -88,6 +_,17 @@
this.xpReward = 50;
}
@@ -26,7 +26,7 @@
@Override
protected PathNavigation createNavigation(Level level) {
FlyingPathNavigation flyingPathNavigation = new FlyingPathNavigation(this, level);
@@ -119,6 +_,7 @@
@@ -120,6 +_,7 @@
protected void addAdditionalSaveData(ValueOutput output) {
super.addAdditionalSaveData(output);
output.putInt("Invul", this.getInvulnerableTicks());
@@ -34,7 +34,7 @@
}
@Override
@@ -128,6 +_,7 @@
@@ -129,6 +_,7 @@
if (this.hasCustomName()) {
this.bossEvent.setName(this.getDisplayName());
}
@@ -42,7 +42,7 @@
}
@Override
@@ -271,7 +_,7 @@
@@ -272,7 +_,7 @@
level.explode(this, this.getX(), this.getEyeY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB);
}
// CraftBukkit end
@@ -51,7 +51,7 @@
// CraftBukkit start - Use relative location for far away sounds
// level.globalLevelEvent(1023, this.blockPosition(), 0);
int viewDistance = level.getCraftServer().getViewDistance() * 16;
@@ -378,8 +_,10 @@
@@ -379,8 +_,10 @@
}
}
@@ -64,7 +64,7 @@
}
this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth());
@@ -576,6 +_,7 @@
@@ -577,6 +_,7 @@
@Override
protected boolean canRide(Entity entity) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -91,10 +_,13 @@
@@ -92,10 +_,13 @@
public boolean canTickSetByAPI = false;
private boolean noTickEquipmentDirty = false;
// Paper end - Allow ArmorStands not to tick
@@ -14,7 +14,7 @@
}
public ArmorStand(Level level, double x, double y, double z) {
@@ -521,6 +_,7 @@
@@ -522,6 +_,7 @@
// Paper start - Allow ArmorStands not to tick
@Override
public void tick() {
@@ -22,7 +22,7 @@
if (!this.canTick) {
if (this.noTickEquipmentDirty) {
this.noTickEquipmentDirty = false;
@@ -811,4 +_,18 @@
@@ -812,4 +_,18 @@
}
}
// Paper end

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/Ghast.java
+++ b/net/minecraft/world/entity/monster/Ghast.java
@@ -155,6 +_,11 @@
@@ -156,6 +_,11 @@
public static boolean checkGhastSpawnRules(
EntityType<Ghast> entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random
) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/Guardian.java
+++ b/net/minecraft/world/entity/monster/Guardian.java
@@ -314,6 +_,11 @@
@@ -315,6 +_,11 @@
public static boolean checkGuardianSpawnRules(
EntityType<? extends Guardian> entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random
) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/Phantom.java
+++ b/net/minecraft/world/entity/monster/Phantom.java
@@ -169,7 +_,11 @@
@@ -170,7 +_,11 @@
ServerLevelAccessor level, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData spawnGroupData
) {
this.anchorPoint = this.blockPosition().above(5);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/Ravager.java
+++ b/net/minecraft/world/entity/monster/Ravager.java
@@ -74,6 +_,7 @@
@@ -75,6 +_,7 @@
protected void registerGoals() {
super.registerGoals();
this.goalSelector.addGoal(0, new FloatGoal(this));
@@ -8,7 +8,7 @@
this.goalSelector.addGoal(4, new MeleeAttackGoal(this, 1.0, true));
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 0.4));
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
@@ -154,7 +_,7 @@
@@ -155,7 +_,7 @@
)) {
BlockState blockState = serverLevel.getBlockState(blockPos);
Block block = blockState.getBlock();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/Skeleton.java
+++ b/net/minecraft/world/entity/monster/Skeleton.java
@@ -129,4 +_,64 @@
@@ -130,4 +_,64 @@
SoundEvent getStepSound() {
return SoundEvents.SKELETON_STEP;
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/Zombie.java
+++ b/net/minecraft/world/entity/monster/Zombie.java
@@ -116,7 +_,19 @@
@@ -117,7 +_,19 @@
this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0));
this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setAlertOthers(ZombifiedPiglin.class));
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
@@ -21,7 +21,7 @@
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true));
this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR));
}
@@ -550,10 +_,7 @@
@@ -551,10 +_,7 @@
}
if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
@@ -138,10 +_,10 @@
@@ -140,10 +_,10 @@
public InteractionResult mobInteract(Player player, InteractionHand hand) {
ItemStack itemInHand = player.getItemInHand(hand);
if (itemInHand.is(Items.GOLDEN_APPLE)) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
@@ -200,6 +_,11 @@
@@ -201,6 +_,11 @@
public static boolean checkHoglinSpawnRules(
EntityType<Hoglin> entityType, LevelAccessor level, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random
) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/npc/Villager.java
+++ b/net/minecraft/world/entity/npc/Villager.java
@@ -178,6 +_,8 @@
@@ -179,6 +_,8 @@
MemoryModuleType.MEETING_POINT,
(villager, poiType) -> poiType.is(PoiTypes.MEETING)
);
@@ -9,7 +9,7 @@
public Villager(EntityType<? extends Villager> type, Level level) {
this(type, level, VillagerType.PLAINS);
@@ -196,6 +_,57 @@
@@ -197,6 +_,57 @@
this.setVillagerData(this.getVillagerData().withType(villagerType).withProfession(level.registryAccess(), VillagerProfession.NONE));
}
@@ -67,7 +67,7 @@
@Override
public Brain<Villager> getBrain() {
return (Brain<Villager>)super.getBrain();
@@ -292,11 +_,22 @@
@@ -293,11 +_,22 @@
// Paper start - EAR 2
this.customServerAiStep(level, false);
}
@@ -92,7 +92,7 @@
profilerFiller.pop();
if (this.assignProfessionWhenSpawned) {
this.assignProfessionWhenSpawned = false;
@@ -368,6 +_,7 @@
@@ -369,6 +_,7 @@
return InteractionResult.CONSUME;
}
@@ -100,7 +100,7 @@
this.startTrading(player);
}
@@ -504,7 +_,7 @@
@@ -505,7 +_,7 @@
public void updateDemand() {
for (MerchantOffer merchantOffer : this.getOffers()) {
@@ -109,7 +109,7 @@
}
}
@@ -697,7 +_,7 @@
@@ -698,7 +_,7 @@
@Override
public boolean canBreed() {
@@ -118,7 +118,7 @@
}
private boolean hungry() {
@@ -922,6 +_,7 @@
@@ -923,6 +_,7 @@
}
public void spawnGolemIfNeeded(ServerLevel level, long gameTime, int minVillagerAmount) {
@@ -126,7 +126,7 @@
if (this.wantsToSpawnGolem(gameTime)) {
AABB aabb = this.getBoundingBox().inflate(10.0, 10.0, 10.0);
List<Villager> entitiesOfClass = level.getEntitiesOfClass(Villager.class, aabb);
@@ -989,6 +_,12 @@
@@ -990,6 +_,12 @@
@Override
public void startSleeping(BlockPos pos) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
@@ -180,11 +_,20 @@
@@ -181,11 +_,20 @@
private int currentImpulseContextResetGraceTime = 0;
public boolean affectsSpawning = true; // Paper - Affects Spawning API
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
@@ -21,7 +21,7 @@
@Override
public org.bukkit.craftbukkit.entity.CraftHumanEntity getBukkitEntity() {
return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity();
@@ -246,6 +_,12 @@
@@ -247,6 +_,12 @@
@Override
public void tick() {
@@ -34,7 +34,7 @@
this.noPhysics = this.isSpectator();
if (this.isSpectator() || this.isPassenger()) {
this.setOnGround(false);
@@ -301,6 +_,17 @@
@@ -302,6 +_,17 @@
this.turtleHelmetTick();
}
@@ -52,7 +52,7 @@
this.cooldowns.tick();
this.updatePlayerPose();
if (this.currentImpulseContextResetGraceTime > 0) {
@@ -512,7 +_,7 @@
@@ -513,7 +_,7 @@
List<Entity> list = Lists.newArrayList();
for (Entity entity : entities) {
@@ -61,7 +61,7 @@
list.add(entity);
} else if (!entity.isRemoved()) {
this.touch(entity);
@@ -1074,7 +_,7 @@
@@ -1075,7 +_,7 @@
flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits
if (flag2) {
damageSource = damageSource.critical(); // Paper - critical damage API
@@ -70,7 +70,7 @@
}
float f2 = f + f1;
@@ -1674,7 +_,23 @@
@@ -1675,7 +_,23 @@
@Override
protected int getBaseExperienceReward(ServerLevel level) {
@@ -95,7 +95,7 @@
}
@Override
@@ -1717,6 +_,13 @@
@@ -1718,6 +_,13 @@
public boolean addItem(ItemStack stack) {
return this.inventory.add(stack);
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/projectile/Snowball.java
+++ b/net/minecraft/world/entity/projectile/Snowball.java
@@ -52,9 +_,39 @@
@@ -53,9 +_,39 @@
protected void onHitEntity(EntityHitResult result) {
super.onHitEntity(result);
Entity entity = result.getEntity();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/inventory/AnvilMenu.java
+++ b/net/minecraft/world/inventory/AnvilMenu.java
@@ -21,6 +_,12 @@
@@ -23,6 +_,12 @@
import net.minecraft.world.level.block.state.BlockState;
import org.slf4j.Logger;
@@ -13,7 +13,7 @@
public class AnvilMenu extends ItemCombinerMenu {
public static final int INPUT_SLOT = 0;
public static final int ADDITIONAL_SLOT = 1;
@@ -50,6 +_,10 @@
@@ -52,6 +_,10 @@
private org.bukkit.craftbukkit.inventory.view.CraftAnvilView bukkitEntity;
// CraftBukkit end
public boolean bypassEnchantmentLevelRestriction = false; // Paper - bypass anvil level restrictions
@@ -24,7 +24,7 @@
public AnvilMenu(int containerId, Inventory playerInventory) {
this(containerId, playerInventory, ContainerLevelAccess.NULL);
@@ -75,12 +_,17 @@
@@ -77,12 +_,17 @@
@Override
protected boolean mayPickup(Player player, boolean hasStack) {
@@ -43,7 +43,7 @@
player.giveExperienceLevels(-this.cost.get());
}
@@ -133,13 +_,19 @@
@@ -135,13 +_,19 @@
@Override
public void createResult() {
@@ -64,7 +64,7 @@
ItemStack itemStack = item.copy();
ItemStack item1 = this.inputSlots.getItem(1);
ItemEnchantments.Mutable mutable = new ItemEnchantments.Mutable(EnchantmentHelper.getEnchantmentsForCrafting(itemStack));
@@ -197,23 +_,34 @@
@@ -199,23 +_,34 @@
int intValue = entry.getIntValue();
intValue = level == intValue ? intValue + 1 : Math.max(intValue, level);
Enchantment enchantment = holder.value();
@@ -103,7 +103,7 @@
intValue = enchantment.getMaxLevel();
}
@@ -242,6 +_,54 @@
@@ -244,6 +_,54 @@
if (!this.itemName.equals(item.getHoverName().getString())) {
i1 = 1;
i += i1;
@@ -158,7 +158,7 @@
itemStack.set(DataComponents.CUSTOM_NAME, Component.literal(this.itemName));
}
} else if (item.has(DataComponents.CUSTOM_NAME)) {
@@ -266,6 +_,12 @@
@@ -268,6 +_,12 @@
this.onlyRenaming = true;
}
@@ -171,7 +171,7 @@
if (this.cost.get() >= this.maximumRepairCost && !this.player.hasInfiniteMaterials()) { // CraftBukkit
itemStack = ItemStack.EMPTY;
}
@@ -286,6 +_,13 @@
@@ -288,6 +_,13 @@
org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(this.getBukkitView(), itemStack); // CraftBukkit
this.broadcastChanges();
@@ -185,7 +185,7 @@
} else {
org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(this.getBukkitView(), ItemStack.EMPTY); // CraftBukkit
this.cost.set(AnvilMenu.DEFAULT_DENIED_COST); // CraftBukkit - use a variable for set a cost for denied item
@@ -294,7 +_,7 @@
@@ -296,7 +_,7 @@
}
public static int calculateIncreasedRepairCost(int oldRepairCost) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/inventory/GrindstoneMenu.java
+++ b/net/minecraft/world/inventory/GrindstoneMenu.java
@@ -91,11 +_,13 @@
@@ -92,11 +_,13 @@
@Override
public void onTake(Player player, ItemStack stack) {
access.execute((level, blockPos) -> {
@@ -15,7 +15,7 @@
// Paper end - Fire BlockExpEvent on grindstone use
}
@@ -124,7 +_,7 @@
@@ -125,7 +_,7 @@
for (Entry<Holder<Enchantment>> entry : enchantmentsForCrafting.entrySet()) {
Holder<Enchantment> holder = entry.getKey();
int intValue = entry.getIntValue();
@@ -24,7 +24,7 @@
i += holder.value().getMinCost(intValue);
}
}
@@ -202,15 +_,75 @@
@@ -203,15 +_,75 @@
for (Entry<Holder<Enchantment>> entry : enchantmentsForCrafting.entrySet()) {
Holder<Enchantment> holder = entry.getKey();
@@ -102,7 +102,7 @@
if (item.is(Items.ENCHANTED_BOOK) && itemEnchantments.isEmpty()) {
item = item.transmuteCopy(Items.BOOK);
}
@@ -222,6 +_,23 @@
@@ -223,6 +_,23 @@
}
item.set(DataComponents.REPAIR_COST, i);
@@ -126,7 +126,7 @@
return item;
}
@@ -278,7 +_,9 @@
@@ -279,7 +_,9 @@
return ItemStack.EMPTY;
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/item/AxeItem.java
+++ b/net/minecraft/world/item/AxeItem.java
@@ -64,13 +_,15 @@
@@ -65,13 +_,15 @@
if (playerHasBlockingItemUseIntent(context)) {
return InteractionResult.PASS;
} else {
@@ -18,14 +18,14 @@
return InteractionResult.PASS;
}
// Paper end
@@ -78,8 +_,15 @@
@@ -79,8 +_,15 @@
CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, clickedPos, itemInHand);
}
- level.setBlock(clickedPos, optional.get(), 11);
- level.setBlock(clickedPos, optional.get(), Block.UPDATE_ALL_IMMEDIATE);
- level.gameEvent(GameEvent.BLOCK_CHANGE, clickedPos, GameEvent.Context.of(player, optional.get()));
+ // Purpur start - Tool actionable options
+ level.setBlock(clickedPos, state, 11);
+ level.setBlock(clickedPos, state, Block.UPDATE_ALL_IMMEDIATE);
+ actionable.drops().forEach((drop, chance) -> {
+ if (level.random.nextDouble() < chance) {
+ Block.popResourceFromFace(level, clickedPos, context.getClickedFace(), new ItemStack(drop));
@@ -36,7 +36,7 @@
if (player != null) {
itemInHand.hurtAndBreak(1, player, context.getHand().asEquipmentSlot());
}
@@ -96,21 +_,23 @@
@@ -97,21 +_,23 @@
&& !player.isSecondaryUseActive();
}
@@ -52,8 +52,8 @@
- Optional<BlockState> previous = WeatheringCopper.getPrevious(state);
+ Optional<org.purpurmc.purpur.tool.Actionable> previous = Optional.ofNullable(level.purpurConfig.axeWeatherables.get(state.getBlock())); // Purpur - Tool actionable options
if (previous.isPresent()) {
- spawnSoundAndParticle(level, pos, player, state, SoundEvents.AXE_SCRAPE, 3005);
+ spawnSoundAndParticle(level, pos, WeatheringCopper.getPrevious(state).isPresent() ? player : null, state, SoundEvents.AXE_SCRAPE, 3005); // Purpur - Tool actionable options - force sound
- spawnSoundAndParticle(level, pos, player, state, SoundEvents.AXE_SCRAPE, LevelEvent.PARTICLES_SCRAPE);
+ spawnSoundAndParticle(level, pos, WeatheringCopper.getPrevious(state).isPresent() ? player : null, state, SoundEvents.AXE_SCRAPE, LevelEvent.PARTICLES_SCRAPE); // Purpur - Tool actionable options - force sound
return previous;
} else {
- Optional<BlockState> optional = Optional.ofNullable(HoneycombItem.WAX_OFF_BY_BLOCK.get().get(state.getBlock()))
@@ -63,8 +63,8 @@
+ // .map(block -> block.withPropertiesOf(state));
+ // Purpur end - Tool actionable options
if (optional.isPresent()) {
- spawnSoundAndParticle(level, pos, player, state, SoundEvents.AXE_WAX_OFF, 3004);
+ spawnSoundAndParticle(level, pos, HoneycombItem.WAX_OFF_BY_BLOCK.get().containsKey(state.getBlock()) ? player : null, state, SoundEvents.AXE_WAX_OFF, 3004); // Purpur - Tool actionable options - force sound
- spawnSoundAndParticle(level, pos, player, state, SoundEvents.AXE_WAX_OFF, LevelEvent.PARTICLES_WAX_OFF);
+ spawnSoundAndParticle(level, pos, HoneycombItem.WAX_OFF_BY_BLOCK.get().containsKey(state.getBlock()) ? player : null, state, SoundEvents.AXE_WAX_OFF, LevelEvent.PARTICLES_WAX_OFF); // Purpur - Tool actionable options - force sound
return optional;
} else {
return Optional.empty();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/item/ShovelItem.java
+++ b/net/minecraft/world/item/ShovelItem.java
@@ -45,9 +_,12 @@
@@ -46,9 +_,12 @@
BlockState blockState1 = FLATTENABLES.get(blockState.getBlock());
BlockState blockState2 = null;
Runnable afterAction = null; // Paper

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/item/SpawnEggItem.java
+++ b/net/minecraft/world/item/SpawnEggItem.java
@@ -68,6 +_,23 @@
@@ -69,6 +_,23 @@
return InteractionResult.FAIL;
} else {
if (level.paperConfig().entities.spawning.disableMobSpawnerSpawnEggTransformation) return InteractionResult.FAIL; // Paper - Allow disabling mob spawner spawn egg transformation
@@ -22,5 +22,5 @@
+ }
+ // Purpur end - PlayerSetSpawnerTypeWithEggEvent
spawner.setEntityId(type, level.getRandom());
level.sendBlockUpdated(clickedPos, blockState, blockState, 3);
level.sendBlockUpdated(clickedPos, blockState, blockState, Block.UPDATE_ALL);
level.gameEvent(context.getPlayer(), GameEvent.BLOCK_CHANGE, clickedPos);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/BaseSpawner.java
+++ b/net/minecraft/world/level/BaseSpawner.java
@@ -61,6 +_,7 @@
@@ -62,6 +_,7 @@
}
public boolean isNearPlayer(Level level, BlockPos pos) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -165,11 +_,55 @@
@@ -166,11 +_,55 @@
}
// Paper end - add paper world config
@@ -56,7 +56,7 @@
public CraftWorld getWorld() {
return this.world;
}
@@ -845,6 +_,8 @@
@@ -846,6 +_,8 @@
// Paper end - getblock optimisations - cache world height/sections
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
@@ -65,7 +65,7 @@
this.generator = generator;
this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment);
@@ -2112,4 +_,14 @@
@@ -2113,4 +_,14 @@
return this.id;
}
}

View File

@@ -2,7 +2,7 @@
+++ b/net/minecraft/world/level/block/CaveVinesBlock.java
@@ -92,4 +_,11 @@
public void performBonemeal(ServerLevel level, RandomSource random, BlockPos pos, BlockState state) {
level.setBlock(pos, state.setValue(BERRIES, true), 2);
level.setBlock(pos, state.setValue(BERRIES, true), Block.UPDATE_CLIENTS);
}
+
+ // Purpur start - cave vines configurable max growth age

View File

@@ -11,7 +11,7 @@
- return InteractionResult.PASS;
- }
- // Paper end
- level.levelEvent(1500, pos, state != blockState ? 1 : 0);
- level.levelEvent(LevelEvent.COMPOSTER_FILL, pos, state != blockState ? 1 : 0);
- player.awardStat(Stats.ITEM_USED.get(stack.getItem()));
- stack.consume(1, player);
- }
@@ -46,17 +46,17 @@
+ // Purpur start - sneak to bulk process composter
+ private static @Nullable BlockState process(int levelValue, Player player, BlockState state, Level level, BlockPos pos, ItemStack stack) {
+ if (levelValue < 7 && !level.isClientSide()) {
+ BlockState iblockdata1 = ComposterBlock.addItem(player, state, level, pos, stack);
+ BlockState blockState = ComposterBlock.addItem(player, state, level, pos, stack);
+ // Paper start - handle cancelled events
+ if (iblockdata1 == null) {
+ if (blockState == null) {
+ return null;
+ }
+ // Paper end
+
+ level.levelEvent(1500, pos, state != iblockdata1 ? 1 : 0);
+ level.levelEvent(LevelEvent.COMPOSTER_FILL, pos, state != blockState ? 1 : 0);
+ player.awardStat(Stats.ITEM_USED.get(stack.getItem()));
+ stack.consume(1, player);
+ return iblockdata1;
+ return blockState;
+ }
+ return state;
+ }

View File

@@ -7,7 +7,7 @@
+ } else if (requiresRedstone(level, state, pos)) { return InteractionResult.CONSUME; // Purpur - Option to make doors require redstone
} else {
state = state.cycle(OPEN);
level.setBlock(pos, state, 10);
level.setBlock(pos, state, Block.UPDATE_CLIENTS | Block.UPDATE_IMMEDIATE);
@@ -287,4 +_,18 @@
public static boolean isWoodenDoor(BlockState state) {
return state.getBlock() instanceof DoorBlock doorBlock && doorBlock.type().canOpenByHand();
@@ -19,8 +19,8 @@
+ // force update client
+ BlockPos otherPos = pos.relative(state.getValue(DoorBlock.HALF) == DoubleBlockHalf.LOWER ? Direction.UP : Direction.DOWN);
+ BlockState otherState = level.getBlockState(otherPos);
+ level.sendBlockUpdated(pos, state, state, 3);
+ level.sendBlockUpdated(otherPos, otherState, otherState, 3);
+ level.sendBlockUpdated(pos, state, state, Block.UPDATE_ALL);
+ level.sendBlockUpdated(otherPos, otherState, otherState, Block.UPDATE_ALL);
+ return true;
+ }
+ return false;

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -186,6 +_,21 @@
@@ -187,6 +_,21 @@
}
ItemStack itemStack = furnace.items.get(1);
@@ -22,7 +22,7 @@
ItemStack itemStack1 = furnace.items.get(0);
boolean flag1 = !itemStack1.isEmpty();
boolean flag2 = !itemStack.isEmpty();
@@ -269,6 +_,8 @@
@@ -270,6 +_,8 @@
if (flag) {
setChanged(level, pos, state);
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -148,16 +_,32 @@
@@ -149,16 +_,32 @@
return this.setText(updater.apply(text), isFrontText);
}
@@ -35,7 +35,7 @@
);
}
}
@@ -306,6 +_,27 @@
@@ -307,6 +_,27 @@
// CraftBukkit - this
return new CommandSourceStack(commandSource, Vec3.atCenterOf(pos), Vec2.ZERO, level, 2, string, component, level.getServer(), player); // Paper - Fix commands from signs not firing command events
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/material/LavaFluid.java
+++ b/net/minecraft/world/level/material/LavaFluid.java
@@ -190,7 +_,7 @@
@@ -192,7 +_,7 @@
@Override
public int getTickDelay(LevelReader level) {
@@ -9,9 +9,9 @@
}
@Override
@@ -211,6 +_,13 @@
@@ -213,6 +_,13 @@
private void fizz(LevelAccessor level, BlockPos pos) {
level.levelEvent(1501, pos, 0);
level.levelEvent(LevelEvent.LAVA_FIZZ, pos, 0);
}
+
+ // Purpur start - Implement infinite liquids

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/portal/PortalShape.java
+++ b/net/minecraft/world/level/portal/PortalShape.java
@@ -28,7 +_,7 @@
@@ -29,7 +_,7 @@
public static final int MAX_WIDTH = 21;
private static final int MIN_HEIGHT = 3;
public static final int MAX_HEIGHT = 21;