Skip to content

Commit

Permalink
improved support for 1.14.x (villager professions, rideable mobs...)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabsoftware committed Sep 9, 2019
1 parent a28b061 commit 5610a66
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 7 deletions.
26 changes: 26 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apply plugin: 'java'
apply plugin: 'maven'

group = 'dynmap-mobs'
version = '1.5-gabsoftware'

description = "Unofficial build with 1.14 support"

sourceCompatibility = 1.6
targetCompatibility = 1.6
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}



repositories {

maven { url "http://hub.spigotmc.org/nexus/content/groups/public/" }
maven { url "http://repo.mikeprimm.com/" }
maven { url "https://repo.maven.apache.org/maven2" }
}
dependencies {
compile group: 'org.bukkit', name: 'bukkit', version:'1.14.4-R0.1-SNAPSHOT'
compile group: 'us.dynmap', name: 'dynmap-api', version:'3.0-SNAPSHOT'
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'dynmap-mobs'
81 changes: 74 additions & 7 deletions src/main/java/org/dynmap/mobs/DynmapMobsPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ else if(mobs[i].mobid.equals("wolf")) { /* Check for tamed wolf */
}
}
}
else if(mobs[i].mobid.equals("ocelot")) { /* Check for tamed ocelot */
Ocelot cat = (Ocelot)le;
else if(mobs[i].mobid.equals("cat")) { /* Check for tamed cat */
Cat cat = (Cat)le;
if(cat.isTamed()) {
i = findNext(i, "cat");
AnimalTamer t = cat.getOwner();
Expand All @@ -357,33 +357,100 @@ else if(mobs[i].mobid.equals("ocelot")) { /* Check for tamed ocelot */
}
}
}
else if(mobs[i].mobid.equals("horse")) { /* Check for tamed cat */
Horse horse = (Horse)le;
if(horse.isTamed()) {
i = findNext(i, "horse");
AnimalTamer t = horse.getOwner();
if((t != null) && (t instanceof OfflinePlayer)) {
label = "Horse (" + ((OfflinePlayer)t).getName() + ")";
}
}
}
else if(mobs[i].mobid.equals("traderllama")) { /* Check for tamed cat */
TraderLlama traderllama = (TraderLlama)le;
if(traderllama.isTamed()) {
i = findNext(i, "traderllama");
AnimalTamer t = traderllama.getOwner();
if((t != null) && (t instanceof OfflinePlayer)) {
label = "TraderLlama (" + ((OfflinePlayer)t).getName() + ")";
}
}
}
else if(mobs[i].mobid.equals("llama")) { /* Check for tamed cat */
Llama llama = (Llama)le;
if(llama.isTamed()) {
i = findNext(i, "llama");
AnimalTamer t = llama.getOwner();
if((t != null) && (t instanceof OfflinePlayer)) {
label = "Llama (" + ((OfflinePlayer)t).getName() + ")";
}
}
}
else if(mobs[i].mobid.equals("parrot")) { /* Check for tamed cat */
Parrot parrot = (Parrot)le;
if(parrot.isTamed()) {
i = findNext(i, "parrot");
AnimalTamer t = parrot.getOwner();
if((t != null) && (t instanceof OfflinePlayer)) {
label = "Parrot (" + ((OfflinePlayer)t).getName() + ")";
}
}
}
else if(mobs[i].mobid.equals("villager")) {
Villager v = (Villager)le;
Profession p = v.getProfession();
if(p != null) {
switch(p) {
case BLACKSMITH:
label = "Blacksmith";
case NONE:
label = "Villager";
break;
case ARMORER:
label = "Armorer";
break;
case BUTCHER:
label = "Butcher";
break;
case CARTOGRAPHER:
label = "Cartographer";
break;
case CLERIC:
label = "Cleric";
break;
case FARMER:
label = "Farmer";
break;
case FISHERMAN:
label = "Fisherman";
break;
case FLETCHER:
label = "Fletcher";
break;
case LEATHERWORKER:
label = "Leatherworker";
break;
case LIBRARIAN:
label = "Librarian";
break;
case MASON:
label = "Mason";
break;
case NITWIT:
label = "Nitwit";
break;
case PRIEST:
label = "Priest";
case SHEPHERD:
label = "Shepherd";
break;
case TOOLSMITH:
label = "Toolsmith";
break;
case WEAPONSMITH:
label = "Weaponsmith";
break;
}
}
}
else if(mobs[i].mobid.equals("vanillahorse") || mobs[i].mobid.equals("donkey") || mobs[i].mobid.equals("mule") || mobs[i].mobid.equals("zombiehorse") || mobs[i].mobid.equals("skeletonhorse")) { /* Check for rider */
else if(mobs[i].mobid.equals("vanillahorse") || mobs[i].mobid.equals("llama") || mobs[i].mobid.equals("traderllama") || mobs[i].mobid.equals("donkey") || mobs[i].mobid.equals("mule") || mobs[i].mobid.equals("zombiehorse") || mobs[i].mobid.equals("skeletonhorse")) { /* Check for rider */
if(le.getPassenger() != null) { /* Has passenger? */
Entity e = le.getPassenger();
if (e instanceof Player) {
Expand Down

0 comments on commit 5610a66

Please sign in to comment.