mirror of
https://github.com/songoda/EpicHoppers.git
synced 2024-11-25 11:46:45 +01:00
Auto stash before merge of "master" and "origin/master"
This commit is contained in:
parent
d3062ce205
commit
36f839ef50
@ -40,7 +40,6 @@ public final class EpicHoppers extends JavaPlugin implements Listener {
|
|||||||
public SettingsManager sm;
|
public SettingsManager sm;
|
||||||
|
|
||||||
public References references = null;
|
public References references = null;
|
||||||
private ConfigWrapper langFile = new ConfigWrapper(this, "", "lang.yml");
|
|
||||||
public ConfigWrapper dataFile = new ConfigWrapper(this, "", "data.yml");
|
public ConfigWrapper dataFile = new ConfigWrapper(this, "", "data.yml");
|
||||||
|
|
||||||
public Map<Player, Block> sync = new HashMap<>();
|
public Map<Player, Block> sync = new HashMap<>();
|
||||||
@ -119,8 +118,6 @@ public final class EpicHoppers extends JavaPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
langFile.createNewFile("Loading language file", "EpicHoppers language file");
|
|
||||||
references = new References();
|
references = new References();
|
||||||
|
|
||||||
hooks = new HookHandler();
|
hooks = new HookHandler();
|
||||||
|
@ -6,12 +6,16 @@ import com.songoda.epichoppers.Hopper.Filter;
|
|||||||
import com.songoda.epichoppers.Hopper.Hopper;
|
import com.songoda.epichoppers.Hopper.Hopper;
|
||||||
import com.songoda.epichoppers.Utils.Debugger;
|
import com.songoda.epichoppers.Utils.Debugger;
|
||||||
import com.songoda.epichoppers.Utils.Methods;
|
import com.songoda.epichoppers.Utils.Methods;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.ExperienceOrb;
|
import org.bukkit.entity.ExperienceOrb;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -21,6 +25,8 @@ import org.bukkit.inventory.InventoryHolder;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by songoda on 3/14/2017.
|
* Created by songoda on 3/14/2017.
|
||||||
*/
|
*/
|
||||||
@ -92,15 +98,14 @@ public class BlockListeners implements Listener {
|
|||||||
|
|
||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
|
|
||||||
|
if (event.getPlayer().getItemInHand() == null) return;
|
||||||
|
|
||||||
|
handleSyncTouch(event);
|
||||||
|
|
||||||
if (event.getBlock().getType() != Material.HOPPER) return;
|
if (event.getBlock().getType() != Material.HOPPER) return;
|
||||||
|
|
||||||
Hopper hopper = instance.getHopperManager().getHopper(block);
|
Hopper hopper = instance.getHopperManager().getHopper(block);
|
||||||
|
|
||||||
if (event.getPlayer().getItemInHand() == null) return;
|
|
||||||
|
|
||||||
handlePick(event);
|
|
||||||
|
|
||||||
|
|
||||||
int level = hopper.getLevel().getLevel();
|
int level = hopper.getLevel().getLevel();
|
||||||
|
|
||||||
if (level != 0) {
|
if (level != 0) {
|
||||||
@ -137,16 +142,28 @@ public class BlockListeners implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handlePick(BlockBreakEvent e) {
|
private void handleSyncTouch(BlockBreakEvent e) {
|
||||||
if (!Methods.isSync(e.getPlayer())) return;
|
if (!Methods.isSync(e.getPlayer())) return;
|
||||||
ItemStack item = e.getPlayer().getItemInHand();
|
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemStack tool = e.getPlayer().getItemInHand();
|
||||||
if (item.getItemMeta().getLore().size() != 2) return;
|
ItemMeta meta = tool.getItemMeta();
|
||||||
|
if (tool.getItemMeta().getLore().size() != 2) return;
|
||||||
|
|
||||||
Location location = Arconix.pl().getApi().serialize().unserializeLocation(meta.getLore().get(1).replaceAll("§", ""));
|
Location location = Arconix.pl().getApi().serialize().unserializeLocation(meta.getLore().get(1).replaceAll("§", ""));
|
||||||
|
|
||||||
if (location.getBlock().getType() != Material.CHEST) return;
|
if (location.getBlock().getType() != Material.CHEST) return;
|
||||||
|
|
||||||
|
if (e.getBlock().getType() == Material.MOB_SPAWNER || e.getBlock().getType() == Material.HOPPER || e.getBlock().getType() == Material.DISPENSER) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (e.getBlock().getType().name().contains("SHULKER") && e.getBlock().getType() != Material.SHULKER_SHELL) return;
|
||||||
|
} catch (Exception ee) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
InventoryHolder ih = (InventoryHolder) location.getBlock().getState();
|
InventoryHolder ih = (InventoryHolder) location.getBlock().getState();
|
||||||
if (e.getPlayer().getItemInHand().getItemMeta().hasEnchant(Enchantment.SILK_TOUCH)) {
|
if (e.getPlayer().getItemInHand().getItemMeta().hasEnchant(Enchantment.SILK_TOUCH)) {
|
||||||
ih.getInventory().addItem(new ItemStack(e.getBlock().getType()));
|
ih.getInventory().addItem(new ItemStack(e.getBlock().getType(),1, e.getBlock().getData()));
|
||||||
} else {
|
} else {
|
||||||
for (ItemStack is : e.getBlock().getDrops())
|
for (ItemStack is : e.getBlock().getDrops())
|
||||||
ih.getInventory().addItem(is);
|
ih.getInventory().addItem(is);
|
||||||
|
@ -113,9 +113,6 @@ public class HopHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Entity e : metaItems) {
|
|
||||||
e.removeMetadata("grabbed", instance);
|
|
||||||
}
|
|
||||||
if (hopper.getLevel().getSuction() != 0) {
|
if (hopper.getLevel().getSuction() != 0) {
|
||||||
int suck = hopper.getLevel().getSuction();
|
int suck = hopper.getLevel().getSuction();
|
||||||
double radius = suck + .5;
|
double radius = suck + .5;
|
||||||
|
@ -2,8 +2,8 @@ name: EpicHoppers
|
|||||||
description: EpicHoppers
|
description: EpicHoppers
|
||||||
main: com.songoda.epichoppers.EpicHoppers
|
main: com.songoda.epichoppers.EpicHoppers
|
||||||
depend: [Arconix]
|
depend: [Arconix]
|
||||||
softdepend: [Towny, RedProtect, Kingdoms, PlotsSquared, GriefPrevention, USkyBlock, ASkyBlock, WorldGuard, Factions, Vault, PlaceholderAPI]
|
softdepend: [Towny, RedProtect, Kingdoms, PlotsSquared, GriefPrevention, USkyBlock, ASkyBlock, WorldGuard, Factions, Vault]
|
||||||
version: 2.3.0
|
version: 2.3.1
|
||||||
author: Songoda
|
author: Songoda
|
||||||
commands:
|
commands:
|
||||||
epichoppers:
|
epichoppers:
|
||||||
|
14
target/classes/SettingDefinitions.yml
Normal file
14
target/classes/SettingDefinitions.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
ECO-Icon: 'This is the default icon that will be used for the Economy upgrade button.'
|
||||||
|
XP-Icon: 'This is the default icon that will be used for the Experience upgrade button.'
|
||||||
|
Upgrading-enabled: 'Setting this to true will allow users to access the upgrade window.'
|
||||||
|
Upgrade-with-eco: 'Setting this to true will allow users to use Economy to upgrade their hoppers.'
|
||||||
|
Upgrade-with-xp: 'Setting this to true will allow users to use Experience to upgrade their hoppers.'
|
||||||
|
On-upgrade-particles: 'Setting this to true will cause particles to emit when a hopper is upgraded.'
|
||||||
|
Teleport-hoppers: 'These are the default levels, the amount of levels can be expanded if you want, just add another level to the bottom of the list while keeping numeric order. Allows you to enable or disable teleporting with hoppers'
|
||||||
|
Hop-Tick: 'This is the tick speed for synced hoppers.'
|
||||||
|
Sync-Timeout: 'This is the timeout that if reached will cancel a sync.'
|
||||||
|
Glass-Type: 'This is the id of the glass used for the background in the guis.'
|
||||||
|
Rainbow-Glass: 'If this is enabled the glass background will be randomized colors. '
|
||||||
|
Limit-Hoppers-Per-Chunk: 'If enabled this will limit the amount hoppers per chunk'
|
||||||
|
Hopper-Limit: 'This is the amount of allowed hoppers per chunk.'
|
||||||
|
Upgrade-particle-type: 'This is the type of particle an upgrade will emit.'
|
BIN
target/classes/com/songoda/epichoppers/API/EpicHoppersAPI.class
Normal file
BIN
target/classes/com/songoda/epichoppers/API/EpicHoppersAPI.class
Normal file
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/EpicHoppers.class
Normal file
BIN
target/classes/com/songoda/epichoppers/EpicHoppers.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Handlers/HopHandler.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Handlers/HopHandler.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Hooks/ASkyBlockHook.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Hooks/ASkyBlockHook.class
Normal file
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Hooks/FactionsHook.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Hooks/FactionsHook.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Hooks/Hook.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Hooks/Hook.class
Normal file
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Hooks/KingdomsHook.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Hooks/KingdomsHook.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Hooks/TownyHook.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Hooks/TownyHook.class
Normal file
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Hooks/USkyBlockHook.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Hooks/USkyBlockHook.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Hopper/Filter.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Hopper/Filter.class
Normal file
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Hopper/Hopper.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Hopper/Hopper.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Hopper/Level.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Hopper/Level.class
Normal file
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Hopper/LevelManager.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Hopper/LevelManager.class
Normal file
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Locale.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Locale.class
Normal file
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/References.class
Normal file
BIN
target/classes/com/songoda/epichoppers/References.class
Normal file
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Utils/Debugger.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Utils/Debugger.class
Normal file
Binary file not shown.
BIN
target/classes/com/songoda/epichoppers/Utils/Methods.class
Normal file
BIN
target/classes/com/songoda/epichoppers/Utils/Methods.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
53
target/classes/en_US.lang
Normal file
53
target/classes/en_US.lang
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
#General Messages
|
||||||
|
|
||||||
|
general.nametag.prefix = "&7[&6EpicHoppers&7]"
|
||||||
|
general.nametag.next = "&9Next"
|
||||||
|
general.nametag.back = "&9Back"
|
||||||
|
general.nametag.nameformat = "&eLevel %level% &fHopper"
|
||||||
|
|
||||||
|
#Interface Messages
|
||||||
|
|
||||||
|
interface.hopper.upgradewithxp = "&aUpgrade with XP"
|
||||||
|
interface.hopper.upgradewithxplore = "&7Cost: &a%cost% Levels"
|
||||||
|
interface.hopper.upgradewitheconomy = "&aUpgrade with ECO"
|
||||||
|
interface.hopper.upgradewitheconomylore = "&7Cost: &a$%cost%"
|
||||||
|
interface.hopper.currentlevel = "&6Hopper Level &7%level%"
|
||||||
|
interface.hopper.nextlevel = "&6Next Level &7%level%"
|
||||||
|
interface.hopper.range = "&7Range: &6%range%"
|
||||||
|
interface.hopper.amount = "&7Amount: &6%amount%"
|
||||||
|
interface.hopper.suction = "&7Suction: &6%suction%"
|
||||||
|
interface.hopper.blockbreak = "&7Block Break: &6Every %ticks% ticks"
|
||||||
|
interface.hopper.alreadymaxed = "&7This hopper is already maxed out!"
|
||||||
|
interface.hopper.synclore = "|&7Left-Click then click a another|&7hopper or chest to sync!||&7Right-Click to desync."
|
||||||
|
interface.hopper.perltitle = "&6Click to Teleport"
|
||||||
|
interface.hopper.perllore = "|&7Left-Click to teleport to|&7the end of the chain.||&7Right-Click to toggle walk|&7on teleport."
|
||||||
|
interface.hopper.filtertitle = "&cClick to Filter"
|
||||||
|
interface.hopper.filterlore = "|&7This allows you to choose|&7which items go where."
|
||||||
|
interface.hopper.synchopper = "&6Click to Sync This hopper"
|
||||||
|
interface.hopper.rejectsync = "&6Click to Sync Rejected Items"
|
||||||
|
interface.filter.infotitle = "&aFilter Guide"
|
||||||
|
interface.filter.infolore = "&7Items placed in the top left|&7space will be whitelisted.||&7Items placed in the right|&7will be void.||&7Items placed in the bottom left|&7will be blacklisted.||&cUsing the whitelist will disable|&cboth the blacklist and the void."
|
||||||
|
interface.filter.whitelist = "&f&lWhite List"
|
||||||
|
interface.filter.blacklist = "&8&lBlack List"
|
||||||
|
interface.filter.void = "&c&lVoid"
|
||||||
|
|
||||||
|
#Event Messages
|
||||||
|
|
||||||
|
event.general.nopermission = "&cYou do not have permission to do that."
|
||||||
|
event.upgrade.cannotafford = "&cYou cannot afford this upgrade."
|
||||||
|
event.upgrade.success = "&7You successfully upgraded this hopper to &6level %level%&7!"
|
||||||
|
event.upgrade.maxed = "&7You maxed out this hopper at &6level %level%&7."
|
||||||
|
event.inventory.noroom = "&7You do not have space in your inventory for this."
|
||||||
|
event.hopper.syncsuccess = "&aSynchronization Successful."
|
||||||
|
event.hopper.desync = "&7You have desynchronized this hopper."
|
||||||
|
event.hopper.syncnext = "&7Click another hopper or container to sync."
|
||||||
|
event.hopper.syncself = "&cYou can't sync a hopper to itself."
|
||||||
|
event.hopper.synctimeout = "&cSyncing timed out."
|
||||||
|
event.hopper.syncoutofrange = "&cThis block is out of your hoppers range."
|
||||||
|
event.hopper.syncdidnotplace = "&cSorry! You need to have placed this hopper to sync things to it."
|
||||||
|
event.hopper.toomany = "&cYou can only place %amount% hoppers per chunk..."
|
||||||
|
event.hopper.walkteleenabled = "Walk on teleporting has been enabled for this hopper."
|
||||||
|
event.hopper.walkteledisabled = "Walk on teleporting has been disabled for this hopper."
|
||||||
|
event.hopper.onlyone = "&cYou may only place a single item at a time."
|
||||||
|
event.hopper.syncchest = "&7You have synchronized your &9%name% &7with this chest."
|
||||||
|
event.hopper.desyncchest = "&7You have desynchronized your &9%name% &7with this chest."
|
13
target/classes/plugin.yml
Normal file
13
target/classes/plugin.yml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
name: EpicHoppers
|
||||||
|
description: EpicHoppers
|
||||||
|
main: com.songoda.epichoppers.EpicHoppers
|
||||||
|
depend: [Arconix]
|
||||||
|
softdepend: [Towny, RedProtect, Kingdoms, PlotsSquared, GriefPrevention, USkyBlock, ASkyBlock, WorldGuard, Factions, Vault]
|
||||||
|
version: 2.3.1
|
||||||
|
author: Songoda
|
||||||
|
commands:
|
||||||
|
epichoppers:
|
||||||
|
description: View information on this plugin.
|
||||||
|
default: true
|
||||||
|
aliases: [sc, eh, synccraft]
|
||||||
|
usage: /eh
|
Loading…
Reference in New Issue
Block a user