Added witch disguise
Added missing files.
This commit is contained in:
parent
e8ddfc266e
commit
8883855297
Binary file not shown.
@ -0,0 +1,43 @@
|
||||
package mineplex.bungee.globalServer;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public abstract class Packet
|
||||
{
|
||||
public abstract void parseStream(DataInputStream inputStream) throws IOException;
|
||||
|
||||
public abstract void write(DataOutputStream dataOutput) throws IOException;
|
||||
|
||||
protected String readString(DataInputStream dataInputStream, int maxLength) throws IOException
|
||||
{
|
||||
short length = dataInputStream.readShort();
|
||||
|
||||
if (length > maxLength)
|
||||
{
|
||||
throw new IOException("Received string length longer than maximum allowed (" + length + " > " + maxLength + ")");
|
||||
}
|
||||
else if (length < 0)
|
||||
{
|
||||
throw new IOException("Received string length is less than zero! Weird string!");
|
||||
}
|
||||
else
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
stringBuilder.append(dataInputStream.readChar());
|
||||
}
|
||||
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
protected void writeString(String string, DataOutputStream dataOutputStream) throws IOException
|
||||
{
|
||||
dataOutputStream.writeShort(string.length());
|
||||
dataOutputStream.writeChars(string);
|
||||
}
|
||||
}
|
@ -1,14 +1,16 @@
|
||||
package mineplex.core.account.repository;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import mineplex.core.mysql.RepositoryBase;
|
||||
|
||||
public class MysqlAccountRepository extends RepositoryBase
|
||||
{
|
||||
private static String CREATE_ACCOUNT_TABLE = "CREATE TABLE IF NOT EXISTS Accounts (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(40), gems INT, rank VARCHAR(40), rankPerm BOOL, rankExpire LONG, lastLogin LONG, totalPlayTime LONG, PRIMARY KEY (id));";
|
||||
|
||||
public MysqlAccountRepository(String connectionUrl, String username, String password)
|
||||
public MysqlAccountRepository(JavaPlugin plugin)
|
||||
{
|
||||
super(connectionUrl, username, password);
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -0,0 +1,27 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
public class DisguiseWitch extends DisguiseMonster
|
||||
{
|
||||
public DisguiseWitch(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(entity);
|
||||
|
||||
DataWatcher.a(21, Byte.valueOf((byte)0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int GetEntityTypeId()
|
||||
{
|
||||
return 66;
|
||||
}
|
||||
|
||||
public void a(boolean flag)
|
||||
{
|
||||
DataWatcher.watch(21, Byte.valueOf((byte)(flag ? 1 : 0)));
|
||||
}
|
||||
|
||||
public boolean bT()
|
||||
{
|
||||
return DataWatcher.getByte(21) == 1;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user