Skip to content

Commit

Permalink
Add new entty types: COD, DOLPHIN, DROWNED, PHANTOM, PUFFERFISH, SALM…
Browse files Browse the repository at this point in the history
…ON, TRIDENT, TROPICAL_FISH, and TURTLE
  • Loading branch information
PseudoKnight committed Aug 3, 2018
1 parent 887c7d6 commit 23d550a
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 56 deletions.
@@ -0,0 +1,12 @@
package com.laytonsmith.abstraction.bukkit.entities;

import com.laytonsmith.abstraction.entities.MCDrowned;
import org.bukkit.entity.Entity;

public class BukkitMCDrowned extends BukkitMCZombie implements MCDrowned {

public BukkitMCDrowned(Entity zombie) {
super(zombie);
}

}
@@ -0,0 +1,15 @@
package com.laytonsmith.abstraction.bukkit.entities;

import com.laytonsmith.abstraction.entities.MCTrident;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Trident;

public class BukkitMCTrident extends BukkitMCArrow implements MCTrident {

private final Trident trident;

public BukkitMCTrident(Entity trident) {
super(trident);
this.trident = (Trident) trident;
}
}
@@ -0,0 +1,4 @@
package com.laytonsmith.abstraction.entities;

public interface MCDrowned extends MCZombie {
}
@@ -0,0 +1,5 @@
package com.laytonsmith.abstraction.entities;

public interface MCTrident extends MCArrow {

}
107 changes: 53 additions & 54 deletions src/main/java/com/laytonsmith/abstraction/enums/MCEntityType.java
Expand Up @@ -107,106 +107,105 @@ public boolean isSpawnable() {


@MEnum("VanillaEntityType") @MEnum("VanillaEntityType")
public enum MCVanillaEntityType { public enum MCVanillaEntityType {
AREA_EFFECT_CLOUD(true, MCVersion.MC1_9), AREA_EFFECT_CLOUD(true),
ARMOR_STAND(true, MCVersion.MC1_8), ARMOR_STAND(true),
ARROW(true), ARROW(true),
BAT(true, MCVersion.MC1_4), BAT(true),
BLAZE(true), BLAZE(true),
BOAT(true), BOAT(true),
CAVE_SPIDER(true), CAVE_SPIDER(true),
CHICKEN(true), CHICKEN(true),
COD(true),
COMPLEX_PART(false), COMPLEX_PART(false),
COW(true), COW(true),
CREEPER(true), CREEPER(true),
DRAGON_FIREBALL(true, MCVersion.MC1_9), DOLPHIN(true),
/** DRAGON_FIREBALL(true),
* Spawn with world.dropItem()
*/
DROPPED_ITEM(true), DROPPED_ITEM(true),
DONKEY(true, MCVersion.MC1_11), DROWNED(true),
DONKEY(true),
EGG(true), EGG(true),
ELDER_GUARDIAN(true, MCVersion.MC1_11), ELDER_GUARDIAN(true),
ENDERMAN(true), ENDERMAN(true),
ENDERMITE(true, MCVersion.MC1_8), ENDERMITE(true),
ENDER_CRYSTAL(true), ENDER_CRYSTAL(true),
ENDER_DRAGON(true), ENDER_DRAGON(true),
ENDER_EYE(true), ENDER_EYE(true),
ENDER_PEARL(true), ENDER_PEARL(true),
EVOKER(true, MCVersion.MC1_11), EVOKER(true),
EVOKER_FANGS(true, MCVersion.MC1_11), EVOKER_FANGS(true),
EXPERIENCE_ORB(true), EXPERIENCE_ORB(true),
/**
* Spawn with world.spawnFallingBlock() I'm not sure what version we switched to FALLING_BLOCK from
* FALLING_SAND, but it was after 1.0
*/
FALLING_BLOCK(true), FALLING_BLOCK(true),
FIREBALL(true), FIREBALL(true),
FIREWORK(true, MCVersion.MC1_4_7), FIREWORK(true),
FISHING_HOOK(false), FISHING_HOOK(false),
GHAST(true), GHAST(true),
GIANT(true), GIANT(true),
GUARDIAN(true, MCVersion.MC1_8), GUARDIAN(true),
HORSE(true, MCVersion.MC1_6), HORSE(true),
HUSK(true, MCVersion.MC1_11), HUSK(true),
ILLUSIONER(true, MCVersion.MC1_12), ILLUSIONER(true),
IRON_GOLEM(true, MCVersion.MC1_2), IRON_GOLEM(true),
ITEM_FRAME(true, MCVersion.MC1_4_5), ITEM_FRAME(true),
LLAMA(true, MCVersion.MC1_11), LLAMA(true),
LLAMA_SPIT(false, MCVersion.MC1_11), LLAMA_SPIT(false),
LEASH_HITCH(true, MCVersion.MC1_6), LEASH_HITCH(true),
/**
* Spawn with world.strikeLightning()
*/
LIGHTNING(true), LIGHTNING(true),
LINGERING_POTION(true, MCVersion.MC1_9), LINGERING_POTION(true),
MAGMA_CUBE(true), MAGMA_CUBE(true),
MINECART(true), MINECART(true),
MINECART_CHEST(true), MINECART_CHEST(true),
MINECART_COMMAND(true, MCVersion.MC1_7), MINECART_COMMAND(true),
MINECART_FURNACE(true), MINECART_FURNACE(true),
MINECART_HOPPER(true, MCVersion.MC1_5), MINECART_HOPPER(true),
MINECART_MOB_SPAWNER(true, MCVersion.MC1_5), MINECART_MOB_SPAWNER(true),
MINECART_TNT(true, MCVersion.MC1_5), MINECART_TNT(true),
MULE(true, MCVersion.MC1_11), MULE(true),
MUSHROOM_COW(true), MUSHROOM_COW(true),
OCELOT(true, MCVersion.MC1_2), OCELOT(true),
PAINTING(true), PAINTING(true),
PARROT(true, MCVersion.MC1_12), PARROT(true),
PHANTOM(true),
PIG(true), PIG(true),
PIG_ZOMBIE(true), PIG_ZOMBIE(true),
PLAYER(false), PLAYER(false),
POLAR_BEAR(true, MCVersion.MC1_10), POLAR_BEAR(true),
PRIMED_TNT(true), PRIMED_TNT(true),
RABBIT(true, MCVersion.MC1_8), PUFFERFISH(true),
RABBIT(true),
SALMON(true),
SHEEP(true), SHEEP(true),
SILVERFISH(true), SILVERFISH(true),
SKELETON(true), SKELETON(true),
SHULKER(true, MCVersion.MC1_9), SHULKER(true),
SHULKER_BULLET(true, MCVersion.MC1_9), SHULKER_BULLET(true),
SKELETON_HORSE(true, MCVersion.MC1_11), SKELETON_HORSE(true),
SLIME(true), SLIME(true),
SMALL_FIREBALL(true), SMALL_FIREBALL(true),
SNOWBALL(true), SNOWBALL(true),
SNOWMAN(true), SNOWMAN(true),
SQUID(true), SQUID(true),
SPECTRAL_ARROW(true, MCVersion.MC1_9), SPECTRAL_ARROW(true),
SPIDER(true), SPIDER(true),
SPLASH_POTION(true), SPLASH_POTION(true),
STRAY(true, MCVersion.MC1_11), STRAY(true),
THROWN_EXP_BOTTLE(true), THROWN_EXP_BOTTLE(true),
TIPPED_ARROW(true, MCVersion.MC1_9), TIPPED_ARROW(true),
VEX(true, MCVersion.MC1_11), TRIDENT(true),
TROPICAL_FISH(true),
TURTLE(true),
VEX(true),
VILLAGER(true), VILLAGER(true),
VINDICATOR(true, MCVersion.MC1_11), VINDICATOR(true),
WEATHER(false), WEATHER(false),
WITCH(true, MCVersion.MC1_4_5), WITCH(true),
WITHER(true, MCVersion.MC1_4), WITHER(true),
WITHER_SKELETON(true, MCVersion.MC1_11), WITHER_SKELETON(true),
WITHER_SKULL(true, MCVersion.MC1_4), WITHER_SKULL(true),
WOLF(true), WOLF(true),
ZOMBIE(true), ZOMBIE(true),
ZOMBIE_HORSE(true, MCVersion.MC1_11), ZOMBIE_HORSE(true),
ZOMBIE_VILLAGER(true, MCVersion.MC1_11), ZOMBIE_VILLAGER(true),
/** /**
* An unknown entity without an Entity Class * An unknown entity without an Entity Class
*/ */
Expand Down Expand Up @@ -238,7 +237,7 @@ public boolean isSpawnable() {
} }


public boolean existsInCurrent() { public boolean existsInCurrent() {
return Static.getServer().getMinecraftVersion().ordinal() >= version.ordinal(); return Static.getServer().getMinecraftVersion().gte(version);
} }
} }
} }
4 changes: 2 additions & 2 deletions src/main/resources/functionDocs/entity_spec
Expand Up @@ -19,7 +19,7 @@ array {entityID} Returns an associative array containing all the data of the giv
* %KEY_AREAEFFECTCLOUD_SOURCE%: The source of the cloud. Can be living entity, dispenser location array, or null. * %KEY_AREAEFFECTCLOUD_SOURCE%: The source of the cloud. Can be living entity, dispenser location array, or null.
* %KEY_AREAEFFECTCLOUD_WAITTIME%: The age of the cloud in ticks before effects can be applied. * %KEY_AREAEFFECTCLOUD_WAITTIME%: The age of the cloud in ticks before effects can be applied.
|- |-
| ARROW | ARROW, TRIDENT
| |
* %KEY_ARROW_CRITICAL%: If this arrow is critical. * %KEY_ARROW_CRITICAL%: If this arrow is critical.
* %KEY_ARROW_KNOCKBACK%: The knockback strength. * %KEY_ARROW_KNOCKBACK%: The knockback strength.
Expand Down Expand Up @@ -239,7 +239,7 @@ without knowing the rotations on the other axis or of other body parts beforehan
* %KEY_WOLF_COLOR%: The collar color of the wolf (can be %DYE_COLOR%). * %KEY_WOLF_COLOR%: The collar color of the wolf (can be %DYE_COLOR%).
* %KEY_WOLF_SITTING%: If the wolf is sitting. * %KEY_WOLF_SITTING%: If the wolf is sitting.
|- |-
| ZOMBIE | ZOMBIE, HUSK, ZOMBIE_VILLAGER, DROWNED
| |
* %KEY_ZOMBIE_BABY%: Whether the zombie is a baby. * %KEY_ZOMBIE_BABY%: Whether the zombie is a baby.
|- |-
Expand Down

0 comments on commit 23d550a

Please sign in to comment.