1
0
mirror of https://github.com/nkomarn/harbor.git synced 2024-12-25 01:37:35 +01:00

Initial commit

This commit is contained in:
Mykyta Komarn 2018-09-25 16:10:43 -07:00
parent b9074ad4d8
commit 2e35634acd
13 changed files with 229 additions and 34 deletions

View File

@ -1,6 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="T:/Test Server/1.8/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.8.3/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.8.8/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.9/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.9.2/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.10/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.10.2/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.11/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.11.1/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.11.2/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.12/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.12.1/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.12.2/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.13/Spigot.jar"/>
<classpathentry kind="lib" path="T:/Test Server/1.13.1/Spigot.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Harbor</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Harbor</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,11 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -0,0 +1,8 @@
package techtoolbox.Harbor.Actionbar;
import org.bukkit.entity.Player;
public interface Actionbar {
public void sendActionbar(Player player, String message);
}

View File

@ -0,0 +1,19 @@
package techtoolbox.Harbor.Actionbar;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_10_R1.IChatBaseComponent;
import net.minecraft.server.v1_10_R1.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_10_R1.PacketPlayOutChat;
public class Actionbar_1_10_R1 implements Actionbar {
@Override
public void sendActionbar(Player player, String message) {
IChatBaseComponent titleComponent = ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', message) + "\"}");
PacketPlayOutChat titlePacket = new PacketPlayOutChat(titleComponent, (byte)2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(titlePacket);
}
}

View File

@ -0,0 +1,19 @@
package techtoolbox.Harbor.Actionbar;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_11_R1.IChatBaseComponent;
import net.minecraft.server.v1_11_R1.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_11_R1.PacketPlayOutChat;
public class Actionbar_1_11_R1 implements Actionbar {
@Override
public void sendActionbar(Player player, String message) {
IChatBaseComponent titleComponent = ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', message) + "\"}");
PacketPlayOutChat titlePacket = new PacketPlayOutChat(titleComponent, (byte)2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(titlePacket);
}
}

View File

@ -0,0 +1,20 @@
package techtoolbox.Harbor.Actionbar;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_12_R1.ChatMessageType;
import net.minecraft.server.v1_12_R1.IChatBaseComponent;
import net.minecraft.server.v1_12_R1.PacketPlayOutChat;
public class Actionbar_1_12_R1 implements Actionbar {
@Override
public void sendActionbar(Player player, String message) {
IChatBaseComponent titleComponent = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', message) + "\"}");
PacketPlayOutChat titlePacket = new PacketPlayOutChat(titleComponent, ChatMessageType.GAME_INFO);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(titlePacket);
}
}

View File

@ -0,0 +1,18 @@
package techtoolbox.Harbor.Actionbar;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_13_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_13_R1.IChatBaseComponent;
import net.minecraft.server.v1_13_R1.PacketPlayOutTitle;
public class Actionbar_1_13_R1 implements Actionbar {
@Override
public void sendActionbar(Player player, String message) {
IChatBaseComponent titleComponent = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', message) + "\"}");
PacketPlayOutTitle titlePacket = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.ACTIONBAR, titleComponent);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(titlePacket);
}
}

View File

@ -0,0 +1,18 @@
package techtoolbox.Harbor.Actionbar;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_13_R2.IChatBaseComponent;
import net.minecraft.server.v1_13_R2.PacketPlayOutTitle;
public class Actionbar_1_13_R2 implements Actionbar {
@Override
public void sendActionbar(Player player, String message) {
IChatBaseComponent titleComponent = IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', message) + "\"}");
PacketPlayOutTitle titlePacket = new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.ACTIONBAR, titleComponent);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(titlePacket);
}
}

View File

@ -0,0 +1,19 @@
package techtoolbox.Harbor.Actionbar;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_8_R1.ChatSerializer;
import net.minecraft.server.v1_8_R1.IChatBaseComponent;
import net.minecraft.server.v1_8_R1.PacketPlayOutChat;
public class Actionbar_1_8_R1 implements Actionbar {
@Override
public void sendActionbar(Player player, String message) {
IChatBaseComponent titleComponent = ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', message) + "\"}");
PacketPlayOutChat titlePacket = new PacketPlayOutChat(titleComponent, (byte)2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(titlePacket);
}
}

View File

@ -0,0 +1,19 @@
package techtoolbox.Harbor.Actionbar;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_8_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_8_R2.IChatBaseComponent;
import net.minecraft.server.v1_8_R2.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_8_R2.PacketPlayOutChat;
public class Actionbar_1_8_R2 implements Actionbar {
@Override
public void sendActionbar(Player player, String message) {
IChatBaseComponent titleComponent = ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', message) + "\"}");
PacketPlayOutChat titlePacket = new PacketPlayOutChat(titleComponent, (byte)2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(titlePacket);
}
}

View File

@ -0,0 +1,20 @@
package techtoolbox.Harbor.Actionbar;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_8_R3.IChatBaseComponent;
import net.minecraft.server.v1_8_R3.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_8_R3.PacketPlayOutChat;
public class Actionbar_1_8_R3 implements Actionbar {
@Override
public void sendActionbar(Player player, String message) {
IChatBaseComponent titleComponent = ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', message) + "\"}");
PacketPlayOutChat titlePacket = new PacketPlayOutChat(titleComponent, (byte)2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(titlePacket);
}
}

View File

@ -0,0 +1,20 @@
package techtoolbox.Harbor.Actionbar;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_9_R1.IChatBaseComponent;
import net.minecraft.server.v1_9_R1.IChatBaseComponent.ChatSerializer;
import net.minecraft.server.v1_9_R1.PacketPlayOutChat;
public class Actionbar_1_9_R1 implements Actionbar {
@Override
public void sendActionbar(Player player, String message) {
IChatBaseComponent titleComponent = ChatSerializer.a("{\"text\": \"" + ChatColor.translateAlternateColorCodes('&', message) + "\"}");
PacketPlayOutChat titlePacket = new PacketPlayOutChat(titleComponent, (byte)2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(titlePacket);
}
}