mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Add config for feeding mushrooms to cows
This commit is contained in:
@@ -1,15 +1,16 @@
|
|||||||
From 617301a9f118aaff29e08b3a0461423bafda464f Mon Sep 17 00:00:00 2001
|
From 9266c5c4a2632b05a03ea9e3e2a5052c1f5dc170 Mon Sep 17 00:00:00 2001
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Date: Sat, 4 May 2019 01:10:30 -0500
|
Date: Sat, 4 May 2019 01:10:30 -0500
|
||||||
Subject: [PATCH] cows to mooshroom when fed mushrooms
|
Subject: [PATCH] cows to mooshroom when fed mushrooms
|
||||||
|
|
||||||
---
|
---
|
||||||
.../java/net/minecraft/server/Entity.java | 1 +
|
.../java/net/minecraft/server/Entity.java | 1 +
|
||||||
.../java/net/minecraft/server/EntityCow.java | 75 ++++++++++++++++++-
|
.../java/net/minecraft/server/EntityCow.java | 76 ++++++++++++++++++-
|
||||||
2 files changed, 75 insertions(+), 1 deletion(-)
|
.../java/net/pl3x/purpur/PurpurConfig.java | 5 ++
|
||||||
|
3 files changed, 81 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||||
index d02e48a86..ab0995c2c 100644
|
index 3b1555dd2..74f00b376 100644
|
||||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||||
@@ -995,6 +995,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
@@ -995,6 +995,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||||
@@ -21,10 +22,14 @@ index d02e48a86..ab0995c2c 100644
|
|||||||
if (!this.isSilent()) {
|
if (!this.isSilent()) {
|
||||||
this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, soundeffect, this.getSoundCategory(), f, f1);
|
this.world.a((EntityHuman) null, this.locX, this.locY, this.locZ, soundeffect, this.getSoundCategory(), f, f1);
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java
|
diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java
|
||||||
index d2c2e3cc3..3cb35c422 100644
|
index d2c2e3cc3..f053ff0e5 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityCow.java
|
--- a/src/main/java/net/minecraft/server/EntityCow.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityCow.java
|
+++ b/src/main/java/net/minecraft/server/EntityCow.java
|
||||||
@@ -4,6 +4,10 @@ package net.minecraft.server;
|
@@ -1,9 +1,14 @@
|
||||||
|
package net.minecraft.server;
|
||||||
|
|
||||||
|
// CraftBukkit start
|
||||||
|
+import net.pl3x.purpur.PurpurConfig;
|
||||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -35,7 +40,7 @@ index d2c2e3cc3..3cb35c422 100644
|
|||||||
|
|
||||||
public class EntityCow extends EntityAnimal {
|
public class EntityCow extends EntityAnimal {
|
||||||
|
|
||||||
@@ -16,7 +20,7 @@ public class EntityCow extends EntityAnimal {
|
@@ -16,7 +21,7 @@ public class EntityCow extends EntityAnimal {
|
||||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||||
this.goalSelector.a(1, new PathfinderGoalPanic(this, 2.0D));
|
this.goalSelector.a(1, new PathfinderGoalPanic(this, 2.0D));
|
||||||
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
this.goalSelector.a(2, new PathfinderGoalBreed(this, 1.0D));
|
||||||
@@ -44,7 +49,7 @@ index d2c2e3cc3..3cb35c422 100644
|
|||||||
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D));
|
this.goalSelector.a(4, new PathfinderGoalFollowParent(this, 1.25D));
|
||||||
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
this.goalSelector.a(5, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||||
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
|
||||||
@@ -79,11 +83,80 @@ public class EntityCow extends EntityAnimal {
|
@@ -79,11 +84,80 @@ public class EntityCow extends EntityAnimal {
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -76,7 +81,7 @@ index d2c2e3cc3..3cb35c422 100644
|
|||||||
+ private boolean feedMushroom(EntityHuman entityhuman, ItemStack itemstack) {
|
+ private boolean feedMushroom(EntityHuman entityhuman, ItemStack itemstack) {
|
||||||
+ world.broadcastEntityEffect(this, (byte) 18); // hearts
|
+ world.broadcastEntityEffect(this, (byte) 18); // hearts
|
||||||
+ playSound(SoundEffects.ENTITY_COW_MILK, 1.0F, 1.0F);
|
+ playSound(SoundEffects.ENTITY_COW_MILK, 1.0F, 1.0F);
|
||||||
+ if (incrementFeedCount(itemstack) < 5) {
|
+ if (incrementFeedCount(itemstack) < PurpurConfig.feedMushroomsToCows) {
|
||||||
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
+ if (!entityhuman.abilities.canInstantlyBuild) {
|
||||||
+ itemstack.subtract(1);
|
+ itemstack.subtract(1);
|
||||||
+ }
|
+ }
|
||||||
@@ -125,6 +130,20 @@ index d2c2e3cc3..3cb35c422 100644
|
|||||||
@Override
|
@Override
|
||||||
public EntityCow createChild(EntityAgeable entityageable) {
|
public EntityCow createChild(EntityAgeable entityageable) {
|
||||||
return (EntityCow) EntityTypes.COW.a(this.world);
|
return (EntityCow) EntityTypes.COW.a(this.world);
|
||||||
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
index e91bd0a36..88835089c 100644
|
||||||
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
|
@@ -102,4 +102,9 @@ public class PurpurConfig {
|
||||||
|
config.addDefault(path, def);
|
||||||
|
return config.getString(path, config.getString(path));
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public static int feedMushroomsToCows = 5;
|
||||||
|
+ private static void cowsSettings() {
|
||||||
|
+ feedMushroomsToCows = getInt("settings.mobs.cow.feed-mushrooms-for-mooshroom", feedMushroomsToCows);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
--
|
--
|
||||||
2.20.1
|
2.20.1
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
From c55bbd3eae4fc9be0c23ec7d5f83a8caad4a2925 Mon Sep 17 00:00:00 2001
|
From 09b27be73afdc7b7caa83fbe80a5e2b963faa628 Mon Sep 17 00:00:00 2001
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Date: Fri, 10 May 2019 19:17:36 -0500
|
Date: Fri, 10 May 2019 19:17:36 -0500
|
||||||
Subject: [PATCH] Add config to suppress specific log outputs
|
Subject: [PATCH] Add config to suppress specific log outputs
|
||||||
@@ -35,12 +35,12 @@ index 3ed12672e..d82102bd8 100644
|
|||||||
WorldServer.LOGGER.error("Deleting duplicate entity {}", entity); // CraftBukkit // paper
|
WorldServer.LOGGER.error("Deleting duplicate entity {}", entity); // CraftBukkit // paper
|
||||||
|
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
index e91bd0a36..734b8026d 100644
|
index 88835089c..b74868b9c 100644
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
@@ -102,4 +102,11 @@ public class PurpurConfig {
|
@@ -107,4 +107,11 @@ public class PurpurConfig {
|
||||||
config.addDefault(path, def);
|
private static void cowsSettings() {
|
||||||
return config.getString(path, config.getString(path));
|
feedMushroomsToCows = getInt("settings.mobs.cow.feed-mushrooms-for-mooshroom", feedMushroomsToCows);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ public static boolean showDuplicateEntityUUIDErrors = true;
|
+ public static boolean showDuplicateEntityUUIDErrors = true;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
From 05b0ff051a20b48b0495aac5b2a6de2a534cc277 Mon Sep 17 00:00:00 2001
|
From 59d40521715a6724ac7f4ca690d07bedf5acad85 Mon Sep 17 00:00:00 2001
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||||
Date: Sun, 12 May 2019 00:43:12 -0500
|
Date: Sun, 12 May 2019 00:43:12 -0500
|
||||||
Subject: [PATCH] Make giants naturally spawn and have AI
|
Subject: [PATCH] Make giants naturally spawn and have AI
|
||||||
@@ -106,10 +106,10 @@ index 19b8312f2..b58b681a9 100644
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
index 734b8026d..5cc9a27db 100644
|
index b74868b9c..f7d24f18a 100644
|
||||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||||
@@ -109,4 +109,11 @@ public class PurpurConfig {
|
@@ -114,4 +114,11 @@ public class PurpurConfig {
|
||||||
showDuplicateEntityUUIDErrors = getBoolean("settings.logger.show-duplicate-entity-uuid-errors", showDuplicateEntityUUIDErrors);
|
showDuplicateEntityUUIDErrors = getBoolean("settings.logger.show-duplicate-entity-uuid-errors", showDuplicateEntityUUIDErrors);
|
||||||
showUnknownAttributeWarnings = getBoolean("settings.logger.show-unknown-attribute-warnings", showUnknownAttributeWarnings);
|
showUnknownAttributeWarnings = getBoolean("settings.logger.show-unknown-attribute-warnings", showUnknownAttributeWarnings);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user