Minor cleanups

This commit is contained in:
mathias 2019-07-24 04:50:19 +03:00
parent 93b968be5d
commit f984ac411a

View file

@ -1,6 +1,6 @@
package pw.kaboom.extras; package pw.kaboom.extras;
import java.util.Arrays; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.UUID; import java.util.UUID;
@ -12,10 +12,19 @@ import com.destroystokyo.paper.profile.PlayerProfile;
public class Main extends JavaPlugin { public class Main extends JavaPlugin {
int fallingBlockCount; int fallingBlockCount;
HashMap<UUID, Long> commandMillisList = new HashMap<UUID, Long>(); HashMap<UUID, Long> commandMillisList = new HashMap<>();
HashMap<UUID, Long> interactMillisList = new HashMap<UUID, Long>(); HashMap<UUID, Long> interactMillisList = new HashMap<>();
HashMap<String, PlayerProfile> playerProfile = new HashMap<String, PlayerProfile>(); HashMap<String, PlayerProfile> playerProfile = new HashMap<>();
HashSet<String> consoleCommandBlacklist = new HashSet<String>(Arrays.asList(new String[] { HashSet<String> consoleCommandBlacklist = new HashSet<>();
HashSet<Material> fallingBlockList = new HashSet<>();
HashSet<Material> nonSolidBlockList = new HashSet<>();
HashSet<Material> nonSolidDoubleBlockList = new HashSet<>();
HashSet<Material> nonSolidSingularBlockList = new HashSet<>();
HashSet<Material> nonSolidWallMountedBlockList = new HashSet<>();
public void onEnable() {
Collections.addAll(
consoleCommandBlacklist,
"essentials:action", "essentials:action",
"essentials:adventure", "essentials:adventure",
"essentials:adventuremode", "essentials:adventuremode",
@ -339,14 +348,18 @@ public class Main extends JavaPlugin {
"w", "w",
"warp", "warp",
"warps", "warps",
"whisper", "whisper"
})); );
HashSet<Material> fallingBlockList = new HashSet<Material>(Arrays.asList(new Material[] {
Collections.addAll(
fallingBlockList,
Material.ANVIL, Material.ANVIL,
Material.GRAVEL, Material.GRAVEL,
Material.SAND, Material.SAND
})); );
HashSet<Material> nonSolidDoubleBlockList = new HashSet<Material>(Arrays.asList(new Material[] {
Collections.addAll(
nonSolidDoubleBlockList,
Material.GRASS, Material.GRASS,
Material.SIGN, Material.SIGN,
Material.OAK_DOOR, Material.OAK_DOOR,
@ -399,9 +412,11 @@ public class Main extends JavaPlugin {
Material.LARGE_FERN, Material.LARGE_FERN,
Material.LILAC, Material.LILAC,
Material.ROSE_BUSH, Material.ROSE_BUSH,
Material.PEONY, Material.PEONY
})); );
HashSet<Material> nonSolidSingularBlockList = new HashSet<Material>(Arrays.asList(new Material[] {
Collections.addAll(
nonSolidSingularBlockList,
Material.ACACIA_SAPLING, Material.ACACIA_SAPLING,
Material.BIRCH_SAPLING, Material.BIRCH_SAPLING,
Material.DARK_OAK_SAPLING, Material.DARK_OAK_SAPLING,
@ -475,9 +490,11 @@ public class Main extends JavaPlugin {
Material.FIRE_CORAL, Material.FIRE_CORAL,
Material.HORN_CORAL, Material.HORN_CORAL,
Material.TUBE_CORAL, Material.TUBE_CORAL,
Material.SEA_PICKLE, Material.SEA_PICKLE
})); );
HashSet<Material> nonSolidWallMountedBlockList = new HashSet<Material>(Arrays.asList(new Material[] {
Collections.addAll(
nonSolidWallMountedBlockList,
Material.TORCH, Material.TORCH,
Material.WALL_TORCH, Material.WALL_TORCH,
Material.LADDER, Material.LADDER,
@ -540,12 +557,9 @@ public class Main extends JavaPlugin {
Material.HORN_CORAL_FAN, Material.HORN_CORAL_FAN,
Material.HORN_CORAL_WALL_FAN, Material.HORN_CORAL_WALL_FAN,
Material.TUBE_CORAL_FAN, Material.TUBE_CORAL_FAN,
Material.TUBE_CORAL_WALL_FAN, Material.TUBE_CORAL_WALL_FAN
})); );
HashSet<Material> nonSolidBlockList = new HashSet<Material>();
public void onEnable() {
this.nonSolidBlockList.addAll(nonSolidDoubleBlockList); this.nonSolidBlockList.addAll(nonSolidDoubleBlockList);
this.nonSolidBlockList.addAll(nonSolidSingularBlockList); this.nonSolidBlockList.addAll(nonSolidSingularBlockList);
this.nonSolidBlockList.addAll(nonSolidWallMountedBlockList); this.nonSolidBlockList.addAll(nonSolidWallMountedBlockList);