Add missing mob goals for API (#3367)

This commit is contained in:
Max Lee
2020-05-17 04:19:24 +01:00
parent ee99320810
commit acbe459f57
2 changed files with 37 additions and 1 deletions

View File

@@ -62,7 +62,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // TODO these kinda should be checked on each release, in case obfuscation changes
+ deobfuscationMap.put("bee_b", "bee_attack");
+ deobfuscationMap.put("bee_c", "bee_become_angry");
+ deobfuscationMap.put("bee_d", "bee_enter_hive");
+ deobfuscationMap.put("bee_e", "bee_go_to_hive");
+ deobfuscationMap.put("bee_f", "bee_go_to_known_flower");
+ deobfuscationMap.put("bee_g", "bee_grow_crop");
+ deobfuscationMap.put("bee_h", "bee_hurt_by_other");
+ deobfuscationMap.put("bee_i", "bee_locate_hive");
+ deobfuscationMap.put("bee_k", "bee_pollinate");
+ deobfuscationMap.put("bee_l", "bee_wander");
+ deobfuscationMap.put("cat_a", "cat_avoid_entity");
+ deobfuscationMap.put("cat_b", "cat_relax_on_owner");
@@ -75,6 +81,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ deobfuscationMap.put("drowned_e", "drowned_swim_up");
+ deobfuscationMap.put("drowned_f", "drowned_trident_attack");
+ deobfuscationMap.put("enderman_a", "enderman_freeze_when_looked_at");
+ deobfuscationMap.put("evoker_a", "evoker_attack_spell");
+ deobfuscationMap.put("evoker_b", "evoker_cast_spell");
+ deobfuscationMap.put("evoker_c", "evoker_summon_spell");
+ deobfuscationMap.put("evoker_d", "evoker_wololo_spell");
+ deobfuscationMap.put("fish_b", "fish_swim");
+ deobfuscationMap.put("fox_a", "fox_defend_trusted");
+ deobfuscationMap.put("fox_b", "fox_faceplant");
@@ -88,9 +98,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ deobfuscationMap.put("fox_o", "fox_pounce");
+ deobfuscationMap.put("fox_p", "fox_search_for_items");
+ deobfuscationMap.put("fox_q", "fox_stroll_through_village");
+ deobfuscationMap.put("fox_r", "fox_perch_and_search");
+ deobfuscationMap.put("fox_s", "fox_seek_shelter");
+ deobfuscationMap.put("fox_t", "fox_sleep");
+ deobfuscationMap.put("fox_u", "fox_stalk_prey");
+ deobfuscationMap.put("illager_abstract_b", "raider_open_door");
+ deobfuscationMap.put("illager_illusioner_a", "illusioner_blindness_spell");
+ deobfuscationMap.put("illager_illusioner_b", "illusioner_mirror_spell");
+ deobfuscationMap.put("illager_wizard_b", "spellcaster_cast_spell");
+ deobfuscationMap.put("llama_a", "llama_attack_wolf");
+ deobfuscationMap.put("llama_c", "llama_hurt_by");
@@ -110,6 +124,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ deobfuscationMap.put("panda_l", "panda_sneeze");
+ deobfuscationMap.put("phantom_b", "phantom_attack_player");
+ deobfuscationMap.put("phantom_c", "phantom_attack_strategy");
+ deobfuscationMap.put("phantom_e", "phantom_circle_around_anchor");
+ deobfuscationMap.put("phantom_i", "phantom_sweep_attack");
+ deobfuscationMap.put("polar_bear_a", "polarbear_attack_players");
+ deobfuscationMap.put("polar_bear_b", "polarbear_hurt_by");
+ deobfuscationMap.put("polar_bear_c", "polarbear_melee");
@@ -883,7 +899,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ List<GoalKey<?>> vanillaNames = classes.stream()
+ .filter(clazz -> clazz.getEnclosingClass() == null || clazz.getSuperclass().getEnclosingClass() == null)
+ .filter(VanillaMobGoalTest::hasNoEnclosingClass)
+ .filter(clazz -> !Modifier.isAbstract(clazz.getModifiers()))
+ .map(goalClass -> MobGoalHelper.getKey((Class<? extends PathfinderGoal>) goalClass))
+ .collect(Collectors.toList());
@@ -912,6 +928,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (shouldFail) Assert.fail("See above");
+ }
+
+ private static boolean hasNoEnclosingClass(Class<?> clazz) {
+ return clazz.getEnclosingClass() == null || hasNoEnclosingClass(clazz.getSuperclass());
+ }
+
+ @Test
+ public void testBukkitMap() {
+ List<Class<?>> classes;