mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
prepare for 1.21.4 update
This commit is contained in:
@@ -1,71 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Thu, 13 May 2021 22:17:50 -0500
|
||||
Subject: [PATCH] Breedable parrots
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Parrot.java b/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
||||
index 9c7e29307b811d859a0d743b232463e18391b5f0..00759f484cab0d7c8d4e8914dd9f27061c8b7d45 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
||||
@@ -224,6 +224,7 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder<Parrot
|
||||
protected void registerGoals() {
|
||||
//this.goalSelector.addGoal(0, new TamableAnimal.TamableAnimalPanicGoal(1.25D)); // Purpur - move down
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
+ if (this.level().purpurConfig.parrotBreedable) this.goalSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.BreedGoal(this, 1.0D)); // Purpur
|
||||
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
this.goalSelector.addGoal(1, new TamableAnimal.TamableAnimalPanicGoal(1.25D)); // Purpur
|
||||
this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, Player.class, 8.0F));
|
||||
@@ -332,6 +333,7 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder<Parrot
|
||||
}
|
||||
}
|
||||
|
||||
+ if (this.level().purpurConfig.parrotBreedable) return super.mobInteract(player, hand); // Purpur
|
||||
return InteractionResult.SUCCESS;
|
||||
} else if (!itemstack.is(ItemTags.PARROT_POISONOUS_FOOD)) {
|
||||
if (!this.isFlying() && this.isTame() && this.isOwnedBy(player)) {
|
||||
@@ -356,7 +358,7 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder<Parrot
|
||||
|
||||
@Override
|
||||
public boolean isFood(ItemStack stack) {
|
||||
- return false;
|
||||
+ return this.level().purpurConfig.parrotBreedable && stack.is(ItemTags.PARROT_FOOD); // Purpur
|
||||
}
|
||||
|
||||
public static boolean checkParrotSpawnRules(EntityType<Parrot> type, LevelAccessor world, EntitySpawnReason spawnReason, BlockPos pos, RandomSource random) {
|
||||
@@ -368,13 +370,13 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder<Parrot
|
||||
|
||||
@Override
|
||||
public boolean canMate(Animal other) {
|
||||
- return false;
|
||||
+ return super.canMate(other); // Purpur
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public AgeableMob getBreedOffspring(ServerLevel world, AgeableMob entity) {
|
||||
- return null;
|
||||
+ return world.purpurConfig.parrotBreedable ? EntityType.PARROT.create(world, EntitySpawnReason.BREEDING) : null; // Purpur
|
||||
}
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index defe5b19e5595d5c18fcf1100a8b1470cbc5e670..aaa0fe0a1cf368bc680d0a2b94fdb4e6ddee0503 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1618,6 +1618,7 @@ public class PurpurWorldConfig {
|
||||
public double parrotMaxHealth = 6.0D;
|
||||
public double parrotScale = 1.0D;
|
||||
public boolean parrotTakeDamageFromWater = false;
|
||||
+ public boolean parrotBreedable = false;
|
||||
private void parrotSettings() {
|
||||
parrotRidable = getBoolean("mobs.parrot.ridable", parrotRidable);
|
||||
parrotRidableInWater = getBoolean("mobs.parrot.ridable-in-water", parrotRidableInWater);
|
||||
@@ -1631,6 +1632,7 @@ public class PurpurWorldConfig {
|
||||
parrotMaxHealth = getDouble("mobs.parrot.attributes.max_health", parrotMaxHealth);
|
||||
parrotScale = Mth.clamp(getDouble("mobs.parrot.attributes.scale", parrotScale), 0.0625D, 16.0D);
|
||||
parrotTakeDamageFromWater = getBoolean("mobs.parrot.takes-damage-from-water", parrotTakeDamageFromWater);
|
||||
+ parrotBreedable = getBoolean("mobs.parrot.can-breed", parrotBreedable);
|
||||
}
|
||||
|
||||
public boolean phantomRidable = false;
|
||||
Reference in New Issue
Block a user