mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
progress
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Cows eat mushrooms
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cow.java b/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
index c9dcbc2dcb2736d0f448496c67121db29b7d4deb..c338dcca4242e472fe2290f0ec20ea67a90cdd06 100644
|
||||
index 1cb5342d63011605b567a4fe16d07de831f04216..a1f498081cb9e198f8796d800c6d130b30256098 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
@@ -1,6 +1,7 @@
|
||||
@@ -24,15 +24,15 @@ index c9dcbc2dcb2736d0f448496c67121db29b7d4deb..c338dcca4242e472fe2290f0ec20ea67
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
@@ -45,6 +47,7 @@ public class Cow extends Animal {
|
||||
this.goalSelector.addGoal(0, new FloatGoal(this));
|
||||
@@ -58,6 +60,7 @@ public class Cow extends Animal {
|
||||
this.goalSelector.addGoal(0, new net.pl3x.purpur.entity.ai.HasRider(this)); // Purpur
|
||||
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0D));
|
||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
|
||||
+ if (level.purpurConfig.cowFeedMushrooms > 0) this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.WHEAT, Blocks.RED_MUSHROOM.asItem(), Blocks.BROWN_MUSHROOM.asItem()), false)); else // Purpur
|
||||
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.WHEAT), false));
|
||||
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25D));
|
||||
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0D));
|
||||
@@ -99,11 +102,80 @@ public class Cow extends Animal {
|
||||
@@ -113,11 +116,80 @@ public class Cow extends Animal {
|
||||
|
||||
player.setItemInHand(hand, itemstack1);
|
||||
return InteractionResult.sidedSuccess(this.level.isClientSide);
|
||||
@@ -114,18 +114,18 @@ index c9dcbc2dcb2736d0f448496c67121db29b7d4deb..c338dcca4242e472fe2290f0ec20ea67
|
||||
public Cow getBreedOffspring(ServerLevel world, AgeableMob entity) {
|
||||
return (Cow) EntityType.COW.create((Level) world);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 808803acb28dd6d7b2db1153a5a30cc3be46b2e4..37b4b1b749a961e1702408c86dd84bc0dcbfa12b 100644
|
||||
index 1806b9121cc131e4d4f57f4da004666954be7268..e9a00422f9952c98d04c0cbb2ea32ea6231f50ed 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -132,6 +132,11 @@ public class PurpurWorldConfig {
|
||||
chickenRetaliate = getBoolean("mobs.chicken.retaliate", chickenRetaliate);
|
||||
@@ -186,9 +186,11 @@ public class PurpurWorldConfig {
|
||||
|
||||
public boolean cowRidable = false;
|
||||
public boolean cowRidableInWater = false;
|
||||
+ public int cowFeedMushrooms = 0;
|
||||
private void cowSettings() {
|
||||
cowRidable = getBoolean("mobs.cow.ridable", cowRidable);
|
||||
cowRidableInWater = getBoolean("mobs.cow.ridable-in-water", cowRidableInWater);
|
||||
+ cowFeedMushrooms = getInt("mobs.cow.feed-mushrooms-for-mooshroom", cowFeedMushrooms);
|
||||
}
|
||||
|
||||
+ public int cowFeedMushrooms = 0;
|
||||
+ private void cowSettings() {
|
||||
+ cowFeedMushrooms = getInt("mobs.cow.feed-mushrooms-for-mooshroom", cowFeedMushrooms);
|
||||
+ }
|
||||
+
|
||||
public double creeperChargedChance = 0.0D;
|
||||
private void creeperSettings() {
|
||||
creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
public boolean creeperRidable = false;
|
||||
|
||||
Reference in New Issue
Block a user