mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
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:
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
) {
|
||||
|
||||
@@ -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
|
||||
) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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
|
||||
) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user