Remove method rename and fix reobf for Goal#getFlags (#6528)
This commit is contained in:
parent
df51228b73
commit
d3dab2f22c
3 changed files with 16 additions and 14 deletions
|
@ -398,7 +398,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+package com.destroystokyo.paper.entity.ai;
|
||||
+
|
||||
+import org.bukkit.entity.Mob;
|
||||
+import com.destroystokyo.paper.entity.ai.Goal;
|
||||
+
|
||||
+/**
|
||||
+ * Wraps api in vanilla
|
||||
|
@ -411,8 +410,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ this.handle = handle;
|
||||
+
|
||||
+ this.setFlags(MobGoalHelper.paperToVanilla(handle.getTypes()));
|
||||
+ if (this.getGoalTypes().size() == 0) {
|
||||
+ this.getGoalTypes().addUnchecked(Flag.UNKNOWN_BEHAVIOR);
|
||||
+ if (this.getFlags().size() == 0) {
|
||||
+ this.getFlags().addUnchecked(Flag.UNKNOWN_BEHAVIOR);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
@ -566,7 +565,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ CraftMob craftMob = (CraftMob) mob;
|
||||
+ Set<Goal<T>> goals = new HashSet<>();
|
||||
+ for (WrappedGoal item : getHandle(craftMob, type).availableGoals) {
|
||||
+ if (!item.getGoal().getGoalTypes().hasElement(MobGoalHelper.paperToVanilla(type))) {
|
||||
+ if (!item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type))) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
|
@ -589,7 +588,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ continue;
|
||||
+ }
|
||||
+ for (WrappedGoal item : getHandle(craftMob, internalType).availableGoals) {
|
||||
+ if (item.getGoal().getGoalTypes().hasElement(MobGoalHelper.paperToVanilla(type))) {
|
||||
+ if (item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type))) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
|
@ -618,7 +617,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ CraftMob craftMob = (CraftMob) mob;
|
||||
+ Set<Goal<T>> goals = new HashSet<>();
|
||||
+ getHandle(craftMob, type).getRunningGoals()
|
||||
+ .filter(item -> item.getGoal().getGoalTypes().hasElement(MobGoalHelper.paperToVanilla(type)))
|
||||
+ .filter(item -> item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type)))
|
||||
+ .forEach(item -> {
|
||||
+ if (item.getGoal() instanceof PaperCustomGoal) {
|
||||
+ //noinspection unchecked
|
||||
|
@ -639,7 +638,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ continue;
|
||||
+ }
|
||||
+ getHandle(craftMob, internalType).getRunningGoals()
|
||||
+ .filter(item -> !item.getGoal().getGoalTypes().hasElement(MobGoalHelper.paperToVanilla(type)))
|
||||
+ .filter(item -> !item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type)))
|
||||
+ .forEach(item -> {
|
||||
+ if (item.getGoal() instanceof PaperCustomGoal) {
|
||||
+ //noinspection unchecked
|
||||
|
@ -693,7 +692,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ public PaperVanillaGoal(Goal handle) {
|
||||
+ this.handle = handle;
|
||||
+ this.key = MobGoalHelper.getKey(handle.getClass());
|
||||
+ this.types = MobGoalHelper.vanillaToPaper(handle.getGoalTypes());
|
||||
+ this.types = MobGoalHelper.vanillaToPaper(handle.getFlags());
|
||||
+ }
|
||||
+
|
||||
+ public Goal getHandle() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue