mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-07-09 05:44:01 +00:00
Update Edit command update VersionService inject
This commit is contained in:
parent
7069f24f14
commit
295afc6e35
@ -16,11 +16,11 @@ import com.google.inject.Inject;
|
|||||||
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
import venture.Aust1n46.chat.initiators.application.VentureChat;
|
||||||
import venture.Aust1n46.chat.localization.LocalizedMessage;
|
import venture.Aust1n46.chat.localization.LocalizedMessage;
|
||||||
import venture.Aust1n46.chat.model.ChatMessage;
|
import venture.Aust1n46.chat.model.ChatMessage;
|
||||||
import venture.Aust1n46.chat.model.VentureChatPlayer;
|
|
||||||
import venture.Aust1n46.chat.model.UniversalCommand;
|
import venture.Aust1n46.chat.model.UniversalCommand;
|
||||||
|
import venture.Aust1n46.chat.model.VentureChatPlayer;
|
||||||
|
import venture.Aust1n46.chat.service.VentureChatFormatService;
|
||||||
import venture.Aust1n46.chat.service.VentureChatPlayerApiService;
|
import venture.Aust1n46.chat.service.VentureChatPlayerApiService;
|
||||||
import venture.Aust1n46.chat.utilities.FormatUtils;
|
import venture.Aust1n46.chat.utilities.FormatUtils;
|
||||||
import venture.Aust1n46.chat.service.VentureChatFormatService;
|
|
||||||
|
|
||||||
public class Edit extends UniversalCommand {
|
public class Edit extends UniversalCommand {
|
||||||
@Inject
|
@Inject
|
||||||
@ -41,7 +41,6 @@ public class Edit extends UniversalCommand {
|
|||||||
@Inject
|
@Inject
|
||||||
public void postConstruct() {
|
public void postConstruct() {
|
||||||
emptyLinePacketContainer = formatService.createPacketPlayOutChat("{\"extra\":[\" \"],\"text\":\"\"}");
|
emptyLinePacketContainer = formatService.createPacketPlayOutChat("{\"extra\":[\" \"],\"text\":\"\"}");
|
||||||
messageDeletedComponentPlayer = WrappedChatComponent.fromJson("{\"text\":\"\",\"extra\":[{\"text\":\"<message removed>\",\"color\":\"red\",\"italic\":\"true\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"" + FormatUtils.FormatStringAll(plugin.getConfig().getString("messageremoverpermissions")) + "\"}]}}}]}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -111,6 +110,9 @@ public class Edit extends UniversalCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public WrappedChatComponent getMessageDeletedChatComponentPlayer() {
|
public WrappedChatComponent getMessageDeletedChatComponentPlayer() {
|
||||||
|
if (messageDeletedComponentPlayer == null) { // avoid errors on startup from this non functional command on different game versions
|
||||||
|
messageDeletedComponentPlayer = WrappedChatComponent.fromJson("{\"text\":\"\",\"extra\":[{\"text\":\"<message removed>\",\"color\":\"red\",\"italic\":\"true\",\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"" + FormatUtils.FormatStringAll(plugin.getConfig().getString("messageremoverpermissions")) + "\"}]}}}]}");
|
||||||
|
}
|
||||||
return this.messageDeletedComponentPlayer;
|
return this.messageDeletedComponentPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,15 +4,12 @@ import com.comphenix.protocol.utility.MinecraftVersion;
|
|||||||
import com.google.inject.Singleton;
|
import com.google.inject.Singleton;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public final class VersionService {
|
public class VersionService {
|
||||||
public static final MinecraftVersion SERVER_VERSION = MinecraftVersion.getCurrentVersion();
|
public static final MinecraftVersion SERVER_VERSION = MinecraftVersion.getCurrentVersion();
|
||||||
private static final MinecraftVersion MC1_19 = new MinecraftVersion(1, 19, 0);
|
private static final MinecraftVersion MC1_19 = new MinecraftVersion(1, 19, 0);
|
||||||
private static final MinecraftVersion MC1_19_1 = new MinecraftVersion(1, 19, 1);
|
private static final MinecraftVersion MC1_19_1 = new MinecraftVersion(1, 19, 1);
|
||||||
private static final MinecraftVersion MC1_20_4 = new MinecraftVersion(1, 20, 4);
|
private static final MinecraftVersion MC1_20_4 = new MinecraftVersion(1, 20, 4);
|
||||||
|
|
||||||
private VersionService() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean is1_7() {
|
public boolean is1_7() {
|
||||||
return SERVER_VERSION.getMinor() == 7 && SERVER_VERSION.getMajor() == 1;
|
return SERVER_VERSION.getMinor() == 7 && SERVER_VERSION.getMajor() == 1;
|
||||||
}
|
}
|
||||||
@ -76,7 +73,7 @@ public final class VersionService {
|
|||||||
public boolean isAbove_1_19() {
|
public boolean isAbove_1_19() {
|
||||||
return SERVER_VERSION.isAtLeast(MC1_19_1);
|
return SERVER_VERSION.isAtLeast(MC1_19_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAtLeast_1_20_4() {
|
public boolean isAtLeast_1_20_4() {
|
||||||
return SERVER_VERSION.isAtLeast(MC1_20_4);
|
return SERVER_VERSION.isAtLeast(MC1_20_4);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user