diff --git a/PlayerHeads-compatibility/PlayerHeads-common-support/pom.xml b/PlayerHeads-compatibility/PlayerHeads-common-support/pom.xml index 1cc6c733..373553b4 100644 --- a/PlayerHeads-compatibility/PlayerHeads-common-support/pom.xml +++ b/PlayerHeads-compatibility/PlayerHeads-common-support/pom.xml @@ -4,7 +4,7 @@ org.shininet.bukkit PlayerHeads-compatibility - 5.2.14-SNAPSHOT + 5.2.15-SNAPSHOT PlayerHeads-common-support jar @@ -20,7 +20,7 @@ org.shininet.bukkit PlayerHeads-compatibility-api - 5.2.14-SNAPSHOT + 5.2.15-SNAPSHOT fr.neatmonster diff --git a/PlayerHeads-compatibility/PlayerHeads-common-support/src/main/java/com/github/crashdemons/playerheads/compatibility/common/Provider_common.java b/PlayerHeads-compatibility/PlayerHeads-common-support/src/main/java/com/github/crashdemons/playerheads/compatibility/common/Provider_common.java index 366fc3fe..1c5a5930 100644 --- a/PlayerHeads-compatibility/PlayerHeads-common-support/src/main/java/com/github/crashdemons/playerheads/compatibility/common/Provider_common.java +++ b/PlayerHeads-compatibility/PlayerHeads-common-support/src/main/java/com/github/crashdemons/playerheads/compatibility/common/Provider_common.java @@ -12,10 +12,12 @@ import com.github.crashdemons.playerheads.compatibility.RuntimeReferences; import com.github.crashdemons.playerheads.compatibility.SkullType; import com.github.crashdemons.playerheads.compatibility.Version; +import java.util.List; import java.util.Optional; import java.util.UUID; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; +import static org.bukkit.Warning.WarningState.value; import org.bukkit.block.BlockState; import org.bukkit.block.Skull; import org.bukkit.entity.AnimalTamer; @@ -32,6 +34,10 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.SkullMeta; +import org.bukkit.metadata.FixedMetadataValue; +import org.bukkit.metadata.MetadataValue; +import org.bukkit.metadata.Metadatable; +import org.bukkit.plugin.Plugin; import org.bukkit.projectiles.ProjectileSource; /** @@ -260,4 +266,49 @@ public LivingEntity getKillerEntity(EntityDeathEvent event, boolean considermobk //if(killer!=null) System.out.println(" final killer: "+killer.getType().name()+" "+killer.getName()); return killer; } + + protected boolean setTemporaryTag(Entity ent, Plugin plugin, String key, String value){ + if(ent instanceof Metadatable){ + ent.setMetadata(key, new FixedMetadataValue(plugin,value)); + return true; + } + return false; + } + protected String getTemporaryTag(Entity ent, Plugin plugin, String key){ + if(ent instanceof Metadatable){ + List values = ent.getMetadata(key); + for(MetadataValue value : values){ + Plugin valuePlugin = value.getOwningPlugin(); + if(valuePlugin==plugin || (valuePlugin!=null && valuePlugin.equals(plugin))){ + return value.asString(); + } + } + } + return null; + } + + protected boolean setPersistentTag(Entity entity, Plugin plugin, String key, String value){ + return false; + } + protected String getPersistentTag(Entity entity, Plugin plugin, String key){ + return null; + } + + @Override + public boolean supportsEntityTagType(boolean persistent){ + return !persistent; + } + + @Override + public boolean setEntityTag(Entity entity, Plugin plugin, String key, String value, boolean persistent){ + if(persistent) return setPersistentTag(entity,plugin,key,value); + return setTemporaryTag(entity,plugin,key,value); + } + + @Override + public String getEntityTag(Entity entity, Plugin plugin, String key, boolean persistent){ + if(persistent) return getPersistentTag(entity,plugin,key); + return getTemporaryTag(entity,plugin,key); + } + } diff --git a/PlayerHeads-compatibility/PlayerHeads-common-support/src/test/java/com/github/crashdemons/playerheads/compatibility/faketestserver_1_0/Provider.java b/PlayerHeads-compatibility/PlayerHeads-common-support/src/test/java/com/github/crashdemons/playerheads/compatibility/faketestserver_1_0/Provider.java index ac33a380..2c17bd8d 100644 --- a/PlayerHeads-compatibility/PlayerHeads-common-support/src/test/java/com/github/crashdemons/playerheads/compatibility/faketestserver_1_0/Provider.java +++ b/PlayerHeads-compatibility/PlayerHeads-common-support/src/test/java/com/github/crashdemons/playerheads/compatibility/faketestserver_1_0/Provider.java @@ -11,6 +11,7 @@ import com.github.crashdemons.playerheads.compatibility.SkullDetails; import com.github.crashdemons.playerheads.compatibility.SkullType; import com.github.crashdemons.playerheads.compatibility.common.Provider_common; +import java.util.List; import java.util.UUID; import org.bukkit.Material; import org.bukkit.OfflinePlayer; @@ -24,6 +25,10 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.SkullMeta; +import org.bukkit.metadata.FixedMetadataValue; +import org.bukkit.metadata.MetadataValue; +import org.bukkit.metadata.Metadatable; +import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.Nullable; /** @@ -134,4 +139,5 @@ public boolean clearProfile(Object o){ throw new IllegalStateException("Not supported by test class"); } + } diff --git a/PlayerHeads-compatibility/PlayerHeads-compatibility-api/pom.xml b/PlayerHeads-compatibility/PlayerHeads-compatibility-api/pom.xml index ff3444dc..4a55435f 100644 --- a/PlayerHeads-compatibility/PlayerHeads-compatibility-api/pom.xml +++ b/PlayerHeads-compatibility/PlayerHeads-compatibility-api/pom.xml @@ -4,7 +4,7 @@ org.shininet.bukkit PlayerHeads-compatibility - 5.2.14-SNAPSHOT + 5.2.15-SNAPSHOT PlayerHeads-compatibility-api jar diff --git a/PlayerHeads-compatibility/PlayerHeads-compatibility-api/src/main/java/com/github/crashdemons/playerheads/compatibility/CompatibilityProvider.java b/PlayerHeads-compatibility/PlayerHeads-compatibility-api/src/main/java/com/github/crashdemons/playerheads/compatibility/CompatibilityProvider.java index 68ba27ee..a6200db8 100644 --- a/PlayerHeads-compatibility/PlayerHeads-compatibility-api/src/main/java/com/github/crashdemons/playerheads/compatibility/CompatibilityProvider.java +++ b/PlayerHeads-compatibility/PlayerHeads-compatibility-api/src/main/java/com/github/crashdemons/playerheads/compatibility/CompatibilityProvider.java @@ -19,6 +19,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.SkullMeta; +import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -499,4 +500,41 @@ public interface CompatibilityProvider { */ public LivingEntity getKillerEntity(EntityDeathEvent event, boolean considermobkillers, boolean considertameowners); -} + + /** + * Checks whether the compatibility provider supports entity tags of the provided type + * @param persistent whether the tag should be persistent (saved through restarts). + * @return whether the tags were supported + */ + public boolean supportsEntityTagType(boolean persistent); + + /** + * Sets a custom tag on the entity. + * This should only be used for information-tracking purposes (such as spawn-cause). + * Not all versions may support setting persistent tags - you must check the result. + * Tag support will be different between versions - a tag may not be detected in a different server version. + * @param entity the entity to set the tag on. + * @param plugin the plugin requesting the tag to be set. + * @param key the key or name of the tag to set + * @param value the value of the tag to set, or null to remove it. + * @param persistent whether the tag should be persistent (saved through restarts). + * @return whether the requested tag could be set. Usually this will fail if Persistence is not supported. + * @since 5.2.15-SNAPSHOT + */ + public boolean setEntityTag(Entity entity, Plugin plugin, String key, String value, boolean persistent); + + + + /** + * Retrieves a custom tag on an entity. + * @param entity the entity containing the tag + * @param plugin the plugin which set the tag + * @param key the key or name of the tag + * @param persistent whether the tag was set as persistent (saved through restarts). + * @return the tag's value, or null if it is not present + * @since 5.2.15-SNAPSHOT + */ + @Nullable + public String getEntityTag(Entity entity, Plugin plugin, String key, boolean persistent); + +} \ No newline at end of file diff --git a/PlayerHeads-compatibility/PlayerHeads-compatibility-lib/dependency-reduced-pom.xml b/PlayerHeads-compatibility/PlayerHeads-compatibility-lib/dependency-reduced-pom.xml index abd1d4e0..91a95de2 100644 --- a/PlayerHeads-compatibility/PlayerHeads-compatibility-lib/dependency-reduced-pom.xml +++ b/PlayerHeads-compatibility/PlayerHeads-compatibility-lib/dependency-reduced-pom.xml @@ -111,7 +111,7 @@ org.shininet.bukkit:PlayerHeads-craftbukkit-1.8-support:jar: org.shininet.bukkit:PlayerHeads-glowstone-1.12-support:jar: org.shininet.bukkit:PlayerHeads-craftbukkit-1.13-support:jar: - org.shininet.bukkit:PlayerHeads-craftbukkit-1.16-support:jar: + org.shininet.bukkit:PlayerHeads-craftbukkit-1.14-support:jar: diff --git a/PlayerHeads-compatibility/PlayerHeads-compatibility-lib/pom.xml b/PlayerHeads-compatibility/PlayerHeads-compatibility-lib/pom.xml index 6e6bca55..b53f6f4f 100644 --- a/PlayerHeads-compatibility/PlayerHeads-compatibility-lib/pom.xml +++ b/PlayerHeads-compatibility/PlayerHeads-compatibility-lib/pom.xml @@ -15,7 +15,7 @@ ${project.groupId} PlayerHeads-compatibility-api - 5.2.14-SNAPSHOT + 5.2.15-SNAPSHOT org.bukkit @@ -81,6 +81,12 @@ PlayerHeads-craftbukkit-1.13-support 5.2.15-SNAPSHOT + + + ${project.groupId} + PlayerHeads-craftbukkit-1.14-support + 5.2.15-SNAPSHOT + @@ -218,7 +224,7 @@ org.shininet.bukkit:PlayerHeads-craftbukkit-1.8-support:jar: org.shininet.bukkit:PlayerHeads-glowstone-1.12-support:jar: org.shininet.bukkit:PlayerHeads-craftbukkit-1.13-support:jar: - org.shininet.bukkit:PlayerHeads-craftbukkit-1.16-support:jar: + org.shininet.bukkit:PlayerHeads-craftbukkit-1.14-support:jar: diff --git a/PlayerHeads-compatibility/PlayerHeads-compatibility-lib/src/main/java/com/github/crashdemons/playerheads/compatibility/CompatibilitySupport.java b/PlayerHeads-compatibility/PlayerHeads-compatibility-lib/src/main/java/com/github/crashdemons/playerheads/compatibility/CompatibilitySupport.java index 963551fa..7fff4c4d 100644 --- a/PlayerHeads-compatibility/PlayerHeads-compatibility-lib/src/main/java/com/github/crashdemons/playerheads/compatibility/CompatibilitySupport.java +++ b/PlayerHeads-compatibility/PlayerHeads-compatibility-lib/src/main/java/com/github/crashdemons/playerheads/compatibility/CompatibilitySupport.java @@ -23,6 +23,7 @@ public class CompatibilitySupport { static{ VERSIONS=new HashMap<>(); VERSIONS.put("craftbukkit", new Integer[][]{ + {1,14}, {1,13}, {1,8} }); diff --git a/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.13-support/pom.xml b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.13-support/pom.xml index a39e9aae..8f0cc1ea 100644 --- a/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.13-support/pom.xml +++ b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.13-support/pom.xml @@ -42,6 +42,17 @@ + + ${project.groupId} + PlayerHeads-compatibility-api + 5.2.15-SNAPSHOT + + + * + * + + + ${project.groupId} @@ -78,11 +89,15 @@ ${project.groupId} PlayerHeads-common-support - 5.2.14-SNAPSHOT + 5.2.15-SNAPSHOT - * - * + org.bukkit + bukkit + + + org.spigotmc + spigot-api diff --git a/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/.gitignore b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/.gitignore new file mode 100644 index 00000000..ecab1b2e --- /dev/null +++ b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/.gitignore @@ -0,0 +1,36 @@ +# Eclipse stuff +/.classpath +/.project +/.settings + +# netbeans +/nbproject + +# maven +/build.xml +/target +/pom.xml.versionsBackup + +# vim +.*.sw[a-p] + +# various other potential build files +/build +/bin +/dist +/manifest.mf + +/world + +# Mac filesystem dust +/.DS_Store + +# intellij +*.iml +*.ipr +*.iws +.idea/ + +#personal +/test-in-spigot.bat + diff --git a/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/README.md b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/README.md new file mode 100644 index 00000000..ebe18449 --- /dev/null +++ b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/README.md @@ -0,0 +1,14 @@ +# PlayerHeads +Bukkit Plugin - Drops a player's head when s/he dies, also mob heads +* Drop player heads on player death +* Drop mob heads on death +* Configure drop rate chances +* Configure whether player-kills are required to drop + +All credit goes to meiskam for creating the plugin and zand, Dragoboss, any many others for maintaining it. + +# Craftbukkit support +This is the implementation branch for Craftbukkit 1.13 support. While this branch is mostly reliant on bukkit-standard features, it also presumes the server has the "authlib" API available to it (for head texturing and improved UUID retrieval), which makes it insufficient for other implementations like Glowstone. + + + diff --git a/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/dependency-reduced-pom.xml b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/dependency-reduced-pom.xml new file mode 100644 index 00000000..f18b4b27 --- /dev/null +++ b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/dependency-reduced-pom.xml @@ -0,0 +1,268 @@ + + + 4.0.0 + org.shininet.bukkit + PlayerHeads-crosscompatible + PlayerHeads-crosscompatible + 4.7.1-SNAPSHOT + + GitHub + https://github.com/crashdemons/PlayerHeads/issues + + + + Mozilla Public License 2.0 + http://mozilla.org/MPL/2.0/ + repo + + + + scm:git:git://github.com/crashdemons/PlayerHeads.git + scm:git:git@github.com:crashdemons/PlayerHeads.git + https://github.com/crashdemons/PlayerHeads/tree/4.x-backport-1.8/ + + + ShiniNet + http://www.shininet.org + + + + + true + ${basedir}/src/main/resources + + + ${project.name}-${project.version} + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.codehaus.mojo + versions-maven-plugin + [2.2,) + + use-latest-versions + + + + + + + + + + + + + + + org.codehaus.mojo + versions-maven-plugin + 2.2 + + + versions + validate + + true + + + + + + org.bukkit + + + + + maven-jar-plugin + 3.0.2 + + + + Maven + ${project.name} + ${project.version} + ${project.groupId} + ${project.organization.name} + + + + + + maven-compiler-plugin + 3.5.1 + + 1.7 + 1.7 + + -Xlint:all + + + + + maven-antrun-plugin + 1.8 + + + install + + run + + + + + + + + + + + maven-shade-plugin + 3.2.0 + + + package + + shade + + + + + org.shininet.bukkit:PlayerHeads:jar: + + + + + org.shininet.bukkit:PlayerHeads:jar: + + + + + + + + + + + + mojang + Mojang's Repository + https://libraries.minecraft.net/ + + + spigot-group-repo + https://hub.spigotmc.org/nexus/content/groups/public/ + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + md_5-releases + http://repo.md-5.net/content/repositories/releases/ + + + + + junit + junit + 4.12 + test + + + hamcrest-core + org.hamcrest + + + + + org.powermock + powermock-module-junit4 + 1.7.4 + test + + + powermock-module-junit4-common + org.powermock + + + hamcrest-core + org.hamcrest + + + + + org.powermock + powermock-api-mockito + 1.7.4 + test + + + mockito-core + org.mockito + + + + + org.powermock + powermock-api-mockito-common + 1.7.4 + test + + + powermock-api-support + org.powermock + + + mockito-core + org.mockito + + + + + com.mojang + authlib + 1.5.25 + compile + + + org.spigotmc + spigot-api + 1.8-R0.1-SNAPSHOT + compile + + + org.bukkit + bukkit + 1.8-R0.1-SNAPSHOT + compile + + + fr.neatmonster + ncpplugin + static + compile + + + bukkit + org.bukkit + + + craftbukkit + org.bukkit + + + + + + UTF-8 + + diff --git a/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/nb-configuration.xml b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/nb-configuration.xml new file mode 100644 index 00000000..c461898b --- /dev/null +++ b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/nb-configuration.xml @@ -0,0 +1,18 @@ + + + + + + ${project.basedir}/nb-licenseheader.txt + + diff --git a/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/nb-licenseheader.txt b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/nb-licenseheader.txt new file mode 100644 index 00000000..275f4d1a --- /dev/null +++ b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/nb-licenseheader.txt @@ -0,0 +1,9 @@ +<#if licenseFirst??> +${licenseFirst} + +${licensePrefix} This Source Code Form is subject to the terms of the Mozilla Public +${licensePrefix} License, v. 2.0. If a copy of the MPL was not distributed with this +${licensePrefix} file, You can obtain one at http://mozilla.org/MPL/2.0/ . +<#if licenseLast??> +${licenseLast} + diff --git a/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/pom.xml b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/pom.xml new file mode 100644 index 00000000..c3ed8039 --- /dev/null +++ b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/pom.xml @@ -0,0 +1,165 @@ + + 4.0.0 + org.shininet.bukkit + PlayerHeads-craftbukkit-1.14-support + jar + PlayerHeads-craftbukkit-1.14-support + + + PlayerHeads-compatibility + org.shininet.bukkit + 5.2.15-SNAPSHOT + + + + ShiniNet + http://www.shininet.org + + + + + Mozilla Public License 2.0 + http://mozilla.org/MPL/2.0/ + repo + + + + + UTF-8 + + + + scm:git:git@github.com:crashdemons/PlayerHeads.git + scm:git:git://github.com/crashdemons/PlayerHeads.git + https://github.com/crashdemons/PlayerHeads/tree/craftbukkit-1.13-support/ + + + + GitHub + https://github.com/crashdemons/PlayerHeads/issues + + + + + + + ${project.groupId} + PlayerHeads-craftbukkit-1.13-support + 5.2.15-SNAPSHOT + + + org.bukkit + bukkit + + + org.spigotmc + spigot-api + + + + + + + ${project.groupId} + PlayerHeads-common-support + 5.2.15-SNAPSHOT + + + * + * + + + + + + org.spigotmc + spigot-api + 1.14-R0.1-SNAPSHOT + + + + + + ${project.name}-${project.version} + + + ${basedir}/src/main/resources + true + + + + + org.codehaus.mojo + versions-maven-plugin + 2.2 + + + org.shininet.bukkit + org.bukkit + + + + + versions + validate + + true + + + + + + + + + + maven-antrun-plugin + 1.8 + + + install + + + + + + + run + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.codehaus.mojo + versions-maven-plugin + [2.2,) + + + + + + + + + + + + + + + + diff --git a/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/src/main/java/com/github/crashdemons/playerheads/compatibility/craftbukkit_1_14/Provider.java b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/src/main/java/com/github/crashdemons/playerheads/compatibility/craftbukkit_1_14/Provider.java new file mode 100644 index 00000000..65bc839a --- /dev/null +++ b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/src/main/java/com/github/crashdemons/playerheads/compatibility/craftbukkit_1_14/Provider.java @@ -0,0 +1,47 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/ . + */ +package com.github.crashdemons.playerheads.compatibility.craftbukkit_1_14; + +import com.github.crashdemons.playerheads.compatibility.CompatibilityProvider; +import org.bukkit.NamespacedKey; +import org.bukkit.entity.Entity; +import org.bukkit.persistence.PersistentDataContainer; +import org.bukkit.persistence.PersistentDataType; +import org.bukkit.plugin.Plugin; + +/** + * CompatibilityProvider Implementation for 1.13+ support + * @author crashdemons (crashenator at gmail.com) + */ +@SuppressWarnings( "deprecation" ) +public class Provider extends com.github.crashdemons.playerheads.compatibility.craftbukkit_1_13.Provider implements CompatibilityProvider { + public Provider(){} + @Override public String getType(){ return "craftbukkit"; } + @Override public String getVersion(){ return "1.14+"; } + + + + @Override + protected boolean setPersistentTag(Entity entity, Plugin plugin, String key, String value){ + NamespacedKey nskey = new NamespacedKey(plugin,key); + PersistentDataContainer pdc = entity.getPersistentDataContainer(); + pdc.set(nskey, PersistentDataType.STRING, value); + return true; + } + @Override + protected String getPersistentTag(Entity entity, Plugin plugin, String key){ + NamespacedKey nskey = new NamespacedKey(plugin,key); + PersistentDataContainer pdc = entity.getPersistentDataContainer(); + return pdc.get(nskey, PersistentDataType.STRING); + } + + @Override + public boolean supportsEntityTagType(boolean persistent){ + return true; + } + + +} diff --git a/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/src/main/java/com/github/crashdemons/playerheads/compatibility/craftbukkit_1_14/package-info.java b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/src/main/java/com/github/crashdemons/playerheads/compatibility/craftbukkit_1_14/package-info.java new file mode 100644 index 00000000..82ff4ab0 --- /dev/null +++ b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/src/main/java/com/github/crashdemons/playerheads/compatibility/craftbukkit_1_14/package-info.java @@ -0,0 +1,10 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/ . + */ + +/** + * Compatibility package implementations for Bukkit 1.14+ support - Do not use as an API. + */ +package com.github.crashdemons.playerheads.compatibility.craftbukkit_1_14; diff --git a/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/src/test/java/com/github/crashdemons/playerheads/compatibility/craftbukkit_1_13/ProviderTest.java b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/src/test/java/com/github/crashdemons/playerheads/compatibility/craftbukkit_1_13/ProviderTest.java new file mode 100644 index 00000000..63db2f33 --- /dev/null +++ b/PlayerHeads-compatibility/PlayerHeads-craftbukkit-1.14-support/src/test/java/com/github/crashdemons/playerheads/compatibility/craftbukkit_1_13/ProviderTest.java @@ -0,0 +1,46 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/ . + */ +package com.github.crashdemons.playerheads.compatibility.craftbukkit_1_13; + +import com.github.crashdemons.playerheads.compatibility.CompatibilityProvider; +import com.github.crashdemons.playerheads.compatibility.Version; +import org.bukkit.entity.EntityType; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author crashdemons (crashenator at gmail.com) + */ +public class ProviderTest { + + public ProviderTest() { + } + + + + + @Test + public void getEntityTypeFromTypename_TestLegacyPigZombie(){ + Version.setDetectedServerVersion("craftbukkit", 1, 13); + System.out.println("getEntityTypeFromTypenameTest"); + CompatibilityProvider provider = new com.github.crashdemons.playerheads.compatibility.craftbukkit_1_14.Provider(); + EntityType expected = EntityType.PIG_ZOMBIE; + EntityType actual = provider.getEntityTypeFromTypename("PIG_ZOMBIE"); + assertEquals(expected,actual); + + } + @Test + public void getEntityTypeFromTypename_TestZombifiedPiglin(){ + Version.setDetectedServerVersion("craftbukkit", 1, 13); + System.out.println("getEntityTypeFromTypenameTest"); + CompatibilityProvider provider = new com.github.crashdemons.playerheads.compatibility.craftbukkit_1_14.Provider(); + EntityType expected = EntityType.PIG_ZOMBIE; + EntityType actual = provider.getEntityTypeFromTypename("ZOMBIFIED_PIGLIN"); + assertEquals(expected,actual); + } + +} diff --git a/PlayerHeads-compatibility/pom.xml b/PlayerHeads-compatibility/pom.xml index 556b1837..41eaa20b 100644 --- a/PlayerHeads-compatibility/pom.xml +++ b/PlayerHeads-compatibility/pom.xml @@ -18,6 +18,7 @@ PlayerHeads-modern-support PlayerHeads-glowstone-1.12-support PlayerHeads-craftbukkit-1.13-support + PlayerHeads-craftbukkit-1.14-support PlayerHeads-craftbukkit-1.8-support PlayerHeads-compatibility-lib diff --git a/PlayerHeads-core/pom.xml b/PlayerHeads-core/pom.xml index b494265b..bf34f71e 100644 --- a/PlayerHeads-core/pom.xml +++ b/PlayerHeads-core/pom.xml @@ -49,7 +49,7 @@ ${project.groupId} PlayerHeads-compatibility-api - 5.2.14-SNAPSHOT + 5.2.15-SNAPSHOT fr.neatmonster @@ -62,7 +62,7 @@ ${project.groupId} PlayerHeads-common-support - 5.2.14-SNAPSHOT + 5.2.15-SNAPSHOT test