mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
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
|
@ -48,3 +48,7 @@ c net/minecraft/world/level/Level net/minecraft/world/level/World
|
||||||
# Paper changes type
|
# Paper changes type
|
||||||
c net/minecraft/core/MappedRegistry net/minecraft/core/RegistryMaterials
|
c net/minecraft/core/MappedRegistry net/minecraft/core/RegistryMaterials
|
||||||
f Lit/unimi/dsi/fastutil/objects/Reference2IntOpenHashMap; toId bw
|
f Lit/unimi/dsi/fastutil/objects/Reference2IntOpenHashMap; toId bw
|
||||||
|
|
||||||
|
# Remove streams from Mob AI System changes type from EnumSet to com.destroystokyo.paper.util.set.OptimizedSmallEnumSet
|
||||||
|
c net/minecraft/world/entity/ai/goal/Goal net/minecraft/world/entity/ai/goal/PathfinderGoal
|
||||||
|
m ()Lcom/destroystokyo/paper/util/set/OptimizedSmallEnumSet; getFlags i
|
||||||
|
|
|
@ -398,7 +398,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+package com.destroystokyo.paper.entity.ai;
|
+package com.destroystokyo.paper.entity.ai;
|
||||||
+
|
+
|
||||||
+import org.bukkit.entity.Mob;
|
+import org.bukkit.entity.Mob;
|
||||||
+import com.destroystokyo.paper.entity.ai.Goal;
|
|
||||||
+
|
+
|
||||||
+/**
|
+/**
|
||||||
+ * Wraps api in vanilla
|
+ * Wraps api in vanilla
|
||||||
|
@ -411,8 +410,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ this.handle = handle;
|
+ this.handle = handle;
|
||||||
+
|
+
|
||||||
+ this.setFlags(MobGoalHelper.paperToVanilla(handle.getTypes()));
|
+ this.setFlags(MobGoalHelper.paperToVanilla(handle.getTypes()));
|
||||||
+ if (this.getGoalTypes().size() == 0) {
|
+ if (this.getFlags().size() == 0) {
|
||||||
+ this.getGoalTypes().addUnchecked(Flag.UNKNOWN_BEHAVIOR);
|
+ this.getFlags().addUnchecked(Flag.UNKNOWN_BEHAVIOR);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -566,7 +565,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ CraftMob craftMob = (CraftMob) mob;
|
+ CraftMob craftMob = (CraftMob) mob;
|
||||||
+ Set<Goal<T>> goals = new HashSet<>();
|
+ Set<Goal<T>> goals = new HashSet<>();
|
||||||
+ for (WrappedGoal item : getHandle(craftMob, type).availableGoals) {
|
+ for (WrappedGoal item : getHandle(craftMob, type).availableGoals) {
|
||||||
+ if (!item.getGoal().getGoalTypes().hasElement(MobGoalHelper.paperToVanilla(type))) {
|
+ if (!item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type))) {
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -589,7 +588,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+ for (WrappedGoal item : getHandle(craftMob, internalType).availableGoals) {
|
+ for (WrappedGoal item : getHandle(craftMob, internalType).availableGoals) {
|
||||||
+ if (item.getGoal().getGoalTypes().hasElement(MobGoalHelper.paperToVanilla(type))) {
|
+ if (item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type))) {
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -618,7 +617,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ CraftMob craftMob = (CraftMob) mob;
|
+ CraftMob craftMob = (CraftMob) mob;
|
||||||
+ Set<Goal<T>> goals = new HashSet<>();
|
+ Set<Goal<T>> goals = new HashSet<>();
|
||||||
+ getHandle(craftMob, type).getRunningGoals()
|
+ getHandle(craftMob, type).getRunningGoals()
|
||||||
+ .filter(item -> item.getGoal().getGoalTypes().hasElement(MobGoalHelper.paperToVanilla(type)))
|
+ .filter(item -> item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type)))
|
||||||
+ .forEach(item -> {
|
+ .forEach(item -> {
|
||||||
+ if (item.getGoal() instanceof PaperCustomGoal) {
|
+ if (item.getGoal() instanceof PaperCustomGoal) {
|
||||||
+ //noinspection unchecked
|
+ //noinspection unchecked
|
||||||
|
@ -639,7 +638,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+ getHandle(craftMob, internalType).getRunningGoals()
|
+ getHandle(craftMob, internalType).getRunningGoals()
|
||||||
+ .filter(item -> !item.getGoal().getGoalTypes().hasElement(MobGoalHelper.paperToVanilla(type)))
|
+ .filter(item -> !item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type)))
|
||||||
+ .forEach(item -> {
|
+ .forEach(item -> {
|
||||||
+ if (item.getGoal() instanceof PaperCustomGoal) {
|
+ if (item.getGoal() instanceof PaperCustomGoal) {
|
||||||
+ //noinspection unchecked
|
+ //noinspection unchecked
|
||||||
|
@ -693,7 +692,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ public PaperVanillaGoal(Goal handle) {
|
+ public PaperVanillaGoal(Goal handle) {
|
||||||
+ this.handle = handle;
|
+ this.handle = handle;
|
||||||
+ this.key = MobGoalHelper.getKey(handle.getClass());
|
+ this.key = MobGoalHelper.getKey(handle.getClass());
|
||||||
+ this.types = MobGoalHelper.vanillaToPaper(handle.getGoalTypes());
|
+ this.types = MobGoalHelper.vanillaToPaper(handle.getFlags());
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public Goal getHandle() {
|
+ public Goal getHandle() {
|
||||||
|
|
|
@ -43,7 +43,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
- public EnumSet<Goal.Flag> getFlags() {
|
- public EnumSet<Goal.Flag> getFlags() {
|
||||||
- return this.flags;
|
- return this.flags;
|
||||||
+ // Paper start - remove streams from pathfindergoalselector
|
+ // Paper start - remove streams from pathfindergoalselector
|
||||||
+ public com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<Goal.Flag> getGoalTypes() {
|
+ public com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<Goal.Flag> getFlags() {
|
||||||
+ return this.goalTypes;
|
+ return this.goalTypes;
|
||||||
+ // Paper end - remove streams from pathfindergoalselector
|
+ // Paper end - remove streams from pathfindergoalselector
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
- this.lockedFlags.remove(flag);
|
- this.lockedFlags.remove(flag);
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+ if (!this.goalTypes.hasCommonElements(wrappedGoal.getGoalTypes()) && wrappedGoal.canContinueToUse()) {
|
+ if (!this.goalTypes.hasCommonElements(wrappedGoal.getFlags()) && wrappedGoal.canContinueToUse()) {
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+ wrappedGoal.stop();
|
+ wrappedGoal.stop();
|
||||||
|
@ -141,7 +141,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> wrappedGoalSet = wrappedGoal.getGoalTypes();
|
+ com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> wrappedGoalSet = wrappedGoal.getFlags();
|
||||||
+
|
+
|
||||||
+ if (this.goalTypes.hasCommonElements(wrappedGoalSet)) {
|
+ if (this.goalTypes.hasCommonElements(wrappedGoalSet)) {
|
||||||
+ continue;
|
+ continue;
|
||||||
|
@ -214,10 +214,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
|
|
||||||
- @Override
|
- @Override
|
||||||
- public EnumSet<Goal.Flag> getFlags() {
|
- public EnumSet<Goal.Flag> getFlags() {
|
||||||
- return this.goal.getFlags();
|
|
||||||
+ // Paper start - remove streams from pathfindergoalselector
|
+ // Paper start - remove streams from pathfindergoalselector
|
||||||
+ public com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<Goal.Flag> getGoalTypes() {
|
+ public com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<Goal.Flag> getFlags() {
|
||||||
+ return this.goal.getGoalTypes();
|
return this.goal.getFlags();
|
||||||
+ // Paper end - remove streams from pathfindergoalselector
|
+ // Paper end - remove streams from pathfindergoalselector
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue