diff options
Diffstat (limited to 'src/main/java/me/fatpigsarefat/quests/title')
12 files changed, 228 insertions, 0 deletions
diff --git a/src/main/java/me/fatpigsarefat/quests/title/Title.java b/src/main/java/me/fatpigsarefat/quests/title/Title.java new file mode 100644 index 00000000..4851440b --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/title/Title.java @@ -0,0 +1,8 @@ +package me.fatpigsarefat.quests.title; + +import org.bukkit.entity.Player; + +public interface Title { + + public void sendTitle(Player player, String message, String submessage); +}
\ No newline at end of file diff --git a/src/main/java/me/fatpigsarefat/quests/title/Title_Bukkit.java b/src/main/java/me/fatpigsarefat/quests/title/Title_Bukkit.java new file mode 100644 index 00000000..0a39b2eb --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/title/Title_Bukkit.java @@ -0,0 +1,11 @@ +package me.fatpigsarefat.quests.title; + +import org.bukkit.entity.Player; + +public class Title_Bukkit implements Title { + + @Override + public void sendTitle(Player player, String message, String submessage) { + player.sendTitle(message, submessage, 10, 100, 10); + } +} diff --git a/src/main/java/me/fatpigsarefat/quests/title/Title_BukkitNoTimings.java b/src/main/java/me/fatpigsarefat/quests/title/Title_BukkitNoTimings.java new file mode 100644 index 00000000..97fe6e02 --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/title/Title_BukkitNoTimings.java @@ -0,0 +1,13 @@ +package me.fatpigsarefat.quests.title; + +import org.bukkit.entity.Player; + +public class Title_BukkitNoTimings implements Title { + + // this one is for 1.8, 1.9 and 1.10 where there was no timings method + @Override + public void sendTitle(Player player, String message, String submessage) { + player.sendTitle(message, submessage); + } + +} diff --git a/src/main/java/me/fatpigsarefat/quests/title/Title_Other.java b/src/main/java/me/fatpigsarefat/quests/title/Title_Other.java new file mode 100644 index 00000000..eef4bc07 --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/title/Title_Other.java @@ -0,0 +1,19 @@ +package me.fatpigsarefat.quests.title; + +import org.bukkit.entity.Player; + +public class Title_Other implements Title { + + @Override + public void sendTitle(Player player, String message, String submessage) { + /* + I'm too lazy to do a null check each time I want to send a title, so here. + Anyway, hello there programmer! I see you're rummaging through my source code. + Try not to leave a mess please. If you see anything dodgy or looks like it + could do with a little improvement make a pull request. + Also join my discord: https://discord.gg/8amrJnX + Have a great day! + - fatpigsarefat + */ + } +} diff --git a/src/main/java/me/fatpigsarefat/quests/title/Title_v1_10_R1.java b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_10_R1.java new file mode 100644 index 00000000..0343ccbd --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_10_R1.java @@ -0,0 +1,22 @@ +//package me.fatpigsarefat.quests.title; +// +//import net.minecraft.server.v1_10_R1.IChatBaseComponent.ChatSerializer; +//import net.minecraft.server.v1_10_R1.PacketPlayOutTitle; +//import net.minecraft.server.v1_10_R1.PacketPlayOutTitle.EnumTitleAction; +//import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer; +//import org.bukkit.entity.Player; +// +//public class Title_v1_10_R1 implements Title { +// +// @Override +// public void sendTitle(Player player, String message, String submessage) { +// message = "{\"text\":\"" + message + "\"}"; +// PacketPlayOutTitle title = new PacketPlayOutTitle(EnumTitleAction.TITLE, ChatSerializer.a(message), 10, 100, +// 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(title); +// submessage = "{\"text\":\"" + submessage + "\"}"; +// PacketPlayOutTitle subtitle = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, ChatSerializer.a(submessage), 10, +// 100, 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(subtitle); +// } +//} diff --git a/src/main/java/me/fatpigsarefat/quests/title/Title_v1_11_R1.java b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_11_R1.java new file mode 100644 index 00000000..edb7e9e7 --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_11_R1.java @@ -0,0 +1,22 @@ +//package me.fatpigsarefat.quests.title; +// +//import net.minecraft.server.v1_11_R1.IChatBaseComponent.ChatSerializer; +//import net.minecraft.server.v1_11_R1.PacketPlayOutTitle; +//import net.minecraft.server.v1_11_R1.PacketPlayOutTitle.EnumTitleAction; +//import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer; +//import org.bukkit.entity.Player; +// +//public class Title_v1_11_R1 implements Title { +// +// @Override +// public void sendTitle(Player player, String message, String submessage) { +// message = "{\"text\":\"" + message + "\"}"; +// PacketPlayOutTitle title = new PacketPlayOutTitle(EnumTitleAction.TITLE, ChatSerializer.a(message), 10, 100, +// 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(title); +// submessage = "{\"text\":\"" + submessage + "\"}"; +// PacketPlayOutTitle subtitle = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, ChatSerializer.a(submessage), 10, +// 100, 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(subtitle); +// } +//} diff --git a/src/main/java/me/fatpigsarefat/quests/title/Title_v1_12_R1.java b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_12_R1.java new file mode 100644 index 00000000..daebefa3 --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_12_R1.java @@ -0,0 +1,22 @@ +//package me.fatpigsarefat.quests.title; +// +//import net.minecraft.server.v1_12_R1.IChatBaseComponent.ChatSerializer; +//import net.minecraft.server.v1_12_R1.PacketPlayOutTitle; +//import net.minecraft.server.v1_12_R1.PacketPlayOutTitle.EnumTitleAction; +//import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer; +//import org.bukkit.entity.Player; +// +//public class Title_v1_12_R1 implements Title { +// +// @Override +// public void sendTitle(Player player, String message, String submessage) { +// message = "{\"text\":\"" + message + "\"}"; +// PacketPlayOutTitle title = new PacketPlayOutTitle(EnumTitleAction.TITLE, ChatSerializer.a(message), 10, 100, +// 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(title); +// submessage = "{\"text\":\"" + submessage + "\"}"; +// PacketPlayOutTitle subtitle = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, ChatSerializer.a(submessage), 10, +// 100, 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(subtitle); +// } +//} diff --git a/src/main/java/me/fatpigsarefat/quests/title/Title_v1_8_R1.java b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_8_R1.java new file mode 100644 index 00000000..4de97c98 --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_8_R1.java @@ -0,0 +1,23 @@ +//package me.fatpigsarefat.quests.title; +// +//import net.minecraft.server.v1_8_R1.ChatSerializer; +//import net.minecraft.server.v1_8_R1.EnumTitleAction; +//import net.minecraft.server.v1_8_R1.PacketPlayOutTitle; +//import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer; +//import org.bukkit.entity.Player; +// +//public class Title_v1_8_R1 implements Title { +// +// @Override +// public void sendTitle(Player player, String message, String submessage) { +// message = "{\"text\":\"" + message + "\"}"; +// PacketPlayOutTitle title = new PacketPlayOutTitle(EnumTitleAction.TITLE, ChatSerializer.a(message), 10, 100, +// 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(title); +// submessage = "{\"text\":\"" + submessage + "\"}"; +// PacketPlayOutTitle subtitle = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, ChatSerializer.a(submessage), 10, +// 100, 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(subtitle); +// } +// +//}
\ No newline at end of file diff --git a/src/main/java/me/fatpigsarefat/quests/title/Title_v1_8_R2.java b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_8_R2.java new file mode 100644 index 00000000..acda3c70 --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_8_R2.java @@ -0,0 +1,22 @@ +//package me.fatpigsarefat.quests.title; +// +//import net.minecraft.server.v1_8_R2.IChatBaseComponent.ChatSerializer; +//import net.minecraft.server.v1_8_R2.PacketPlayOutTitle; +//import net.minecraft.server.v1_8_R2.PacketPlayOutTitle.EnumTitleAction; +//import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer; +//import org.bukkit.entity.Player; +// +//public class Title_v1_8_R2 implements Title { +// +// @Override +// public void sendTitle(Player player, String message, String submessage) { +// message = "{\"text\":\"" + message + "\"}"; +// PacketPlayOutTitle title = new PacketPlayOutTitle(EnumTitleAction.TITLE, ChatSerializer.a(message), 10, 100, +// 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(title); +// submessage = "{\"text\":\"" + submessage + "\"}"; +// PacketPlayOutTitle subtitle = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, ChatSerializer.a(submessage), 10, +// 100, 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(subtitle); +// } +//}
\ No newline at end of file diff --git a/src/main/java/me/fatpigsarefat/quests/title/Title_v1_8_R3.java b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_8_R3.java new file mode 100644 index 00000000..0bc56b5f --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_8_R3.java @@ -0,0 +1,22 @@ +//package me.fatpigsarefat.quests.title; +// +//import net.minecraft.server.v1_8_R3.IChatBaseComponent.ChatSerializer; +//import net.minecraft.server.v1_8_R3.PacketPlayOutTitle; +//import net.minecraft.server.v1_8_R3.PacketPlayOutTitle.EnumTitleAction; +//import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; +//import org.bukkit.entity.Player; +// +//public class Title_v1_8_R3 implements Title { +// +// @Override +// public void sendTitle(Player player, String message, String submessage) { +// message = "{\"text\":\"" + message + "\"}"; +// PacketPlayOutTitle title = new PacketPlayOutTitle(EnumTitleAction.TITLE, ChatSerializer.a(message), 10, 100, +// 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(title); +// submessage = "{\"text\":\"" + submessage + "\"}"; +// PacketPlayOutTitle subtitle = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, ChatSerializer.a(submessage), 10, +// 100, 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(subtitle); +// } +//} diff --git a/src/main/java/me/fatpigsarefat/quests/title/Title_v1_9_R1.java b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_9_R1.java new file mode 100644 index 00000000..80e25392 --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_9_R1.java @@ -0,0 +1,22 @@ +//package me.fatpigsarefat.quests.title; +// +//import net.minecraft.server.v1_9_R1.IChatBaseComponent.ChatSerializer; +//import net.minecraft.server.v1_9_R1.PacketPlayOutTitle; +//import net.minecraft.server.v1_9_R1.PacketPlayOutTitle.EnumTitleAction; +//import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer; +//import org.bukkit.entity.Player; +// +//public class Title_v1_9_R1 implements Title { +// +// @Override +// public void sendTitle(Player player, String message, String submessage) { +// message = "{\"text\":\"" + message + "\"}"; +// PacketPlayOutTitle title = new PacketPlayOutTitle(EnumTitleAction.TITLE, ChatSerializer.a(message), 10, 100, +// 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(title); +// submessage = "{\"text\":\"" + submessage + "\"}"; +// PacketPlayOutTitle subtitle = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, ChatSerializer.a(submessage), 10, +// 100, 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(subtitle); +// } +//} diff --git a/src/main/java/me/fatpigsarefat/quests/title/Title_v1_9_R2.java b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_9_R2.java new file mode 100644 index 00000000..29b52bbd --- /dev/null +++ b/src/main/java/me/fatpigsarefat/quests/title/Title_v1_9_R2.java @@ -0,0 +1,22 @@ +//package me.fatpigsarefat.quests.title; +// +//import net.minecraft.server.v1_9_R2.IChatBaseComponent.ChatSerializer; +//import net.minecraft.server.v1_9_R2.PacketPlayOutTitle; +//import net.minecraft.server.v1_9_R2.PacketPlayOutTitle.EnumTitleAction; +//import org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer; +//import org.bukkit.entity.Player; +// +//public class Title_v1_9_R2 implements Title { +// +// @Override +// public void sendTitle(Player player, String message, String submessage) { +// message = "{\"text\":\"" + message + "\"}"; +// PacketPlayOutTitle title = new PacketPlayOutTitle(EnumTitleAction.TITLE, ChatSerializer.a(message), 10, 100, +// 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(title); +// submessage = "{\"text\":\"" + submessage + "\"}"; +// PacketPlayOutTitle subtitle = new PacketPlayOutTitle(EnumTitleAction.SUBTITLE, ChatSerializer.a(submessage), 10, +// 100, 10); +// ((CraftPlayer) player).getHandle().playerConnection.sendPacket(subtitle); +// } +//} |
