mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Fix compilation and improve some features
This commit is contained in:
1 parent
ad8089855c
commit
2fb1eb0eb5
14 files changed
+45
-116
No files matched your search
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<artifactId>SimpleChatParent</artifactId>
|
||||
<groupId>net.draycia</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<version>1.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>SimpleChat</artifactId>
|
||||
@@ -23,50 +23,7 @@
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<configuration>
|
||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>co.aikar.commands</pattern>
|
||||
<shadedPattern>net.draycia.simplechat.libs.acf</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>co.aikar.locales</pattern>
|
||||
<shadedPattern>net.draycia.simplechat.libs.locales</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>co.aikar.idb</pattern>
|
||||
<shadedPattern>net.draycia.simplechat.libs.idb</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>net.kyori</pattern>
|
||||
<shadedPattern>net.draycia.simplechat.libs.kyori</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>io.papermc.lib</pattern>
|
||||
<shadedPattern>net.draycia.simplechat.libs.paperlib</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.fasterxml</pattern>
|
||||
<shadedPattern>net.draycia.simplechat.libs.fasterxml</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.neovisionaries</pattern>
|
||||
<shadedPattern>net.draycia.simplechat.libs.neovisionaries</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>okio</pattern>
|
||||
<shadedPattern>net.draycia.simplechat.libs.okio</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>okhttp3</pattern>
|
||||
<shadedPattern>net.draycia.simplechat.libs.okhttp3</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.checkerframework</pattern>
|
||||
<shadedPattern>net.draycia.simplechat.libs.checkerframework</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
package net.draycia.simplechat.channels;
|
||||
|
||||
import net.draycia.simplechat.SimpleChat;
|
||||
import net.draycia.simplechat.events.ChatFormatEvent;
|
||||
import net.draycia.simplechat.storage.ChatUser;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public abstract class ChatChannel {
|
||||
|
||||
-6
@@ -1,17 +1,11 @@
|
||||
package net.draycia.simplechat.channels.impls;
|
||||
|
||||
import com.palmergames.bukkit.towny.TownyAPI;
|
||||
import com.palmergames.bukkit.towny.event.NationRemoveTownEvent;
|
||||
import com.palmergames.bukkit.towny.event.TownRemoveResidentEvent;
|
||||
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
|
||||
import com.palmergames.bukkit.towny.object.Resident;
|
||||
import net.draycia.simplechat.SimpleChat;
|
||||
import net.draycia.simplechat.storage.ChatUser;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
public class AllianceChatChannel extends NationChatChannel implements Listener {
|
||||
|
||||
|
||||
-1
@@ -1,7 +1,6 @@
|
||||
package net.draycia.simplechat.channels.impls;
|
||||
|
||||
import com.palmergames.bukkit.towny.TownyAPI;
|
||||
import com.palmergames.bukkit.towny.event.TownAddResidentEvent;
|
||||
import com.palmergames.bukkit.towny.event.TownRemoveResidentEvent;
|
||||
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
|
||||
import com.palmergames.bukkit.towny.object.Resident;
|
||||
|
||||
@@ -5,7 +5,6 @@ import co.aikar.commands.annotation.*;
|
||||
import net.draycia.simplechat.SimpleChat;
|
||||
import net.draycia.simplechat.channels.ChatChannel;
|
||||
import net.draycia.simplechat.storage.ChatUser;
|
||||
import net.draycia.simplechat.storage.UserChannelSettings;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package net.draycia.simplechat.listeners;
|
||||
|
||||
import net.draycia.simplechat.events.ChatFormatEvent;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
public class MuteHandler implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onMute(ChatFormatEvent event) {
|
||||
if (event.getUser().isMuted()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package net.draycia.simplechat.listeners;
|
||||
|
||||
import net.draycia.simplechat.events.ChatComponentEvent;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
public class ShadowMuteHandler implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onComponent(ChatComponentEvent event) {
|
||||
if (event.getUser().isShadowMuted()) {
|
||||
if (event.getRecipients().size() == 1 && event.getUser().equals(event.getRecipients().get(0))) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
event.getRecipients().clear();
|
||||
event.getRecipients().add(event.getUser());
|
||||
} catch (UnsupportedOperationException e) {}
|
||||
}
|
||||
|
||||
// TODO: figure out a way to add the console "[SM]" prefix for shadow muted players
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,19 +30,17 @@ import java.lang.reflect.Method;
|
||||
|
||||
public final class ItemStackUtils {
|
||||
|
||||
private final Class<?> craftItemStackClass;
|
||||
private final Method asNMSCopyMethod;
|
||||
private final Class<?> itemStackClass;
|
||||
private final Method cMethod;
|
||||
|
||||
public ItemStackUtils() throws NoSuchMethodException, ClassNotFoundException {
|
||||
final String version = Bukkit.getServer().getClass().getPackage().getName()
|
||||
.substring("org.bukkit.craftbukkit.".length());
|
||||
|
||||
this.craftItemStackClass = Class.forName("org.bukkit.craftbukkit." + version + ".inventory.CraftItemStack");
|
||||
this.asNMSCopyMethod = this.craftItemStackClass.getMethod("asNMSCopy", ItemStack.class);
|
||||
this.itemStackClass = Class.forName("net.minecraft.server." + version + ".ItemStack");
|
||||
this.cMethod = this.itemStackClass.getMethod("C");
|
||||
Class<?> craftItemStackClass = Class.forName("org.bukkit.craftbukkit." + version + ".inventory.CraftItemStack");
|
||||
this.asNMSCopyMethod = craftItemStackClass.getMethod("asNMSCopy", ItemStack.class);
|
||||
Class<?> itemStackClass = Class.forName("net.minecraft.server." + version + ".ItemStack");
|
||||
this.cMethod = itemStackClass.getMethod("C");
|
||||
}
|
||||
|
||||
public Component createComponent(final Player player) {
|
||||
|
||||
Reference in new issue
Block a user