Skip to content

Commit

Permalink
SimpleEntityData - Fixes (SkriptLang#2088)
Browse files Browse the repository at this point in the history
* SimpleEntityData - Fixes
- Register zombie after Husk and Drowned to ensure those 2 work

* SimpleEntityData - Changes
- Added in "mob" as well, not really sure why this was never added

* SimpleEntityData - Changes
- Fixed tabs

* English.lang - Changes
- Im throwing the 1.14 enchantments into here as well
  • Loading branch information
ShaneBeee authored and FranKusmiruk committed May 22, 2019
1 parent d7746b5 commit 7c67f2a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/main/java/ch/njol/skript/entity/SimpleEntityData.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@
import org.bukkit.entity.Llama;
import org.bukkit.entity.LlamaSpit;
import org.bukkit.entity.MagmaCube;
import org.bukkit.entity.Mob;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Mule;
import org.bukkit.entity.MushroomCow;
import org.bukkit.entity.Painting;
import org.bukkit.entity.Panda;
import org.bukkit.entity.Phantom;
import org.bukkit.entity.PigZombie;
import org.bukkit.entity.Pillager;
Expand All @@ -103,7 +103,6 @@
import org.bukkit.entity.TNTPrimed;
import org.bukkit.entity.ThrownExpBottle;
import org.bukkit.entity.TippedArrow;
import org.bukkit.entity.TraderLlama;
import org.bukkit.entity.Trident;
import org.bukkit.entity.TropicalFish;
import org.bukkit.entity.Turtle;
Expand Down Expand Up @@ -205,11 +204,6 @@ public boolean equals(final @Nullable Object obj) {
types.add(new SimpleEntityDataInfo("bottle of enchanting", ThrownExpBottle.class));
types.add(new SimpleEntityDataInfo("tnt", TNTPrimed.class));
types.add(new SimpleEntityDataInfo("leash hitch", LeashHitch.class));
if (Skript.classExists("org.bukkit.entity.Husk")) {
// Husk must be registered before zombie to work correctly
types.add(new SimpleEntityDataInfo("husk", Husk.class));
}
types.add(new SimpleEntityDataInfo("zombie", Zombie.class));

if (Skript.classExists("org.bukkit.entity.ItemFrame")) {
types.add(new SimpleEntityDataInfo("item frame", ItemFrame.class));
Expand Down Expand Up @@ -237,6 +231,7 @@ public boolean equals(final @Nullable Object obj) {
if (Skript.isRunningMinecraft(1, 11)) { // More subtypes, more supertypes - changes needed
types.add(new SimpleEntityDataInfo("wither skeleton", WitherSkeleton.class));
types.add(new SimpleEntityDataInfo("stray", Stray.class));
types.add(new SimpleEntityDataInfo("husk", Husk.class));
types.add(new SimpleEntityDataInfo("skeleton", Skeleton.class, true));

// Guardians
Expand Down Expand Up @@ -292,12 +287,16 @@ public boolean equals(final @Nullable Object obj) {
if (Skript.classExists("org.bukkit.entity.Illusioner")) {
types.add(new SimpleEntityDataInfo("illusioner", Illusioner.class));
}
// Register zombie after Husk and Drowned to make sure those 2 work
types.add(new SimpleEntityDataInfo("zombie", Zombie.class));

// TODO !Update with every version [entities]

// supertypes
types.add(new SimpleEntityDataInfo("human", HumanEntity.class, true));
types.add(new SimpleEntityDataInfo("damageable", Damageable.class, true));
types.add(new SimpleEntityDataInfo("monster", Monster.class, true)); //I don't know why Njol never included that. I did now ^^
types.add(new SimpleEntityDataInfo("mob", Mob.class, true)); //Same goes for this one
types.add(new SimpleEntityDataInfo("creature", Creature.class, true));
types.add(new SimpleEntityDataInfo("animal", Animals.class, true));
types.add(new SimpleEntityDataInfo("golem", Golem.class, true));
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/lang/english.lang
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ enchantments:
riptide: Riptide
impaling: Impaling
loyalty: Loyalty
# new 1.14 Enchantments
multishot: multishot, multi shot
piercing: piercing
quick_charge: quick charge

# -- Potion Effects --
potions:
Expand Down Expand Up @@ -1059,6 +1063,9 @@ entities:
monster:
name: monster¦s
pattern: monster(|1¦s)
mob:
name: mob¦s
pattern: mob(|1¦s)
animal:
name: animal¦s
pattern: animal(|1¦s)
Expand Down

0 comments on commit 7c67f2a

Please sign in to comment.