Move diffs around to compile without later ones applied

This commit is contained in:
Nassim Jahnke
2024-01-23 18:01:39 +01:00
parent 091f54138b
commit cd30cd6d41
19 changed files with 243 additions and 196 deletions

View File

@@ -311,10 +311,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return deobfuscationMap.getOrDefault(name, name);
+ }
+
+ public static EnumSet<GoalType> vanillaToPaper(OptimizedSmallEnumSet<Goal.Flag> types) {
+ public static EnumSet<GoalType> vanillaToPaper(Goal goal) {
+ EnumSet<GoalType> goals = EnumSet.noneOf(GoalType.class);
+ for (GoalType type : GoalType.values()) {
+ if (types.hasElement(paperToVanilla(type))) {
+ if (goal.getFlags().contains(paperToVanilla(type))) {
+ goals.add(type);
+ }
+ }
@@ -420,7 +420,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ this.setFlags(MobGoalHelper.paperToVanilla(handle.getTypes()));
+ if (this.getFlags().size() == 0) {
+ this.getFlags().addUnchecked(Flag.UNKNOWN_BEHAVIOR);
+ this.getFlags().add(Flag.UNKNOWN_BEHAVIOR);
+ }
+ }
+
@@ -574,7 +574,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ CraftMob craftMob = (CraftMob) mob;
+ Set<Goal<T>> goals = new HashSet<>();
+ for (WrappedGoal item : getHandle(craftMob, type).getAvailableGoals()) {
+ if (!item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type))) {
+ if (!item.getGoal().getFlags().contains(MobGoalHelper.paperToVanilla(type))) {
+ continue;
+ }
+
@@ -597,7 +597,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ continue;
+ }
+ for (WrappedGoal item : getHandle(craftMob, internalType).getAvailableGoals()) {
+ if (item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type))) {
+ if (item.getGoal().getFlags().contains(MobGoalHelper.paperToVanilla(type))) {
+ continue;
+ }
+
@@ -626,7 +626,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ CraftMob craftMob = (CraftMob) mob;
+ Set<Goal<T>> goals = new HashSet<>();
+ getHandle(craftMob, type).getRunningGoals()
+ .filter(item -> item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type)))
+ .filter(item -> item.getGoal().getFlags().contains(MobGoalHelper.paperToVanilla(type)))
+ .forEach(item -> {
+ if (item.getGoal() instanceof PaperCustomGoal) {
+ //noinspection unchecked
@@ -647,7 +647,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ continue;
+ }
+ getHandle(craftMob, internalType).getRunningGoals()
+ .filter(item -> !item.getGoal().getFlags().hasElement(MobGoalHelper.paperToVanilla(type)))
+ .filter(item -> !item.getGoal().getFlags().contains(MobGoalHelper.paperToVanilla(type)))
+ .forEach(item -> {
+ if (item.getGoal() instanceof PaperCustomGoal) {
+ //noinspection unchecked
@@ -701,7 +701,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public PaperVanillaGoal(Goal handle) {
+ this.handle = handle;
+ this.key = MobGoalHelper.getKey(handle.getClass());
+ this.types = MobGoalHelper.vanillaToPaper(handle.getFlags());
+ this.types = MobGoalHelper.vanillaToPaper(handle);
+ }
+
+ public Goal getHandle() {