mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 12:05:53 +01:00
Goat ram API (#6336)
This commit is contained in:
parent
a923e332ee
commit
3f17694803
23
patches/api/0345-Goat-ram-API.patch
Normal file
23
patches/api/0345-Goat-ram-API.patch
Normal file
@ -0,0 +1,23 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Seggan <segganew@gmail.com>
|
||||
Date: Thu, 5 Aug 2021 13:10:31 -0400
|
||||
Subject: [PATCH] Goat ram API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Goat.java b/src/main/java/org/bukkit/entity/Goat.java
|
||||
index 90e9028b5ee7fcf9488d37090875b7163bdcd1d0..01827c4118df36fe1b77115f181fb4d225c3c866 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Goat.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Goat.java
|
||||
@@ -24,4 +24,12 @@ public interface Goat extends Animals {
|
||||
* @param screaming screaming status
|
||||
*/
|
||||
void setScreaming(boolean screaming);
|
||||
+
|
||||
+ // Paper start - Goat ram API
|
||||
+ /**
|
||||
+ * Makes the goat ram at the specified entity
|
||||
+ * @param entity the entity to ram at
|
||||
+ */
|
||||
+ void ram(@org.jetbrains.annotations.NotNull LivingEntity entity);
|
||||
+ // Paper end
|
||||
}
|
44
patches/server/0841-Goat-ram-API.patch
Normal file
44
patches/server/0841-Goat-ram-API.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Seggan <segganew@gmail.com>
|
||||
Date: Thu, 5 Aug 2021 13:10:27 -0400
|
||||
Subject: [PATCH] Goat ram API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
index 32d0387b6c66462ca965add78a562dec3c4b95a9..c7e24da48aaff9fbd1a8272483231744326e3a8e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
|
||||
@@ -279,6 +279,17 @@ public class Goat extends Animal {
|
||||
return new Goat.GoatPathNavigation(this, world);
|
||||
}
|
||||
|
||||
+ // Paper start - Goat ram API
|
||||
+ public void ram(LivingEntity entity) {
|
||||
+ Brain<Goat> brain = this.getBrain();
|
||||
+ brain.setMemory(MemoryModuleType.RAM_TARGET, entity.position());
|
||||
+ brain.eraseMemory(MemoryModuleType.RAM_COOLDOWN_TICKS);
|
||||
+ brain.eraseMemory(MemoryModuleType.BREED_TARGET);
|
||||
+ brain.eraseMemory(MemoryModuleType.TEMPTING_PLAYER);
|
||||
+ brain.setActiveActivityIfPossible(net.minecraft.world.entity.schedule.Activity.RAM);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
private static class GoatPathNavigation extends GroundPathNavigation {
|
||||
|
||||
GoatPathNavigation(Goat goat, Level world) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGoat.java
|
||||
index ae74df5c9845ac125968a52897f4343b0f348217..436aa41563b8fab112d03c8cc516cf6ff37587bd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGoat.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGoat.java
|
||||
@@ -34,4 +34,11 @@ public class CraftGoat extends CraftAnimals implements Goat {
|
||||
public void setScreaming(boolean screaming) {
|
||||
this.getHandle().setScreamingGoat(screaming);
|
||||
}
|
||||
+
|
||||
+ // Paper start - Goat ram API
|
||||
+ @Override
|
||||
+ public void ram(@org.jetbrains.annotations.NotNull org.bukkit.entity.LivingEntity entity) {
|
||||
+ this.getHandle().ram(((CraftLivingEntity) entity).getHandle());
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
Loading…
Reference in New Issue
Block a user