1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Static non-final names compliance changes

This commit is contained in:
Sfiguz7 2019-08-30 22:58:46 +02:00
parent 29a8d81345
commit e253f1dc43
25 changed files with 147 additions and 147 deletions

View File

@ -637,7 +637,7 @@ public final class SlimefunItems {
public static final ItemStack GPS_EMERGENCY_TRANSMITTER = new CustomItem(getSkull("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjBjOWMxYTAyMmY0MGI3M2YxNGI0Y2JhMzdjNzE4YzZhNTMzZjNhMjg2NGI2NTM2ZDVmNDU2OTM0Y2MxZiJ9fX0="), "&cGPS Emergency Transmitter", "", "&rCarrying this in your Inventory", "&rautomatically sets a Waypoint", "&rat your Location when you die.");
public static final ItemStack ANDROID_INTERFACE_FUEL = new CustomItem(Material.DISPENSER, "&7Android Interface &c(Fuel)", "", "&rItems stored in this Interface", "&rwill be inserted into an Android's Fuel Slot", "&rwhen its Script tells them to do so");
public static final ItemStack ANDROID_INTERFACE_ITEMS = new CustomItem(Material.DISPENSER, "&7Android Interface &9(Items)", "", "&rItems stored in an Android's Inventory", "&rwill be inserted into this Interface", "&rwhen its Script tells them to do so");
public static final ItemStack ANDROID_INTERFACE_items = new CustomItem(Material.DISPENSER, "&7Android Interface &9(Items)", "", "&rItems stored in an Android's Inventory", "&rwill be inserted into this Interface", "&rwhen its Script tells them to do so");
public static final ItemStack GPS_GEO_SCANNER = new CustomItem(getSkull("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmFkOGNmZWIzODdhNTZlM2U1YmNmODUzNDVkNmE0MTdiMjQyMjkzODg3ZGIzY2UzYmE5MWZhNDA5YjI1NGI4NiJ9fX0="), "&bGPS Geo-Scanner", "", "&rScans a Chunk for natural Resources", "&rsuch as &8Oil");
public static final ItemStack OIL_PUMP = new CustomItem(getSkull("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYWZlMWEwNDBhNDI1ZTMxYTQ2ZDRmOWE5Yjk4MDZmYTJmMGM0N2VlODQ3MTFjYzE5MzJmZDhhYjMyYjJkMDM4In19fQ=="), "&rOil Pump", "", "&7Pumps up Oil and fills it into Buckets", "", "&c&l! &cMake sure to Geo-Scan the Chunk first");

View File

@ -76,11 +76,11 @@ public class Category {
Collections.sort(list, new CategorySorter());
if (this instanceof SeasonalCategory) {
if (((SeasonalCategory) this).isUnlocked()) Slimefun.current_categories.add(this);
if (((SeasonalCategory) this).isUnlocked()) Slimefun.currentCategories.add(this);
}
else Slimefun.current_categories.add(this);
else Slimefun.currentCategories.add(this);
Collections.sort(Slimefun.current_categories, new CategorySorter());
Collections.sort(Slimefun.currentCategories, new CategorySorter());
}
/**

View File

@ -80,7 +80,7 @@ public class Research {
}
public boolean isEnabled() {
return SlimefunStartup.instance.getSettings().RESEARCHES_ENABLED && enabled;
return SlimefunStartup.instance.getSettings().Researches_ENABLED && enabled;
}
/**
@ -214,7 +214,7 @@ public class Research {
*/
public boolean canUnlock(Player p) {
if (!isEnabled()) return true;
return (p.getGameMode() == GameMode.CREATIVE && SlimefunStartup.instance.getSettings().RESEARCHES_FREE_IN_CREATIVE) || p.getLevel() >= this.cost;
return (p.getGameMode() == GameMode.CREATIVE && SlimefunStartup.instance.getSettings().Researches_FREE_IN_CREATIVE) || p.getLevel() >= this.cost;
}
/**

View File

@ -37,7 +37,7 @@ public class SlimefunItem {
public static List<SlimefunItem> items = new ArrayList<>();
public static Map<String, SlimefunItem> map_id = new HashMap<>();
public static Map<String, SlimefunItem> mapID = new HashMap<>();
public static List<ItemStack> radioactive = new ArrayList<>();
public static Set<String> tickers = new HashSet<>();
@ -209,7 +209,7 @@ public class SlimefunItem {
public void register(boolean slimefun) {
this.addon = !slimefun;
try {
if (map_id.containsKey(this.id)) throw new IllegalArgumentException("ID \"" + this.id + "\" already exists");
if (mapID.containsKey(this.id)) throw new IllegalArgumentException("ID \"" + this.id + "\" already exists");
if (this.recipe.length < 9) this.recipe = new ItemStack[] {null, null, null, null, null, null, null, null, null};
all.add(this);
@ -248,7 +248,7 @@ public class SlimefunItem {
this.permission = SlimefunStartup.getItemCfg().getString(this.id + ".required-permission");
items.add(this);
if (slimefun) SlimefunStartup.instance.getUtilities().vanillaItems++;
map_id.put(this.id, this);
mapID.put(this.id, this);
this.create();
for (ItemHandler handler: itemhandlers) {
@ -308,14 +308,14 @@ public class SlimefunItem {
*/
@Deprecated
public static SlimefunItem getByName(String name) {
return map_id.get(name);
return mapID.get(name);
}
/**
* @since 4.1.11, rename of {@link #getByName(String)}.
*/
public static SlimefunItem getByID(String id) {
return map_id.get(id);
return mapID.get(id);
}
public static SlimefunItem getByItem(ItemStack item) {

View File

@ -105,7 +105,7 @@ public class AdvancedCargoOutputNode extends SlimefunItem {
menu.addMenuClickHandler(41, (p, slot, item, action) -> {
int channel = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) - 1;
if (channel < 0) {
if (CargoNet.EXTRA_CHANNELS) channel = 16;
if (CargoNet.extraChannels) channel = 16;
else channel = 15;
}
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channel));
@ -132,7 +132,7 @@ public class AdvancedCargoOutputNode extends SlimefunItem {
menu.addMenuClickHandler(43, (p, slot, item, action) -> {
int channeln = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) + 1;
if (CargoNet.EXTRA_CHANNELS) {
if (CargoNet.extraChannels) {
if (channeln > 16) channeln = 0;
}
else {

View File

@ -121,7 +121,7 @@ public class CargoInputNode extends SlimefunItem {
menu.addMenuClickHandler(41, (p, slot, item, action) -> {
int channel = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) - 1;
if (channel < 0) {
if (CargoNet.EXTRA_CHANNELS) channel = 16;
if (CargoNet.extraChannels) channel = 16;
else channel = 15;
}
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channel));
@ -148,7 +148,7 @@ public class CargoInputNode extends SlimefunItem {
menu.addMenuClickHandler(43, (p, slot, item, action) -> {
int channeln = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) + 1;
if (CargoNet.EXTRA_CHANNELS) {
if (CargoNet.extraChannels) {
if (channeln > 16) channeln = 0;
}
else {

View File

@ -45,7 +45,7 @@ public class CargoOutputNode extends SlimefunItem {
menu.addMenuClickHandler(12, (p, slot, item, action) -> {
int channel = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) - 1;
if (channel < 0) {
if (CargoNet.EXTRA_CHANNELS) channel = 16;
if (CargoNet.extraChannels) channel = 16;
else channel = 15;
}
BlockStorage.addBlockInfo(b, "frequency", String.valueOf(channel));
@ -72,7 +72,7 @@ public class CargoOutputNode extends SlimefunItem {
menu.addMenuClickHandler(14, (p, slot, item, action) -> {
int channeln = Integer.parseInt(BlockStorage.getLocationInfo(b.getLocation(), "frequency")) + 1;
if (CargoNet.EXTRA_CHANNELS) {
if (CargoNet.extraChannels) {
if (channeln > 16) channeln = 0;
}
else {

View File

@ -6,14 +6,14 @@ public final class Files {
private Files() {}
public static File RESEARCHES = new File("plugins/Slimefun/Researches.yml");
public static File CONFIG = new File("plugins/Slimefun/config.yml");
public static File ITEMS = new File("plugins/Slimefun/Items.yml");
public static File DATABASE = new File("data-storage/Slimefun/Players");
public static File WHITELIST = new File("plugins/Slimefun/whitelist.yml");
public static File Researches = new File("plugins/Slimefun/Researches.yml");
public static File config = new File("plugins/Slimefun/config.yml");
public static File items = new File("plugins/Slimefun/Items.yml");
public static File database = new File("data-storage/Slimefun/Players");
public static File whitelist = new File("plugins/Slimefun/whitelist.yml");
public static void cleanup() {
if (!RESEARCHES.exists()) {
if (!Researches.exists()) {
System.err.println("###############################################");
System.err.println("############## = - INFO - = #################");
System.err.println("###############################################");
@ -29,8 +29,8 @@ public final class Files {
delete(new File("data-storage/Slimefun"));
}
if (!DATABASE.exists()) {
DATABASE.mkdirs();
if (!database.exists()) {
database.mkdirs();
}
}

View File

@ -34,7 +34,7 @@ public final class MiscSetup {
private MiscSetup() {}
public static List<PostSlimefunLoadingHandler> post_handlers = new ArrayList<>();
public static List<PostSlimefunLoadingHandler> postHandlers = new ArrayList<>();
public static void setupMisc() {
if (SlimefunItem.getByID("COMMON_TALISMAN") != null && (Boolean) Slimefun.getItemValue("COMMON_TALISMAN", "recipe-requires-nether-stars")) {
@ -205,7 +205,7 @@ public final class MiscSetup {
CommandSender sender = Bukkit.getConsoleSender();
ChatColor color = Colors.getRandom();
for (PostSlimefunLoadingHandler handler: post_handlers) {
for (PostSlimefunLoadingHandler handler: postHandlers) {
handler.run(pre, init, post);
}

View File

@ -177,7 +177,7 @@ public final class ResearchSetup {
Slimefun.registerResearch(new Research(177, "Basic GPS Setup", 28), SlimefunItems.GPS_TRANSMITTER, SlimefunItems.GPS_CONTROL_PANEL, SlimefunItems.GPS_MARKER_TOOL);
Slimefun.registerResearch(new Research(178, "GPS Emergency Waypoint", 30), SlimefunItems.GPS_EMERGENCY_TRANSMITTER);
Slimefun.registerResearch(new Research(179, "Programmable Androids", 50), SlimefunItems.PROGRAMMABLE_ANDROID, SlimefunItems.PROGRAMMABLE_ANDROID_FARMER, SlimefunItems.PROGRAMMABLE_ANDROID_BUTCHER, SlimefunItems.PROGRAMMABLE_ANDROID_FISHERMAN, SlimefunItems.PROGRAMMABLE_ANDROID_MINER, SlimefunItems.PROGRAMMABLE_ANDROID_WOODCUTTER);
Slimefun.registerResearch(new Research(180, "Android Interfaces", 26), SlimefunItems.ANDROID_INTERFACE_FUEL, SlimefunItems.ANDROID_INTERFACE_ITEMS);
Slimefun.registerResearch(new Research(180, "Android Interfaces", 26), SlimefunItems.ANDROID_INTERFACE_FUEL, SlimefunItems.ANDROID_INTERFACE_items);
Slimefun.registerResearch(new Research(181, "GEO-Scans", 30), SlimefunItems.GPS_GEO_SCANNER);
Slimefun.registerResearch(new Research(182, "Combustion Reactor", 38), SlimefunItems.COMBUSTION_REACTOR);
Slimefun.registerResearch(new Research(183, "Teleporter Base Components", 42), SlimefunItems.GPS_TELEPORTATION_MATRIX, SlimefunItems.GPS_TELEPORTER_PYLON);

View File

@ -22,7 +22,7 @@ public final class SlimefunManager {
private SlimefunManager() {}
public static SlimefunStartup plugin;
public static String PREFIX;
public static String prefix;
public static Map<EntityType, List<ItemStack>> drops = new EnumMap<>(EntityType.class);
public static void registerArmorSet(ItemStack baseComponent, ItemStack[] items, String idSyntax, PotionEffect[][] effects, boolean special, boolean slimefun) {

View File

@ -3294,7 +3294,7 @@ public final class SlimefunSetup {
}
.register(true);
new SlimefunItem(Categories.ELECTRICITY, SlimefunItems.ANDROID_INTERFACE_ITEMS, "ANDROID_INTERFACE_ITEMS", RecipeType.ENHANCED_CRAFTING_TABLE,
new SlimefunItem(Categories.ELECTRICITY, SlimefunItems.ANDROID_INTERFACE_items, "ANDROID_INTERFACE_items", RecipeType.ENHANCED_CRAFTING_TABLE,
new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.PLASTIC_SHEET, SlimefunItems.PLASTIC_SHEET, SlimefunItems.PLASTIC_SHEET, SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.BLUE_STAINED_GLASS), SlimefunItems.PLASTIC_SHEET, SlimefunItems.PLASTIC_SHEET, SlimefunItems.PLASTIC_SHEET})
.register(true);
@ -4380,7 +4380,7 @@ public final class SlimefunSetup {
}
public static void registerPostHandler(PostSlimefunLoadingHandler handler) {
MiscSetup.post_handlers.add(handler);
MiscSetup.postHandlers.add(handler);
}
}

View File

@ -65,8 +65,8 @@ public final class SlimefunGuide {
* @since 4.1.13
*/
public static int stars = 0;
public static int code_bytes = 0;
public static Date last_update = new Date();
public static int codeBytes = 0;
public static Date lastUpdate = new Date();
private static final int category_size = 36;
@ -168,7 +168,7 @@ public final class SlimefunGuide {
});
try {
menu.addItem(4, new CustomItem(new ItemStack(Material.COMPARATOR), "&eSource Code", "", "&7Bytes of Code: &6" + IntegerFormat.formatBigNumber(code_bytes), "&7Last Update: &a" + IntegerFormat.timeDelta(last_update) + " ago", "&7Forks: &e" + forks, "&7Stars: &e" + stars, "", "&7&oSlimefun 4 is a community project,", "&7&othe source code is available on GitHub", "&7&oand if you want to keep this Plugin alive,", "&7&othen please consider contributing to it", "", "&7\u21E8 Click to go to GitHub"));
menu.addItem(4, new CustomItem(new ItemStack(Material.COMPARATOR), "&eSource Code", "", "&7Bytes of Code: &6" + IntegerFormat.formatBigNumber(codeBytes), "&7Last Update: &a" + IntegerFormat.timeDelta(lastUpdate) + " ago", "&7Forks: &e" + forks, "&7Stars: &e" + stars, "", "&7&oSlimefun 4 is a community project,", "&7&othe source code is available on GitHub", "&7&oand if you want to keep this Plugin alive,", "&7&othen please consider contributing to it", "", "&7\u21E8 Click to go to GitHub"));
menu.addMenuClickHandler(4, (pl, slot, item, action) -> {
pl.closeInventory();
pl.sendMessage("");
@ -416,8 +416,8 @@ public final class SlimefunGuide {
pl -> pl.playSound(pl.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 0.7F, 0.7F)
);
List<Category> categories = Slimefun.current_categories;
List<GuideHandler> handlers = Slimefun.guide_handlers.values().stream().flatMap(List::stream).collect(Collectors.toList());
List<Category> categories = Slimefun.currentCategories;
List<GuideHandler> handlers = Slimefun.guideHandlers.values().stream().flatMap(List::stream).collect(Collectors.toList());
int index = 9;
int pages = 1;
@ -567,7 +567,7 @@ public final class SlimefunGuide {
openCategory(p, category, true, selected_page, book);
}
else {
if (!(p.getGameMode() == GameMode.CREATIVE && SlimefunStartup.instance.getSettings().RESEARCHES_FREE_IN_CREATIVE)) {
if (!(p.getGameMode() == GameMode.CREATIVE && SlimefunStartup.instance.getSettings().Researches_FREE_IN_CREATIVE)) {
p.setLevel(p.getLevel() - research.getCost());
}
@ -706,12 +706,12 @@ public final class SlimefunGuide {
openCategory(p, category, true, selected_page, book);
}
else {
if (!(pl.getGameMode() == GameMode.CREATIVE && SlimefunStartup.instance.getSettings().RESEARCHES_FREE_IN_CREATIVE)) {
if (!(pl.getGameMode() == GameMode.CREATIVE && SlimefunStartup.instance.getSettings().Researches_FREE_IN_CREATIVE)) {
pl.setLevel(pl.getLevel() - research.getCost());
}
if (pl.getGameMode() == GameMode.CREATIVE) {
research.unlock(pl, SlimefunStartup.instance.getSettings().RESEARCHES_FREE_IN_CREATIVE);
research.unlock(pl, SlimefunStartup.instance.getSettings().Researches_FREE_IN_CREATIVE);
openCategory(pl, category, survival, selected_page, book);
}
else {

View File

@ -145,9 +145,9 @@ public final class SlimefunStartup extends JavaPlugin {
utils.setupConfig();
// Loading all extra configs
researches = new Config(Files.RESEARCHES);
items = new Config(Files.ITEMS);
whitelist = new Config(Files.WHITELIST);
researches = new Config(Files.Researches);
items = new Config(Files.items);
whitelist = new Config(Files.whitelist);
// Setup Config and messages.yml
utils.setupLocalization();
@ -191,7 +191,7 @@ public final class SlimefunStartup extends JavaPlugin {
MiscSetup.loadDescriptions();
settings = new Settings(config);
settings.RESEARCHES_ENABLED = getResearchCfg().getBoolean("enable-researching");
settings.Researches_ENABLED = getResearchCfg().getBoolean("enable-researching");
settings.SMELTERY_FIRE_BREAK_CHANCE = (Integer) Slimefun.getItemValue("SMELTERY", "chance.fireBreak");
System.out.println("[Slimefun] Loading Researches...");
@ -349,7 +349,7 @@ public final class SlimefunStartup extends JavaPlugin {
}
}
for (UniversalBlockMenu menu: BlockStorage.universal_inventories.values()) {
for (UniversalBlockMenu menu: BlockStorage.universalInventories.values()) {
menu.save();
}
@ -362,16 +362,16 @@ public final class SlimefunStartup extends JavaPlugin {
whitelist = null;
instance = null;
Messages.local = null;
Files.CONFIG = null;
Files.DATABASE = null;
Files.ITEMS = null;
Files.RESEARCHES = null;
Files.WHITELIST = null;
Files.config = null;
Files.database = null;
Files.items = null;
Files.Researches = null;
Files.whitelist = null;
MultiBlock.list = null;
Research.list = null;
SlimefunItem.all = null;
SlimefunItem.items = null;
SlimefunItem.map_id = null;
SlimefunItem.mapID = null;
SlimefunItem.handlers = null;
SlimefunItem.radioactive = null;
SlimefunCommand.arguments = null;
@ -379,19 +379,19 @@ public final class SlimefunStartup extends JavaPlugin {
SlimefunCommand.tabs = null;
SlimefunItem.blockhandler = null;
BlockMenuPreset.presets = null;
BlockStorage.loaded_tickers = null;
BlockStorage.ticking_chunks = null;
BlockStorage.loadedTickers = null;
BlockStorage.tickingChunks = null;
BlockStorage.worlds = null;
ChargableBlock.capacitors = null;
ChargableBlock.max_charges = null;
ChargableBlock.maxCharges = null;
AContainer.processing = null;
AContainer.progress = null;
Slimefun.guide_handlers = null;
EnergyNet.machines_input = null;
EnergyNet.machines_output = null;
EnergyNet.machines_storage = null;
Slimefun.guideHandlers = null;
EnergyNet.machinesInput = null;
EnergyNet.machinesOutput = null;
EnergyNet.machinesStorage = null;
CargoNet.faces = null;
BlockStorage.universal_inventories = null;
BlockStorage.universalInventories = null;
PlayerProfile.profiles = null;
OreWasher.items = null;

View File

@ -351,8 +351,8 @@ public abstract class ProgrammableAndroid extends SlimefunItem {
case MOVE_AND_DIG_DOWN:
movedig(b, face, b.getRelative(BlockFace.DOWN));
break;
case INTERFACE_ITEMS:
if (BlockStorage.check(b.getRelative(face), "ANDROID_INTERFACE_ITEMS") && b.getRelative(face).getState() instanceof Dispenser) {
case INTERFACE_items:
if (BlockStorage.check(b.getRelative(face), "ANDROID_INTERFACE_items") && b.getRelative(face).getState() instanceof Dispenser) {
Dispenser d = (Dispenser) b.getRelative(face).getState();
for (int slot: getOutputSlots()) {
ItemStack stack = BlockStorage.getInventory(b).getItemInSlot(slot);

View File

@ -51,7 +51,7 @@ public enum ScriptPart {
FARM_EXOTIC_DOWN(AndroidType.ADVANCED_FARMER, "&bAdvanced Harvest and Replant &7(Block underneath)", "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmQ0Mjk2YjMzM2QyNTMxOWFmM2YzMzA1MTc5N2Y5ZTZkODIxY2QxOWEwMTRmYjcxMzdiZWI4NmE0ZTllOTYifX19"),
// Action - Interface
INTERFACE_ITEMS(AndroidType.NONE, "&9Push Inventory Contents to the faced Interface", "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTBhNGRiZjY2MjVjNDJiZTU3YThiYTJjMzMwOTU0YTc2YmRmMjI3ODU1NDBlODdhNWM5NjcyNjg1MjM4ZWMifX19"),
INTERFACE_items(AndroidType.NONE, "&9Push Inventory Contents to the faced Interface", "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTBhNGRiZjY2MjVjNDJiZTU3YThiYTJjMzMwOTU0YTc2YmRmMjI3ODU1NDBlODdhNWM5NjcyNjg1MjM4ZWMifX19"),
INTERFACE_FUEL(AndroidType.NONE, "&cPull Fuel from the faced Interface", "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjQzMmY1MjgyYTUwNzQ1YjkxMmJlMTRkZWRhNTgxYmQ0YTA5Yjk3N2EzYzMyZDdlOTU3ODQ5MWZlZThmYTcifX19");

View File

@ -39,16 +39,16 @@ public class BlockStorage {
private static final String path_chunks = "data-storage/Slimefun/stored-chunks/";
public static Map<String, BlockStorage> worlds = new HashMap<>();
public static Map<String, Set<Location>> ticking_chunks = new HashMap<>();
public static Set<String> loaded_tickers = new HashSet<>();
public static Map<String, Set<Location>> tickingChunks = new HashMap<>();
public static Set<String> loadedTickers = new HashSet<>();
private World world;
private Map<Location, Config> storage = new HashMap<>();
private static Map<String, String> map_chunks = new HashMap<>();
private static Map<String, String> mapChunks = new HashMap<>();
private Map<Location, BlockMenu> inventories = new HashMap<>();
public static Map<String, UniversalBlockMenu> universal_inventories = new HashMap<>();
public static Map<String, UniversalBlockMenu> universalInventories = new HashMap<>();
private Map<String, Config> cache_blocks = new HashMap<>();
@ -129,10 +129,10 @@ public class BlockStorage {
storage.put(l, blockInfo);
if (SlimefunItem.isTicking(file.getName().replace(".sfb", ""))) {
Set<Location> locations = ticking_chunks.containsKey(chunkString) ? ticking_chunks.get(chunkString): new HashSet<>();
Set<Location> locations = tickingChunks.containsKey(chunkString) ? tickingChunks.get(chunkString): new HashSet<>();
locations.add(l);
ticking_chunks.put(chunkString, locations);
if (!loaded_tickers.contains(chunkString)) loaded_tickers.add(chunkString);
tickingChunks.put(chunkString, locations);
if (!loadedTickers.contains(chunkString)) loadedTickers.add(chunkString);
}
} catch (Exception x) {
System.err.println("[Slimefun] Failed to load " + file.getName() + "(ERR: " + key + ")");
@ -156,7 +156,7 @@ public class BlockStorage {
FileConfiguration cfg = YamlConfiguration.loadConfiguration(chunks);
for (String key: cfg.getKeys(false)) {
try {
if (world.getName().equals(key.split(";")[0])) map_chunks.put(key, cfg.getString(key));
if (world.getName().equals(key.split(";")[0])) mapChunks.put(key, cfg.getString(key));
} catch (Exception x) {
System.err.println("[Slimefun] Failed to load " + chunks.getName() + " for World \"" + world.getName() + "\" (ERR: " + key + ")");
x.printStackTrace();
@ -191,24 +191,24 @@ public class BlockStorage {
BlockMenuPreset preset = BlockMenuPreset.getPreset(cfg.getString("preset"));
if (preset != null) {
universal_inventories.put(preset.getID(), new UniversalBlockMenu(preset, cfg));
universalInventories.put(preset.getID(), new UniversalBlockMenu(preset, cfg));
}
}
}
}
private static int chunk_changes = 0;
private static int chunkChanges = 0;
private int changes = 0;
public void computeChanges() {
changes = cache_blocks.size() + chunk_changes;
changes = cache_blocks.size() + chunkChanges;
Map<Location, BlockMenu> inventories2 = new HashMap<>(inventories);
for (Map.Entry<Location, BlockMenu> entry: inventories2.entrySet()) {
changes += entry.getValue().getUnsavedChanges();
}
Map<String, UniversalBlockMenu> universalInventories2 = new HashMap<>(universal_inventories);
Map<String, UniversalBlockMenu> universalInventories2 = new HashMap<>(universalInventories);
for (Map.Entry<String, UniversalBlockMenu> entry: universalInventories2.entrySet()) {
changes += entry.getValue().getUnsavedChanges();
}
@ -254,17 +254,17 @@ public class BlockStorage {
entry.getValue().save(entry.getKey());
}
Map<String, UniversalBlockMenu> universalInventories2 = new HashMap<>(universal_inventories);
Map<String, UniversalBlockMenu> universalInventories2 = new HashMap<>(universalInventories);
for (Map.Entry<String, UniversalBlockMenu> entry: universalInventories2.entrySet()) {
entry.getValue().save();
}
if (chunk_changes > 0) {
if (chunkChanges > 0) {
File chunks = new File(path_chunks + "chunks.sfc");
Config cfg = new Config("data-storage/Slimefun/temp.yml");
for (Map.Entry<String, String> entry: map_chunks.entrySet()) {
for (Map.Entry<String, String> entry: mapChunks.entrySet()) {
cfg.setValue(entry.getKey(), entry.getValue());
}
@ -276,7 +276,7 @@ public class BlockStorage {
}
changes = 0;
chunk_changes = 0;
chunkChanges = 0;
}
public static void store(Block block, ItemStack item) {
@ -360,7 +360,7 @@ public class BlockStorage {
}
private static String getJSONData(Chunk chunk) {
return map_chunks.get(serializeChunk(chunk));
return mapChunks.get(serializeChunk(chunk));
}
@Deprecated
@ -413,7 +413,7 @@ public class BlockStorage {
storage.storage.put(l, cfg);
if (BlockMenuPreset.isInventory(cfg.getString("id"))) {
if (BlockMenuPreset.isUniversalInventory(cfg.getString("id"))) {
if (!universal_inventories.containsKey(cfg.getString("id"))) storage.loadUniversalInventory(BlockMenuPreset.getPreset(cfg.getString("id")));
if (!universalInventories.containsKey(cfg.getString("id"))) storage.loadUniversalInventory(BlockMenuPreset.getPreset(cfg.getString("id")));
}
else if (!storage.hasInventory(l)) {
File file = new File("data-storage/Slimefun/stored-inventories/" + serializeLocation(l) + ".sfi");
@ -463,14 +463,14 @@ public class BlockStorage {
storage.getUniversalInventory(l).save();
}
String chunkString = locationToChunkString(l);
if (ticking_chunks.containsKey(chunkString)) {
Set<Location> locations = ticking_chunks.get(chunkString);
if (tickingChunks.containsKey(chunkString)) {
Set<Location> locations = tickingChunks.get(chunkString);
locations.remove(l);
if (locations.isEmpty()) {
ticking_chunks.remove(chunkString);
loaded_tickers.remove(chunkString);
tickingChunks.remove(chunkString);
loadedTickers.remove(chunkString);
}
else ticking_chunks.put(chunkString, locations);
else tickingChunks.put(chunkString, locations);
}
}
}
@ -505,14 +505,14 @@ public class BlockStorage {
storage.storage.remove(from);
String chunkString = locationToChunkString(from);
if (ticking_chunks.containsKey(chunkString)) {
Set<Location> locations = ticking_chunks.get(chunkString);
if (tickingChunks.containsKey(chunkString)) {
Set<Location> locations = tickingChunks.get(chunkString);
locations.remove(from);
if (locations.isEmpty()) {
ticking_chunks.remove(chunkString);
loaded_tickers.remove(chunkString);
tickingChunks.remove(chunkString);
loadedTickers.remove(chunkString);
}
else ticking_chunks.put(chunkString, locations);
else tickingChunks.put(chunkString, locations);
}
}
@ -526,12 +526,12 @@ public class BlockStorage {
if (item != null && item.isTicking()) {
String chunkString = locationToChunkString(l);
if (value != null) {
Set<Location> locations = ticking_chunks.get(chunkString);
Set<Location> locations = tickingChunks.get(chunkString);
if (locations == null) locations = new HashSet<>();
locations.add(l);
ticking_chunks.put(chunkString, locations);
if (!loaded_tickers.contains(chunkString)) loaded_tickers.add(chunkString);
tickingChunks.put(chunkString, locations);
if (!loadedTickers.contains(chunkString)) loadedTickers.add(chunkString);
}
}
}
@ -575,7 +575,7 @@ public class BlockStorage {
}
public static Set<String> getTickingChunks() {
return new HashSet<>(loaded_tickers);
return new HashSet<>(loadedTickers);
}
@Deprecated
@ -597,7 +597,7 @@ public class BlockStorage {
}
public static Set<Location> getTickingLocations(String chunk) {
return new HashSet<>(ticking_chunks.get(chunk));
return new HashSet<>(tickingChunks.get(chunk));
}
public BlockMenu loadInventory(Location l, BlockMenuPreset preset) {
@ -607,7 +607,7 @@ public class BlockStorage {
}
public void loadUniversalInventory(BlockMenuPreset preset) {
universal_inventories.put(preset.getID(), new UniversalBlockMenu(preset));
universalInventories.put(preset.getID(), new UniversalBlockMenu(preset));
}
public void clearInventory(Location l) {
@ -629,7 +629,7 @@ public class BlockStorage {
}
public boolean hasUniversalInventory(String id) {
return universal_inventories.containsKey(id);
return universalInventories.containsKey(id);
}
public UniversalBlockMenu getUniversalInventory(Block block) {
@ -642,7 +642,7 @@ public class BlockStorage {
}
public UniversalBlockMenu getUniversalInventory(String id) {
return universal_inventories.get(id);
return universalInventories.get(id);
}
public static BlockMenu getInventory(Block b) {
@ -659,7 +659,7 @@ public class BlockStorage {
public static Config getChunkInfo(Chunk chunk) {
try {
Config cfg = new Config("data-storage/Slimefun/temp.yml");
if (!map_chunks.containsKey(serializeChunk(chunk))) return cfg;
if (!mapChunks.containsKey(serializeChunk(chunk))) return cfg;
for (Map.Entry<String, String> entry: parseJSON(getJSONData(chunk)).entrySet()) {
cfg.setValue(entry.getKey(), entry.getValue());
@ -680,7 +680,7 @@ public class BlockStorage {
}
public static boolean hasChunkInfo(Chunk chunk) {
return map_chunks.containsKey(serializeChunk(chunk));
return mapChunks.containsKey(serializeChunk(chunk));
}
public static void setChunkInfo(Chunk chunk, String key, String value) {
@ -693,9 +693,9 @@ public class BlockStorage {
json.add(path, new JsonPrimitive(cfg.getString(path)));
}
map_chunks.put(serializeChunk(chunk), json.toString());
mapChunks.put(serializeChunk(chunk), json.toString());
chunk_changes++;
chunkChanges++;
}
public static String getChunkInfo(Chunk chunk, String key) {
@ -707,7 +707,7 @@ public class BlockStorage {
}
public static void clearChunkInfo(Chunk chunk) {
map_chunks.remove(serializeChunk(chunk));
mapChunks.remove(serializeChunk(chunk));
}
public static String getBlockInfoAsJson(Block block) {

View File

@ -161,7 +161,7 @@ public final class PlayerProfile {
}
public String getTitle() {
List<String> titles = SlimefunStartup.instance.getSettings().RESEARCHES_TITLES;
List<String> titles = SlimefunStartup.instance.getSettings().Researches_TITLES;
int index = Math.round(Float.valueOf(String.valueOf(Math.round(((researches.size() * 100.0F) / Research.list().size()) * 100.0F) / 100.0F)) / 100.0F) * titles.size();
if (index > 0) index--;

View File

@ -26,7 +26,7 @@ import me.mrCookieSlime.Slimefun.Setup.Messages;
*/
public class Slimefun {
public static Map<Integer, List<GuideHandler>> guide_handlers = new HashMap<>();
public static Map<Integer, List<GuideHandler>> guideHandlers = new HashMap<>();
/**
* Instance of the GPSNetwork.
@ -41,13 +41,13 @@ public class Slimefun {
/**
* Lists all the registered categories.
*/
public static List<Category> current_categories = new ArrayList<>();
public static List<Category> currentCategories = new ArrayList<>();
public static void registerGuideHandler(GuideHandler handler) {
List<GuideHandler> handlers = new ArrayList<>();
if (guide_handlers.containsKey(handler.getTier())) handlers = guide_handlers.get(handler.getTier());
if (guideHandlers.containsKey(handler.getTier())) handlers = guideHandlers.get(handler.getTier());
handlers.add(handler);
guide_handlers.put(handler.getTier(), handlers);
guideHandlers.put(handler.getTier(), handlers);
}
/**
@ -270,7 +270,7 @@ public class Slimefun {
* Returns a list of all the ItemStacks representing the registered categories.
*
* @return the list of the display items of all the registered categories.
* @see #current_categories
* @see #currentCategories
*/
public static List<ItemStack> listCategories() {
List<ItemStack> items = new ArrayList<>();
@ -348,6 +348,6 @@ public class Slimefun {
}
public static List<GuideHandler> getGuideHandlers(int tier) {
return guide_handlers.containsKey(tier) ? guide_handlers.get(tier): new ArrayList<>();
return guideHandlers.containsKey(tier) ? guideHandlers.get(tier): new ArrayList<>();
}
}

View File

@ -18,17 +18,17 @@ import org.bukkit.block.Skull;
public class ChargableBlock {
public static Map<String, Integer> max_charges = new HashMap<>();
public static Map<String, Integer> maxCharges = new HashMap<>();
public static Set<String> rechargeable = new HashSet<>();
public static Set<String> capacitors = new HashSet<>();
public static void registerChargableBlock(String id, int capacity, boolean recharge) {
max_charges.put(id, capacity);
maxCharges.put(id, capacity);
if (recharge) rechargeable.add(id);
}
public static void registerCapacitor(String id, int capacity) {
max_charges.put(id, capacity);
maxCharges.put(id, capacity);
rechargeable.add(id);
capacitors.add(id);
}
@ -39,13 +39,13 @@ public class ChargableBlock {
public static boolean isChargable(Location l) {
if (!BlockStorage.hasBlockInfo(l)) return false;
return max_charges.containsKey(BlockStorage.checkID(l));
return maxCharges.containsKey(BlockStorage.checkID(l));
}
public static boolean isRechargable(Block b) {
if (!BlockStorage.hasBlockInfo(b)) return false;
String id = BlockStorage.checkID(b);
return max_charges.containsKey(id) && rechargeable.contains(id);
return maxCharges.containsKey(id) && rechargeable.contains(id);
}
public static boolean isCapacitor(Block b) {
@ -63,7 +63,7 @@ public class ChargableBlock {
public static int getDefaultCapacity(Location l) {
String id = BlockStorage.checkID(l);
return id == null ? 0: max_charges.get(id);
return id == null ? 0: maxCharges.get(id);
}
public static int getCharge(Block b) {

View File

@ -26,40 +26,40 @@ public class EnergyNet extends Network {
private static final int RANGE = 6;
public static Set<String> machines_input = new HashSet<>();
public static Set<String> machines_storage = new HashSet<>();
public static Set<String> machines_output = new HashSet<>();
public static Set<String> machinesInput = new HashSet<>();
public static Set<String> machinesStorage = new HashSet<>();
public static Set<String> machinesOutput = new HashSet<>();
public static NetworkComponent getComponent(Block b) {
return getComponent(b.getLocation());
}
public static NetworkComponent getComponent(String id) {
if (machines_input.contains(id)) return NetworkComponent.SOURCE;
if (machines_storage.contains(id)) return NetworkComponent.DISTRIBUTOR;
if (machines_output.contains(id)) return NetworkComponent.CONSUMER;
if (machinesInput.contains(id)) return NetworkComponent.SOURCE;
if (machinesStorage.contains(id)) return NetworkComponent.DISTRIBUTOR;
if (machinesOutput.contains(id)) return NetworkComponent.CONSUMER;
return NetworkComponent.NONE;
}
public static NetworkComponent getComponent(Location l) {
if (!BlockStorage.hasBlockInfo(l)) return NetworkComponent.NONE;
String id = BlockStorage.checkID(l);
if (machines_input.contains(id)) return NetworkComponent.SOURCE;
if (machines_storage.contains(id)) return NetworkComponent.DISTRIBUTOR;
if (machines_output.contains(id)) return NetworkComponent.CONSUMER;
if (machinesInput.contains(id)) return NetworkComponent.SOURCE;
if (machinesStorage.contains(id)) return NetworkComponent.DISTRIBUTOR;
if (machinesOutput.contains(id)) return NetworkComponent.CONSUMER;
return NetworkComponent.NONE;
}
public static void registerComponent(String id, NetworkComponent component) {
switch (component) {
case CONSUMER:
machines_output.add(id);
machinesOutput.add(id);
break;
case DISTRIBUTOR:
machines_storage.add(id);
machinesStorage.add(id);
break;
case SOURCE:
machines_input.add(id);
machinesInput.add(id);
break;
default:
break;

View File

@ -34,11 +34,11 @@ import me.mrCookieSlime.Slimefun.holograms.CargoHologram;
public class CargoNet extends Network {
public static boolean EXTRA_CHANNELS = false;
public static boolean extraChannels = false;
private static final int RANGE = 5;
public static List<BlockFace> faces = Arrays.asList(BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST);
public static Map<Location, Integer> round_robin = new HashMap<>();
public static Map<Location, Integer> roundRobin = new HashMap<>();
public static Set<ItemRequest> requests = new HashSet<>();
private static int[] slots = new int[] {19, 20, 21, 28, 29, 30, 37, 38, 39};
@ -192,7 +192,7 @@ public class CargoNet extends Network {
self.display();
}
//Chest Terminal Code
if (EXTRA_CHANNELS) {
if (extraChannels) {
for (Location bus : imports) {
BlockMenu menu = BlockStorage.getInventory(bus);
@ -345,11 +345,11 @@ public class CargoNet extends Network {
List<Location> outputlist = new ArrayList<>(output.get(frequency));
if (roundrobin) {
if (!round_robin.containsKey(input)) {
round_robin.put(input, 0);
if (!roundRobin.containsKey(input)) {
roundRobin.put(input, 0);
}
int cIndex = round_robin.get(input);
int cIndex = roundRobin.get(input);
if (cIndex < outputlist.size()) {
for (int i = 0; i < cIndex; i++) {
@ -361,7 +361,7 @@ public class CargoNet extends Network {
}
else cIndex = 1;
round_robin.put(input, cIndex);
roundRobin.put(input, cIndex);
}
for (Location out : outputlist) {
@ -389,7 +389,7 @@ public class CargoNet extends Network {
}
}
//Chest Terminal Code
if (EXTRA_CHANNELS) {
if (extraChannels) {
List<StoredItem> items = new ArrayList<>();
for (Location l: providers) {
Block target = getAttachedBlock(l.getBlock());

View File

@ -14,10 +14,10 @@ import me.mrCookieSlime.Slimefun.SlimefunStartup;
public abstract class Network {
private static List<Network> NETWORK_LIST = new ArrayList<>();
private static List<Network> networkList = new ArrayList<>();
public static<T extends Network> T getNetworkFromLocation(Location l, Class<T> type) {
for(Network n: NETWORK_LIST) {
for(Network n: networkList) {
if(type.isInstance(n) && n.connectsTo(l)) {
return type.cast(n);
}
@ -27,7 +27,7 @@ public abstract class Network {
public static<T extends Network> List<T> getNetworksFromLocation(Location l, Class<T> type) {
List<T> ret = new ArrayList<>();
for(Network n: NETWORK_LIST) {
for(Network n: networkList) {
if(type.isInstance(n) && n.connectsTo(l)) {
ret.add(type.cast(n));
}
@ -36,11 +36,11 @@ public abstract class Network {
}
public static void registerNetwork(Network n) {
NETWORK_LIST.add(n);
networkList.add(n);
}
public static void unregisterNetwork(Network n) {
NETWORK_LIST.remove(n);
networkList.remove(n);
}
public static void handleAllNetworkLocationUpdate(Location l) {

View File

@ -120,7 +120,7 @@ public final class GitHubSetup {
SlimefunGuide.issues = object.get("open_issues_count").getAsInt();
SlimefunGuide.forks = object.get("forks").getAsInt();
SlimefunGuide.stars = object.get("stargazers_count").getAsInt();
SlimefunGuide.last_update = IntegerFormat.parseGitHubDate(object.get("pushed_at").getAsString());
SlimefunGuide.lastUpdate = IntegerFormat.parseGitHubDate(object.get("pushed_at").getAsString());
}
@Override
@ -148,7 +148,7 @@ public final class GitHubSetup {
@Override
public void onSuccess(JsonElement element) {
JsonObject object = element.getAsJsonObject();
SlimefunGuide.code_bytes = object.get("Java").getAsInt();
SlimefunGuide.codeBytes = object.get("Java").getAsInt();
}
@Override

View File

@ -6,9 +6,9 @@ import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
public final class Settings {
public boolean RESEARCHES_ENABLED;
public boolean RESEARCHES_FREE_IN_CREATIVE;
public List<String> RESEARCHES_TITLES;
public boolean Researches_ENABLED;
public boolean Researches_FREE_IN_CREATIVE;
public List<String> Researches_TITLES;
public int BLOCK_LOADING_INFO_DELAY;
public int BLOCK_AUTO_SAVE_DELAY;
@ -24,8 +24,8 @@ public final class Settings {
public int SMELTERY_FIRE_BREAK_CHANCE;
public Settings(Config cfg) {
RESEARCHES_FREE_IN_CREATIVE = cfg.getBoolean("options.allow-free-creative-research");
RESEARCHES_TITLES = cfg.getStringList("research-ranks");
Researches_FREE_IN_CREATIVE = cfg.getBoolean("options.allow-free-creative-research");
Researches_TITLES = cfg.getStringList("research-ranks");
BLOCK_LOADING_INFO_DELAY = cfg.getInt("URID.info-delay");
BLOCK_AUTO_SAVE_DELAY = cfg.getInt("options.auto-save-delay-in-minutes");