Merge branch 'clans/beta' of https://github.com/Mineplex-LLC/Minecraft-PC into feature/incognito
This commit is contained in:
commit
a27fb90c2a
@ -1,13 +1,11 @@
|
|||||||
package mineplex.core.incognito.repository;
|
package mineplex.core.incognito.repository;
|
||||||
|
|
||||||
import mineplex.cache.player.PlayerCache;
|
|
||||||
import mineplex.core.account.CoreClientManager;
|
import mineplex.core.account.CoreClientManager;
|
||||||
import mineplex.core.common.util.EnclosedObject;
|
import mineplex.core.common.util.EnclosedObject;
|
||||||
import mineplex.core.common.util.UUIDFetcher;
|
import mineplex.core.common.util.UUIDFetcher;
|
||||||
import mineplex.core.database.MinecraftRepository;
|
import mineplex.core.database.MinecraftRepository;
|
||||||
import mineplex.core.incognito.IncognitoManager;
|
import mineplex.core.incognito.IncognitoManager;
|
||||||
import mineplex.serverdata.database.DBPool;
|
import mineplex.serverdata.database.DBPool;
|
||||||
import mineplex.serverdata.database.column.ColumnBoolean;
|
|
||||||
import mineplex.serverdata.database.column.ColumnInt;
|
import mineplex.serverdata.database.column.ColumnInt;
|
||||||
|
|
||||||
public class IncognitoRepository extends MinecraftRepository
|
public class IncognitoRepository extends MinecraftRepository
|
||||||
@ -32,7 +30,7 @@ public class IncognitoRepository extends MinecraftRepository
|
|||||||
public void SetStatus(int accountId, boolean status)
|
public void SetStatus(int accountId, boolean status)
|
||||||
{
|
{
|
||||||
System.out.println("[INCOGNITO] Updated status for " + accountId + " to " + status);
|
System.out.println("[INCOGNITO] Updated status for " + accountId + " to " + status);
|
||||||
executeUpdate(SET_STATUS, new ColumnInt("accountId", accountId), new ColumnBoolean("status", status));
|
executeUpdate(SET_STATUS, new ColumnInt("accountId", accountId), new ColumnInt("status", status ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean GetStatus(int accountId)
|
public boolean GetStatus(int accountId)
|
||||||
@ -41,7 +39,7 @@ public class IncognitoRepository extends MinecraftRepository
|
|||||||
|
|
||||||
executeQuery(GET_STATUS, result -> {
|
executeQuery(GET_STATUS, result -> {
|
||||||
if (result.next())
|
if (result.next())
|
||||||
status.Set(Boolean.valueOf(result.getBoolean("accountId")));
|
status.Set(result.getInt("status") == 1 ? Boolean.TRUE : Boolean.FALSE);
|
||||||
else
|
else
|
||||||
status.Set(Boolean.FALSE);
|
status.Set(Boolean.FALSE);
|
||||||
}, new ColumnInt("accountId", accountId));
|
}, new ColumnInt("accountId", accountId));
|
||||||
@ -57,16 +55,7 @@ public class IncognitoRepository extends MinecraftRepository
|
|||||||
accountId.Set(id)
|
accountId.Set(id)
|
||||||
);
|
);
|
||||||
|
|
||||||
EnclosedObject<Boolean> status = new EnclosedObject<>();
|
return GetStatus(accountId.Get().intValue());
|
||||||
|
|
||||||
executeQuery(GET_STATUS, result -> {
|
|
||||||
if (result.next())
|
|
||||||
status.Set(Boolean.valueOf(result.getBoolean("accountId")));
|
|
||||||
else
|
|
||||||
status.Set(Boolean.FALSE);
|
|
||||||
}, new ColumnInt("accountId", accountId.Get().intValue()));
|
|
||||||
|
|
||||||
return status.Get().booleanValue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initialize()
|
protected void initialize()
|
||||||
|
@ -127,7 +127,7 @@ public class Clans extends JavaPlugin
|
|||||||
new FriendManager(this, _clientManager, preferenceManager, portal);
|
new FriendManager(this, _clientManager, preferenceManager, portal);
|
||||||
new InventoryManager(this, _clientManager);
|
new InventoryManager(this, _clientManager);
|
||||||
ResourcePackManager resourcePackManager = new ResourcePackManager(this, portal);
|
ResourcePackManager resourcePackManager = new ResourcePackManager(this, portal);
|
||||||
resourcePackManager.setResourcePack("http://b.garblox.com/CLANS_BETA_PACK_V5.zip", true);
|
resourcePackManager.setResourcePack("http://b.garblox.com/CLANS_BETA_PACK_V6.zip", true);
|
||||||
|
|
||||||
// Enable custom-gear related managers
|
// Enable custom-gear related managers
|
||||||
new CustomTagFix(this, packetHandler);
|
new CustomTagFix(this, packetHandler);
|
||||||
|
@ -65,12 +65,6 @@ public class SiegeManager extends MiniPlugin
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void join(PlayerJoinEvent event)
|
|
||||||
{
|
|
||||||
event.getPlayer().getWorld().getEntitiesByClass(Slime.class).forEach(Entity::remove);
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void save(UpdateEvent event)
|
public void save(UpdateEvent event)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user