Skip to content

Commit

Permalink
Fix dumb devs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Jul 10, 2019
1 parent f043530 commit 2e40b90
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 24 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.beefbytes</groupId>
<artifactId>puffix</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.1.0</version>

<repositories>
<repository>
Expand All @@ -23,7 +23,7 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.9.1</version>
<version>2.10.3</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/beefbytes/puffix/Puffix.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.beefbytes.puffix;

import me.clip.placeholderapi.PlaceholderAPI;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
Expand All @@ -24,7 +25,7 @@ public class Puffix extends JavaPlugin {
@Override
public void onEnable(){
if(Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")){
new PuffixPlaceholderHook(this).hook();
PlaceholderAPI.registerPlaceholderHook("puffix", new PuffixPlaceholderHook(this));
getLogger().log(Level.INFO, "PlaceholderAPI Hooked");
} else {
throw new RuntimeException("PlaceholderAPI not found!");
Expand Down
40 changes: 20 additions & 20 deletions src/main/java/com/beefbytes/puffix/PuffixPlaceholderHook.java
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
package com.beefbytes.puffix;

import me.clip.placeholderapi.external.EZPlaceholderHook;
import me.clip.placeholderapi.PlaceholderHook;
import org.bukkit.entity.Player;

public class PuffixPlaceholderHook extends EZPlaceholderHook {
public class PuffixPlaceholderHook extends PlaceholderHook {

private Puffix plugin;
private Puffix plugin;

public PuffixPlaceholderHook(Puffix plugin){
super(plugin, "puffix");
this.plugin = plugin;
}
public PuffixPlaceholderHook(Puffix plugin){
this.plugin = plugin;
}

@Override
public String onPlaceholderRequest(Player p, String identifier){
if(p == null){
return "";
}
@Override
public String onPlaceholderRequest(Player p, String identifier){
if(p == null){
return "";
}

switch(identifier){
case "prefix":
return plugin.getPrefix(p);
case "suffix":
return plugin.getSuffix(p);
}
switch(identifier){
case "prefix":
return plugin.getPrefix(p);
case "suffix":
return plugin.getSuffix(p);
}

return null;
}

return null;
}
}
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Puffix
author: Vilsol
main: com.beefbytes.puffix.Puffix
version: 1.0.0
version: 1.1.0
softdepend: [PlaceholderAPI]
commands:
puffix:
Expand Down

0 comments on commit 2e40b90

Please sign in to comment.