-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
943221c
commit b85a21a
Showing
22 changed files
with
745 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
29 changes: 29 additions & 0 deletions
29
bukkit/src/main/java/me/regadpole/plumbot/bukkit/hook/AuthMeHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package me.regadpole.plumbot.bukkit.hook; | ||
|
||
import fr.xephi.authme.api.v3.AuthMeApi; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.plugin.Plugin; | ||
import taboolib.common.platform.function.IOKt; | ||
|
||
public class AuthMeHook { | ||
|
||
public static Boolean hasAuthMe; | ||
public static AuthMeApi authMeApi; | ||
|
||
public static void hookAuthme() { | ||
|
||
Plugin authMe = Bukkit.getPluginManager().getPlugin("AuthMe"); | ||
try { | ||
if (authMe != null) { | ||
hasAuthMe = true; | ||
authMeApi = AuthMeApi.getInstance(); | ||
IOKt.info("AuthMe 关联成功"); | ||
}else{ | ||
hasAuthMe = false; | ||
IOKt.info("AuthMe 关联失败"); | ||
} | ||
} catch (Throwable e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
bukkit/src/main/java/me/regadpole/plumbot/bukkit/hook/GriefDefenderHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package me.regadpole.plumbot.bukkit.hook; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.plugin.Plugin; | ||
import taboolib.common.platform.function.IOKt; | ||
|
||
public class GriefDefenderHook { | ||
|
||
|
||
public static Boolean hasGriefDefender; | ||
|
||
public static void hookGriefDefender() { | ||
|
||
Plugin authMe = Bukkit.getPluginManager().getPlugin("GriefDefender"); | ||
try { | ||
if (authMe != null) { | ||
hasGriefDefender = true; | ||
IOKt.info("GriefDefender 关联成功"); | ||
}else{ | ||
hasGriefDefender = false; | ||
IOKt.info("GriefDefender 关联失败"); | ||
} | ||
} catch (Throwable e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
bukkit/src/main/java/me/regadpole/plumbot/bukkit/hook/QuickShopHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package me.regadpole.plumbot.bukkit.hook; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.plugin.Plugin; | ||
import taboolib.common.platform.function.IOKt; | ||
|
||
public class QuickShopHook { | ||
|
||
public static Boolean hasQs; | ||
|
||
public static Boolean hasQsHikari; | ||
|
||
public static void hookQuickShop() { | ||
|
||
Plugin quickShop = Bukkit.getPluginManager().getPlugin("QuickShop"); | ||
try { | ||
if (quickShop != null) { | ||
hasQs = true; | ||
hasQsHikari = false; | ||
IOKt.info("QuickShop-Reremake 关联成功"); | ||
}else{ | ||
hasQs = false; | ||
Plugin quickShopHikari = Bukkit.getPluginManager().getPlugin("QuickShop-Hikari"); | ||
try { | ||
if (quickShopHikari != null) { | ||
hasQsHikari = true; | ||
IOKt.info("QuickShop-Hikari 关联成功"); | ||
}else{ | ||
hasQsHikari = false; | ||
IOKt.info("QuickShop 关联失败"); | ||
} | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} catch (Throwable e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
bukkit/src/main/java/me/regadpole/plumbot/bukkit/hook/ResidenceHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package me.regadpole.plumbot.bukkit.hook; | ||
|
||
import com.bekvon.bukkit.residence.Residence; | ||
import com.bekvon.bukkit.residence.chat.ChatManager; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.plugin.Plugin; | ||
import taboolib.common.platform.function.IOKt; | ||
|
||
public class ResidenceHook { | ||
|
||
public static Boolean hasRes; | ||
|
||
public static ChatManager resChatApi; | ||
|
||
public static void hookRes() { | ||
|
||
Plugin residence = Bukkit.getPluginManager().getPlugin("Residence"); | ||
try { | ||
if (residence != null) { | ||
hasRes = true; | ||
resChatApi = Residence.getInstance().getChatManager(); | ||
IOKt.info("Residence 关联成功"); | ||
}else{ | ||
hasRes = false; | ||
IOKt.info("Residence 关联失败"); | ||
} | ||
} catch (Throwable e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} | ||
|
136 changes: 136 additions & 0 deletions
136
bukkit/src/main/java/me/regadpole/plumbot/bukkit/listener/ConsoleSender.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
package me.regadpole.plumbot.bukkit.listener; | ||
|
||
import me.regadpole.plumbot.bukkit.util.ServerManager; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.Server; | ||
import org.bukkit.command.ConsoleCommandSender; | ||
import org.bukkit.conversations.Conversation; | ||
import org.bukkit.conversations.ConversationAbandonedEvent; | ||
import org.bukkit.permissions.Permission; | ||
import org.bukkit.permissions.PermissionAttachment; | ||
import org.bukkit.permissions.PermissionAttachmentInfo; | ||
import org.bukkit.plugin.Plugin; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.Set; | ||
import java.util.UUID; | ||
|
||
public class ConsoleSender implements ConsoleCommandSender { | ||
|
||
private final Server server = Bukkit.getServer(); | ||
|
||
public Server getServer() { | ||
return this.server; | ||
} | ||
|
||
public String getName() { | ||
return "CONSOLE"; | ||
} | ||
|
||
public void sendMessage(String message) { | ||
ServerManager.msgList.add(message); | ||
} | ||
|
||
public void sendMessage(String[] messages) { | ||
for (String msg : messages) | ||
sendMessage(msg); | ||
} | ||
|
||
public void sendMessage(@Nullable UUID sender, @NotNull String message) { | ||
ServerManager.msgList.add(message); | ||
} | ||
|
||
public void sendMessage(@Nullable UUID sender, @NotNull String[] messages) { | ||
for (String msg : messages) | ||
sendMessage(null, msg); | ||
} | ||
|
||
public boolean isPermissionSet(String s) { | ||
return false; | ||
} | ||
|
||
public boolean isPermissionSet(Permission permission) { | ||
return false; | ||
} | ||
|
||
public boolean hasPermission(String s) { | ||
return true; | ||
} | ||
|
||
public boolean hasPermission(Permission permission) { | ||
return true; | ||
} | ||
|
||
public boolean isOp() { | ||
return true; | ||
} | ||
|
||
public void setOp(boolean b) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public Spigot spigot() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public boolean isConversing() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public void acceptConversationInput(String s) { | ||
ServerManager.msgList.add(s); | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public boolean beginConversation(Conversation conversation) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public void abandonConversation(Conversation conversation) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public void abandonConversation(Conversation conversation, ConversationAbandonedEvent conversationAbandonedEvent) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public void sendRawMessage(String s) { | ||
ServerManager.msgList.add(s); | ||
} | ||
|
||
public void sendRawMessage(@Nullable UUID sender, @NotNull String message) { | ||
ServerManager.msgList.add(message); | ||
} | ||
|
||
public PermissionAttachment addAttachment(Plugin plugin, String s, boolean b) { | ||
ServerManager.msgList.add(s); | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public PermissionAttachment addAttachment(Plugin plugin) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public PermissionAttachment addAttachment(Plugin plugin, String s, boolean b, int i) { | ||
ServerManager.msgList.add(s); | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public PermissionAttachment addAttachment(Plugin plugin, int i) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public void removeAttachment(PermissionAttachment permissionAttachment) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public void recalculatePermissions() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public Set<PermissionAttachmentInfo> getEffectivePermissions() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
bukkit/src/main/java/me/regadpole/plumbot/bukkit/listener/GDClaimEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package me.regadpole.plumbot.bukkit.listener; | ||
|
||
import com.griefdefender.api.event.ClaimEvent; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.Listener; | ||
|
||
public class GDClaimEvent implements Listener { | ||
|
||
|
||
private static String gdMessage; | ||
|
||
@EventHandler(priority = EventPriority.HIGH) | ||
public void onGDClaim (ClaimEvent e){ | ||
setGDMessage(e.getMessage().toString()); | ||
} | ||
|
||
public static String getGDMessage() {return gdMessage;} | ||
private static void setGDMessage(String s) {gdMessage = s;} | ||
} |
23 changes: 23 additions & 0 deletions
23
bukkit/src/main/java/me/regadpole/plumbot/bukkit/listener/QsChatEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package me.regadpole.plumbot.bukkit.listener; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.Listener; | ||
|
||
public class QsChatEvent implements Listener { | ||
|
||
private static String qsMessage; | ||
private static Player qsSender; | ||
|
||
@EventHandler(priority = EventPriority.HIGH) | ||
public void onQSChat (org.maxgamer.quickshop.api.event.QSHandleChatEvent e){ | ||
setQsMessage(e.getMessage()); | ||
setQsSender(e.getSender()); | ||
} | ||
|
||
public static String getQsMessage() {return qsMessage;} | ||
public static Player getQsSender() {return qsSender;} | ||
private static void setQsMessage(String s) {qsMessage = s;} | ||
private static void setQsSender(Player p) {qsSender = p;} | ||
} |
23 changes: 23 additions & 0 deletions
23
bukkit/src/main/java/me/regadpole/plumbot/bukkit/listener/QsHikariChatEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package me.regadpole.plumbot.bukkit.listener; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.Listener; | ||
public class QsHikariChatEvent implements Listener { | ||
|
||
private static String qsMessage; | ||
private static Player qsSender; | ||
|
||
@EventHandler(priority = EventPriority.HIGH) | ||
public void onQSChat (com.ghostchu.quickshop.api.event.QSHandleChatEvent e){ | ||
setQsMessage(e.getMessage()); | ||
setQsSender(e.getSender()); | ||
} | ||
|
||
|
||
public static String getQsMessage() {return qsMessage;} | ||
public static Player getQsSender() {return qsSender;} | ||
private static void setQsMessage(String s) {qsMessage = s;} | ||
private static void setQsSender(Player p) {qsSender = p;} | ||
} |
Oops, something went wrong.