Upstream Paper's upgrade to vineflower 12.0.0 (#1782)

This commit is contained in:
granny
2026-05-31 16:42:41 -07:00
committed by GitHub
parent dc4a255969
commit 3fe5edd4b5
116 changed files with 1321 additions and 1333 deletions

View File

@@ -15,7 +15,7 @@
+ public float maxUpStep; // Purpur - Add option to set armorstand step height
public boolean noPhysics;
- public final RandomSource random = SHARED_RANDOM; // Paper - Share random for entities to make them more random
+ public final RandomSource random; // Paper - Share random for entities to make them more random // Add toggle for RNG manipulation
+ public final RandomSource random; // Paper - Share random for entities to make them more random // Purpur - Add toggle for RNG manipulation
public int tickCount;
private int remainingFireTicks;
private final EntityFluidInteraction fluidInteraction = new EntityFluidInteraction(Set.of(FluidTags.WATER, FluidTags.LAVA));
@@ -69,7 +69,7 @@
this.onBelowWorld();
}
}
@@ -2005,7 +_,7 @@
@@ -2007,7 +_,7 @@
}
public boolean fireImmune() {
@@ -78,7 +78,7 @@
}
public boolean causeFallDamage(final double fallDistance, final float damageModifier, final DamageSource damageSource) {
@@ -2591,7 +_,7 @@
@@ -2593,7 +_,7 @@
output.putBoolean("Bukkit.invisible", this.persistentInvisibility);
}
// SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
@@ -87,7 +87,7 @@
output.putInt("Bukkit.MaxAirSupply", this.getMaxAirSupply());
}
output.putInt("Spigot.ticksLived", this.totalEntityAge); // Paper
@@ -2678,6 +_,11 @@
@@ -2679,6 +_,11 @@
output.putBoolean("Paper.FreezeLock", true);
}
// Paper end
@@ -96,28 +96,28 @@
+ output.putBoolean("Purpur.FireImmune", immuneToFire);
+ }
+ // Purpur end - Fire immune API
} catch (Throwable var7) {
CrashReport report = CrashReport.forThrowable(var7, "Saving entity NBT");
} catch (Throwable t) {
CrashReport report = CrashReport.forThrowable(t, "Saving entity NBT");
CrashReportCategory category = report.addCategory("Entity being saved");
@@ -2800,6 +_,9 @@
@@ -2802,6 +_,9 @@
}
freezeLocked = input.getBooleanOr("Paper.FreezeLock", false);
// Paper end
+
+ immuneToFire = input.read("Purpur.FireImmune", com.mojang.serialization.Codec.BOOL).orElse(null); // Purpur - Fire immune API
+
} catch (Throwable var7) {
CrashReport report = CrashReport.forThrowable(var7, "Loading entity NBT");
} catch (Throwable t) {
CrashReport report = CrashReport.forThrowable(t, "Loading entity NBT");
CrashReportCategory category = report.addCategory("Entity being loaded");
@@ -3068,6 +_,7 @@
if (this.isAlive() && this instanceof Leashable leashablex) {
if (leashablex.getLeashHolder() == player) {
@@ -3067,6 +_,7 @@
if (this.isAlive() && this instanceof Leashable leashable) {
if (leashable.getLeashHolder() == player) {
if (!this.level().isClientSide()) {
+ if (hand == InteractionHand.OFF_HAND && (level().purpurConfig.villagerCanBeLeashed || level().purpurConfig.wanderingTraderCanBeLeashed) && this instanceof net.minecraft.world.entity.npc.villager.AbstractVillager) return InteractionResult.CONSUME; // Purpur - Allow leashing villagers
// Paper start - EntityUnleashEvent
if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerUnleashEntityEvent(
leashablex, player, hand, !player.hasInfiniteMaterials(), true
@@ -3498,15 +_,18 @@
leashable, player, hand, !player.hasInfiniteMaterials(), true
@@ -3500,15 +_,18 @@
return Vec3.directionFromRotation(this.getRotationVector());
}
@@ -137,7 +137,7 @@
}
}
}
@@ -4236,7 +_,7 @@
@@ -4238,7 +_,7 @@
}
public boolean canUsePortal(final boolean ignorePassenger) {
@@ -146,7 +146,7 @@
}
public boolean canTeleport(final Level from, final Level to) {
@@ -4786,6 +_,12 @@
@@ -4788,6 +_,12 @@
return Mth.lerp(partial, this.yRotO, this.yRot);
}
@@ -159,7 +159,7 @@
public boolean touchingUnloadedChunk() {
AABB box = this.getBoundingBox().inflate(1.0);
int x0 = Mth.floor(box.minX);
@@ -5089,7 +_,7 @@
@@ -5091,7 +_,7 @@
}
public float maxUpStep() {

View File

@@ -31,7 +31,7 @@
}
@Override
@@ -1046,15 +_,33 @@
@@ -1048,15 +_,33 @@
}
if (targetingEntity != null) {
@@ -74,40 +74,40 @@
return visibilityPercent;
}
@@ -1101,6 +_,7 @@
Iterator<MobEffectInstance> iterator = this.activeEffects.values().iterator();
while (iterator.hasNext()) {
MobEffectInstance effect = iterator.next();
+ if (cause == EntityPotionEffectEvent.Cause.MILK && !this.level().purpurConfig.milkClearsBeneficialEffects && effect.getEffect().value().isBeneficial()) continue; // Purpur - Milk Keeps Beneficial Effects
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
if (event.isCancelled()) {
continue;
@@ -1432,6 +_,24 @@
this.stopSleeping();
}
@@ -1106,6 +_,7 @@
Iterator<MobEffectInstance> iterator = this.activeEffects.values().iterator();
while (iterator.hasNext()) {
MobEffectInstance effect = iterator.next();
+ if (cause == EntityPotionEffectEvent.Cause.MILK && !this.level().purpurConfig.milkClearsBeneficialEffects && effect.getEffect().value().isBeneficial()) continue; // Purpur - Milk Keeps Beneficial Effects
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
if (event.isCancelled()) {
continue;
@@ -1438,7 +_,23 @@
this.stopSleeping();
}
+ // Purpur start - One Punch Man!
+ if (source.getEntity() instanceof net.minecraft.world.entity.player.Player player && source.getEntity().level().purpurConfig.creativeOnePunch && !source.is(DamageTypeTags.IS_PROJECTILE)) {
+ if (player.isCreative()) {
+ org.apache.commons.lang3.mutable.MutableDouble attackDamage = new org.apache.commons.lang3.mutable.MutableDouble();
+ player.getMainHandItem().forEachModifier(EquipmentSlot.MAINHAND, (attributeHolder, attributeModifier) -> {
+ if (attributeModifier.operation() == AttributeModifier.Operation.ADD_VALUE) {
+ attackDamage.addAndGet(attributeModifier.amount());
+ }
+ });
+
+ if (attackDamage.doubleValue() == 0.0D) {
+ // One punch!
+ damage = this.getHealth();
- this.noActionTime = 0;
+ // Purpur start - One Punch Man!
+ if (source.getEntity() instanceof net.minecraft.world.entity.player.Player player && source.getEntity().level().purpurConfig.creativeOnePunch && !source.is(DamageTypeTags.IS_PROJECTILE)) {
+ if (player.isCreative()) {
+ org.apache.commons.lang3.mutable.MutableDouble attackDamage = new org.apache.commons.lang3.mutable.MutableDouble();
+ player.getMainHandItem().forEachModifier(EquipmentSlot.MAINHAND, (attributeHolder, attributeModifier) -> {
+ if (attributeModifier.operation() == AttributeModifier.Operation.ADD_VALUE) {
+ attackDamage.addAndGet(attributeModifier.amount());
+ }
+ });
+
+ if (attackDamage.doubleValue() == 0.0D) {
+ // One punch!
+ damage = this.getHealth();
+ }
+ }
+ // Purpur end - One Punch Man!
+
this.noActionTime = 0;
if (damage < 0.0F) {
damage = 0.0F;
@@ -1693,10 +_,10 @@
+ }
+ // Purpur end - One Punch Man!this.noActionTime = 0;
if (damage < 0.0F) {
damage = 0.0F;
}
@@ -1699,10 +_,10 @@
protected @Nullable Player resolvePlayerResponsibleForDamage(final DamageSource source) {
Entity sourceEntity = source.getEntity();
if (sourceEntity instanceof Player playerSource) {
@@ -120,26 +120,25 @@
} else {
this.lastHurtByPlayer = null;
this.lastHurtByPlayerMemoryTime = 0;
@@ -1747,6 +_,18 @@
}
@@ -1754,6 +_,17 @@
}
}
+ // Purpur start - Totems work in inventory
+ if (level().purpurConfig.totemOfUndyingWorksInInventory && this instanceof ServerPlayer player && (itemStack == null || itemStack.getItem() != Items.TOTEM_OF_UNDYING) && player.getBukkitEntity().hasPermission("purpur.inventory_totem")) {
+ for (ItemStack item : player.getInventory().getNonEquipmentItems()) {
+ if (item.getItem() == Items.TOTEM_OF_UNDYING) {
+ itemStack = item;
+ protectionItem = item.copy();
+ break;
+ }
+ // Purpur start - Totems work in inventory
+ if (level().purpurConfig.totemOfUndyingWorksInInventory && this instanceof ServerPlayer player && (itemStack == null || itemStack.getItem() != Items.TOTEM_OF_UNDYING) && player.getBukkitEntity().hasPermission("purpur.inventory_totem")) {
+ for (ItemStack item : player.getInventory().getNonEquipmentItems()) {
+ if (item.getItem() == Items.TOTEM_OF_UNDYING) {
+ itemStack = item;
+ protectionItem = item.copy();
+ break;
+ }
+ }
+ // Purpur end - Totems work in inventory
+
final org.bukkit.inventory.EquipmentSlot handSlot = (usedHand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(usedHand) : null;
final EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
event.setCancelled(protectionItem == null);
@@ -1921,6 +_,7 @@
+ }
+ // Purpur end - Totems work in inventory
final org.bukkit.inventory.EquipmentSlot handSlot = (usedHand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(usedHand) : null;
final EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
event.setCancelled(protectionItem == null);
@@ -1927,6 +_,7 @@
boolean playerKilled = this.lastHurtByPlayerMemoryTime > 0;
this.dropEquipment(level); // CraftBukkit - from below
if (this.shouldDropLoot(level)) {
@@ -147,7 +146,7 @@
this.dropFromLootTable(level, source, playerKilled);
// Paper start
final boolean prev = this.clearEquipmentSlots;
@@ -1929,6 +_,7 @@
@@ -1935,6 +_,7 @@
// Paper end
this.dropCustomDeathLoot(level, source, playerKilled);
this.clearEquipmentSlots = prev; // Paper
@@ -155,7 +154,7 @@
}
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
@@ -3256,6 +_,7 @@
@@ -3264,6 +_,7 @@
float dmg = (float)(diff * 10.0 - 3.0);
if (dmg > 0.0F) {
this.playSound(this.getFallDamageSound((int)dmg), 1.0F, 1.0F);
@@ -163,7 +162,7 @@
this.hurt(this.damageSources().flyIntoWall(), dmg);
}
}
@@ -4740,6 +_,12 @@
@@ -4749,6 +_,12 @@
? slot == EquipmentSlot.MAINHAND && this.canUseSlot(EquipmentSlot.MAINHAND)
: slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.typeHolder());
}

View File

@@ -61,7 +61,7 @@
// Paper start - allow changing despawnInPeaceful
this.despawnInPeacefulOverride = readDespawnInPeacefulOverride(input);
}
@@ -1256,7 +_,7 @@
@@ -1251,7 +_,7 @@
);
}
@@ -70,7 +70,7 @@
return groupData;
}
@@ -1613,6 +_,7 @@
@@ -1608,6 +_,7 @@
}
this.postPiercingAttack();

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/ai/attributes/RangedAttribute.java
+++ b/net/minecraft/world/entity/ai/attributes/RangedAttribute.java
@@ -29,6 +_,7 @@
@@ -33,6 +_,7 @@
@Override
public double sanitizeValue(final double value) {

View File

@@ -1,11 +1,11 @@
--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
@@ -90,7 +_,7 @@
};
// Paper start - optimise POI searches
java.util.List<Pair<Holder<PoiType>, BlockPos>> poiPositionsRaw = new java.util.ArrayList<>();
- ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.findNearestPoiPositions(poiManager, poiType, cacheTest, body.blockPosition(), SCAN_RANGE, Double.MAX_VALUE, PoiManager.Occupancy.HAS_SPACE, ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.LOAD_FOR_SEARCHING, 5, poiPositionsRaw);
+ ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.findNearestPoiPositions(poiManager, poiType, cacheTest, body.blockPosition(), level.purpurConfig.villagerAcquirePoiSearchRadius, Double.MAX_VALUE, PoiManager.Occupancy.HAS_SPACE, ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.LOAD_FOR_SEARCHING, 5, poiPositionsRaw); // Purpur - Configurable villager search radius
Set<Pair<Holder<PoiType>, BlockPos>> poiPositions = new java.util.HashSet<>(poiPositionsRaw.size());
for (Pair<Holder<PoiType>, BlockPos> pair : poiPositionsRaw) {
if (validPoi.test(level, pair.getSecond())) {
@@ -96,7 +_,7 @@
};
// Paper start - optimise POI searches
java.util.List<Pair<Holder<PoiType>, BlockPos>> poiPositionsRaw = new java.util.ArrayList<>();
- ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.findNearestPoiPositions(poiManager, poiType, cacheTest, body.blockPosition(), SCAN_RANGE, Double.MAX_VALUE, PoiManager.Occupancy.HAS_SPACE, ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.LOAD_FOR_SEARCHING, 5, poiPositionsRaw);
+ ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.findNearestPoiPositions(poiManager, poiType, cacheTest, body.blockPosition(), level.purpurConfig.villagerAcquirePoiSearchRadius, Double.MAX_VALUE, PoiManager.Occupancy.HAS_SPACE, ca.spottedleaf.moonrise.patches.poi_lookup.PoiAccess.LOAD_FOR_SEARCHING, 5, poiPositionsRaw); // Purpur - Configurable villager search radius
Set<Pair<Holder<PoiType>, BlockPos>> poiPositions = new java.util.HashSet<>(poiPositionsRaw.size());
for (Pair<Holder<PoiType>, BlockPos> pair : poiPositionsRaw) {
if (validPoi.test(level, pair.getSecond())) {

View File

@@ -8,7 +8,7 @@
if (!this.llama.isLeashed() && !this.llama.inCaravan()) {
List<Entity> llamas = this.llama
.level()
@@ -70,6 +_,7 @@
@@ -74,6 +_,7 @@
@Override
public boolean canContinueToUse() {

View File

@@ -1,7 +1,7 @@
--- a/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
+++ b/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
@@ -54,7 +_,7 @@
}
@@ -56,7 +_,7 @@
return true;
};
Set<Pair<Holder<PoiType>, BlockPos>> pois = poiManager.findAllWithType(
- e -> e.is(PoiTypes.HOME), cacheTest, body.blockPosition(), AcquirePoi.SCAN_RANGE, PoiManager.Occupancy.ANY

View File

@@ -1,13 +1,13 @@
--- a/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
+++ b/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
@@ -63,6 +_,10 @@
return false;
} else if (this.selector != null && !this.selector.test(target, level)) {
@@ -67,6 +_,10 @@
if (this.selector != null && !this.selector.test(target, level)) {
return false;
+ // Purpur start - AFK API
+ } else if (!level.purpurConfig.idleTimeoutTargetPlayer && target instanceof net.minecraft.server.level.ServerPlayer player && player.isAfk()) {
+ return false;
+ // Purpur end - AFK API
} else {
if (targeter == null) {
if (this.isCombat && (!target.canBeSeenAsEnemy() || level.getDifficulty() == Difficulty.PEACEFUL)) {
}
if (targeter == null) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/bee/Bee.java
+++ b/net/minecraft/world/entity/animal/bee/Bee.java
@@ -172,7 +_,7 @@
@@ -171,7 +_,7 @@
// Paper end - Fix MC-167279
this.lookControl = new Bee.BeeLookControl(this);
this.setPathfindingMalus(PathType.FIRE_IN_NEIGHBOR, -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);
@@ -363,13 +_,19 @@
@@ -362,13 +_,19 @@
if (this.stayOutOfHiveCountdown <= 0 && !this.beePollinateGoal.isPollinating() && !this.hasStung() && this.getTarget() == null) {
boolean wantsToEnterHive = this.hasNectar()
|| this.isTiredOfLookingForNectar()
@@ -30,7 +30,7 @@
public void setStayOutOfHiveCountdown(final int ticks) {
this.stayOutOfHiveCountdown = ticks;
}
@@ -390,7 +_,7 @@
@@ -389,7 +_,7 @@
@Override
protected void customServerAiStep(final ServerLevel level) {
boolean hasStung = this.hasStung();
@@ -39,7 +39,7 @@
this.underWaterTicks++;
} else {
this.underWaterTicks = 0;
@@ -400,6 +_,7 @@
@@ -399,6 +_,7 @@
this.hurtServer(level, this.damageSources().drown(), 1.0F);
}
@@ -47,7 +47,7 @@
if (hasStung) {
this.timeSinceSting++;
if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, 1, 1200)) == 0) {
@@ -1168,6 +_,7 @@
@@ -1132,6 +_,7 @@
Bee.this.savedFlowerPos = nearbyPos.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);
@@ -55,7 +55,7 @@
return true;
} else {
Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60);
@@ -1214,6 +_,7 @@
@@ -1178,6 +_,7 @@
this.pollinating = false;
Bee.this.navigation.stop();
Bee.this.remainingCooldownBeforeLocatingNewFlower = 200;
@@ -63,7 +63,7 @@
}
@Override
@@ -1260,6 +_,7 @@
@@ -1224,6 +_,7 @@
this.setWantedPos();
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/fox/Fox.java
+++ b/net/minecraft/world/entity/animal/fox/Fox.java
@@ -364,6 +_,11 @@
@@ -363,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);
@@ -391,6 +_,7 @@
@@ -390,6 +_,7 @@
public void setVariant(final Fox.Variant variant) {
this.entityData.set(DATA_TYPE_ID, variant.getId());
@@ -20,7 +20,7 @@
}
@Override
@@ -716,6 +_,29 @@
@@ -715,6 +_,29 @@
return slot == EquipmentSlot.MAINHAND;
}
// Paper end

View File

@@ -42,11 +42,11 @@
this.readPersistentAngerSaveData(this.level(), input);
}
@@ -267,6 +_,7 @@
float pitch = 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F;
this.playSound(SoundEvents.IRON_GOLEM_REPAIR, 1.0F, pitch);
itemStack.consume(1, player);
+ if (this.level().purpurConfig.ironGolemHealCalm && isAngry() && getHealth() == getMaxHealth()) stopBeingAngry(); // Purpur - Iron golem calm anger options
return InteractionResult.SUCCESS;
}
}
@@ -269,6 +_,7 @@
float pitch = 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F;
this.playSound(SoundEvents.IRON_GOLEM_REPAIR, 1.0F, pitch);
itemStack.consume(1, player);
+ if (this.level().purpurConfig.ironGolemHealCalm && isAngry() && getHealth() == getMaxHealth()) stopBeingAngry(); // Purpur - Iron golem calm anger options
return InteractionResult.SUCCESS;
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/polarbear/PolarBear.java
+++ b/net/minecraft/world/entity/animal/polarbear/PolarBear.java
@@ -67,6 +_,29 @@
@@ -66,6 +_,29 @@
super(type, level);
}
@@ -30,7 +30,7 @@
@Override
public @Nullable AgeableMob getBreedOffspring(final ServerLevel level, final AgeableMob partner) {
return EntityType.POLAR_BEAR.create(level, EntitySpawnReason.BREEDING);
@@ -74,7 +_,7 @@
@@ -73,7 +_,7 @@
@Override
public boolean isFood(final ItemStack itemStack) {
@@ -39,7 +39,7 @@
}
@Override
@@ -83,6 +_,12 @@
@@ -82,6 +_,12 @@
this.goalSelector.addGoal(0, new FloatGoal(this));
this.goalSelector.addGoal(1, new PolarBear.PolarBearMeleeAttackGoal());
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0, bear -> bear.isBaby() ? DamageTypeTags.PANIC_CAUSES : DamageTypeTags.PANIC_ENVIRONMENTAL_CAUSES));

View File

@@ -39,7 +39,7 @@
if (this.tentacleMovement < Mth.PI) {
float tentacleScale = this.tentacleMovement / Mth.PI;
this.tentacleAngle = Mth.sin(tentacleScale * tentacleScale * Mth.PI) * Mth.PI * 0.25F;
@@ -321,7 +_,7 @@
@@ -316,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/wolf/Wolf.java
+++ b/net/minecraft/world/entity/animal/wolf/Wolf.java
@@ -97,6 +_,37 @@
@@ -96,6 +_,37 @@
public static final TargetingConditions.Selector PREY_SELECTOR = (target, level) -> target.is(EntityType.SHEEP)
|| target.is(EntityType.RABBIT)
|| target.is(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;
@@ -118,12 +_,47 @@
@@ -117,12 +_,47 @@
this.setPathfindingMalus(PathType.ON_TOP_OF_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));
@@ -136,7 +_,7 @@
@@ -135,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));
@@ -231,6 +_,7 @@
@@ -230,6 +_,7 @@
protected void addAdditionalSaveData(final 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()
@@ -245,6 +_,10 @@
@@ -244,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(soundVariant -> this.registryAccess().lookupOrThrow(Registries.WOLF_SOUND_VARIANT).get((ResourceKey<WolfSoundVariant>)soundVariant))
@@ -268,6 +_,10 @@
@@ -267,6 +_,10 @@
}
this.setSoundVariant(WolfSoundVariants.pickRandomSoundVariant(this.registryAccess(), level.getRandom()));
@@ -125,7 +125,7 @@
return super.finalizeSpawn(level, difficulty, spawnReason, groupData);
}
@@ -316,6 +_,11 @@
@@ -315,6 +_,11 @@
public void tick() {
super.tick();
if (this.isAlive()) {

View File

@@ -34,23 +34,23 @@
}
@Override
@@ -115,15 +_,17 @@
@@ -118,15 +_,17 @@
}
// CraftBukkit end
if (!source.is(DamageTypeTags.IS_EXPLOSION)) {
+ if (shouldExplode()) {// Purpur - End crystal explosion options
DamageSource damageSource = source.getEntity() != null ? this.damageSources().explosion(this, source.getEntity()) : null;
// CraftBukkit start
- org.bukkit.event.entity.ExplosionPrimeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExplosionPrimeEvent(this, 6.0F, false);
+ org.bukkit.event.entity.ExplosionPrimeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExplosionPrimeEvent(this, getExplosionPower(), hasExplosionFire()); // Purpur - End crystal explosion options
if (event.isCancelled()) {
return false;
}
// CraftBukkit end
if (!source.is(DamageTypeTags.IS_EXPLOSION)) {
+ if (shouldExplode()) {// Purpur - End crystal explosion options
DamageSource damageSource = source.getEntity() != null ? this.damageSources().explosion(this, source.getEntity()) : null;
// CraftBukkit start
- org.bukkit.event.entity.ExplosionPrimeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExplosionPrimeEvent(this, 6.0F, false);
+ org.bukkit.event.entity.ExplosionPrimeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExplosionPrimeEvent(this, getExplosionPower(), hasExplosionFire()); // Purpur - End crystal explosion options
if (event.isCancelled()) {
return false;
}
this.remove(Entity.RemovalReason.KILLED, org.bukkit.event.entity.EntityRemoveEvent.Cause.EXPLODE); // Paper - add Bukkit remove cause
- level.explode(this, damageSource, null, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.BLOCK);
+ level.explode(this, damageSource, null, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), getExplosionEffect()); // Purpur - End crystal explosion options
+ } else this.unsetRemoved(); // Purpur - End crystal explosion options
} else {
this.remove(Entity.RemovalReason.KILLED, org.bukkit.event.entity.EntityRemoveEvent.Cause.DEATH); // Paper - add Bukkit remove cause
// CraftBukkit end
this.remove(Entity.RemovalReason.KILLED, org.bukkit.event.entity.EntityRemoveEvent.Cause.EXPLODE); // Paper - add Bukkit remove cause
- level.explode(this, damageSource, null, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.BLOCK);
+ level.explode(this, damageSource, null, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), getExplosionEffect()); // Purpur - End crystal explosion options
+ } else this.unsetRemoved(); // Purpur - End crystal explosion options
} else {
this.remove(Entity.RemovalReason.KILLED, org.bukkit.event.entity.EntityRemoveEvent.Cause.DEATH); // Paper - add Bukkit remove cause
// CraftBukkit end

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -959,6 +_,7 @@
@@ -960,6 +_,7 @@
@Override
protected boolean canRide(final Entity vehicle) {
@@ -8,7 +8,7 @@
return false;
}
@@ -994,7 +_,7 @@
@@ -995,7 +_,7 @@
boolean shouldDrop = level.getGameRules().get(GameRules.MOB_DROPS);
int xpCount = 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
@@ -82,6 +_,7 @@
@@ -81,6 +_,7 @@
private static final TargetingConditions.Selector LIVING_ENTITY_SELECTOR = (target, level) -> !target.is(EntityTypeTags.WITHER_FRIENDS)
&& target.attackable();
private static final TargetingConditions TARGETING_CONDITIONS = TargetingConditions.forCombat().range(20.0).selector(LIVING_ENTITY_SELECTOR);
@@ -8,7 +8,7 @@
public WitherBoss(final EntityType<? extends WitherBoss> type, final Level level) {
super(type, level);
@@ -90,6 +_,16 @@
@@ -89,6 +_,16 @@
this.xpReward = 50;
}
@@ -25,7 +25,7 @@
@Override
protected PathNavigation createNavigation(final Level level) {
FlyingPathNavigation flyingPathNavigation = new FlyingPathNavigation(this, level);
@@ -122,6 +_,7 @@
@@ -121,6 +_,7 @@
protected void addAdditionalSaveData(final ValueOutput output) {
super.addAdditionalSaveData(output);
output.putInt("Invul", this.getInvulnerableTicks());
@@ -33,7 +33,7 @@
}
@Override
@@ -131,6 +_,7 @@
@@ -130,6 +_,7 @@
if (this.hasCustomName()) {
this.bossEvent.setName(this.getDisplayName());
}
@@ -41,7 +41,7 @@
}
@Override
@@ -274,7 +_,7 @@
@@ -273,7 +_,7 @@
level.explode(this, this.getX(), this.getEyeY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB);
}
// CraftBukkit end
@@ -50,7 +50,7 @@
// CraftBukkit start - Use relative location for far away sounds
// level.globalLevelEvent(LevelEvent.SOUND_WITHER_BOSS_SPAWN, this.blockPosition(), 0);
int viewDistance = level.getCraftServer().getViewDistance() * 16;
@@ -378,8 +_,10 @@
@@ -377,8 +_,10 @@
}
}
@@ -63,7 +63,7 @@
}
this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth());
@@ -576,6 +_,7 @@
@@ -579,6 +_,7 @@
@Override
protected boolean canRide(final Entity vehicle) {

View File

@@ -14,7 +14,7 @@
}
public ArmorStand(final Level level, final double x, final double y, final double z) {
@@ -523,6 +_,7 @@
@@ -546,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;
@@ -809,4 +_,19 @@
@@ -832,4 +_,19 @@
}
}
// Paper end

View File

@@ -29,9 +29,9 @@
+ } else if (this.isInvulnerableToBase(source)) {
+ // Purpur end - Item entity immunities
return false;
} else if (!level.getGameRules().get(GameRules.MOB_GRIEFING) && source.getEntity() instanceof Mob) {
return false;
@@ -517,6 +_,12 @@
}
@@ -521,6 +_,12 @@
public void setItem(final ItemStack itemStack) {
this.getEntityData().set(DATA_ITEM, itemStack);
this.despawnRate = this.level().paperConfig().entities.spawning.altItemDespawnRate.enabled ? this.level().paperConfig().entities.spawning.altItemDespawnRate.items.getOrDefault(itemStack.getItem(), this.level().spigotConfig.itemDespawnRate) : this.level().spigotConfig.itemDespawnRate; // Paper - Alternative item-despawn-rate

View File

@@ -18,22 +18,23 @@
final com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent event = new com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent((org.bukkit.entity.Enderman) getBukkitEntity(), (org.bukkit.entity.Player) player.getBukkitEntity());
event.setCancelled(!shouldAttack);
return event.callEvent();
@@ -373,6 +_,7 @@
@@ -373,7 +_,7 @@
public boolean hurtServer(final ServerLevel level, final DamageSource source, final float damage) {
if (this.isInvulnerableTo(level, source)) {
return false;
+ } else if (org.purpurmc.purpur.PurpurConfig.endermanShortHeight && source.is(net.minecraft.world.damagesource.DamageTypes.IN_WALL)) { return false; // Purpur - no suffocation damage if short height - Short enderman height
} else {
AbstractThrownPotion thrownPotion = source.getDirectEntity() instanceof AbstractThrownPotion potion ? potion : null;
if (!source.is(DamageTypeTags.IS_PROJECTILE) && thrownPotion == null) { // Paper - EndermanEscapeEvent - diff on change - below logic relies on this path covering non-projectile damage.
@@ -387,6 +_,7 @@
} else {
boolean hurtWithCleanWater = thrownPotion != null && this.hurtWithCleanWater(level, source, thrownPotion, damage);
- }
+ } else if (org.purpurmc.purpur.PurpurConfig.endermanShortHeight && source.is(net.minecraft.world.damagesource.DamageTypes.IN_WALL)) { return false; } // Purpur - no suffocation damage if short height - Short enderman height
+ if (!hurtWithCleanWater && level.purpurConfig.endermanIgnoreProjectiles) return super.hurtServer(level, source, damage); // Purpur - Config to disable Enderman teleport on projectile hit
if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper - EndermanEscapeEvent
for (int i = 0; i < 64; i++) {
if (this.teleport()) {
AbstractThrownPotion thrownPotion = source.getDirectEntity() instanceof AbstractThrownPotion potion ? potion : null;
if (!source.is(DamageTypeTags.IS_PROJECTILE) && thrownPotion == null) { // Paper - EndermanEscapeEvent - diff on change - below logic relies on this path covering non-projectile damage.
@@ -388,6 +_,7 @@
} else {
boolean hurtWithCleanWater = thrownPotion != null && this.hurtWithCleanWater(level, source, thrownPotion, damage);
+ if (!hurtWithCleanWater && level.purpurConfig.endermanIgnoreProjectiles) return super.hurtServer(level, source, damage); // Purpur - Config to disable Enderman teleport on projectile hit
if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper - EndermanEscapeEvent
for (int i = 0; i < 64; i++) {
if (this.teleport()) {
@@ -430,7 +_,7 @@
@Override

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/Guardian.java
+++ b/net/minecraft/world/entity/monster/Guardian.java
@@ -308,6 +_,11 @@
@@ -310,6 +_,11 @@
final BlockPos pos,
final RandomSource random
) {

View File

@@ -11,7 +11,7 @@
+ // Purpur end - Config to disable hostile mob spawn on ice
if (level.getBrightness(LightLayer.SKY, pos) > random.nextInt(32)) {
return false;
} else {
}
@@ -113,6 +_,11 @@
public static boolean checkAnyLightMonsterSpawnRules(
final EntityType<? extends Monster> type, final LevelAccessor level, final EntitySpawnReason spawnReason, final BlockPos pos, final RandomSource random

View File

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

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/Shulker.java
+++ b/net/minecraft/world/entity/monster/Shulker.java
@@ -94,6 +_,22 @@
@@ -93,6 +_,22 @@
this.lookControl = new Shulker.ShulkerLookControl(this);
}
@@ -23,7 +23,7 @@
@Override
protected void registerGoals() {
this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, Player.class, 8.0F, 0.02F, true));
@@ -455,11 +_,21 @@
@@ -454,11 +_,21 @@
private void hitByShulkerBullet() {
Vec3 oldPosition = this.position();
AABB oldAabb = this.getBoundingBox();
@@ -49,7 +49,7 @@
if (baby != null) {
baby.setVariant(this.getVariant());
baby.snapTo(oldPosition);
@@ -566,7 +_,7 @@
@@ -565,7 +_,7 @@
}
public Optional<DyeColor> getVariant() {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/piglin/PiglinAi.java
+++ b/net/minecraft/world/entity/monster/piglin/PiglinAi.java
@@ -669,14 +_,24 @@
@@ -666,14 +_,24 @@
}
public static boolean isWearingSafeArmor(final LivingEntity livingEntity) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/skeleton/AbstractSkeleton.java
+++ b/net/minecraft/world/entity/monster/skeleton/AbstractSkeleton.java
@@ -142,7 +_,7 @@
@@ -137,7 +_,7 @@
this.populateDefaultEquipmentEnchantments(level, random, difficulty);
this.reassessWeaponGoal();
this.setCanPickUpLoot(level.getLevel().paperConfig().entities.behavior.mobsCanAlwaysPickUpLoot.skeletons || random.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); // Paper - Add world settings for mobs picking up loot
@@ -9,7 +9,7 @@
this.setItemSlot(EquipmentSlot.HEAD, new ItemStack(random.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN));
this.setDropChance(EquipmentSlot.HEAD, 0.0F);
}
@@ -189,7 +_,7 @@
@@ -184,7 +_,7 @@
double distanceToTarget = Math.sqrt(xd * xd + zd * zd);
if (this.level() instanceof ServerLevel serverLevel) {
Projectile.Delayed<AbstractArrow> delayedEntity = Projectile.spawnProjectileUsingShootDelayed( // Paper - delayed

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/zombie/Zombie.java
+++ b/net/minecraft/world/entity/monster/zombie/Zombie.java
@@ -128,7 +_,19 @@
@@ -127,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));
}
@@ -543,7 +_,7 @@
@@ -540,7 +_,7 @@
}
}

View File

@@ -92,15 +92,15 @@
profiler.pop();
if (this.assignProfessionWhenSpawned) {
this.assignProfessionWhenSpawned = false;
@@ -344,6 +_,7 @@
return InteractionResult.CONSUME;
}
+ if (this.level().purpurConfig.villagerAllowTrading) // Purpur - Add config for villager trading
this.startTrading(player);
@@ -347,6 +_,7 @@
return InteractionResult.CONSUME;
}
@@ -485,7 +_,7 @@
+ if (this.level().purpurConfig.villagerAllowTrading) // Purpur - Add config for villager trading
this.startTrading(player);
}
@@ -487,7 +_,7 @@
public void updateDemand() {
for (MerchantOffer offer : this.getOffers()) {
@@ -109,7 +109,7 @@
}
}
@@ -685,7 +_,7 @@
@@ -687,7 +_,7 @@
@Override
public boolean canBreed() {
@@ -118,7 +118,7 @@
}
private boolean hungry() {
@@ -891,6 +_,7 @@
@@ -893,6 +_,7 @@
}
public void spawnGolemIfNeeded(final ServerLevel level, final long timestamp, final int villagersNeededToAgree) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/npc/wanderingtrader/WanderingTrader.java
+++ b/net/minecraft/world/entity/npc/wanderingtrader/WanderingTrader.java
@@ -61,6 +_,13 @@
@@ -60,6 +_,13 @@
super(type, level);
}
@@ -14,7 +14,7 @@
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
@@ -78,7 +_,7 @@
@@ -77,7 +_,7 @@
.addGoal(
0,
new UseItemGoal<>(
@@ -23,7 +23,7 @@
)
);
this.goalSelector.addGoal(1, new TradeWithPlayerGoal(this));
@@ -121,8 +_,10 @@
@@ -120,8 +_,10 @@
return InteractionResult.CONSUME;
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java
+++ b/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java
@@ -133,7 +_,17 @@
@@ -135,7 +_,17 @@
int xPosition = referencePosition.getX() + this.random.nextInt(radius * 2) - radius;
int zPosition = referencePosition.getZ() + this.random.nextInt(radius * 2) - radius;
int yPosition = level.getHeight(SpawnPlacements.getHeightmapType(EntityType.WANDERING_TRADER), xPosition, zPosition);

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
@@ -174,11 +_,20 @@
@@ -173,11 +_,20 @@
public float hurtDir;
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();
@@ -239,6 +_,12 @@
@@ -242,6 +_,12 @@
@Override
public void tick() {
@@ -34,7 +34,7 @@
this.noPhysics = this.isSpectator();
if (this.isSpectator() || this.isPassenger()) {
this.setOnGround(false);
@@ -296,6 +_,17 @@
@@ -299,6 +_,17 @@
this.turtleHelmetTick();
}
@@ -52,7 +52,7 @@
this.cooldowns.tick();
this.updatePlayerPose();
}
@@ -501,7 +_,7 @@
@@ -504,7 +_,7 @@
List<Entity> orbs = Lists.newArrayList();
for (Entity entity : entities) {
@@ -61,7 +61,7 @@
orbs.add(entity);
} else if (!entity.isRemoved()) {
this.touch(entity);
@@ -1044,7 +_,7 @@
@@ -1052,7 +_,7 @@
criticalAttack = criticalAttack && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits
if (criticalAttack) {
damageSource = damageSource.critical(); // Paper - critical damage API
@@ -70,7 +70,7 @@
}
float totalDamage = baseDamage + magicBoost;
@@ -1740,7 +_,23 @@
@@ -1748,7 +_,23 @@
@Override
protected int getBaseExperienceReward(final ServerLevel level) {
@@ -95,7 +95,7 @@
}
@Override
@@ -1783,6 +_,13 @@
@@ -1791,6 +_,13 @@
public boolean addItem(final ItemStack itemStack) {
return this.inventory.add(itemStack);
}

View File

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

View File

@@ -26,17 +26,17 @@
Iterator<Raid> raidIterator = this.raidMap.values().iterator();
while (raidIterator.hasNext()) {
@@ -137,11 +_,11 @@
// }
@@ -139,11 +_,12 @@
// }
if (!raid.isStarted() || (raid.isInProgress() && raid.getRaidOmenLevel() < raid.getMaxRaidOmenLevel())) { // CraftBukkit - fixed a bug with raid: players could add up Bad Omen level even when the raid had finished
- // CraftBukkit start
+ if (level.purpurConfig.raidCooldownSeconds != 0 && playerCooldowns.containsKey(player.getUUID())) return null; // Purpur - Raid cooldown setting// CraftBukkit start
if (!org.bukkit.craftbukkit.event.CraftEventFactory.callRaidTriggerEvent(level, raid, player)) {
player.removeEffect(net.minecraft.world.effect.MobEffects.RAID_OMEN);
return null;
- }
+ }if (level.purpurConfig.raidCooldownSeconds != 0) playerCooldowns.put(player.getUUID(), level.purpurConfig.raidCooldownSeconds); // Purpur - Raid cooldown setting
if (!raid.isStarted() || (raid.isInProgress() && raid.getRaidOmenLevel() < raid.getMaxRaidOmenLevel())) { // CraftBukkit - fixed a bug with raid: players could add up Bad Omen level even when the raid had finished
+ if (level.purpurConfig.raidCooldownSeconds != 0 && playerCooldowns.containsKey(player.getUUID())) return null; // Purpur - Raid cooldown setting
// CraftBukkit start
if (!org.bukkit.craftbukkit.event.CraftEventFactory.callRaidTriggerEvent(level, raid, player)) {
player.removeEffect(net.minecraft.world.effect.MobEffects.RAID_OMEN);
return null;
- }
+ }if (level.purpurConfig.raidCooldownSeconds != 0) playerCooldowns.put(player.getUUID(), level.purpurConfig.raidCooldownSeconds); // Purpur - Raid cooldown setting
if (!raid.isStarted() && !this.raidMap.containsValue(raid)) {
this.raidMap.put(this.getUniqueId(), raid);
if (!raid.isStarted() && !this.raidMap.containsValue(raid)) {
this.raidMap.put(this.getUniqueId(), raid);

View File

@@ -6,6 +6,6 @@
if (deltaMovement.length() > 0.01) {
- return deltaMovement.normalize().scale(deltaMovement.length() + 0.06);
+ return deltaMovement.normalize().scale(deltaMovement.length() + this.level().purpurConfig.poweredRailBoostModifier); // Purpur - Configurable powered rail boost modifier
} else {
Vec3 powerDirection = this.minecart.getRedstoneDirection(pos);
return powerDirection.lengthSqr() <= 0.0 ? deltaMovement : powerDirection.scale(deltaMovement.length() + 0.2);
}
Vec3 powerDirection = this.minecart.getRedstoneDirection(pos);