mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
88 lines
4.9 KiB
Diff
88 lines
4.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: AlphaKR93 <dev@alpha93.kr>
|
|
Date: Wed, 27 Sep 2023 18:29:51 +0900
|
|
Subject: [PATCH] Plazma: Add some missing Pufferfish configurations
|
|
|
|
Original license: MIT
|
|
Original project: https://github.com/PlazmaMC/PlazmaBukkit
|
|
|
|
Add Pufferfish DAB support for Camel, Sniffer
|
|
https://github.com/pufferfish-gg/Pufferfish/issues/83
|
|
|
|
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
index fb8a56d0ee80b0d397f2acd3af1f52fc26676b62..5d93eb5e56e45d485c0718db9e3d8754e97b691c 100644
|
|
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
@@ -162,8 +162,10 @@ public class Armadillo extends Animal {
|
|
return ArmadilloAi.makeBrain(this.brainProvider().makeBrain(dynamic));
|
|
}
|
|
|
|
+ private int behaviorTick; // Leaf - Plazma - Add missing Pufferfish configurations
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
+ if (this.behaviorTick++ % this.activatedPriority == 0) // Leaf - Plazma - Add missing Pufferfish configurations
|
|
((Brain<Armadillo>)this.brain).tick(level, this);
|
|
ArmadilloAi.updateActivity(this);
|
|
if (this.isAlive() && !this.isBaby() && --this.scuteTime <= 0) {
|
|
diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java
|
|
index 101931ff4474ab4445be3fa1a241a731ad3ac1da..8d2dc9b94a13c386b7e54788a9ec6baf15c09a13 100644
|
|
--- a/net/minecraft/world/entity/animal/camel/Camel.java
|
|
+++ b/net/minecraft/world/entity/animal/camel/Camel.java
|
|
@@ -167,9 +167,11 @@ public class Camel extends AbstractHorse {
|
|
return pose == Pose.SITTING ? SITTING_DIMENSIONS.scale(this.getAgeScale()) : super.getDefaultDimensions(pose);
|
|
}
|
|
|
|
+ private int behaviorTick = 0; // Leaf - Plazma - Add missing Pufferfish configurations
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
Brain<?> brain = this.getBrain();
|
|
+ if (this.behaviorTick++ % this.activatedPriority == 0) // Leaf - Plazma - Add missing Pufferfish configurations
|
|
((Brain<Camel>)brain).tick(level, this);
|
|
CamelAi.updateActivity(this);
|
|
super.customServerAiStep(level);
|
|
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
index 0565b37dd5320b49efb11cf28f064d6a970048aa..598216a2794d2c7b325a9e479dfb553427fa0bc7 100644
|
|
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
|
@@ -482,8 +482,10 @@ public class Sniffer extends Animal {
|
|
return Brain.provider(SnifferAi.MEMORY_TYPES, SnifferAi.SENSOR_TYPES);
|
|
}
|
|
|
|
+ private int behaviorTick; // Leaf - Plazma - Add missing Pufferfish configurations
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
+ if (this.behaviorTick++ % this.activatedPriority == 0) // Leaf - Plazma - Add missing Pufferfish configurations
|
|
this.getBrain().tick(level, this);
|
|
SnifferAi.updateActivity(this);
|
|
super.customServerAiStep(level);
|
|
diff --git a/net/minecraft/world/entity/monster/breeze/Breeze.java b/net/minecraft/world/entity/monster/breeze/Breeze.java
|
|
index d91ce14cc39b1b6ccd558f53ed605d4c6a5acae5..52558a99c915da3c46e5f63bd8014cfcdb38505f 100644
|
|
--- a/net/minecraft/world/entity/monster/breeze/Breeze.java
|
|
+++ b/net/minecraft/world/entity/monster/breeze/Breeze.java
|
|
@@ -228,8 +228,10 @@ public class Breeze extends Monster {
|
|
return pos.closerThan(center, 4.0, 10.0);
|
|
}
|
|
|
|
+ private int behaviorTick; // Leaf - Plazma - Add missing Pufferfish configurations
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
+ if (this.behaviorTick++ % this.activatedPriority == 0) // Leaf - Plazma - Add missing Pufferfish configurations
|
|
this.getBrain().tick(level, this);
|
|
BreezeAi.updateActivity(this);
|
|
super.customServerAiStep(level);
|
|
diff --git a/net/minecraft/world/entity/monster/creaking/Creaking.java b/net/minecraft/world/entity/monster/creaking/Creaking.java
|
|
index c9404d72de59e18dc809b8dec107f1f23d50f441..91c6956311da3694cb3cda2f7a86c7e110c0d212 100644
|
|
--- a/net/minecraft/world/entity/monster/creaking/Creaking.java
|
|
+++ b/net/minecraft/world/entity/monster/creaking/Creaking.java
|
|
@@ -231,8 +231,10 @@ public class Creaking extends Monster {
|
|
return (Brain<Creaking>)super.getBrain();
|
|
}
|
|
|
|
+ private int behaviorTick; // Leaf - Plazma - Add missing Pufferfish configurations
|
|
@Override
|
|
protected void customServerAiStep(ServerLevel level) {
|
|
+ if (this.behaviorTick++ % this.activatedPriority == 0) // Leaf - Plazma - Add missing Pufferfish configurations
|
|
this.getBrain().tick((ServerLevel)this.level(), this);
|
|
CreakingAi.updateActivity(this);
|
|
}
|