use of net.minecraft.server.v1_14_R1.ChatMessage in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_16_R3 method openWorkbench.
@Override
public void openWorkbench(Player player, Location loc, InventoryType type) {
TileInventory tileEntity = new TileInventory(new CustomTileEntityContainerWorkbench(this, loc), new ChatMessage("container.crafting", new Object[0]));
((CraftPlayer) player).getHandle().openContainer(tileEntity);
}
use of net.minecraft.server.v1_14_R1.ChatMessage in project PowerBoard by Xitee1.
the class version_1_11 method sendTab.
@SuppressWarnings("deprecation")
public static void sendTab(Player player, String head, String foot) {
IChatBaseComponent header = new ChatMessage(head);
IChatBaseComponent footer = new ChatMessage(foot);
PacketPlayOutPlayerListHeaderFooter tablist = new PacketPlayOutPlayerListHeaderFooter();
try {
Field headerField = tablist.getClass().getDeclaredField("a");
headerField.setAccessible(true);
headerField.set(tablist, header);
headerField.setAccessible(!headerField.isAccessible());
Field footerField = tablist.getClass().getDeclaredField("b");
footerField.setAccessible(true);
footerField.set(tablist, footer);
footerField.setAccessible(!footerField.isAccessible());
} catch (Exception e) {
e.printStackTrace();
}
CraftPlayer cp = (CraftPlayer) player;
cp.getHandle().playerConnection.sendPacket(tablist);
}
use of net.minecraft.server.v1_14_R1.ChatMessage in project PowerBoard by Xitee1.
the class version_1_10 method sendTab.
@SuppressWarnings("deprecation")
public static void sendTab(Player player, String head, String foot) {
IChatBaseComponent header = new ChatMessage(head);
IChatBaseComponent footer = new ChatMessage(foot);
PacketPlayOutPlayerListHeaderFooter tablist = new PacketPlayOutPlayerListHeaderFooter();
try {
Field headerField = tablist.getClass().getDeclaredField("a");
headerField.setAccessible(true);
headerField.set(tablist, header);
headerField.setAccessible(!headerField.isAccessible());
Field footerField = tablist.getClass().getDeclaredField("b");
footerField.setAccessible(true);
footerField.set(tablist, footer);
footerField.setAccessible(!footerField.isAccessible());
} catch (Exception e) {
e.printStackTrace();
}
CraftPlayer cp = (CraftPlayer) player;
cp.getHandle().playerConnection.sendPacket(tablist);
}
use of net.minecraft.server.v1_14_R1.ChatMessage in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_14_R1 method openWorkbench.
@Override
public void openWorkbench(Player player, Location loc, InventoryType type) {
TileInventory tileEntity = new TileInventory(new CustomTileEntityContainerWorkbench(this, loc), new ChatMessage("container.crafting", new Object[0]));
((CraftPlayer) player).getHandle().openContainer(tileEntity);
}
use of net.minecraft.server.v1_14_R1.ChatMessage in project PublicCrafters by BananaPuncher714.
the class ContainerManager_v1_15_R1 method openWorkbench.
@Override
public void openWorkbench(Player player, Location loc, InventoryType type) {
TileInventory tileEntity = new TileInventory(new CustomTileEntityContainerWorkbench(this, loc), new ChatMessage("container.crafting", new Object[0]));
((CraftPlayer) player).getHandle().openContainer(tileEntity);
}
Aggregations