Change config entries

This commit is contained in:
Telesphoreo 2022-04-09 00:08:03 -05:00
parent e421867f63
commit e35d70bc3c
6 changed files with 30 additions and 18 deletions

View File

@ -28,7 +28,7 @@ public class BlockListener extends PlexListener
@EventHandler(priority = EventPriority.LOW)
public void onBlockPlace(BlockPlaceEvent event)
{
List<String> blockedBlocksConfig = plugin.config.getStringList("blockedBlocks");
List<String> blockedBlocksConfig = plugin.config.getStringList("blocked_blocks");
if (blockedBlocksConfig != cachedBlockedBlocksConfig)
{
blockedBlocks.clear();

View File

@ -9,6 +9,9 @@ public class DropListener extends PlexListener
@EventHandler
public void onPlayerDropItem(PlayerDropItemEvent event)
{
if (!plugin.config.getBoolean("allowdrops")) event.setCancelled(true);
if (!plugin.config.getBoolean("allowdrops"))
{
event.setCancelled(true);
}
}
}

View File

@ -39,7 +39,7 @@ public class SpawnListener extends PlexListener
return;
}
if (plugin.config.getStringList("blockedEntities").stream().anyMatch(type -> type.equalsIgnoreCase(event.getEntityType().name())))
if (plugin.config.getStringList("blocked_entities").stream().anyMatch(type -> type.equalsIgnoreCase(event.getEntityType().name())))
{
event.setCancelled(true);
Location location = event.getLocation();
@ -109,7 +109,8 @@ public class SpawnListener extends PlexListener
}
}
private static EntityType spawnEggToEntityType(Material mat){
private static EntityType spawnEggToEntityType(Material mat)
{
EntityType eggType;
try
{

View File

@ -32,10 +32,14 @@ public class MongoConnection extends PlexBase
if (database != null && !database.isEmpty())
{
connectionString = "mongodb://" + username + ":" + password + "@" + host + ":" + port + "/?authSource=" + database;
} else {
}
else
{
connectionString = "mongodb://" + username + ":" + password + "@" + host + ":" + port + "/";
}
} else {
}
else
{
connectionString = "mongodb://" + host + ":" + port + "/";
}
connectionString += "?uuidRepresentation=STANDARD";

View File

@ -45,7 +45,8 @@ public class SQLConnection extends PlexBase
{
dataSource.setJdbcUrl("jdbc:sqlite:" + new File(plugin.getDataFolder(), "database.db").getAbsolutePath());
plugin.setStorageType(StorageType.SQLITE);
} else if (plugin.config.getString("data.central.storage").equalsIgnoreCase("mariadb"))
}
else if (plugin.config.getString("data.central.storage").equalsIgnoreCase("mariadb"))
{
Class.forName("org.mariadb.jdbc.Driver");
dataSource.setJdbcUrl("jdbc:mariadb://" + host + ":" + port + "/" + database);
@ -53,7 +54,8 @@ public class SQLConnection extends PlexBase
dataSource.setPassword(password);
Plex.get().setStorageType(StorageType.MARIADB);
}
} catch (ClassNotFoundException throwables)
}
catch (ClassNotFoundException throwables)
{
throwables.printStackTrace();
}
@ -90,7 +92,8 @@ public class SQLConnection extends PlexBase
"`note` VARCHAR(2000), " +
"`timestamp` BIGINT" +
");").execute();
} catch (SQLException throwables)
}
catch (SQLException throwables)
{
throwables.printStackTrace();
}
@ -105,7 +108,8 @@ public class SQLConnection extends PlexBase
try
{
return dataSource.getConnection();
} catch (SQLException e)
}
catch (SQLException e)
{
e.printStackTrace();
}

View File

@ -139,13 +139,13 @@ autowipe:
allowdrops: true
# What blocks should be blocked?
blockedBlocks:
blocked_blocks:
- "SPAWNER"
- "STRUCTURE_BLOCK"
- "JIGSAW"
# What entities should be blocked?
blockedEntities:
blocked_entities:
- "WITHER"
- "ENDER_DRAGON"
- "MINECART_TNT"