9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-04 15:41:40 +00:00
Files
Leaf/patches/server/0046-Plazma-Add-some-missing-Pufferfish-configurations.patch
2024-12-13 21:19:57 -05:00

74 lines
4.3 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/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
index 8e8345d9062b1e666cd1b987c44175741b094d07..8046dcd9740c64cc768351f3fd174a836a839e05 100644
--- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
+++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
@@ -159,8 +159,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 world) {
+ if (this.behaviorTick++ % this.activatedPriority == 0) // Leaf - Plazma - Add missing Pufferfish configurations
((Brain<Armadillo>) this.brain).tick(world, this); // CraftBukkit - decompile error
ArmadilloAi.updateActivity(this);
if (this.isAlive() && !this.isBaby() && --this.scuteTime <= 0) {
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index 542b972b266eae642b220025c6173c738fcff80f..c0595b595905e4f876e013a16e75204d9ceeead9 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
@@ -150,10 +150,12 @@ public class Camel extends AbstractHorse {
return pose == Pose.SITTING ? Camel.SITTING_DIMENSIONS.scale(this.getAgeScale()) : super.getDefaultDimensions(pose);
}
+ private int behaviorTick = 0; // Leaf - Plazma - Add missing Pufferfish configurations
@Override
protected void customServerAiStep(ServerLevel world) {
Brain<Camel> behaviorcontroller = (Brain<Camel>) this.getBrain(); // CraftBukkit - decompile error
+ if (this.behaviorTick++ % this.activatedPriority == 0) // Leaf - Plazma - Add missing Pufferfish configurations
behaviorcontroller.tick(world, this);
CamelAi.updateActivity(this);
super.customServerAiStep(world);
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
index bd752597c925a68f834939d502a7224e022ae79e..dc0f8bf73170f5012a5d4af3a7e823352d684bd9 100644
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -491,8 +491,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 world) {
+ if (this.behaviorTick++ % this.activatedPriority == 0) // Leaf - Plazma - Add missing Pufferfish configurations
this.getBrain().tick(world, this);
SnifferAi.updateActivity(this);
super.customServerAiStep(world);
diff --git a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java
index 2e6b6ef451cd3caa1fde466e5c670b7f17814753..b38245294249086a0dfa15147a424d76b17a5af9 100644
--- a/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java
+++ b/src/main/java/net/minecraft/world/entity/monster/breeze/Breeze.java
@@ -232,8 +232,10 @@ public class Breeze extends Monster {
return pos.closerThan(vec3d1, 4.0D, 10.0D);
}
+ private int behaviorTick; // Leaf - Plazma - Add missing Pufferfish configurations
@Override
protected void customServerAiStep(ServerLevel world) {
+ if (this.behaviorTick++ % this.activatedPriority == 0) // Leaf - Plazma - Add missing Pufferfish configurations
this.getBrain().tick(world, this);
BreezeAi.updateActivity(this);
super.customServerAiStep(world);