Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Feb 7, 2024
1 parent 279576e commit 69cc78e
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 165 deletions.
4 changes: 1 addition & 3 deletions src/main/java/org/surf/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ public void registerEvents() {
pluginManager.registerEvents(new CleanIllegal(), this);

// AntiLag
if (ConfigCache.BlockPhysicsEnabled) {
pluginManager.registerEvents(new BlockPhysics(), this);
}
if (ConfigCache.BlockPhysicsEnabled) pluginManager.registerEvents(new BlockPhysics(), this);
pluginManager.registerEvents(new MinecartLag(this), this);
pluginManager.registerEvents(new WitherSpawn(), this);

Expand Down
115 changes: 0 additions & 115 deletions src/main/java/org/surf/modules/patches/ChestLagFix.java

This file was deleted.

109 changes: 62 additions & 47 deletions src/main/java/org/surf/util/ConfigCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,35 @@ public class ConfigCache {
private final static Main plugin = Main.getInstance();

public static String Prefix;

// Anti Illegal
public static boolean AntiillegalBlockPlaceEnabled;
public static boolean AntiillegalChunkLoadEnabled;
public static boolean AntiillegalHopperTransferEnabled;
public static boolean AntiillegalInventoryCloseEnabled;
public static boolean AntiillegalInventoryOpenEnabled;
public static boolean AntiillegalItemPickupEnabled;
public static boolean AntiillegalHotbarMoveEnabled;
public static boolean AntiillegalDeleteStackedTotem;
public static boolean AntiillegalPlayerSwapOffhandEnabled;
public static boolean AntiillegalPlayerInteractEnabled;
public static List<String> AntiillegalIllegalItemsList;

public static boolean IllegalBlockPlaceEnabled;
public static String IllegalBlockPlaceMessage;
public static int IllegalEnchantsThreshold;

public static boolean AntiIllegalCheckIllegalDamage;
public static String IllegalDamageMessage;
public static String IllegalPotionMessage;

// Anti Lag
public static boolean BlockPhysicsEnabled;
public static int BlockPhysicsDisableTPS;

public static int MinecartPerChunkLimit;

// Patches
public static boolean GateWayPreventCrashExploit;
public static boolean GateWayPreventEntityEnterPortal;

Expand All @@ -28,79 +54,68 @@ public class ConfigCache {
public static String NetherBottomMessage;
public static boolean NetherTopBottomDoDamage;

public static boolean AntiIllegalCheckIllegalDamage;
public static String IllegalDamageMessage;
public static String IllegalPotionMessage;

public static boolean BlockPhysicsEnabled;
public static int BlockPhysicsDisableTPS;

public static int MinecartPerChunkLimit;

public static boolean FirstJoinEnabled;
public static String FirstJoinMessage;

// Connection
public static boolean ConnectionEnabled;
public static String ConnectionPlayerJoinMessage;
public static String ConnectionPlayerLeaveMessage;
public static boolean ConnectionPreventKickEnabled;
public static List<String> ConnectionKickReasons;

public static boolean AntiillegalBlockPlaceEnabled;
public static boolean AntiillegalChunkLoadEnabled;
public static boolean AntiillegalHopperTransferEnabled;
public static boolean AntiillegalInventoryCloseEnabled;
public static boolean AntiillegalInventoryOpenEnabled;
public static boolean AntiillegalItemPickupEnabled;
public static boolean AntiillegalHotbarMoveEnabled;
public static boolean AntiillegalDeleteStackedTotem;
public static boolean AntiillegalPlayerSwapOffhandEnabled;
public static boolean AntiillegalPlayerInteractEnabled;
public static List<String> AntiillegalIllegalItemsList;

public static int IllegalEnchantsThreshold;
public static boolean FirstJoinEnabled;
public static String FirstJoinMessage;

public static void loadConfig() {
Prefix = plugin.getConfig().getString("Prefix");

// Anti Illegal
AntiillegalBlockPlaceEnabled = plugin.getConfig().getBoolean("Antiillegal.BlockPlace-Enabled");
AntiillegalChunkLoadEnabled = plugin.getConfig().getBoolean("Antiillegal.ChunkLoad-Enabled");
AntiillegalHopperTransferEnabled = plugin.getConfig().getBoolean("Antiillegal.HopperTransfer-Enabled");
AntiillegalInventoryCloseEnabled = plugin.getConfig().getBoolean("Antiillegal.InventoryClose-Enabled");
AntiillegalInventoryOpenEnabled = plugin.getConfig().getBoolean("Antiillegal.InventoryOpen-Enabled");
AntiillegalItemPickupEnabled = plugin.getConfig().getBoolean("Antiillegal.ItemPickup-Enabled");
AntiillegalHotbarMoveEnabled = plugin.getConfig().getBoolean("Antiillegal.HotbarMove-Enabled");
AntiillegalDeleteStackedTotem = plugin.getConfig().getBoolean("Antiillegal.Delete-Stacked-Totem");
AntiillegalPlayerSwapOffhandEnabled = plugin.getConfig().getBoolean("Antiillegal.PlayerSwapOffhand-Enabled");
AntiillegalPlayerInteractEnabled = plugin.getConfig().getBoolean("Antiillegal.PlayerInteract-Enabled");
AntiillegalIllegalItemsList = plugin.getConfig().getStringList("Antiillegal.Illegal-Items-List");
ItemUtils.loadIllegalMaterials();

IllegalBlockPlaceEnabled = plugin.getConfig().getBoolean("IllegalBlockPlace.Enabled");
IllegalBlockPlaceMessage = plugin.getConfig().getString("IllegalBlockPlace.Message");
IllegalEnchantsThreshold = plugin.getConfig().getInt("IllegalEnchants.Threshold");

AntiIllegalCheckIllegalDamage = plugin.getConfig().getBoolean("Antiillegal.Check-Illegal-Damage");
IllegalDamageMessage = plugin.getConfig().getString("IllegalDamage.Message");
IllegalPotionMessage = plugin.getConfig().getString("IllegalPotion.Message");

// Anti Lag
BlockPhysicsEnabled = plugin.getConfig().getBoolean("BlockPhysics.Enabled");
BlockPhysicsDisableTPS = plugin.getConfig().getInt("BlockPhysics.disable-tps");
MinecartPerChunkLimit = plugin.getConfig().getInt("Minecart-per-chunk.limit");

// Patches
GateWayPreventCrashExploit = plugin.getConfig().getBoolean("GateWay.PreventCrashExploit");
GateWayPreventEntityEnterPortal = plugin.getConfig().getBoolean("GateWay.PreventEntityEnterPortal");

ChunkBanEnabled = plugin.getConfig().getBoolean("ChunkBan.Enabled");
ChunkBanTileEntityMax = plugin.getConfig().getInt("ChunkBan.TileEntity-Max");
ChunkBanPreventMessage = plugin.getConfig().getString("ChunkBan.Prevent-Message");
ChunkBanSkullMax = plugin.getConfig().getInt("ChunkBan.Skull-Max");

NetherEnabled = plugin.getConfig().getBoolean("Nether.Enabled");
NetherTopLayer = plugin.getConfig().getInt("Nether.Top-Layer");
NetherBottomLayer = plugin.getConfig().getInt("Nether.Bottom-Layer");
NetherTopMessage = plugin.getConfig().getString("Nether.Top-message");
NetherBottomMessage = plugin.getConfig().getString("Nether.Bottom-message");
NetherTopBottomDoDamage = plugin.getConfig().getBoolean("Nether.top-bottom-do-damage");
AntiIllegalCheckIllegalDamage = plugin.getConfig().getBoolean("Antiillegal.Check-Illegal-Damage");
IllegalDamageMessage = plugin.getConfig().getString("IllegalDamage.Message");
IllegalPotionMessage = plugin.getConfig().getString("IllegalPotion.Message");
BlockPhysicsEnabled = plugin.getConfig().getBoolean("BlockPhysics.Enabled");
BlockPhysicsDisableTPS = plugin.getConfig().getInt("BlockPhysics.disable-tps");
MinecartPerChunkLimit = plugin.getConfig().getInt("Minecart-per-chunk.limit");
FirstJoinEnabled = plugin.getConfig().getBoolean("FirstJoin.Enabled");
FirstJoinMessage = plugin.getConfig().getString("FirstJoin.Message");

// Connection
ConnectionEnabled = plugin.getConfig().getBoolean("Connection.Enabled");
ConnectionPlayerJoinMessage = plugin.getConfig().getString("Connection.Player-Join-Message");
ConnectionPlayerLeaveMessage = plugin.getConfig().getString("Connection.Player-Leave-Message");
ConnectionPreventKickEnabled = plugin.getConfig().getBoolean("Connection-Prevent-Kick.Enabled");
ConnectionKickReasons = plugin.getConfig().getStringList("Connection-Prevent-Kick.Kick-Reasons");
AntiillegalBlockPlaceEnabled = plugin.getConfig().getBoolean("Antiillegal.BlockPlace-Enabled");
AntiillegalChunkLoadEnabled = plugin.getConfig().getBoolean("Antiillegal.ChunkLoad-Enabled");
AntiillegalHopperTransferEnabled = plugin.getConfig().getBoolean("Antiillegal.HopperTransfer-Enabled");
AntiillegalInventoryCloseEnabled = plugin.getConfig().getBoolean("Antiillegal.InventoryClose-Enabled");
AntiillegalInventoryOpenEnabled = plugin.getConfig().getBoolean("Antiillegal.InventoryOpen-Enabled");
AntiillegalItemPickupEnabled = plugin.getConfig().getBoolean("Antiillegal.ItemPickup-Enabled");
AntiillegalHotbarMoveEnabled = plugin.getConfig().getBoolean("Antiillegal.HotbarMove-Enabled");
AntiillegalDeleteStackedTotem = plugin.getConfig().getBoolean("Antiillegal.Delete-Stacked-Totem");
AntiillegalPlayerSwapOffhandEnabled = plugin.getConfig().getBoolean("Antiillegal.PlayerSwapOffhand-Enabled");
AntiillegalPlayerInteractEnabled = plugin.getConfig().getBoolean("Antiillegal.PlayerInteract-Enabled");
AntiillegalIllegalItemsList = plugin.getConfig().getStringList("Antiillegal.Illegal-Items-List");
ItemUtils.loadIllegalMaterials();
IllegalEnchantsThreshold = plugin.getConfig().getInt("IllegalEnchants.Threshold");
FirstJoinEnabled = plugin.getConfig().getBoolean("FirstJoin.Enabled");
FirstJoinMessage = plugin.getConfig().getString("FirstJoin.Message");
}
}

0 comments on commit 69cc78e

Please sign in to comment.