<commit_before>/*
 * Copyright (c) 2014 <NAME>.
 *
 * All Rights Reserved
 */

package com.skelril.aurora.shards.GoldRush;

import com.sk89q.worldedit.blocks.BlockID;
import com.sk89q.worldedit.blocks.ItemID;
import com.sk89q.worldedit.bukkit.BukkitPlayer;
import com.sk89q.worldedit.bukkit.BukkitUtil;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import com.skelril.aurora.economic.store.AdminStoreComponent;
import com.skelril.aurora.items.custom.CustomItemCenter;
import com.skelril.aurora.items.custom.CustomItems;
import com.skelril.aurora.modifiers.ModifierType;
import com.skelril.aurora.shards.BukkitShardInstance;
import com.skelril.aurora.util.*;
import com.skelril.aurora.util.item.ItemUtil;
import com.skelril.aurora.util.player.PlayerRespawnProfile_1_7_10;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.Chest;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.Lever;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;

import static com.sk89q.commandbook.CommandBook.inst;
import static com.skelril.aurora.modifiers.ModifierComponent.getModifierCenter;
import static com.zachsthings.libcomponents.bukkit.BasePlugin.server;

public class GoldRushInstance extends BukkitShardInstance<GoldRushShard> implements Runnable {

    // Constants
    private static final double FEE_MINIMUM = 100;
    private static final double FEE_MULTIPLIER = .005;


    private CuboidRegion roomOne, roomTwo;

    private CuboidRegion doorOne, doorTwo;

    // Block - Should be flipped
    private ConcurrentHashMap<Location, Boolean> leverBlocks = new ConcurrentHashMap<>();
    private List<Location> floodBlocks = new ArrayList<>();
    private List<Location> chestBlocks = new ArrayList<>();

    // Block - Is unlocked
    private List<Location> locks = new ArrayList<>();
    private Location rewardChest;

    // Session
    private long startTime = -1;
    private Map<UUID, Double> origonalCharge = new HashMap<>();
    private double lootSplit = 0;
    private int playerMod = 0;
    private int floodBlockType = BlockID.WATER;
    private boolean keysTriggered = false;
    private boolean checkingKeys = true;
    private boolean leversTriggered = false;
    private boolean checkingLevers = true;
    private long lastLeverSwitch = System.currentTimeMillis();
    private long lastFlood = System.currentTimeMillis();

    public GoldRushInstance(GoldRushShard shard, World world, ProtectedRegion region) {
        super(shard, world, region);
        setup();
    }

    private void setup() {
        com.sk89q.worldedit.Vector offset = getRegion().getMinimumPoint();

        rewardChest = new Location(getBukkitWorld(), offset.getX() + 15, offset.getY() + 2, offset.getZ() + 6);

        roomOne = new CuboidRegion(offset.add(1, 1, 36), offset.add(29, 7, 74));
        roomTwo = new CuboidRegion(offset.add(11, 1, 17), offset.add(19, 7, 35));

        doorOne = new CuboidRegion(offset.add(14, 1, 36), offset.add(16, 3, 36));
        doorTwo = new CuboidRegion(offset.add(14, 1, 16), offset.add(16, 3, 16));

        findChestAndKeys();         // Setup room one
        findLeversAndFloodBlocks(); // Setup room two
    }

    @Override
    public void prepare() {<commit_msg>Call remove on Gold Rush startup<commit_after>/*
 * Copyright (c) 2014 <NAME>.
 *
 * All Rights Reserved
 */

package com.skelril.aurora.shards.GoldRush;

import com.sk89q.worldedit.blocks.BlockID;
import com.sk89q.worldedit.blocks.ItemID;
import com.sk89q.worldedit.bukkit.BukkitPlayer;
import com.sk89q.worldedit.bukkit.BukkitUtil;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import com.skelril.aurora.economic.store.AdminStoreComponent;
import com.skelril.aurora.items.custom.CustomItemCenter;
import com.skelril.aurora.items.custom.CustomItems;
import com.skelril.aurora.modifiers.ModifierType;
import com.skelril.aurora.shards.BukkitShardInstance;
import com.skelril.aurora.util.*;
import com.skelril.aurora.util.item.ItemUtil;
import com.skelril.aurora.util.player.PlayerRespawnProfile_1_7_10;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.Chest;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.Lever;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;

import static com.sk89q.commandbook.CommandBook.inst;
import static com.skelril.aurora.modifiers.ModifierComponent.getModifierCenter;
import static com.zachsthings.libcomponents.bukkit.BasePlugin.server;

public class GoldRushInstance extends BukkitShardInstance<GoldRushShard> implements Runnable {

    // Constants
    private static final double FEE_MINIMUM = 100;
    private static final double FEE_MULTIPLIER = .005;


    private CuboidRegion roomOne, roomTwo;

    private CuboidRegion doorOne, doorTwo;

    // Block - Should be flipped
    private ConcurrentHashMap<Location, Boolean> leverBlocks = new ConcurrentHashMap<>();
    private List<Location> floodBlocks = new ArrayList<>();
    private List<Location> chestBlocks = new ArrayList<>();

    // Block - Is unlocked
    private List<Location> locks = new ArrayList<>();
    private Location rewardChest;

    // Session
    private long startTime = -1;
    private Map<UUID, Double> origonalCharge = new HashMap<>();
    private double lootSplit = 0;
    private int playerMod = 0;
    private int floodBlockType = BlockID.WATER;
    private boolean keysTriggered = false;
    private boolean checkingKeys = true;
    private boolean leversTriggered = false;
    private boolean checkingLevers = true;
    private long lastLeverSwitch = System.currentTimeMillis();
    private long lastFlood = System.currentTimeMillis();

    public GoldRushInstance(GoldRushShard shard, World world, ProtectedRegion region) {
        super(shard, world, region);
        setup();
        remove();
    }

    private void setup() {
        com.sk89q.worldedit.Vector offset = getRegion().getMinimumPoint();

        rewardChest = new Location(getBukkitWorld(), offset.getX() + 15, offset.getY() + 2, offset.getZ() + 6);

        roomOne = new CuboidRegion(offset.add(1, 1, 36), offset.add(29, 7, 74));
        roomTwo = new CuboidRegion(offset.add(11, 1, 17), offset.add(19, 7, 35));

        doorOne = new CuboidRegion(offset.add(14, 1, 36), offset.add(16, 3, 36));
        doorTwo = new CuboidRegion(offset.add(14, 1, 16), offset.add(16, 3, 16));

        findChestAndKeys();         // Setup room one
        findLeversAndFloodBlocks(); // Setup room two
    }

    @Override
    public void prepare() {
{'fraction_non_alphanumeric': 0.10783638617270348, 'fraction_numerical': 0.021484643988431345, 'mean_word_length': 4.220704529115744, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5630089', 'n_tokens_mistral': 2435, 'n_tokens_neox': 2267, 'n_words': 512}