mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
Change some default config options to match vanilla behaviors
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
From 28e6cd80aab548a6cbb18a9a3e548b1aea593ab0 Mon Sep 17 00:00:00 2001
|
||||
From b653df02c21db40f850ad00a87994d01b617b98e Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 4 May 2019 01:10:30 -0500
|
||||
Subject: [PATCH] cows to mooshroom when fed mushrooms
|
||||
|
||||
---
|
||||
.../java/net/minecraft/server/Entity.java | 2 +
|
||||
.../java/net/minecraft/server/EntityCow.java | 71 ++++++++++++++++++-
|
||||
.../java/net/minecraft/server/EntityCow.java | 70 +++++++++++++++++++
|
||||
.../net/minecraft/server/EntityLiving.java | 10 ++-
|
||||
.../java/net/pl3x/purpur/PurpurConfig.java | 5 ++
|
||||
4 files changed, 85 insertions(+), 3 deletions(-)
|
||||
4 files changed, 85 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index e8def7f812..40ab9daade 100644
|
||||
@@ -31,24 +31,23 @@ index e8def7f812..40ab9daade 100644
|
||||
this.setPositionRotation(entity.locX, entity.locY, entity.locZ, entity.yaw, entity.pitch);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java
|
||||
index d2c2e3cc33..c3aef0b2a1 100644
|
||||
index d2c2e3cc33..0c00a86a84 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityCow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityCow.java
|
||||
@@ -16,7 +16,7 @@ public class EntityCow extends EntityAnimal {
|
||||
@@ -16,6 +16,7 @@ public class EntityCow extends EntityAnimal {
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
this.goalSelector.a(1, new PathfinderGoalPanic(this, 2.0D));
|
||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
||||
- this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT), false));
|
||||
+ this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT, Blocks.RED_MUSHROOM.getItem(), Blocks.BROWN_MUSHROOM.getItem()), false));
|
||||
+ if (net.pl3x.purpur.PurpurConfig.feedMushroomsToCows > 0) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT, Blocks.RED_MUSHROOM.getItem(), Blocks.BROWN_MUSHROOM.getItem()), false)); else // Purpur
|
||||
this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.25D, RecipeItemStack.a(Items.WHEAT), false));
|
||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D));
|
||||
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||
@@ -79,11 +79,80 @@ public class EntityCow extends EntityAnimal {
|
||||
@@ -79,11 +80,80 @@ public class EntityCow extends EntityAnimal {
|
||||
// CraftBukkit end
|
||||
|
||||
return true;
|
||||
+ // Purpur start - feed mushroom to change to mooshroom
|
||||
+ } else if (getEntityType() != EntityTypes.MOOSHROOM && isMushroom(itemstack)) {
|
||||
+ } else if (net.pl3x.purpur.PurpurConfig.feedMushroomsToCows > 0 && getEntityType() != EntityTypes.MOOSHROOM && isMushroom(itemstack)) {
|
||||
+ return feedMushroom(entityhuman, itemstack);
|
||||
+ // Purpur end
|
||||
} else {
|
||||
@@ -125,7 +124,7 @@ index d2c2e3cc33..c3aef0b2a1 100644
|
||||
public EntityCow createChild(EntityAgeable entityageable) {
|
||||
return (EntityCow) EntityTypes.COW.a(this.world);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 87056e17ca..168b5aa2d1 100644
|
||||
index 31ab07176e..5ee807f0ea 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2742,8 +2742,14 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -146,7 +145,7 @@ index 87056e17ca..168b5aa2d1 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index b0f0040a4a..d433eca03b 100644
|
||||
index b0f0040a4a..d013f84076 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -130,4 +130,9 @@ public class PurpurConfig {
|
||||
@@ -154,7 +153,7 @@ index b0f0040a4a..d433eca03b 100644
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
+
|
||||
+ public static int feedMushroomsToCows = 5;
|
||||
+ public static int feedMushroomsToCows = 0;
|
||||
+ private static void cowsSettings() {
|
||||
+ feedMushroomsToCows = getInt("settings.mobs.cow.feed-mushrooms-for-mooshroom", feedMushroomsToCows);
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user