mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
[ci skip] add a good chunk of patch identifying comments
This commit is contained in:
@@ -5,35 +5,35 @@ 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 8229a99d4454df64def52bbf686183284d62c900..5b1cd0003f48a44609ed42919a191ec22c379640 100644
|
||||
index 064188a7032170ed16cf3b538efc444e54325036..88dd147317e200a11eb6a7e496bfffee9079fd6f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Cow.java
|
||||
@@ -74,7 +74,7 @@ public class Cow extends Animal {
|
||||
@@ -75,7 +75,7 @@ public class Cow extends Animal {
|
||||
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0D));
|
||||
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D));
|
||||
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, (itemstack) -> {
|
||||
- return itemstack.is(ItemTags.COW_FOOD);
|
||||
+ return level().purpurConfig.cowFeedMushrooms > 0 && (itemstack.is(net.minecraft.world.level.block.Blocks.RED_MUSHROOM.asItem()) || itemstack.is(net.minecraft.world.level.block.Blocks.BROWN_MUSHROOM.asItem())) || itemstack.is(ItemTags.COW_FOOD); // Purpur
|
||||
+ return level().purpurConfig.cowFeedMushrooms > 0 && (itemstack.is(net.minecraft.world.level.block.Blocks.RED_MUSHROOM.asItem()) || itemstack.is(net.minecraft.world.level.block.Blocks.BROWN_MUSHROOM.asItem())) || itemstack.is(ItemTags.COW_FOOD); // Purpur - Cows eat mushrooms
|
||||
}, false));
|
||||
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25D));
|
||||
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0D));
|
||||
@@ -136,6 +136,10 @@ public class Cow extends Animal {
|
||||
@@ -137,6 +137,10 @@ public class Cow extends Animal {
|
||||
|
||||
player.setItemInHand(hand, itemstack1);
|
||||
return InteractionResult.SUCCESS;
|
||||
+ // Purpur start - feed mushroom to change to mooshroom
|
||||
+ // Purpur start - feed mushroom to change to mooshroom - Cows eat mushrooms
|
||||
+ } else if (level().purpurConfig.cowFeedMushrooms > 0 && this.getType() != EntityType.MOOSHROOM && isMushroom(itemstack)) {
|
||||
+ return this.feedMushroom(player, itemstack);
|
||||
+ // Purpur end
|
||||
+ // Purpur end - Cows eat mushrooms
|
||||
} else {
|
||||
return super.mobInteract(player, hand);
|
||||
}
|
||||
@@ -151,4 +155,67 @@ public class Cow extends Animal {
|
||||
@@ -152,4 +156,67 @@ public class Cow extends Animal {
|
||||
public EntityDimensions getDefaultDimensions(Pose pose) {
|
||||
return this.isBaby() ? Cow.BABY_DIMENSIONS : super.getDefaultDimensions(pose);
|
||||
}
|
||||
+
|
||||
+ // Purpur start - feed mushroom to change to mooshroom
|
||||
+ // Purpur start - feed mushroom to change to mooshroom - Cows eat mushrooms
|
||||
+ private int redMushroomsFed = 0;
|
||||
+ private int brownMushroomsFed = 0;
|
||||
+
|
||||
@@ -94,7 +94,7 @@ index 8229a99d4454df64def52bbf686183284d62c900..5b1cd0003f48a44609ed42919a191ec2
|
||||
+ }
|
||||
+ return InteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+ // Purpur end - Cows eat mushrooms
|
||||
}
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index b3284dfbcdc240919776f47a780a824c406c2781..6eb25a9b4bb634e57f6de015c9a9f2fc78d0b86f 100644
|
||||
|
||||
Reference in New Issue
Block a user