Skip to content

Commit

Permalink
5.1.1 API: expose CompatibilityProvider methods to third-party plugins
Browse files Browse the repository at this point in the history
for better access to head information
  • Loading branch information
crashdemons committed Jul 8, 2019
1 parent ab18e30 commit 5d3ec75
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 326 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ public interface PlayerHeadsAPI {
/**
* Gets an instance of a class that provides many useful internal PlayerHeads capabilities that would normally be version-specific.
* For example: viewing and editing ownership information for skinned playerheads.
* @return the CompatibilityProvider instance.
* @return the CompatibilityProvider instance or null if PlayerHeads plugin was not initialized yet.
*/
@Nullable
public CompatibilityProvider getCompatibilityProvider();
}
4 changes: 2 additions & 2 deletions PlayerHeads-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>PlayerHeads</artifactId>
<groupId>org.shininet.bukkit</groupId>
<version>5.1.0-SNAPSHOT</version>
<version>5.1.1-SNAPSHOT</version>
</parent>


Expand Down Expand Up @@ -62,7 +62,7 @@
<!-- This shouldn't be a dep which is packaging: pom -->
<groupId>${project.groupId}</groupId>
<artifactId>PlayerHeads-api</artifactId>
<version>5.1.0-SNAPSHOT</version>
<version>5.1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.github.crashdemons.playerheads.SkullConverter;
import com.github.crashdemons.playerheads.SkullManager;
import com.github.crashdemons.playerheads.TexturedSkullType;
import com.github.crashdemons.playerheads.compatibility.Compatibility;
import com.github.crashdemons.playerheads.compatibility.CompatibilityProvider;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
Expand Down Expand Up @@ -109,4 +111,12 @@ public ItemStack getHeadDrop(Entity e) {
private TexturedSkullType headFromApiHead(HeadType h) {
return TexturedSkullType.get(h.getOwner());
}


//5.1.1 API
@Override
public CompatibilityProvider getCompatibilityProvider(){
if(!Compatibility.isProviderAvailable()) return null;
return Compatibility.getProvider();
}
}

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions PlayerHeads-craftbukkit-1.13-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>PlayerHeads</artifactId>
<groupId>org.shininet.bukkit</groupId>
<version>5.0.0-SNAPSHOT</version>
<version>5.1.1-SNAPSHOT</version>
</parent>

<organization>
Expand Down Expand Up @@ -65,7 +65,7 @@
<!-- This shouldn't be a dep which is packaging: pom -->
<groupId>${project.groupId}</groupId>
<artifactId>PlayerHeads-craftbukkit-support</artifactId>
<version>5.0.0-SNAPSHOT</version>
<version>5.1.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.bukkit</groupId>
Expand All @@ -77,7 +77,7 @@
<!-- This shouldn't be a dep which is packaging: pom -->
<groupId>${project.groupId}</groupId>
<artifactId>PlayerHeads-core</artifactId>
<version>5.0.0-SNAPSHOT</version>
<version>5.1.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.bukkit</groupId>
Expand Down
Loading

0 comments on commit 5d3ec75

Please sign in to comment.