尝试ASM失败,还是反射简单...
This commit is contained in:
parent
863dc35e56
commit
4cc3ce4fc8
92
TabooLib.iml
92
TabooLib.iml
@ -10,6 +10,15 @@
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module-library">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/libs/ProtocolLib.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.javalite:activejdbc:2.0" level="project" />
|
||||
@ -21,6 +30,7 @@
|
||||
<orderEntry type="library" name="Maven: com.h2database:h2:1.4.197" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.ilummc.eagletdl:EagletCore:1.1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.ow2.asm:asm:6.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: me.clip:placeholderapi:2.8.4" level="project" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: bukkit:bukkit1_12:1">
|
||||
<CLASSES>
|
||||
@ -30,17 +40,6 @@
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="Maven: net.milkbowl.vault:VaultAPI:1.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bukkit:bukkit:1.9-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: junit:junit:4.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:17.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.avaje:ebean:2.8.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.15" level="project" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: bukkit:bukkit1_8:1">
|
||||
<CLASSES>
|
||||
@ -50,33 +49,6 @@
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: bukkit:bukkit1_9:1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/libs/1_9_R3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: bukkit:bukkit1_10:1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/libs/1_10_R1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: bukkit:bukkit1_11:1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/libs/1_11_R1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: com.sun.tools:jshell:1">
|
||||
<CLASSES>
|
||||
@ -87,9 +59,18 @@
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: placeholder:placeholder:1">
|
||||
<library name="Maven: taboocode:taboocode:1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/libs/PlaceholderAPI.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/libs/TabooCode5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: yum:yum:1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/libs/Yum.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
@ -104,24 +85,6 @@
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: sk:sk:1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/libs/Skript.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: taboocode:taboocode:1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/libs/TabooCode5.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: wg:wg:1">
|
||||
<CLASSES>
|
||||
@ -132,9 +95,18 @@
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: yum:yum:1">
|
||||
<library name="Maven: sk:sk:1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/libs/Yum.jar!/" />
|
||||
<root url="jar://$MODULE_DIR$/libs/Skript.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: vault:vault:1">
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/libs/Vault.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
85
pom.xml
85
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>me.skymc</groupId>
|
||||
<artifactId>TabooLib</artifactId>
|
||||
<version>3.832</version>
|
||||
<version>4.0</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@ -57,8 +57,8 @@
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>vault</id>
|
||||
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
|
||||
<id>placeholderapi</id>
|
||||
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<dependencies>
|
||||
@ -93,6 +93,11 @@
|
||||
<artifactId>asm</artifactId>
|
||||
<version>6.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>2.8.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>bukkit</groupId>
|
||||
<artifactId>bukkit1_12</artifactId>
|
||||
@ -100,11 +105,6 @@
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/1_12_R1.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<version>1.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>bukkit</groupId>
|
||||
<artifactId>bukkit1_8</artifactId>
|
||||
@ -112,27 +112,6 @@
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/1_8_R3.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>bukkit</groupId>
|
||||
<artifactId>bukkit1_9</artifactId>
|
||||
<version>1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/1_9_R3.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>bukkit</groupId>
|
||||
<artifactId>bukkit1_10</artifactId>
|
||||
<version>1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/1_10_R1.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>bukkit</groupId>
|
||||
<artifactId>bukkit1_11</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>1</version>
|
||||
<systemPath>${basedir}/libs/1_11_R1.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.tools</groupId>
|
||||
<artifactId>jshell</artifactId>
|
||||
@ -140,27 +119,6 @@
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/com.sun.tools.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>placeholder</groupId>
|
||||
<artifactId>placeholder</artifactId>
|
||||
<version>1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/PlaceholderAPI.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plib</groupId>
|
||||
<artifactId>plib</artifactId>
|
||||
<version>1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/ProtocolLib.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>sk</groupId>
|
||||
<artifactId>sk</artifactId>
|
||||
<version>1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/Skript.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>taboocode</groupId>
|
||||
<artifactId>taboocode</artifactId>
|
||||
@ -168,6 +126,20 @@
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/TabooCode5.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>yum</groupId>
|
||||
<artifactId>yum</artifactId>
|
||||
<version>1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/Yum.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>plib</groupId>
|
||||
<artifactId>plib</artifactId>
|
||||
<version>1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/ProtocolLib.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>wg</groupId>
|
||||
<artifactId>wg</artifactId>
|
||||
@ -176,11 +148,18 @@
|
||||
<systemPath>${basedir}/libs/WorldGuard.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>yum</groupId>
|
||||
<artifactId>yum</artifactId>
|
||||
<groupId>sk</groupId>
|
||||
<artifactId>sk</artifactId>
|
||||
<version>1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/Yum.jar</systemPath>
|
||||
<systemPath>${basedir}/libs/Skript.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>vault</groupId>
|
||||
<artifactId>vault</artifactId>
|
||||
<version>1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/Vault.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -72,7 +72,7 @@ public class TLocaleLoader {
|
||||
*/
|
||||
public static void load(Plugin plugin, boolean isCover) {
|
||||
try {
|
||||
if ((isCover || !isLocaleLoaded(plugin)) && (plugin.equals(Main.getInst()) || isDependWithTabooLib(plugin))) {
|
||||
if (isLoadLocale(plugin, isCover)) {
|
||||
// 获取文件
|
||||
File localeFile = getLocaleFile(plugin);
|
||||
if (localeFile == null) {
|
||||
@ -99,6 +99,10 @@ public class TLocaleLoader {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isLoadLocale(Plugin plugin, boolean isCover) {
|
||||
return (isCover || !isLocaleLoaded(plugin)) && (plugin.equals(Main.getInst()) || isDependWithTabooLib(plugin));
|
||||
}
|
||||
|
||||
private static void infoLogger(String path, String... args) {
|
||||
TLogger.getGlobalLogger().info(Strings.replaceWithOrder(TLib.getInternalLanguage().getString(path), args));
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ import me.skymc.taboolib.update.UpdateTask;
|
||||
import me.skymc.tlm.TLM;
|
||||
import me.skymc.tlm.command.TLMCommands;
|
||||
import me.skymc.tlm.module.TabooLibraryModule;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -49,12 +48,14 @@ import org.bukkit.scheduler.BukkitRunnable;
|
||||
import java.io.File;
|
||||
import java.util.Random;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
/**
|
||||
* @author sky
|
||||
*/
|
||||
public class Main extends JavaPlugin implements Listener {
|
||||
|
||||
private static Plugin inst;
|
||||
|
||||
private static Economy Economy;
|
||||
private static net.milkbowl.vault.economy.Economy Economy;
|
||||
|
||||
private static File playerDataFolder;
|
||||
|
||||
|
80
src/main/java/me/skymc/taboolib/anvil/AnvilContainer.java
Normal file
80
src/main/java/me/skymc/taboolib/anvil/AnvilContainer.java
Normal file
@ -0,0 +1,80 @@
|
||||
package me.skymc.taboolib.anvil;
|
||||
|
||||
import com.ilummc.tlib.util.asm.AsmClassTransformer;
|
||||
import me.skymc.taboolib.nms.NMSUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* @author sky
|
||||
*/
|
||||
public class AnvilContainer {
|
||||
|
||||
// private static IAnvilContainer instance;
|
||||
|
||||
private static Class<?> ChatMessage = NMSUtils.getNMSClass("ChatMessage");
|
||||
private static Class<?> PacketPlayOutOpenWindow = NMSUtils.getNMSClass("PacketPlayOutOpenWindow");
|
||||
private static Class<?> IChatBaseComponent = NMSUtils.getNMSClass("IChatBaseComponent");
|
||||
private static Class<?> Packet = NMSUtils.getNMSClass("Packet");
|
||||
|
||||
// public static IAnvilContainer getInstance() {
|
||||
// return instance;
|
||||
// }
|
||||
//
|
||||
// static {
|
||||
// /*
|
||||
// * 玩不懂玩不懂... 似乎不会更改父类的包名?
|
||||
// */
|
||||
// instance = (IAnvilContainer) AsmClassTransformer.builder()
|
||||
// .from(AnvilContainerImpl.class)
|
||||
// .fromVersion("v1_12_R1")
|
||||
// .toVersion(Bukkit.getServer().getClass().getName().split("\\.")[3])
|
||||
// .build()
|
||||
// .transform();
|
||||
// }
|
||||
|
||||
public static void openAnvil(Player p) {
|
||||
try {
|
||||
Object player = p.getClass().getMethod("getHandle").invoke(p);
|
||||
int c = (int) player.getClass().getMethod("nextContainerCounter").invoke(player);
|
||||
Object chatMessage = ChatMessage.getConstructor(String.class, Object[].class).newInstance("Repairing", new Object[0]);
|
||||
Object packetPlayOutOpenWindow = PacketPlayOutOpenWindow.getConstructor(Integer.TYPE, String.class, IChatBaseComponent, Integer.TYPE).newInstance(c, "minecraft:anvil", chatMessage, 0);
|
||||
Object playerConnection = player.getClass().getDeclaredField("playerConnection").get(player);
|
||||
playerConnection.getClass().getMethod("sendPacket", Packet).invoke(playerConnection, packetPlayOutOpenWindow);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//interface IAnvilContainer {
|
||||
//
|
||||
// /**
|
||||
// * 打开铁砧界面
|
||||
// *
|
||||
// * @param player 玩家
|
||||
// */
|
||||
// void openAnvil(Player player);
|
||||
//}
|
||||
//
|
||||
//class AnvilContainerImpl extends net.minecraft.server.v1_12_R1.ContainerAnvil implements IAnvilContainer {
|
||||
//
|
||||
// public AnvilContainerImpl(net.minecraft.server.v1_12_R1.EntityHuman player) {
|
||||
// super(player.inventory, player.world, new net.minecraft.server.v1_12_R1.BlockPosition(0, 0, 0), player);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void openAnvil(Player p) {
|
||||
// net.minecraft.server.v1_12_R1.EntityPlayer player = ((org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer) p).getHandle();
|
||||
// AnvilContainerImpl container = new AnvilContainerImpl(player);
|
||||
// int c = player.nextContainerCounter();
|
||||
// player.playerConnection.sendPacket(new net.minecraft.server.v1_12_R1.PacketPlayOutOpenWindow(c, "minecraft:anvil", new net.minecraft.server.v1_12_R1.ChatMessage("Repairing"), 0));
|
||||
// player.activeContainer = container;
|
||||
// player.activeContainer.windowId = c;
|
||||
// player.activeContainer.addSlotListener(player);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean a(net.minecraft.server.v1_12_R1.EntityHuman player) {
|
||||
// return true;
|
||||
// }
|
||||
//}
|
@ -1,6 +1,6 @@
|
||||
package me.skymc.taboolib.anvil;
|
||||
|
||||
import me.skymc.taboolib.anvil.versions.AnvilContainer_V1_9_4;
|
||||
import com.ilummc.tlib.resources.TLocale;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -19,6 +19,9 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author sky
|
||||
*/
|
||||
public class AnvilContainerAPI implements Listener {
|
||||
|
||||
public static List<String> list = new ArrayList<>();
|
||||
@ -29,14 +32,12 @@ public class AnvilContainerAPI implements Listener {
|
||||
public static void send(Player p, String type, String str, List<String> lorelist) {
|
||||
isOpen.put(p.getName(), type);
|
||||
|
||||
AnvilContainer_V1_9_4.openAnvil(p);
|
||||
AnvilContainer.openAnvil(p);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
|
||||
list.clear();
|
||||
if (lorelist == null) {
|
||||
list.add("");
|
||||
list.add("§7在上方文本框内输入信息");
|
||||
list.add("§7随后点击右侧输出物品");
|
||||
list.addAll(TLocale.asStringList("ANVIL-CONTAINER.LORE-NORMAL"));
|
||||
} else {
|
||||
list = lorelist;
|
||||
}
|
||||
@ -91,7 +92,7 @@ public class AnvilContainerAPI implements Listener {
|
||||
if ("/anvilexample".equals(e.getMessage())) {
|
||||
if (e.getPlayer().hasPermission("taboolib.admin")) {
|
||||
e.setCancelled(true);
|
||||
AnvilContainerAPI.send(e.getPlayer(), "EXAMPLE", "在这里输入文本", null);
|
||||
AnvilContainerAPI.send(e.getPlayer(), "EXAMPLE", TLocale.asString("ANVIL-CONTAINER.NAME-EXAMPLE"), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,32 +0,0 @@
|
||||
package me.skymc.taboolib.anvil.versions;
|
||||
|
||||
import net.minecraft.server.v1_11_R1.*;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class AnvilContainer_V1_11_R1 extends ContainerAnvil {
|
||||
|
||||
public AnvilContainer_V1_11_R1(EntityHuman player) {
|
||||
super(player.inventory, player.world, new BlockPosition(0, 0, 0), player);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 方法已过期,已有新的方法
|
||||
*/
|
||||
@Deprecated
|
||||
public static void openAnvil(Player p) {
|
||||
EntityPlayer player = ((CraftPlayer) p).getHandle();
|
||||
AnvilContainer_V1_11_R1 container = new AnvilContainer_V1_11_R1(player);
|
||||
int c = player.nextContainerCounter();
|
||||
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(c, "minecraft:anvil", new ChatMessage("Repairing"), 0));
|
||||
player.activeContainer = container;
|
||||
player.activeContainer.windowId = c;
|
||||
player.activeContainer.addSlotListener(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a(EntityHuman player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package me.skymc.taboolib.anvil.versions;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.*;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class AnvilContainer_V1_8_R3 extends ContainerAnvil {
|
||||
|
||||
public AnvilContainer_V1_8_R3(EntityHuman player) {
|
||||
super(player.inventory, player.world, new BlockPosition(0, 0, 0), player);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 方法已过期,已有新的方法
|
||||
*/
|
||||
@Deprecated
|
||||
public static void openAnvil(Player p) {
|
||||
EntityPlayer player = ((CraftPlayer) p).getHandle();
|
||||
AnvilContainer_V1_8_R3 container = new AnvilContainer_V1_8_R3(player);
|
||||
int c = player.nextContainerCounter();
|
||||
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(c, "minecraft:anvil", new ChatMessage("Repairing"), 0));
|
||||
player.activeContainer = container;
|
||||
player.activeContainer.windowId = c;
|
||||
player.activeContainer.addSlotListener(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a(EntityHuman player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package me.skymc.taboolib.anvil.versions;
|
||||
|
||||
import net.minecraft.server.v1_9_R2.*;
|
||||
import org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class AnvilContainer_V1_9_4 extends ContainerAnvil {
|
||||
|
||||
public AnvilContainer_V1_9_4(EntityHuman player) {
|
||||
super(player.inventory, player.world, new BlockPosition(0, 0, 0), player);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 方法已过期,已有新的方法
|
||||
*/
|
||||
@Deprecated
|
||||
public static void openAnvil(Player p) {
|
||||
EntityPlayer player = ((CraftPlayer) p).getHandle();
|
||||
AnvilContainer_V1_9_4 container = new AnvilContainer_V1_9_4(player);
|
||||
int c = player.nextContainerCounter();
|
||||
player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(c, "minecraft:anvil", new ChatMessage("Repairing"), 0));
|
||||
player.activeContainer = container;
|
||||
player.activeContainer.windowId = c;
|
||||
player.activeContainer.addSlotListener(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean a(EntityHuman player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -8,6 +8,9 @@ import me.skymc.tlm.module.sub.ModuleKits;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
/**
|
||||
* @author sky
|
||||
*/
|
||||
public class SupportPlaceholder extends EZPlaceholderHook {
|
||||
|
||||
public SupportPlaceholder(Plugin plugin, String identifier) {
|
||||
|
@ -132,7 +132,7 @@ public class TagAPI implements Listener {
|
||||
builtUUID.append(sent.getId());
|
||||
}
|
||||
|
||||
AsyncPlayerReceiveNameTagEvent newEvent = new AsyncPlayerReceiveNameTagEvent(destinationPlayer, namedPlayer, oldEvent.getTag(), UUID.fromString(builtUUID.toString()));
|
||||
AsyncPlayerReceiveNameTagEvent newEvent = new AsyncPlayerReceiveNameTagEvent(destinationPlayer, namedPlayer, getPlayerDisplayName(namedPlayer), UUID.fromString(builtUUID.toString()));
|
||||
Bukkit.getServer().getPluginManager().callEvent(newEvent);
|
||||
|
||||
return new WrappedGameProfile(newEvent.getUUID(), newEvent.getTag().substring(0, Math.min(newEvent.getTag().length(), 16)));
|
||||
|
@ -77,7 +77,14 @@ LANGUAGE2:
|
||||
FALL-NOTFOUND-FILE: '语言文件 {0} 不存在'
|
||||
|
||||
TIMECYCLE:
|
||||
FALL-CYCLE-EXISTS: '注册周期管理器 §8{0}§c 失败, 原因: &4名称重复'
|
||||
FALL-CYCLE-EXISTS: '注册周期管理器 &8{0}&c 失败, 原因: &4名称重复'
|
||||
|
||||
ANVIL-CONTAINER:
|
||||
NAME-EXAMPLE: '在这里输入文本'
|
||||
LORE-NORMAL:
|
||||
- ''
|
||||
- '&7在上方文本框内输入信息'
|
||||
- '&7随后点击右侧输出物品'
|
||||
|
||||
UPDATETASK:
|
||||
VERSION-LATEST: '插件已是最新版, 无需更新!'
|
||||
@ -110,17 +117,17 @@ COMMANDS:
|
||||
ONLY-PLAYER: '&8[&3&lTabooLib&8] &4控制台无法这么做'
|
||||
ONLY-STORAGE-SQL: '&8[&3&lTabooLib&8] &4只有启用数据库储存时才能这么做'
|
||||
INTERNAL:
|
||||
ONLY-PLAYER: '&8[&3&lTabooLib&8] §7指令 §f{0} §7只能由 §f{1} §7执行'
|
||||
ONLY-PLAYER: '&8[&3&lTabooLib&8] &7指令 &f{0} &7只能由 &f{1} &7执行'
|
||||
TYPE-PLAYER: 玩家
|
||||
TYPE-CONSOLE: 控制台
|
||||
ERROR-USAGE:
|
||||
- '&8[&3&lTabooLib&8] §7指令 §f{0} §7参数不足'
|
||||
- '&8[&3&lTabooLib&8] §7正确用法:'
|
||||
- '&8[&3&lTabooLib&8] §7{1}'
|
||||
- '&8[&3&lTabooLib&8] &7指令 &f{0} &7参数不足'
|
||||
- '&8[&3&lTabooLib&8] &7正确用法:'
|
||||
- '&8[&3&lTabooLib&8] &7{1}'
|
||||
ERROR-COMMAND:
|
||||
- '&8[&3&lTabooLib&8] §7指令 §f{0} §7不存在'
|
||||
- '&8[&3&lTabooLib&8] §7你可能想要:'
|
||||
- '&8[&3&lTabooLib&8] §7{1}'
|
||||
- '&8[&3&lTabooLib&8] &7指令 &f{0} &7不存在'
|
||||
- '&8[&3&lTabooLib&8] &7你可能想要:'
|
||||
- '&8[&3&lTabooLib&8] &7{1}'
|
||||
COMMAND-REGISTER: '&7自动为插件 &f{0} &7的命令 &f{1} &7注册 &f{2} &7条子命令'
|
||||
PARAMETER:
|
||||
UNKNOWN: '&8[&3&lTabooLib&8] &4指令错误'
|
||||
@ -130,7 +137,7 @@ COMMANDS:
|
||||
SUCCESS-NORMAL: '&8[&3&lTabooLib&8] &7重载成功'
|
||||
SUCCESS-ELAPSED-TIME: '&8[&3&lTabooLib&8] &7重载成功, 耗时: &f{0} ms'
|
||||
TABOOLIB:
|
||||
COMMAND-TITLE: '§b§l----- §3§lTabooLib Commands §b§l-----'
|
||||
COMMAND-TITLE: '&b&l----- &3&lTabooLib Commands &b&l-----'
|
||||
SAVE:
|
||||
DESCRIPTION: '载入插件'
|
||||
ARGUMENTS:
|
||||
@ -174,7 +181,7 @@ COMMANDS:
|
||||
READ-RESULT: '&8[&3&lTabooLib&8] &7变量 &f{0} &7的值为: &f{1}'
|
||||
READ-SUCCESS: '&8[&3&lTabooLib&8] &7写入完成, 耗时: &f{0} &7(ms)'
|
||||
IMPORTDATA:
|
||||
DESCRIPTION: '§4向数据库导入本地数据 §8(该操作将会清空数据库)'
|
||||
DESCRIPTION: '&4向数据库导入本地数据 &8(该操作将会清空数据库)'
|
||||
CLEARING: '&8[&3&lTabooLib&8] &7正在清空数据库...'
|
||||
EMPTYDATA: '&8[&3&lTabooLib&8] &4没有玩家数据可以导入'
|
||||
IMPORTING-START: '&8[&3&lTabooLib&8] &7开始导入 &f{0} &7项玩家数据'
|
||||
@ -223,22 +230,22 @@ COMMANDS:
|
||||
- ==: JSON
|
||||
text:
|
||||
- ''
|
||||
- '§b§l----- §3§lItemStack Info §b§l-----'
|
||||
- '&b&l----- &3&lItemStack Info &b&l-----'
|
||||
- ''
|
||||
- '§7 - 物品材质: §f<{0}@type>'
|
||||
- '§7 - 物品名称: §f<{1}@name>'
|
||||
- '§7 - 物品序号: §f<{2}@id>'
|
||||
- '§7 - 物品数据: §f<NBT@nbt>'
|
||||
- '&7 - 物品材质: &f<{0}@type>'
|
||||
- '&7 - 物品名称: &f<{1}@name>'
|
||||
- '&7 - 物品序号: &f<{2}@id>'
|
||||
- '&7 - 物品数据: &f<NBT@nbt>'
|
||||
- ''
|
||||
args:
|
||||
type:
|
||||
hover: '§f点击复制'
|
||||
hover: '&f点击复制'
|
||||
suggest: '{0}'
|
||||
name:
|
||||
hover: '§f点击复制'
|
||||
hover: '&f点击复制'
|
||||
suggest: '{1}'
|
||||
id:
|
||||
hover: '§f点击复制'
|
||||
hover: '&f点击复制'
|
||||
suggest: '{2}'
|
||||
nbt:
|
||||
hover: '{3}'
|
||||
@ -246,27 +253,27 @@ COMMANDS:
|
||||
DESCRIPTION: '查看所有物品'
|
||||
MENU:
|
||||
TITLE: '物品库 {0}'
|
||||
NEXT: '§f上一页'
|
||||
BACK: '§f下一页'
|
||||
NEXT: '&f上一页'
|
||||
BACK: '&f下一页'
|
||||
LORE:
|
||||
- ''
|
||||
- '§f§m '
|
||||
- '§f序列号: §8{0}'
|
||||
- '&f&m '
|
||||
- '&f序列号: &8{0}'
|
||||
SOUNDS:
|
||||
DESCRIPTION: '查看所有音效'
|
||||
MENU:
|
||||
TITLE: '音效库 {0}'
|
||||
NEXT: '§f上一页'
|
||||
BACK: '§f下一页'
|
||||
NEXT: '&f上一页'
|
||||
BACK: '&f下一页'
|
||||
LORE:
|
||||
- ''
|
||||
- '§f左键: §71 音调'
|
||||
- '§f右键: §72 音调'
|
||||
- '§f中键: §7复制名称'
|
||||
- '&f左键: &71 音调'
|
||||
- '&f右键: &72 音调'
|
||||
- '&f中键: &7复制名称'
|
||||
RESULT:
|
||||
SEARCH:
|
||||
- '§7查询名称: §f{0}'
|
||||
- '§7查询结果: §f{1}'
|
||||
- '&7查询名称: &f{0}'
|
||||
- '&7查询结果: &f{1}'
|
||||
COPY:
|
||||
- ==: JSON
|
||||
text: '&7点击复制: <&f&n{0}@sound>'
|
||||
@ -292,23 +299,23 @@ COMMANDS:
|
||||
CYCLE-RESET: '&8[&3&lTabooLib&8] &7检查器 &f{0} &7初始化完成'
|
||||
CYCLE-INFO:
|
||||
- ''
|
||||
- '§b§l----- §3§lTimeCycle Info §b§l-----'
|
||||
- '&b&l----- &3&lTimeCycle Info &b&l-----'
|
||||
- ''
|
||||
- ' §f- §7注册周期: §f{0}'
|
||||
- ' §f- §7注册插件: §f{1}'
|
||||
- ' §f- §7上次刷新时间: §f{2}'
|
||||
- ' §f- §7下次刷新时间: §f{3}'
|
||||
- ' &f- &7注册周期: &f{0}'
|
||||
- ' &f- &7注册插件: &f{1}'
|
||||
- ' &f- &7上次刷新时间: &f{2}'
|
||||
- ' &f- &7下次刷新时间: &f{3}'
|
||||
LIST:
|
||||
HEAD:
|
||||
- ''
|
||||
- '§b§l----- §3§lTimeCycle List §b§l-----'
|
||||
- '&b&l----- &3&lTimeCycle List &b&l-----'
|
||||
- ''
|
||||
BODY:
|
||||
- ==: JSON
|
||||
text: ' §7- §f{0} <&8(点击复制)@copy>'
|
||||
text: ' &7- &f{0} <&8(点击复制)@copy>'
|
||||
args:
|
||||
copy:
|
||||
hover: '§f点击复制'
|
||||
hover: '&f点击复制'
|
||||
suggest: '{0}'
|
||||
FOOT:
|
||||
- ''
|
||||
@ -316,14 +323,14 @@ COMMANDS:
|
||||
DESCRIPTION: '查看所有属性'
|
||||
HEAD:
|
||||
- ''
|
||||
- '§b§l----- §3§lItemStack Attributes §b§l-----'
|
||||
- '&b&l----- &3&lItemStack Attributes &b&l-----'
|
||||
- ''
|
||||
BODY:
|
||||
- ==: JSON
|
||||
text: ' §7- §f{0} <&8(点击复制)@copy>'
|
||||
text: ' &7- &f{0} <&8(点击复制)@copy>'
|
||||
args:
|
||||
copy:
|
||||
hover: '§f点击复制'
|
||||
hover: '&f点击复制'
|
||||
suggest: '{0}'
|
||||
FOOT:
|
||||
- ''
|
||||
@ -331,14 +338,14 @@ COMMANDS:
|
||||
DESCRIPTION: '查看所有附魔'
|
||||
HEAD:
|
||||
- ''
|
||||
- '§b§l----- §3§lItemStack Enchantments §b§l-----'
|
||||
- '&b&l----- &3&lItemStack Enchantments &b&l-----'
|
||||
- ''
|
||||
BODY:
|
||||
- ==: JSON
|
||||
text: ' §7- §f{0}. {1} <&8(点击复制)@copy>'
|
||||
text: ' &7- &f{0}. {1} <&8(点击复制)@copy>'
|
||||
args:
|
||||
copy:
|
||||
hover: '§f点击复制'
|
||||
hover: '&f点击复制'
|
||||
suggest: '{1}'
|
||||
FOOT:
|
||||
- ''
|
||||
@ -346,14 +353,14 @@ COMMANDS:
|
||||
DESCRIPTION: '查看所有药水'
|
||||
HEAD:
|
||||
- ''
|
||||
- '§b§l----- §3§lItemStack PotionEffects §b§l-----'
|
||||
- '&b&l----- &3&lItemStack PotionEffects &b&l-----'
|
||||
- ''
|
||||
BODY:
|
||||
- ==: JSON
|
||||
text: ' §7- §f{0}. {1} <&8(点击复制)@copy>'
|
||||
text: ' &7- &f{0}. {1} <&8(点击复制)@copy>'
|
||||
args:
|
||||
copy:
|
||||
hover: '§f点击复制'
|
||||
hover: '&f点击复制'
|
||||
suggest: '{1}'
|
||||
FOOT:
|
||||
- ''
|
||||
@ -361,14 +368,14 @@ COMMANDS:
|
||||
DESCRIPTION: '查看所有标签'
|
||||
HEAD:
|
||||
- ''
|
||||
- '§b§l----- §3§lItemStack Flags §b§l-----'
|
||||
- '&b&l----- &3&lItemStack Flags &b&l-----'
|
||||
- ''
|
||||
BODY:
|
||||
- ==: JSON
|
||||
text: ' §7- §f{0} <&8(点击复制)@copy>'
|
||||
text: ' &7- &f{0} <&8(点击复制)@copy>'
|
||||
args:
|
||||
copy:
|
||||
hover: '§f点击复制'
|
||||
hover: '&f点击复制'
|
||||
suggest: '{0}'
|
||||
FOOT:
|
||||
- ''
|
||||
@ -376,14 +383,14 @@ COMMANDS:
|
||||
DESCRIPTION: '查看所有部位'
|
||||
HEAD:
|
||||
- ''
|
||||
- '§b§l----- §3§lItemStack Slots §b§l-----'
|
||||
- '&b&l----- &3&lItemStack Slots &b&l-----'
|
||||
- ''
|
||||
BODY:
|
||||
- ==: JSON
|
||||
text: ' §7- §f{0} <&8(点击复制)@copy>'
|
||||
text: ' &7- &f{0} <&8(点击复制)@copy>'
|
||||
args:
|
||||
copy:
|
||||
hover: '§f点击复制'
|
||||
hover: '&f点击复制'
|
||||
suggest: '{0}'
|
||||
FOOT:
|
||||
- ''
|
||||
@ -392,10 +399,10 @@ COMMANDS:
|
||||
SUCCESS-SEND: '&8[&3&lTabooLib&8] &7信息已发送, 耗时&f: {0}'
|
||||
HELP:
|
||||
- ''
|
||||
- '§b§l----- §3§lLanguage2 Commands §b§l-----'
|
||||
- '&b&l----- &3&lLanguage2 Commands &b&l-----'
|
||||
- ''
|
||||
- '§f /{0} send §8[§7玩家/ALL§8] §8[§7语言§8] §8<§7变量§8> §6- §e发送语言提示'
|
||||
- '§f /{0} reload §6- §e重载语言库'
|
||||
- '&f /{0} send &8[&7玩家/ALL&8] &8[&7语言&8] &8<&7变量&8> &6- &e发送语言提示'
|
||||
- '&f /{0} reload &6- &e重载语言库'
|
||||
- ''
|
||||
TLOCALE:
|
||||
INVALID-PLAYER: '&8[&3&lTabooLib&8] &4玩家 &c{0} &4不在线'
|
||||
@ -403,13 +410,13 @@ COMMANDS:
|
||||
SUCCESS-SEND: '&8[&3&lTabooLib&8] &7信息已发送, 耗时&f: {0}'
|
||||
HELP:
|
||||
- ''
|
||||
- '§b§l----- §3§lTabooLibLoacle Commands §b§l-----'
|
||||
- '&b&l----- &3&lTabooLibLoacle Commands &b&l-----'
|
||||
- ''
|
||||
- '§f /{0} send §8[§7玩家/ALL§8] §8[§7语言§8] §8<§7变量§8> §6- §e发送语言提示'
|
||||
- '§f /{0} reload §6- §e重载语言库'
|
||||
- '&f /{0} send &8[&7玩家/ALL&8] &8[&7语言&8] &8<&7变量&8> &6- &e发送语言提示'
|
||||
- '&f /{0} reload &6- &e重载语言库'
|
||||
- ''
|
||||
TPLUGIN:
|
||||
COMMAND-TITLE: '§e§l----- §6§lTabooLibPlugin Commands §b§l-----'
|
||||
COMMAND-TITLE: '&e&l----- &6&lTabooLibPlugin Commands &b&l-----'
|
||||
LIST:
|
||||
DESCRIPTION: '列出插件'
|
||||
LIST-PLUGIN:
|
||||
|
Loading…
Reference in New Issue
Block a user