This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( handshake.getProtocolVersion() > Vanilla.PROTOCOL_VERSION ) | |
{ | |
disconnect( bungee.getTranslation( "outdated_server" ) ); | |
} else if ( handshake.getProtocolVersion() < Vanilla.PROTOCOL_VERSION ) | |
{ | |
disconnect( bungee.getTranslation( "outdated_client" ) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void set(String playerName, int number) { | |
try { | |
PreparedStatement checkStatement = connection.prepareStatement("SELECT ? FROM ? WHERE ? = ?;"); | |
checkStatement.setString(1, INT_COLUMN); | |
checkStatement.setString(2, MYSQL_TABLE); | |
checkStatement.setString(3, USER_COLUMN); | |
checkStatement.setString(4, playerName); | |
if (checkStatement.executeQuery().next()) { | |
PreparedStatement updateStatement = connection.prepareStatement("UPDATE ? SET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.*; | |
public class StorageLib { | |
/** | |
* Der MySQL-Host, z.B. 'localhost' oder 'vweb02.nitrado.net' | |
*/ | |
private static final String MYSQL_HOST = "localhost"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.batschkoto.mcping; | |
import com.google.common.base.Charsets; | |
import io.netty.buffer.ByteBuf; | |
import io.netty.buffer.Unpooled; | |
import io.netty.channel.Channel; | |
import io.netty.channel.ChannelHandlerContext; | |
import io.netty.channel.SimpleChannelInboundHandler; | |
public class Handler extends SimpleChannelInboundHandler<ByteBuf> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void registerListeners() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException { | |
PluginManager pluginManager = this.getServer().getPluginManager(); | |
for(ClassPath.ClassInfo classInfo: ClassPath.from(this.getClassLoader()).getTopLevelClasses("de.muwbi.clashofnations.listeners")) { | |
pluginManager.registerEvents((Listener) Class.forName(classInfo.getName()).newInstance(), this); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package <your-package>; | |
import lombok.RequiredArgsConstructor; | |
import lombok.Setter; | |
import lombok.experimental.Accessors; | |
import org.bukkit.Material; | |
import org.bukkit.enchantments.Enchantment; | |
import org.bukkit.entity.Player; | |
import org.bukkit.inventory.ItemStack; |