├── .github
├── FUNDING.yml
└── workflows
│ ├── maven.yml
│ └── pr_test.yml
├── .gitignore
├── LICENSE
├── README.md
├── pom.xml
└── src
├── main
├── java
│ └── ca
│ │ └── jamiesinn
│ │ └── trailgui
│ │ ├── Listeners.java
│ │ ├── TrailGUI.java
│ │ ├── Util.java
│ │ ├── api
│ │ ├── TrailDisableEvent.java
│ │ ├── TrailDisplayEvent.java
│ │ ├── TrailEnableEvent.java
│ │ └── TrailGUIAPI.java
│ │ ├── commands
│ │ ├── CommandTrail.java
│ │ ├── CommandTrailGUI.java
│ │ └── CommandTrails.java
│ │ ├── files
│ │ └── Userdata.java
│ │ ├── sql
│ │ └── SQLManager.java
│ │ └── trails
│ │ ├── BlockTrail.java
│ │ ├── EffectTrail.java
│ │ ├── ItemTrail.java
│ │ ├── NormalTrail.java
│ │ ├── RedstoneTrail.java
│ │ ├── SculkChargeTrail.java
│ │ ├── ShriekTrail.java
│ │ └── Trail.java
└── resources
│ ├── config.yml
│ └── plugin.yml
└── test
├── java
└── MaterialsTest.java
└── resources
└── config.yml
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [jamiesinn]
4 |
--------------------------------------------------------------------------------
/.github/workflows/maven.yml:
--------------------------------------------------------------------------------
1 | name: Java CI
2 |
3 | on: [push]
4 |
5 | jobs:
6 | build:
7 |
8 | runs-on: ubuntu-latest
9 |
10 | steps:
11 | - uses: actions/checkout@v1
12 | - name: Set up JDK 1.8
13 | uses: actions/setup-java@v1
14 | with:
15 | java-version: 1.8
16 | - name: Build with Maven
17 | run: mvn package --file pom.xml
18 | - name: Deploy package to GH Packages
19 | run: mvn deploy -Dregistry=https://maven.pkg.github.com/SinnDevelopment -Dtoken=${{ secrets.GITHUB_TOKEN }}
20 |
21 |
--------------------------------------------------------------------------------
/.github/workflows/pr_test.yml:
--------------------------------------------------------------------------------
1 | name: Java CI
2 |
3 | on: [pull_request]
4 |
5 | jobs:
6 | build:
7 |
8 | runs-on: ubuntu-latest
9 |
10 | steps:
11 | - uses: actions/checkout@v1
12 | - name: Set up JDK 1.8
13 | uses: actions/setup-java@v1
14 | with:
15 | java-version: 1.8
16 | - name: Build with Maven
17 | run: mvn -B package --file pom.xml
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 | TrailsGUI.iml
3 | TrailGUI.iml
4 | .idea
5 | target
6 |
7 | # Mobile Tools for Java (J2ME)
8 | .mtj.tmp/
9 |
10 | # Package files #
11 | *.jar
12 | *.war
13 | *.ear
14 |
15 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
16 | hs_err_pid*
17 |
18 | # =========================
19 | # Operating System files
20 | # =========================
21 |
22 | # OSX
23 | # =========================
24 |
25 | .DS_Store
26 | .AppleDouble
27 | .LSOverride
28 |
29 | # Thumbnails
30 | ._*
31 |
32 | # files that might appear on external disk
33 | .Spotlight-V100
34 | .Trashes
35 |
36 | # Directories potentially created on remote AFP share
37 | .AppleDB
38 | .AppleDesktop
39 | Network Trash Folder
40 | Temporary Items
41 | .apdisk
42 |
43 | # Windows
44 | # =========================
45 |
46 | # Windows image file caches
47 | Thumbs.db
48 | ehthumbs.db
49 |
50 | # Folder config file
51 | Desktop.ini
52 |
53 | # Recycle Bin used on file shares
54 | $RECYCLE.BIN/
55 |
56 | # Windows Installer files
57 | *.cab
58 | *.msi
59 | *.msm
60 | *.msp
61 |
62 | # Windows shortcuts
63 | *.lnk
64 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The Sinn Development Open Source License (SINNDEV-OS)
2 |
3 | Copyright (c) 2015 Sinn Development
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software with minor restriction. The following are without limitations; the rights to to use, copy, modify, merge.
8 | Explicit permission must be granted for the following; to re-publish, distribute, sublicense, and/or sell
9 | copies of the Software. Any persons using the Software are subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 |
22 | IF THE SOFTWARE IS RE-PUBLISHED WITH EXPLICIT PERMISSION, THE SOURCE OF THE SOFTWARE MUST REMAIN OPEN SOURCE, AND ACCESSIBLE FOR ALL.
23 |
24 | THE AUTHOR ("Sinn Development") MAY REQUEST AT ANY TIME OF ANY PERSON WHO HAS BEEN LICENSED TO RE-PUBLISH THE SOFTWARE TO REMOVE THEIR RE-PUBLISHED VERSION OF THE SOFTWARE.
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # TrailGUI
2 | The TrailGUI Spigot Plugin!
3 |
4 | The most comprehensive trails plugin available!
5 |
6 | ## [Spigot MC Page](https://www.spigotmc.org/resources/trailgui.1091/)
7 |
8 | ## [Jenkins](http://ci.md-5.net/job/TrailGUI/)
9 |
10 | Please report all bugs as issues.
11 |
12 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 | ca.jamiesinn
7 | TrailGUI
8 | 6.16.1
9 |
10 |
11 |
12 | spigot-repo
13 | https://hub.spigotmc.org/nexus/content/groups/public/
14 |
15 |
16 |
17 |
18 | org.spigotmc
19 | spigot-api
20 | 1.19-R0.1-SNAPSHOT
21 |
22 |
23 |
24 | junit
25 | junit
26 | 4.13.1
27 | test
28 |
29 |
30 |
31 |
32 | clean install package test
33 | ${project.artifactId}-${project.version}
34 |
35 |
36 | org.apache.maven.plugins
37 | maven-compiler-plugin
38 |
39 | 1.8
40 | 1.8
41 |
42 |
43 |
44 | org.apache.maven.plugins
45 | maven-surefire-plugin
46 | 2.19.1
47 |
48 |
49 |
50 |
51 | src/main/resources
52 | true
53 |
54 |
55 |
56 |
57 | ${project.basedir}/src/test/resources
58 |
59 |
60 |
61 |
62 |
63 | github
64 | GitHub SinnDevelopment Apache Maven Packages
65 | https://maven.pkg.github.com/SinnDevelopment/TrailGUI
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/Listeners.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui;
2 |
3 | import ca.jamiesinn.trailgui.trails.Trail;
4 | import org.bukkit.Material;
5 | import org.bukkit.entity.Player;
6 | import org.bukkit.event.EventHandler;
7 | import org.bukkit.event.Listener;
8 | import org.bukkit.event.entity.EntityDamageByEntityEvent;
9 | import org.bukkit.event.inventory.InventoryClickEvent;
10 | import org.bukkit.event.player.PlayerMoveEvent;
11 | import org.bukkit.event.player.PlayerQuitEvent;
12 | import org.bukkit.inventory.ItemStack;
13 |
14 | import java.util.List;
15 |
16 | public class Listeners implements Listener
17 | {
18 | private TrailGUI trailGUI;
19 |
20 | public Listeners(TrailGUI trailGUI)
21 | {
22 | this.trailGUI = trailGUI;
23 | }
24 |
25 | @EventHandler
26 | public void onEntityDamageByEntity(EntityDamageByEntityEvent event)
27 | {
28 | if (TrailGUI.removeTrailOnPlayerHit)
29 | {
30 | if (((event.getDamager() instanceof Player)) &&
31 | ((event.getEntity() instanceof Player)))
32 | {
33 | Player hit = (Player) event.getEntity();
34 |
35 | Util.clearTrails(hit);
36 | }
37 | }
38 | }
39 |
40 | @EventHandler
41 | public void onInventoryClick(InventoryClickEvent event)
42 | {
43 | if (event.getView().getTitle().contains(TrailGUI.getPlugin().getConfig().getString("inventoryName")))
44 | {
45 | event.setCancelled(true);
46 |
47 | Player player = (Player) event.getWhoClicked();
48 | if ((event.getCurrentItem() == null) || (event.getCurrentItem() == new ItemStack(Material.AIR)))
49 | {
50 | return;
51 | }
52 | int currentPage = Integer.parseInt(event.getView().getTitle().replaceFirst(".+? ([0-9]+) / [0-9]+", "$1"));
53 | List trails = Util.getSubList(currentPage);
54 |
55 | for (Trail trail : trails)
56 | {
57 | if (trail.onInventoryClick(player, event.getCurrentItem()))
58 | {
59 | if (event.getView().getTopInventory().equals(player.getOpenInventory().getTopInventory()))
60 | {
61 | Util.openGUI(player, currentPage);
62 | }
63 | return;
64 | }
65 | }
66 |
67 | if (event.getCurrentItem().equals(Util.itemNoPerms()) && TrailGUI.getPlugin().getConfig().getBoolean("closeInventoryOnDenyPermission"))
68 | {
69 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("GUI.denyPermissionMessage").replaceAll("&", "\u00A7"));
70 | player.closeInventory();
71 | return;
72 | }
73 |
74 | if (event.getCurrentItem().equals(Util.getItemPreviousPage()))
75 | {
76 | if (!player.hasPermission("trailgui.inventory.previouspage"))
77 | {
78 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("GUI.denyPermissionMessage").replaceAll("&", "\u00A7"));
79 | if (TrailGUI.getPlugin().getConfig().getBoolean("closeInventoryOnDenyPermission"))
80 | {
81 | player.closeInventory();
82 | }
83 | return;
84 | }
85 | Util.openGUI(player, currentPage - 1);
86 | }
87 | else if (event.getCurrentItem().equals(Util.getItemRemoveTrails()))
88 | {
89 | if (!player.hasPermission("trailgui.inventory.clearall"))
90 | {
91 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("GUI.denyPermissionMessage").replaceAll("&", "\u00A7"));
92 | if (TrailGUI.getPlugin().getConfig().getBoolean("closeInventoryOnDenyPermission"))
93 | {
94 | player.closeInventory();
95 | }
96 | return;
97 | }
98 | Util.clearTrails(player);
99 |
100 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("RemoveTrails.message").replaceAll("&", "\u00A7"));
101 | if (TrailGUI.getPlugin().getConfig().getBoolean("GUI.closeInventoryAferSelect"))
102 | {
103 | player.closeInventory();
104 | }
105 | else
106 | {
107 | Util.openGUI(player, currentPage);
108 | }
109 | }
110 | else if (event.getCurrentItem().equals(Util.getItemNextPage()))
111 | {
112 | if (!player.hasPermission("trailgui.inventory.nextpage"))
113 | {
114 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("GUI.denyPermissionMessage").replaceAll("&", "\u00A7"));
115 | if (TrailGUI.getPlugin().getConfig().getBoolean("closeInventoryOnDenyPermission"))
116 | {
117 | player.closeInventory();
118 | }
119 | return;
120 | }
121 | Util.openGUI(player, currentPage + 1);
122 | }
123 | }
124 | }
125 |
126 |
127 | @EventHandler
128 | public void onPlayerMove(PlayerMoveEvent event)
129 | {
130 | final Player player = event.getPlayer();
131 | if (!TrailGUI.enabledTrails.containsKey(player.getUniqueId()))
132 | {
133 | return;
134 | }
135 | if ((TrailGUI.getPlugin().getConfig().getBoolean("disabledWhenSpinning")) &&
136 | (event.getFrom().getX() == event.getTo().getX()) && (event.getFrom().getY() == event.getTo().getY()) && (event.getFrom().getZ() == event.getTo().getZ()))
137 | {
138 | return;
139 | }
140 |
141 | if (trailGUI.isWorldDisabled(player.getWorld().getName()))
142 | {
143 | return;
144 | }
145 | List trails = TrailGUI.enabledTrails.get(player.getUniqueId());
146 | try
147 | {
148 | for (Trail trail : trails)
149 | {
150 | trail.display(player);
151 | }
152 | }
153 | catch (NullPointerException e)
154 | {
155 | Util.clearTrails(player);
156 | }
157 | }
158 |
159 | @EventHandler
160 | public void onLogout(PlayerQuitEvent e)
161 | {
162 | if(TrailGUI.getPlugin().getConfig().getBoolean("clearTrailsOnDisconnect"))
163 | Util.clearTrails(e.getPlayer());
164 | else
165 | Util.saveTrails(e.getPlayer().getUniqueId());
166 | }
167 | }
168 |
169 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/TrailGUI.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui;
2 |
3 | import ca.jamiesinn.trailgui.api.TrailGUIAPI;
4 | import ca.jamiesinn.trailgui.commands.CommandTrail;
5 | import ca.jamiesinn.trailgui.commands.CommandTrailGUI;
6 | import ca.jamiesinn.trailgui.commands.CommandTrails;
7 | import ca.jamiesinn.trailgui.files.Userdata;
8 | import ca.jamiesinn.trailgui.sql.SQLManager;
9 | import ca.jamiesinn.trailgui.trails.*;
10 | import org.bukkit.ChatColor;
11 | import org.bukkit.configuration.ConfigurationSection;
12 | import org.bukkit.plugin.java.JavaPlugin;
13 |
14 | import java.io.File;
15 | import java.io.IOException;
16 | import java.io.InputStream;
17 | import java.nio.file.Files;
18 | import java.sql.SQLException;
19 | import java.util.HashMap;
20 | import java.util.List;
21 | import java.util.Map;
22 | import java.util.UUID;
23 |
24 | public class TrailGUI
25 | extends JavaPlugin
26 | {
27 | private static TrailGUI plugin;
28 | public static String prefix;
29 | static boolean removeTrailOnPlayerHit;
30 | public static boolean oneTrailAtATime;
31 | public static int maxTrails;
32 | public static List disabledWorlds;
33 | public static Map> enabledTrails = new HashMap>();
34 | public static Map trailTypes = new HashMap();
35 | private static SQLManager sqlManager;
36 | private static int configRevision = 5;
37 | private TrailGUIAPI api = new TrailGUIAPI(this);
38 |
39 | public static TrailGUI getPlugin()
40 | {
41 | return plugin;
42 | }
43 |
44 | @Override
45 | public void onEnable()
46 | {
47 | saveDefaultConfig();
48 | getServer().getPluginManager().registerEvents(new Listeners(this), this);
49 | getCommand("trail").setExecutor(new CommandTrail(this));
50 | getCommand("trails").setExecutor(new CommandTrails(this));
51 | getCommand("trailgui").setExecutor(new CommandTrailGUI(this));
52 | plugin = this;
53 | if (getConfig().getBoolean("mysql"))
54 | {
55 | try
56 | {
57 | sqlManager = new SQLManager(getConfig().getString("mysql-conn.host"),
58 | getConfig().getInt("mysql-conn.port"),
59 | getConfig().getString("mysql-conn.database"),
60 | getConfig().getString("mysql-conn.user"),
61 | getConfig().getString("mysql-conn.pass"));
62 | }
63 | catch (SQLException e)
64 | {
65 | e.printStackTrace();
66 | }
67 | }
68 |
69 | load();
70 | }
71 |
72 |
73 |
74 | private void load()
75 | {
76 | reloadConfig();
77 | maxTrails = getConfig().getInt("maxActiveTrails");
78 | oneTrailAtATime = getConfig().getBoolean("oneTrailAtATime", false);
79 | prefix = getConfig().getString("prefix").replaceAll("&", "\u00A7");
80 |
81 | if(getConfig().getInt("configVersion") != configRevision)
82 | {
83 | getLogger().severe("Your config is out of date with the current one. Plugin will be disabled until it is corrected.");
84 | getLogger().severe("Copied the latest default config to the plugin directory for reference.");
85 | File dest = new File(getDataFolder(), "config.new.yml");
86 | try (InputStream inputStream = getResource("config.yml"))
87 | {
88 | dest.getParentFile().mkdirs();
89 | Files.copy(inputStream, dest.toPath());
90 | }
91 | catch (IOException e)
92 | {
93 | e.printStackTrace();
94 | }
95 | this.setEnabled(false);
96 | }
97 | if (prefix == null)
98 | {
99 | getLogger().info(ChatColor.RED + "Warning - You have either no value for the prefix - or you have an outdated config. Please update it.");
100 | prefix = ChatColor.DARK_GRAY + "[" + ChatColor.RED + "TrailGUI" + ChatColor.DARK_GRAY + "] ";
101 | }
102 | removeTrailOnPlayerHit = getConfig().getBoolean("removeTrailOnPlayerHit", false);
103 | disabledWorlds = getConfig().getStringList("disabledWorlds");
104 | new Userdata().loadConfig();
105 | loadTrails();
106 | Util.restoreTrails();
107 | }
108 |
109 | public void reload()
110 | {
111 | trailTypes.clear();
112 | enabledTrails.clear();
113 | load();
114 | }
115 |
116 | private void loadTrails()
117 | {
118 | if (getConfig().isConfigurationSection("trails"))
119 | {
120 | ConfigurationSection section = getConfig().getConfigurationSection("trails");
121 | for (String key : section.getKeys(false))
122 | {
123 | if (section.isConfigurationSection(key))
124 | {
125 | ConfigurationSection trailTypeSection = section.getConfigurationSection(key);
126 | try
127 | {
128 | if (trailTypeSection.getString("type").equalsIgnoreCase("ITEM_CRACK"))
129 | {
130 | trailTypes.put(trailTypeSection.getName(), new ItemTrail(trailTypeSection));
131 | }
132 | else if (trailTypeSection.getString("type").equalsIgnoreCase("BLOCK_CRACK")
133 | || trailTypeSection.getString("type").equalsIgnoreCase("BLOCK_DUST")
134 | || trailTypeSection.getString("type").equalsIgnoreCase("FALLING_DUST"))
135 | {
136 | trailTypes.put(trailTypeSection.getName(), new BlockTrail(trailTypeSection));
137 | }
138 | else if (trailTypeSection.getString("type").equalsIgnoreCase("REDSTONE"))
139 | {
140 | trailTypes.put(trailTypeSection.getName(), new RedstoneTrail(trailTypeSection));
141 | }
142 | else if (trailTypeSection.getBoolean("is_effect", false))
143 | {
144 | trailTypes.put(trailTypeSection.getName(), new EffectTrail(trailTypeSection));
145 | }
146 | else if (trailTypeSection.getString("type").equalsIgnoreCase("SCULK_CHARGE"))
147 | {
148 | trailTypes.put(trailTypeSection.getName(), new SculkChargeTrail(trailTypeSection));
149 | }
150 | else if (trailTypeSection.getString("type").equalsIgnoreCase("SHRIEK"))
151 | {
152 | trailTypes.put(trailTypeSection.getName(), new ShriekTrail(trailTypeSection));
153 | }
154 | else
155 | {
156 | trailTypes.put(trailTypeSection.getName(), new NormalTrail(trailTypeSection));
157 | }
158 | }
159 | catch (Exception ex)
160 | {
161 | getLogger().warning("Failed to load '" + trailTypeSection.getName() + "'. Error: " + ex.getMessage());
162 | }
163 |
164 | }
165 | }
166 | }
167 | }
168 |
169 | @Override
170 | public void onDisable()
171 | {
172 | Util.saveTrails();
173 | if (getConfig().getBoolean("mysql"))
174 | sqlManager.disconnect();
175 | }
176 |
177 | public static SQLManager getSqlManager()
178 | {
179 | return sqlManager;
180 | }
181 |
182 | public TrailGUIAPI getApi()
183 | {
184 | return api;
185 | }
186 |
187 | public boolean isWorldDisabled(String worldName)
188 | {
189 | for (String string : TrailGUI.disabledWorlds)
190 | {
191 | string = string.replace("[", "");
192 | string = string.replace("]", "");
193 | if (string.equals(worldName))
194 | {
195 | return true;
196 | }
197 | }
198 | return false;
199 | }
200 | }
201 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/Util.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui;
2 |
3 | import ca.jamiesinn.trailgui.files.Userdata;
4 | import ca.jamiesinn.trailgui.sql.SQLManager;
5 | import ca.jamiesinn.trailgui.trails.Trail;
6 | import org.bukkit.Bukkit;
7 | import org.bukkit.ChatColor;
8 | import org.bukkit.Material;
9 | import org.bukkit.OfflinePlayer;
10 | import org.bukkit.configuration.file.FileConfiguration;
11 | import org.bukkit.enchantments.Enchantment;
12 | import org.bukkit.entity.Player;
13 | import org.bukkit.inventory.Inventory;
14 | import org.bukkit.inventory.ItemFlag;
15 | import org.bukkit.inventory.ItemStack;
16 | import org.bukkit.inventory.meta.ItemMeta;
17 |
18 | import java.sql.SQLException;
19 | import java.util.*;
20 |
21 | public class Util
22 | {
23 | private static ItemStack itemNextPage;
24 | private static ItemStack itemPreviousPage;
25 | private static ItemStack itemRemoveTrails;
26 |
27 | public static void clearTrails(OfflinePlayer player)
28 | {
29 | List currentTrails;
30 | if (TrailGUI.enabledTrails.containsKey(player.getUniqueId()))
31 | {
32 | currentTrails = TrailGUI.enabledTrails.get(player.getUniqueId());
33 | Trail.disableEvent(player.getPlayer(), currentTrails);
34 | currentTrails.clear();
35 | TrailGUI.enabledTrails.put(player.getUniqueId(), currentTrails);
36 | }
37 | }
38 |
39 | static void saveTrails(UUID user)
40 | {
41 | if (TrailGUI.getPlugin().getConfig().getBoolean("mysql"))
42 | {
43 | SQLManager sql = TrailGUI.getSqlManager();
44 |
45 | List trailNames = new ArrayList<>();
46 | List trails = TrailGUI.enabledTrails.get(user);
47 | if (trails == null)
48 | return;
49 | for (Trail t : trails)
50 | trailNames.add(t.getName());
51 | try
52 | {
53 | sql.insertUser(user, trailNames);
54 | }
55 | catch (SQLException e)
56 | {
57 | e.printStackTrace();
58 | }
59 |
60 | }
61 | else
62 | {
63 | FileConfiguration config = Userdata.getInstance().getConfig();
64 | for (String key : config.getKeys(false))
65 | {
66 | config.set(key, null);
67 | }
68 |
69 |
70 | List trailNames = new ArrayList<>();
71 | List trails = TrailGUI.enabledTrails.get(user);
72 | if (trails == null)
73 | return;
74 | for (Trail trail : trails)
75 | {
76 | trailNames.add(trail.getName());
77 | }
78 | config.set(user.toString(), trailNames);
79 |
80 | Userdata.getInstance().saveConfig();
81 | }
82 | }
83 |
84 | static void saveTrails()
85 | {
86 | for (UUID player : TrailGUI.enabledTrails.keySet())
87 | {
88 | saveTrails(player);
89 | }
90 | }
91 |
92 | static void restoreTrails()
93 | {
94 | if (TrailGUI.getPlugin().getConfig().getBoolean("mysql"))
95 | {
96 | try
97 | {
98 | HashMap> trails = TrailGUI.getSqlManager().getTrails();
99 | if (trails == null) return;
100 | for (UUID uuid : trails.keySet())
101 | {
102 | if (trails.get(uuid) == null) return;
103 | List trailTypes = new ArrayList<>(trails.get(uuid));
104 | Trail.enableEvent(Bukkit.getPlayer(uuid), trailTypes);
105 | TrailGUI.enabledTrails.put(uuid, trailTypes);
106 | }
107 |
108 | }
109 | catch (SQLException e)
110 | {
111 | e.printStackTrace();
112 | }
113 | }
114 | else
115 | {
116 | FileConfiguration config = Userdata.getInstance().getConfig();
117 | for (String key : config.getKeys(false))
118 | {
119 | List trails = config.getStringList(key);
120 | if (!trails.isEmpty())
121 | {
122 | List trailTypes = new ArrayList();
123 | for (String trail : trails)
124 | {
125 | trailTypes.add(TrailGUI.trailTypes.get(trail));
126 | }
127 | Trail.enableEvent(Bukkit.getPlayer(UUID.fromString(key)), trailTypes);
128 | TrailGUI.enabledTrails.put(UUID.fromString(key), trailTypes);
129 | }
130 | }
131 | }
132 | }
133 |
134 | public static void openGUI(Player player)
135 | {
136 | openGUI(player, 1);
137 | }
138 |
139 | static void openGUI(Player player, int currentPage)
140 | {
141 |
142 | int pageSize = 27;
143 | List sortedList = new ArrayList<>(TrailGUI.trailTypes.values());
144 | sortedList.sort(new orderComparator());
145 | int maxPages = (int) Math.ceil((double) sortedList.size() / pageSize);
146 | currentPage = currentPage > maxPages ? 1 : currentPage;
147 | int begin = (pageSize * currentPage) - pageSize;
148 | int end = begin + pageSize;
149 | if (end > sortedList.size())
150 | {
151 | end = sortedList.size();
152 | }
153 | List subList = sortedList.subList(begin, end);
154 | String page = " " + currentPage + " / " + maxPages;
155 | Inventory inv = Bukkit.createInventory(null, 45,
156 | TrailGUI.getPlugin().getConfig().getString("inventoryName").replaceAll("&", "\u00A7")
157 | + (TrailGUI.getPlugin().getConfig().getBoolean("showPages") ? page : ""));
158 | int i = 0;
159 | for (Trail trail : subList)
160 | {
161 | if (trail.canUseInventory(player))
162 | {
163 | ItemStack is = trail.getItem();
164 | List enabled = TrailGUI.enabledTrails.get(player.getUniqueId());
165 | if (trail.isGlowEnabled() && enabled != null && enabled.contains(trail))
166 | {
167 | ItemMeta meta = is.getItemMeta();
168 | meta.addEnchant(Enchantment.LURE, 1, false);
169 | meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
170 | is.setItemMeta(meta);
171 | }
172 | inv.setItem(i, is);
173 | }
174 | else
175 | {
176 | inv.setItem(i, itemNoPerms());
177 | }
178 | i++;
179 | }
180 |
181 | if (currentPage > 1)
182 | {
183 | inv.setItem(TrailGUI.getPlugin().getConfig().getInt("PreviousPage.inventorySlot"), getItemPreviousPage());
184 | }
185 | inv.setItem(TrailGUI.getPlugin().getConfig().getInt("RemoveTrails.inventorySlot"), getItemRemoveTrails());
186 | if (currentPage < maxPages)
187 | {
188 | inv.setItem(TrailGUI.getPlugin().getConfig().getInt("NextPage.inventorySlot"), getItemNextPage());
189 | }
190 | player.openInventory(inv);
191 |
192 | }
193 |
194 | //region Items for Inventory Slots
195 | static ItemStack itemNoPerms()
196 | {
197 | ItemStack i = new ItemStack(Material.RED_STAINED_GLASS_PANE, 1);
198 | ItemMeta meta = i.getItemMeta();
199 | meta.setDisplayName(TrailGUI.getPlugin().getConfig().getString("GUI.noPermMessage").replaceAll("&", "\u00A7"));
200 | i.setItemMeta(meta);
201 | return i;
202 |
203 | }
204 |
205 | static ItemStack getItemNextPage()
206 | {
207 | if (itemNextPage == null)
208 | {
209 | itemNextPage = createItemNextPage();
210 | }
211 | return itemNextPage;
212 | }
213 |
214 | private static ItemStack createItemNextPage()
215 | {
216 | ItemStack itemNextPage = new ItemStack(Material.valueOf(TrailGUI.getPlugin().getConfig().getString("NextPage.itemType").toUpperCase()), 1);
217 | ItemMeta metaNextPage = itemNextPage.getItemMeta();
218 |
219 | String name1 = TrailGUI.getPlugin().getConfig().getString("NextPage.itemName");
220 | String name2 = name1.replaceAll("&", "\u00A7");
221 | if (TrailGUI.getPlugin().getConfig().getBoolean("NextPage.loreEnabled"))
222 | {
223 | List loreNextPage = new ArrayList<>();
224 |
225 | for (String s : TrailGUI.getPlugin().getConfig().getStringList("NextPage.lore"))
226 | {
227 | loreNextPage.add(ChatColor.translateAlternateColorCodes('&', s));
228 | }
229 | metaNextPage.setLore(loreNextPage);
230 | }
231 | metaNextPage.setDisplayName(name2);
232 | itemNextPage.setItemMeta(metaNextPage);
233 | return itemNextPage;
234 | }
235 |
236 | static ItemStack getItemPreviousPage()
237 | {
238 | if (itemPreviousPage == null)
239 | {
240 | itemPreviousPage = createItemPreviousPage();
241 | }
242 | return itemPreviousPage;
243 | }
244 |
245 | private static ItemStack createItemPreviousPage()
246 | {
247 | ItemStack itemPreviousPage = new ItemStack(Material.valueOf(TrailGUI.getPlugin().getConfig().getString("PreviousPage.itemType").toUpperCase()), 1);
248 | ItemMeta metaPreviousPage = itemPreviousPage.getItemMeta();
249 |
250 | String name1 = TrailGUI.getPlugin().getConfig().getString("PreviousPage.itemName");
251 | String name2 = name1.replaceAll("&", "\u00A7");
252 | if (TrailGUI.getPlugin().getConfig().getBoolean("PreviousPage.loreEnabled"))
253 | {
254 | List lorePreviousPage = new ArrayList<>();
255 |
256 | for (String s : TrailGUI.getPlugin().getConfig().getStringList("PreviousPage.lore"))
257 | {
258 | lorePreviousPage.add(ChatColor.translateAlternateColorCodes('&', s));
259 | }
260 |
261 | metaPreviousPage.setLore(lorePreviousPage);
262 | }
263 | metaPreviousPage.setDisplayName(name2);
264 | itemPreviousPage.setItemMeta(metaPreviousPage);
265 | return itemPreviousPage;
266 | }
267 |
268 | static ItemStack getItemRemoveTrails()
269 | {
270 | if (itemRemoveTrails == null)
271 | {
272 | itemRemoveTrails = createItemRemoveTrails();
273 | }
274 | return itemRemoveTrails;
275 | }
276 |
277 | private static ItemStack createItemRemoveTrails()
278 | {
279 | ItemStack itemRemoveTrails = new ItemStack(Material.valueOf(TrailGUI.getPlugin().getConfig().getString("RemoveTrails.itemType").toUpperCase()), 1);
280 | ItemMeta metaRemoveTrails = itemRemoveTrails.getItemMeta();
281 |
282 | String name1 = TrailGUI.getPlugin().getConfig().getString("RemoveTrails.itemName");
283 | String name2 = name1.replaceAll("&", "\u00A7");
284 | if (TrailGUI.getPlugin().getConfig().getBoolean("RemoveTrails.loreEnabled"))
285 | {
286 | List loreRemoveTrail = new ArrayList<>();
287 |
288 | for (String s : TrailGUI.getPlugin().getConfig().getStringList("RemoveTrails.lore"))
289 | {
290 | loreRemoveTrail.add(ChatColor.translateAlternateColorCodes('&', s));
291 | }
292 |
293 | metaRemoveTrails.setLore(loreRemoveTrail);
294 | }
295 | metaRemoveTrails.setDisplayName(name2);
296 | itemRemoveTrails.setItemMeta(metaRemoveTrails);
297 | return itemRemoveTrails;
298 | }
299 |
300 | static List getSubList(int currentPage)
301 | {
302 | int pageSize = 27;
303 | List sortedList = new ArrayList<>(TrailGUI.trailTypes.values());
304 | sortedList.sort(new orderComparator());
305 | int maxPages = (int) Math.ceil((double) sortedList.size() / pageSize);
306 | currentPage = currentPage > maxPages ? 1 : currentPage;
307 | int begin = (pageSize * currentPage) - pageSize;
308 | int end = begin + pageSize;
309 | if (end > sortedList.size())
310 | {
311 | end = sortedList.size();
312 | }
313 | return sortedList.subList(begin, end);
314 | }
315 |
316 | //endregion
317 |
318 | private static class orderComparator implements Comparator
319 | {
320 | public int compare(Trail o1, Trail o2)
321 | {
322 | return o1.getOrder() - o2.getOrder();
323 | }
324 | }
325 |
326 | }
327 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/api/TrailDisableEvent.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.api;
2 |
3 | import ca.jamiesinn.trailgui.trails.Trail;
4 | import org.bukkit.entity.Player;
5 | import org.bukkit.event.Event;
6 | import org.bukkit.event.HandlerList;
7 |
8 | import java.util.List;
9 |
10 | public class TrailDisableEvent extends Event
11 | {
12 | private static final HandlerList handlers = new HandlerList();
13 | private Trail trail;
14 | private Player player;
15 | private List trails;
16 |
17 | public TrailDisableEvent(Player player, List trails)
18 | {
19 | this.player = player;
20 | this.trails = trails;
21 |
22 | }
23 | public TrailDisableEvent(Player player, Trail trail)
24 | {
25 | this.trail = trail;
26 | this.player = player;
27 | }
28 |
29 | @Override public HandlerList getHandlers()
30 | {
31 | return handlers;
32 | }
33 |
34 | public Player getPlayer()
35 | {
36 | return player;
37 | }
38 |
39 | public Trail getTrail()
40 | {
41 | return trail;
42 | }
43 |
44 | public List getTrails()
45 | {
46 | if(trails.isEmpty())
47 | trails.add(trail);
48 | return trails;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/api/TrailDisplayEvent.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.api;
2 |
3 | import org.bukkit.Particle;
4 | import org.bukkit.event.Cancellable;
5 | import org.bukkit.event.Event;
6 | import org.bukkit.event.HandlerList;
7 |
8 | public class TrailDisplayEvent extends Event implements Cancellable
9 | {
10 | private static final HandlerList handlers = new HandlerList();
11 | private String name;
12 | private double displayLocation;
13 | private int amount;
14 | private int cooldown;
15 | private float speed;
16 | private int range;
17 | private Particle type;
18 | private boolean cancelled;
19 |
20 | public TrailDisplayEvent(String name, double displayLocation, int amount, int cooldown, float speed, int range, Particle type)
21 | {
22 | this.name = name;
23 | this.displayLocation = displayLocation;
24 | this.amount = amount;
25 | this.cooldown = cooldown;
26 | this.speed = speed;
27 | this.range = range;
28 | this.type = type;
29 | }
30 |
31 | @Override
32 | public HandlerList getHandlers()
33 | {
34 | return handlers;
35 | }
36 |
37 |
38 | public double getDisplayLocation()
39 | {
40 | return displayLocation;
41 | }
42 |
43 | public int getAmount()
44 | {
45 | return amount;
46 | }
47 |
48 | public int getCooldown()
49 | {
50 | return cooldown;
51 | }
52 |
53 | public float getSpeed()
54 | {
55 | return speed;
56 | }
57 |
58 | public int getRange()
59 | {
60 | return range;
61 | }
62 |
63 | public String getName()
64 | {
65 | return name;
66 | }
67 |
68 | public Particle getType()
69 | {
70 | return type;
71 | }
72 |
73 | public boolean isCancelled()
74 | {
75 | return cancelled;
76 | }
77 |
78 | public void setCancelled(boolean cancelled)
79 | {
80 | this.cancelled = cancelled;
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/api/TrailEnableEvent.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.api;
2 |
3 | import ca.jamiesinn.trailgui.trails.Trail;
4 | import org.bukkit.entity.Player;
5 | import org.bukkit.event.Event;
6 | import org.bukkit.event.HandlerList;
7 |
8 | import java.util.List;
9 |
10 | public class TrailEnableEvent extends Event
11 | {
12 | private static final HandlerList handlers = new HandlerList();
13 | private Trail trail;
14 | private Player player;
15 | private List trails;
16 | public TrailEnableEvent(Player player, List trails)
17 | {
18 | this.player = player;
19 | this.trails = trails;
20 |
21 | }
22 | public TrailEnableEvent(Player player, Trail trail)
23 | {
24 | this.trail = trail;
25 | this.player = player;
26 | }
27 |
28 | @Override public HandlerList getHandlers()
29 | {
30 | return handlers;
31 | }
32 |
33 | public Player getPlayer()
34 | {
35 | return player;
36 | }
37 |
38 | public Trail getTrail()
39 | {
40 | return trail;
41 | }
42 |
43 | public List getTrails()
44 | {
45 | if(trails.isEmpty())
46 | trails.add(trail);
47 | return trails;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/api/TrailGUIAPI.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.api;
2 |
3 | import ca.jamiesinn.trailgui.TrailGUI;
4 | import ca.jamiesinn.trailgui.trails.Trail;
5 | import org.bukkit.entity.Player;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | public class TrailGUIAPI
11 | {
12 | private TrailGUI plugin;
13 |
14 | public TrailGUIAPI(TrailGUI plugin)
15 | {
16 | this.plugin = plugin;
17 | }
18 |
19 |
20 | public void addTrail(String name, Player player)
21 | {
22 | List trails = new ArrayList<>(TrailGUI.trailTypes.values());
23 | trails.forEach(trail ->
24 | {
25 | if (trail.getName().equalsIgnoreCase(name))
26 | {
27 | List currentTrails = new ArrayList();
28 | if (TrailGUI.enabledTrails.containsKey(player.getUniqueId()))
29 | {
30 | currentTrails = TrailGUI.enabledTrails.get(player.getUniqueId());
31 | }
32 | if (currentTrails.contains(trail))
33 | {
34 | return;
35 | }
36 | currentTrails.add(trail);
37 | Trail.enableEvent(player, currentTrails);
38 | TrailGUI.enabledTrails.put(player.getUniqueId(), currentTrails);
39 | }
40 | });
41 | }
42 |
43 | public void removeTrail(String name, Player player)
44 | {
45 | List trails = new ArrayList<>(TrailGUI.trailTypes.values());
46 | trails.forEach(t ->
47 | {
48 | if(t.getName().equalsIgnoreCase(name))
49 | {
50 | List currentTrails = new ArrayList();
51 | if (TrailGUI.enabledTrails.containsKey(player.getUniqueId()))
52 | {
53 | currentTrails = TrailGUI.enabledTrails.get(player.getUniqueId());
54 | }
55 | currentTrails.removeIf(tr->tr==t);
56 | Trail.disableEvent(player, t);
57 | TrailGUI.enabledTrails.put(player.getUniqueId(), currentTrails);
58 | }
59 | });
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/commands/CommandTrail.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.commands;
2 |
3 | import ca.jamiesinn.trailgui.Util;
4 | import ca.jamiesinn.trailgui.TrailGUI;
5 | import ca.jamiesinn.trailgui.trails.Trail;
6 | import org.bukkit.Bukkit;
7 | import org.bukkit.ChatColor;
8 | import org.bukkit.OfflinePlayer;
9 | import org.bukkit.command.Command;
10 | import org.bukkit.command.CommandExecutor;
11 | import org.bukkit.command.CommandSender;
12 | import org.bukkit.command.TabCompleter;
13 | import org.bukkit.entity.Player;
14 |
15 | import java.util.ArrayList;
16 | import java.util.Collections;
17 | import java.util.List;
18 |
19 | public class CommandTrail implements CommandExecutor, TabCompleter
20 | {
21 | private TrailGUI trailGUI;
22 |
23 | public CommandTrail(TrailGUI trailGUI)
24 | {
25 | this.trailGUI = trailGUI;
26 | }
27 |
28 | public List onTabComplete(CommandSender sender, Command cmd, String commandLabel, String[] args)
29 | {
30 | List trailList = new ArrayList<>(TrailGUI.trailTypes.keySet());
31 | trailList.add("ClearAll");
32 | if (args.length == 1)
33 | {
34 | Collections.sort(trailList);
35 | return trailList;
36 | }
37 | return null;
38 | }
39 |
40 | private void showList(Player player)
41 | {
42 | player.sendMessage(TrailGUI.prefix + ChatColor.GREEN + "Available trails:");
43 | StringBuilder list = new StringBuilder(ChatColor.RED + "Trails: " + ChatColor.GREEN);
44 | for (Trail type : TrailGUI.trailTypes.values())
45 | {
46 | if (type.canUse(player))
47 | {
48 | list.append(type.getName()).append(", ");
49 | }
50 | }
51 | list = new StringBuilder(list.substring(0, list.length() - 2));
52 | player.sendMessage(list.toString());
53 | }
54 |
55 | public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
56 | {
57 | List trails = new ArrayList<>(TrailGUI.trailTypes.values());
58 | if (!(sender instanceof Player))
59 | {
60 | if(args.length == 2 && args[0].equalsIgnoreCase("clearall"))
61 | {
62 | OfflinePlayer player = Bukkit.getOfflinePlayer(args[1]);
63 | Util.clearTrails(player);
64 | }
65 | else
66 | sender.sendMessage("Syntax: /trail clearall ");
67 | return true;
68 | }
69 | Player player = (Player) sender;
70 | if (trailGUI.isWorldDisabled(player.getWorld().getName()))
71 | {
72 | player.sendMessage(TrailGUI.prefix + ChatColor.GREEN + "You cannot use this command in this world.");
73 | return true;
74 | }
75 |
76 | if (args.length == 0)
77 | {
78 | player.sendMessage(TrailGUI.prefix + ChatColor.GREEN + "Available commands:");
79 | player.sendMessage(ChatColor.GREEN + "/trail ");
80 | player.sendMessage(ChatColor.GREEN + "/trail ");
81 | showList(player);
82 | return true;
83 | }
84 |
85 |
86 | for (Trail trail : trails)
87 | {
88 | if (trail.onCommand(player, args))
89 | {
90 | return true;
91 | }
92 | }
93 |
94 | if (args[0].equalsIgnoreCase("clearall"))
95 | {
96 | if (!player.hasPermission("trailgui.commands.clearall") && !player.hasPermission("trailgui.*"))
97 | {
98 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.denyPermissionMessage").replaceAll("&", "\u00A7"));
99 | return false;
100 | }
101 | if (args.length == 1)
102 | {
103 | Util.clearTrails(player);
104 | player.sendMessage(this.trailGUI.getConfig().getString("ClearAll.message").replaceAll("&", "\u00A7").replaceAll("%TrailName%", "ClearAll"));
105 | return true;
106 | }
107 | if (!player.hasPermission("trailgui.commands.clearall.other") && !player.hasPermission("trailgui.*"))
108 | {
109 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.denyPermissionMessage").replaceAll("&", "\u00A7"));
110 | return true;
111 | }
112 | Player target = Bukkit.getServer().getPlayerExact(args[1]);
113 | if (target == null)
114 | {
115 | player.sendMessage(this.trailGUI.getConfig().getString("Commands.noTargetMessage").replaceAll("&", "\u00A7").replaceAll("%Target%", args[1]));
116 | return true;
117 | }
118 | if (player.getName().equals(args[1]))
119 | {
120 | player.sendMessage(this.trailGUI.getConfig().getString("Commands.targetSelfMessage").replaceAll("&", "\u00A7").replaceAll("%TrailName%", "ClearAll"));
121 | return true;
122 | }
123 | Util.clearTrails(target);
124 | target.sendMessage(this.trailGUI.getConfig().getString("ClearAll.targetMessage").replaceAll("&", "\u00A7").replaceAll("%Sender%", player.getName()));
125 | player.sendMessage(this.trailGUI.getConfig().getString("ClearAll.senderMessage").replaceAll("&", "\u00A7").replaceAll("%Target%", args[1]));
126 | return true;
127 | }
128 | else
129 | {
130 | player.sendMessage(TrailGUI.prefix + ChatColor.DARK_RED + "That's not a valid trail.");
131 | showList(player);
132 | return true;
133 | }
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/commands/CommandTrailGUI.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.commands;
2 |
3 | import ca.jamiesinn.trailgui.TrailGUI;
4 | import ca.jamiesinn.trailgui.files.Userdata;
5 | import org.bukkit.ChatColor;
6 | import org.bukkit.command.Command;
7 | import org.bukkit.command.CommandExecutor;
8 | import org.bukkit.command.CommandSender;
9 | import org.bukkit.entity.Player;
10 |
11 | public class CommandTrailGUI implements CommandExecutor
12 | {
13 | private TrailGUI trailGUI;
14 |
15 | public CommandTrailGUI(TrailGUI trailGUI)
16 | {
17 | this.trailGUI = trailGUI;
18 | }
19 |
20 |
21 | public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
22 | {
23 | if (sender instanceof Player)
24 | {
25 | Player player = (Player) sender;
26 | if (trailGUI.isWorldDisabled(player.getWorld().getName()))
27 | {
28 | player.sendMessage(TrailGUI.prefix + ChatColor.RED + "You cannot use this command in this world.");
29 | return true;
30 | }
31 | }
32 | if (args.length == 0)
33 | {
34 | sender.sendMessage(TrailGUI.prefix + ChatColor.GREEN + "Available commands:");
35 | sender.sendMessage(ChatColor.GREEN + "/trailgui reload");
36 | sender.sendMessage(ChatColor.GREEN + "/trailgui version");
37 | return true;
38 | }
39 | if (args[0].equalsIgnoreCase("reload"))
40 | {
41 | if (!sender.hasPermission("trailgui.commands.reloadconfigs") && !sender.hasPermission("trailgui.*"))
42 | {
43 | sender.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.denyPermissionMessage").replaceAll("&", "\u00A7"));
44 | return true;
45 | }
46 | Userdata.getInstance().reloadConfig();
47 | Userdata.getInstance().saveConfig();
48 |
49 | TrailGUI.getPlugin().reload();
50 |
51 | sender.sendMessage(TrailGUI.prefix + ChatColor.GREEN + "Successfully reloaded all config files.");
52 | return true;
53 | }
54 | if (args[0].equalsIgnoreCase("version"))
55 | {
56 | sender.sendMessage(TrailGUI.prefix + ChatColor.GREEN + "Version: "
57 | + this.trailGUI.getDescription().getVersion());
58 | return true;
59 | }
60 |
61 | return false;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/commands/CommandTrails.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.commands;
2 |
3 | import ca.jamiesinn.trailgui.TrailGUI;
4 | import ca.jamiesinn.trailgui.Util;
5 | import org.bukkit.ChatColor;
6 | import org.bukkit.command.Command;
7 | import org.bukkit.command.CommandExecutor;
8 | import org.bukkit.command.CommandSender;
9 | import org.bukkit.entity.Player;
10 |
11 | public class CommandTrails
12 | implements CommandExecutor
13 | {
14 | private TrailGUI trailGUI;
15 |
16 | public CommandTrails(TrailGUI trailGUI)
17 | {
18 | this.trailGUI = trailGUI;
19 | }
20 |
21 |
22 | public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
23 | {
24 | if (!(sender instanceof Player))
25 | {
26 | sender.sendMessage(TrailGUI.prefix + ChatColor.RED + "Only players can perform this command.");
27 | return true;
28 | }
29 | Player player = (Player) sender;
30 |
31 | if (trailGUI.isWorldDisabled(player.getWorld().getName()))
32 | {
33 | player.sendMessage(TrailGUI.prefix + ChatColor.GREEN + "You cannot use this command in this world.");
34 | return true;
35 | }
36 | if (!player.hasPermission("trailgui.commands.trails") && !player.hasPermission("trailgui.*"))
37 | {
38 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.denyPermissionMessage").replaceAll("&", "\u00A7"));
39 | if (TrailGUI.getPlugin().getConfig().getBoolean("closeInventoryOnDenyPermission"))
40 | {
41 | player.closeInventory();
42 | }
43 | return true;
44 | }
45 | Util.openGUI(player);
46 | return false;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/files/Userdata.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.files;
2 |
3 | import ca.jamiesinn.trailgui.TrailGUI;
4 | import org.bukkit.ChatColor;
5 | import org.bukkit.configuration.file.FileConfiguration;
6 | import org.bukkit.configuration.file.YamlConfiguration;
7 |
8 | import java.io.File;
9 | import java.io.IOException;
10 |
11 | public class Userdata
12 | {
13 | private static Userdata instance;
14 | private FileConfiguration config;
15 | private String FILENAME = "Userdata.yml";
16 | private File file;
17 |
18 |
19 | public Userdata()
20 | {
21 | instance = this;
22 | file = new File(TrailGUI.getPlugin().getDataFolder(), FILENAME);
23 | }
24 |
25 | public static Userdata getInstance()
26 | {
27 | return instance;
28 | }
29 |
30 | private void createFile()
31 | {
32 | try
33 | {
34 | file.createNewFile();
35 | } catch (Exception ex)
36 | {
37 | TrailGUI.getPlugin().getLogger().warning(ChatColor.DARK_RED + "Failed to generate the file: " + FILENAME);
38 | }
39 | }
40 |
41 | public void loadConfig()
42 | {
43 | if (!file.exists())
44 | {
45 | createFile();
46 | }
47 | config = YamlConfiguration.loadConfiguration(file);
48 | }
49 |
50 | public FileConfiguration getConfig()
51 | {
52 | return config;
53 | }
54 |
55 | public void reloadConfig()
56 | {
57 | config = YamlConfiguration.loadConfiguration(file);
58 | }
59 |
60 | public void saveConfig()
61 | {
62 | try
63 | {
64 | config.save(file);
65 | } catch (IOException ex)
66 | {
67 | TrailGUI.getPlugin().getLogger().warning(ChatColor.DARK_RED + "Could not save the file: " + FILENAME);
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/sql/SQLManager.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.sql;
2 |
3 | import ca.jamiesinn.trailgui.TrailGUI;
4 | import ca.jamiesinn.trailgui.trails.Trail;
5 |
6 | import java.sql.*;
7 | import java.util.*;
8 |
9 | public class SQLManager
10 | {
11 | private Connection connection;
12 | private String host;
13 | private int port;
14 | private String database;
15 | private String user;
16 | private String pass;
17 |
18 |
19 | private TrailGUI pl = TrailGUI.getPlugin();
20 |
21 | /**
22 | * @param host host
23 | * @param port port
24 | * @param database database
25 | * @param user user
26 | * @param pass pass
27 | * @throws SQLException exception
28 | */
29 | public SQLManager(String host, int port, String database, String user, String pass) throws SQLException
30 | {
31 | this.host = host;
32 | this.port = port;
33 | this.database = database;
34 | this.user = user;
35 | this.pass = pass;
36 |
37 | boolean res = connectToDatabase(host, port, database, user, pass);
38 | if (connection != null || !res)
39 | {
40 | createTables(connection);
41 | }
42 | }
43 |
44 | public Connection getConnection()
45 | {
46 | return connection;
47 | }
48 |
49 | private boolean connectToDatabase(String host, int port, String database, String user, String pass)
50 | {
51 | try
52 | {
53 | Class.forName("com.mysql.jdbc.Driver");
54 | }
55 | catch (ClassNotFoundException e)
56 | {
57 | e.printStackTrace();
58 | return false;
59 | }
60 | try
61 | {
62 | pl.getLogger().info("MySQL JDBC Driver Registered");
63 | connection = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database, user, pass);
64 | }
65 | catch (SQLException e)
66 | {
67 | pl.getLogger().warning("Connection Failed. Check config.");
68 | e.printStackTrace();
69 | return false;
70 | }
71 | pl.getLogger().info("Connected to MySQL Database Successfully.");
72 | return connection != null;
73 | }
74 |
75 | private void createTables(Connection connection) throws SQLException
76 | {
77 | PreparedStatement stmt;
78 | String query =
79 | "CREATE TABLE IF NOT EXISTS userdata"
80 | + "(uuid VARCHAR(64) NOT NULL UNIQUE,"
81 | + "trails VARCHAR(255));";
82 | stmt = connection.prepareStatement(query);
83 | stmt.executeUpdate();
84 | stmt.close();
85 |
86 | }
87 |
88 | public void insertUser(UUID player, List active) throws SQLException
89 | {
90 | if (!isConnAlive()) return;
91 | PreparedStatement statement;
92 | String insertRowSQL =
93 | "INSERT INTO userdata" +
94 | "(uuid, trails) VALUES" +
95 | "(?,?)" +
96 | "ON DUPLICATE KEY UPDATE trails=?";
97 | statement = connection.prepareStatement(insertRowSQL);
98 | statement.setString(1, player.toString());
99 | statement.setString(2, active.toString());
100 | statement.setString(3, active.toString());
101 | statement.executeUpdate();
102 | statement.close();
103 | }
104 |
105 | public HashMap> getTrails() throws SQLException
106 | {
107 |
108 | HashMap> result = new HashMap<>();
109 | if (!isConnAlive()) return result;
110 | PreparedStatement uuidSt;
111 | PreparedStatement trailSt;
112 | String uuidSQL = "SELECT uuid FROM userdata WHERE trails IS NOT NULL";
113 | String trailsSQL = "SELECT trails FROM userdata WHERE trails IS NOT NULL";
114 | trailSt = connection.prepareStatement(trailsSQL);
115 | uuidSt = connection.prepareStatement(uuidSQL);
116 |
117 |
118 | ResultSet uuidRS = uuidSt.executeQuery();
119 | ResultSet trailRS = trailSt.executeQuery();
120 |
121 | List players = new ArrayList<>();
122 | List> trails = new ArrayList<>();
123 | List> rawTrails = new ArrayList<>();
124 | while (uuidRS.next() && trailRS.next())
125 | {
126 | List parsed = Arrays.asList(trailRS.getString("trails").replaceAll("\\[|\\]", "").split(", "));
127 | if (parsed.isEmpty())
128 | continue;
129 | players.add(UUID.fromString(uuidRS.getString("uuid")));
130 | rawTrails.add(parsed);
131 | }
132 |
133 |
134 | for (List l : rawTrails)
135 | {
136 | List tr = new ArrayList<>();
137 | for (String s : l)
138 | {
139 | Trail t = TrailGUI.trailTypes.get(s);
140 | tr.add(t);
141 | }
142 | trails.add(tr);
143 | }
144 | for (UUID p : players)
145 | {
146 | int index = players.indexOf(p);
147 | result.put(p, trails.get(index));
148 | }
149 | return result;
150 | }
151 |
152 | public boolean disconnect()
153 | {
154 | try
155 | {
156 | if (connection != null && !connection.isClosed())
157 | connection.close();
158 | }
159 | catch (SQLException e)
160 | {
161 | e.printStackTrace();
162 | }
163 | return true;
164 | }
165 |
166 | private boolean isConnAlive() throws SQLException
167 | {
168 | if (this.connection.isValid(500))
169 | return true;
170 | else
171 | {
172 | connectToDatabase(this.host, this.port, this.database, this.user, this.pass);
173 | if (this.connection != null)
174 | {
175 | createTables(this.connection);
176 | return true;
177 | }
178 | else
179 | {
180 | this.pl.getLogger().severe("Database was not connected, and connection was not able to be re-established.");
181 | return false;
182 | }
183 | }
184 | }
185 | }
186 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/trails/BlockTrail.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.trails;
2 |
3 | import org.bukkit.Particle;
4 | import org.bukkit.block.data.BlockData;
5 | import org.bukkit.configuration.ConfigurationSection;
6 | import org.bukkit.entity.Player;
7 |
8 | public class BlockTrail extends Trail
9 | {
10 | public BlockTrail(ConfigurationSection config)
11 | {
12 | super(config);
13 | loadType(config.getString("type"));
14 | }
15 |
16 | @Override
17 | protected void loadType(String sType)
18 | {
19 | this.type = Particle.valueOf(sType);
20 | }
21 |
22 | @Override
23 | public void justDisplay(Player player)
24 | {
25 | if(!displayEvent(getName(), getDisplayLocation(), getAmount(), cooldown, getSpeed(), getRange(), type).isCancelled())
26 | {
27 | BlockData blockData = itemType.createBlockData();
28 | player.getWorld().spawnParticle(type, player.getLocation().add(0.0D, displayLocation, 0.0D), amount, 0,0,0, speed, blockData);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/trails/EffectTrail.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.trails;
2 |
3 | import org.bukkit.Effect;
4 | import org.bukkit.configuration.ConfigurationSection;
5 | import org.bukkit.entity.Player;
6 |
7 | public class EffectTrail extends Trail
8 | {
9 | private Effect effect;
10 |
11 | public EffectTrail(ConfigurationSection config)
12 | {
13 | super(config);
14 | loadType(config.getString("type"));
15 | }
16 |
17 | @Override
18 | protected void loadType(String sType)
19 | {
20 | this.effect = Effect.valueOf(sType);
21 | }
22 |
23 | @Override
24 | public void justDisplay(Player player)
25 | {
26 | if(!displayEvent(getName(), getDisplayLocation(), getAmount(), cooldown, getSpeed(), getRange(), type).isCancelled())
27 | player.getWorld().playEffect(player.getLocation(), this.effect, 1);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/trails/ItemTrail.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.trails;
2 |
3 | import org.bukkit.Particle;
4 | import org.bukkit.configuration.ConfigurationSection;
5 | import org.bukkit.entity.Player;
6 | import org.bukkit.inventory.ItemStack;
7 |
8 | public class ItemTrail extends Trail
9 | {
10 | private ItemStack data;
11 |
12 | public ItemTrail(ConfigurationSection config)
13 | {
14 | super(config);
15 | data = new ItemStack(itemType, 1);
16 | loadType(config.getString("type"));
17 | }
18 |
19 | @Override
20 | protected void loadType(String sType)
21 | {
22 | this.type = Particle.valueOf(sType);
23 | }
24 |
25 | @Override
26 | public void justDisplay(Player player)
27 | {
28 | if (type == null)
29 | {
30 | return;
31 | }
32 | if(!displayEvent(getName(), getDisplayLocation(), getAmount(), cooldown, getSpeed(), getRange(), type).isCancelled())
33 | player.getWorld().spawnParticle(type, player.getLocation().add(0.0D, displayLocation, 0.0D), amount, 0,0,0, speed, data);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/trails/NormalTrail.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.trails;
2 |
3 | import org.bukkit.Particle;
4 | import org.bukkit.configuration.ConfigurationSection;
5 | import org.bukkit.entity.Player;
6 |
7 | public class NormalTrail extends Trail
8 | {
9 | public NormalTrail(ConfigurationSection config)
10 | {
11 | super(config);
12 | loadType(config.getString("type"));
13 | }
14 |
15 | @Override
16 | protected void loadType(String sType)
17 | {
18 | this.type = Particle.valueOf(sType);
19 | }
20 |
21 | @Override
22 | public void justDisplay(Player player)
23 | {
24 | if (type == null)
25 | {
26 | return;
27 | }
28 | if(!displayEvent(getName(), getDisplayLocation(), getAmount(), cooldown, getSpeed(), getRange(), type).isCancelled())
29 | player.getWorld().spawnParticle(type, player.getLocation().add(0.0D, displayLocation, 0.0D), amount, 0, 0, 0, speed);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/trails/RedstoneTrail.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.trails;
2 |
3 | import org.bukkit.Color;
4 | import org.bukkit.Particle;
5 | import org.bukkit.configuration.ConfigurationSection;
6 | import org.bukkit.entity.Player;
7 |
8 | public class RedstoneTrail extends Trail
9 | {
10 | private Particle.DustOptions dustOptions;
11 |
12 | public RedstoneTrail(ConfigurationSection config)
13 | {
14 | super(config);
15 | Color color = config.getColor("dustColor", Color.RED);
16 | float size = (float) config.getDouble("dustSize", 1);
17 | dustOptions = new Particle.DustOptions(color, size);
18 | loadType(config.getString("type"));
19 | }
20 |
21 | @Override
22 | protected void loadType(String sType)
23 | {
24 | this.type = Particle.valueOf(sType);
25 | }
26 |
27 | @Override
28 | public void justDisplay(Player player)
29 | {
30 | if(!displayEvent(getName(), getDisplayLocation(), getAmount(), cooldown, getSpeed(), getRange(), type).isCancelled())
31 | player.getWorld().spawnParticle(type, player.getLocation().add(0.0D, displayLocation, 0.0D), amount, 0,0,0, speed, dustOptions);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/trails/SculkChargeTrail.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.trails;
2 |
3 | import org.bukkit.Particle;
4 | import org.bukkit.block.data.BlockData;
5 | import org.bukkit.configuration.ConfigurationSection;
6 | import org.bukkit.entity.Player;
7 |
8 | public class SculkChargeTrail extends Trail
9 | {
10 | public SculkChargeTrail(ConfigurationSection config)
11 | {
12 | super(config);
13 | loadType(config.getString("type"));
14 | }
15 |
16 | @Override
17 | protected void loadType(String sType)
18 | {
19 | this.type = Particle.valueOf(sType);
20 | }
21 |
22 | @Override
23 | public void justDisplay(Player player)
24 | {
25 | if(!displayEvent(getName(), getDisplayLocation(), getAmount(), cooldown, getSpeed(), getRange(), type).isCancelled())
26 | player.getWorld().spawnParticle(type, player.getLocation().add(0.0D, displayLocation, 0.0D), amount, 0,0,0, speed, (float) 0);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/trails/ShriekTrail.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.trails;
2 |
3 | import org.bukkit.Particle;
4 | import org.bukkit.configuration.ConfigurationSection;
5 | import org.bukkit.entity.Player;
6 |
7 | public class ShriekTrail extends Trail
8 | {
9 | public ShriekTrail(ConfigurationSection config)
10 | {
11 | super(config);
12 | loadType(config.getString("type"));
13 | }
14 |
15 | @Override
16 | protected void loadType(String sType)
17 | {
18 | this.type = Particle.valueOf(sType);
19 | }
20 |
21 | @Override
22 | public void justDisplay(Player player)
23 | {
24 | if(!displayEvent(getName(), getDisplayLocation(), getAmount(), cooldown, getSpeed(), getRange(), type).isCancelled())
25 | player.getWorld().spawnParticle(type, player.getLocation().add(0.0D, displayLocation, 0.0D), amount, 0,0,0, speed, 0);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/ca/jamiesinn/trailgui/trails/Trail.java:
--------------------------------------------------------------------------------
1 | package ca.jamiesinn.trailgui.trails;
2 |
3 | import ca.jamiesinn.trailgui.TrailGUI;
4 | import ca.jamiesinn.trailgui.Util;
5 | import ca.jamiesinn.trailgui.api.TrailDisableEvent;
6 | import ca.jamiesinn.trailgui.api.TrailDisplayEvent;
7 | import ca.jamiesinn.trailgui.api.TrailEnableEvent;
8 | import org.bukkit.Bukkit;
9 | import org.bukkit.ChatColor;
10 | import org.bukkit.Material;
11 | import org.bukkit.Particle;
12 | import org.bukkit.configuration.ConfigurationSection;
13 | import org.bukkit.enchantments.Enchantment;
14 | import org.bukkit.entity.Player;
15 | import org.bukkit.inventory.ItemFlag;
16 | import org.bukkit.inventory.ItemStack;
17 | import org.bukkit.inventory.meta.ItemMeta;
18 | import org.bukkit.potion.PotionEffectType;
19 |
20 | import java.util.*;
21 |
22 | public abstract class Trail
23 | {
24 | private String name;
25 | double displayLocation;
26 | int amount;
27 | int cooldown;
28 | float speed;
29 | private int range;
30 | private int order;
31 | Material itemType;
32 | private String itemName;
33 | private boolean loreEnabled;
34 | private boolean glowEnabled;
35 | private List lore;
36 | Particle type;
37 | private Map cooldownMap = new HashMap<>();
38 |
39 | public Trail(ConfigurationSection config)
40 | {
41 | this.name = config.getName();
42 | this.displayLocation = config.getDouble("displayLocation");
43 | this.amount = config.getInt("amount");
44 | this.speed = (float) config.getDouble("speed");
45 | this.range = config.getInt("range");
46 | this.cooldown = config.getInt("cooldown", 0);
47 | this.order = config.getInt("order");
48 | this.itemType = Material.valueOf(config.getString("itemType").toUpperCase());
49 | this.itemName = config.getString("itemName", "").replace("&", "\u00a7");
50 | this.loreEnabled = config.getBoolean("loreEnabled", false);
51 | this.glowEnabled = config.getBoolean("glowEnabled", true);
52 | this.lore = new ArrayList<>();
53 |
54 | if (isLoreEnabled())
55 | for (String s : config.getStringList("lore"))
56 | {
57 | lore.add(ChatColor.translateAlternateColorCodes('&', s));
58 | }
59 | }
60 |
61 | protected abstract void loadType(String sType);
62 |
63 | double getDisplayLocation()
64 | {
65 | return displayLocation;
66 | }
67 |
68 | int getAmount()
69 | {
70 | return amount;
71 | }
72 |
73 | float getSpeed()
74 | {
75 | return speed;
76 | }
77 |
78 | int getRange()
79 | {
80 | return range;
81 | }
82 |
83 | public int getOrder()
84 | {
85 | return order;
86 | }
87 |
88 | public Material getItemType()
89 | {
90 | return itemType;
91 | }
92 |
93 | public String getItemName()
94 | {
95 | return itemName;
96 | }
97 |
98 | public boolean isLoreEnabled()
99 | {
100 | return loreEnabled;
101 | }
102 |
103 | public List getLore()
104 | {
105 | return lore;
106 | }
107 |
108 | public String getName()
109 | {
110 | return name;
111 | }
112 |
113 | public boolean canUse(Player player)
114 | {
115 | return player.hasPermission("trailgui.trails." + getName()) || player.hasPermission("trailgui.trail." + getName())
116 | || player.hasPermission("trailgui.trail.*") || player.hasPermission("trailgui.*");
117 | }
118 |
119 | public boolean canUseCommand(Player player)
120 | {
121 | return player.hasPermission("trailgui.trails." + getName()) || player.hasPermission("trailgui.commands." + getName())
122 | || player.hasPermission("trailgui.*");
123 | }
124 |
125 | public boolean canUseInventory(Player player)
126 | {
127 | return player.hasPermission("trailgui.inventory." + getName()) || player.hasPermission("trailgui.trail.*") || player.hasPermission("trailgui.*");
128 | }
129 |
130 | public boolean canUseOnOthers(Player player)
131 | {
132 | return player.hasPermission("trailgui.trails." + getName() + ".other") || player.hasPermission("trailgui.commands.other." + getName())
133 | || player.hasPermission("trailgui.*");
134 | }
135 |
136 | // Returns true if you are at your limit via permissions
137 | public boolean getPermLimit(Player player)
138 | {
139 | List currentTrails = new ArrayList();
140 | int max = 0;
141 | for (int i = 0; i <= TrailGUI.trailTypes.size(); i++)
142 | if (player.hasPermission("trailgui.trailmax." + i))
143 | max = i;
144 | if (max == 0)
145 | return false;
146 |
147 | if (TrailGUI.enabledTrails.containsKey(player.getUniqueId()))
148 | currentTrails = TrailGUI.enabledTrails.get(player.getUniqueId());
149 | return currentTrails.size() >= max;
150 | }
151 |
152 | public ItemStack getItem()
153 | {
154 | ItemStack item = new ItemStack(itemType, 1);
155 | ItemMeta meta = item.getItemMeta();
156 | meta.setDisplayName(itemName);
157 | if (loreEnabled)
158 | {
159 | meta.setLore(lore);
160 | }
161 | meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
162 | item.setItemMeta(meta);
163 | return item;
164 | }
165 |
166 | public void display(Player player)
167 | {
168 | if (player.hasPotionEffect(PotionEffectType.INVISIBILITY))
169 | return;
170 |
171 | if (cooldown <= 0)
172 | {
173 | justDisplay(player);
174 | }
175 | else
176 | {
177 | if (!cooldownMap.containsKey(player.getUniqueId()))
178 | {
179 | justDisplay(player);
180 | cooldownMap.put(player.getUniqueId(), System.currentTimeMillis());
181 | }
182 | else if (System.currentTimeMillis() - cooldownMap.get(player.getUniqueId()) > cooldown)
183 | {
184 | justDisplay(player);
185 | cooldownMap.put(player.getUniqueId(), System.currentTimeMillis());
186 | }
187 | }
188 | }
189 |
190 | public abstract void justDisplay(Player player);
191 |
192 | public boolean onInventoryClick(Player player, ItemStack currentItem)
193 | {
194 | if(currentItem.containsEnchantment(Enchantment.LURE)) {
195 | ItemMeta meta = currentItem.getItemMeta();
196 | meta.removeEnchant(Enchantment.LURE);
197 | meta.removeItemFlags(ItemFlag.HIDE_ENCHANTS);
198 | currentItem.setItemMeta(meta);
199 | }
200 |
201 | if (currentItem.equals(this.getItem()))
202 | {
203 | List currentTrails = new ArrayList();
204 |
205 | if (TrailGUI.enabledTrails.containsKey(player.getUniqueId()))
206 | {
207 | currentTrails = TrailGUI.enabledTrails.get(player.getUniqueId());
208 | }
209 |
210 | if (!canUseInventory(player))
211 | {
212 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("GUI.denyPermissionMessage").replaceAll("&", "\u00A7"));
213 | if (TrailGUI.getPlugin().getConfig().getBoolean("closeInventoryOnDenyPermission"))
214 | {
215 | player.closeInventory();
216 | }
217 | return true;
218 | }
219 | if (currentTrails.contains(this))
220 | {
221 | if (TrailGUI.oneTrailAtATime)
222 | {
223 | Util.clearTrails(player);
224 | }
225 |
226 | currentTrails.remove(this);
227 | disableEvent(player, this);
228 | TrailGUI.enabledTrails.put(player.getUniqueId(), currentTrails);
229 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("GUI.removeTrailMessage").replaceAll("&", "\u00A7").replaceAll("%TrailName%", this.getName()));
230 | if (TrailGUI.getPlugin().getConfig().getBoolean("GUI.closeInventoryAferSelect"))
231 | {
232 | player.closeInventory();
233 | }
234 | return true;
235 | }
236 | else
237 | {
238 | if (TrailGUI.oneTrailAtATime)
239 | {
240 | Util.clearTrails(player);
241 | }
242 | if ((TrailGUI.maxTrails < currentTrails.size() && TrailGUI.maxTrails != 0) || getPermLimit(player))
243 | {
244 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.tooManyTrailsMessage").replaceAll("&", "\u00A7").replaceAll("%TrailName%", this.name));
245 | return true;
246 | }
247 | currentTrails.add(this);
248 | enableEvent(player, this);
249 | TrailGUI.enabledTrails.put(player.getUniqueId(), currentTrails);
250 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("GUI.selectTrailMessage").replaceAll("&", "\u00A7").replaceAll("%TrailName%", this.getName()));
251 | if (TrailGUI.getPlugin().getConfig().getBoolean("GUI.closeInventoryAferSelect"))
252 | {
253 | player.closeInventory();
254 | }
255 | return true;
256 | }
257 |
258 | }
259 | return false;
260 | }
261 |
262 | public boolean onCommand(Player player, String[] args)
263 | {
264 | if (args[0].equalsIgnoreCase(getName()))
265 | {
266 | if (!canUseCommand(player))
267 | {
268 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.denyPermissionMessage").replaceAll("&", "\u00A7"));
269 | return false;
270 | }
271 |
272 | if (args.length == 1)
273 | {
274 | List currentTrails = new ArrayList();
275 | if (TrailGUI.enabledTrails.containsKey(player.getUniqueId()))
276 | {
277 | currentTrails = TrailGUI.enabledTrails.get(player.getUniqueId());
278 | }
279 | if (currentTrails.contains(this))
280 | {
281 | if (TrailGUI.oneTrailAtATime)
282 | {
283 | Util.clearTrails(player);
284 | }
285 | currentTrails.remove(this);
286 | TrailGUI.enabledTrails.put(player.getUniqueId(), currentTrails);
287 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.removeTrailMessage").replaceAll("&", "\u00A7").replaceAll("%TrailName%", this.name));
288 | return true;
289 | }
290 | else
291 | {
292 | if (TrailGUI.oneTrailAtATime)
293 | {
294 | Util.clearTrails(player);
295 | }
296 | if ((TrailGUI.maxTrails < currentTrails.size() && TrailGUI.maxTrails != 0) || getPermLimit(player))
297 | {
298 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.tooManyTrailsMessage").replaceAll("&", "\u00A7").replaceAll("%TrailName%", this.name));
299 | return true;
300 | }
301 | currentTrails.add(this);
302 | enableEvent(player, this);
303 | TrailGUI.enabledTrails.put(player.getUniqueId(), currentTrails);
304 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.selectTrailMessage").replaceAll("&", "\u00A7").replaceAll("%TrailName%", this.name));
305 | return true;
306 | }
307 | }
308 |
309 |
310 | if (canUseOnOthers(player))
311 | {
312 | Player target = Bukkit.getServer().getPlayerExact(args[1]);
313 | if (target == null)
314 | {
315 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.noTargetMessage").replaceAll("&", "\u00A7").replaceAll("%Target%", args[1]));
316 | return true;
317 | }
318 | if (player.getName().equals(args[1]))
319 | {
320 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.targetSelfMessage").replaceAll("&", "\u00A7").replaceAll("%TrailName%", this.name));
321 | return true;
322 | }
323 |
324 | List currentTrails = new ArrayList();
325 | if (TrailGUI.enabledTrails.containsKey(target.getUniqueId()))
326 | {
327 | currentTrails = TrailGUI.enabledTrails.get(target.getUniqueId());
328 | }
329 | if (currentTrails.contains(this))
330 | {
331 | if (TrailGUI.oneTrailAtATime)
332 | {
333 | Util.clearTrails(target);
334 | }
335 | currentTrails.remove(this);
336 | TrailGUI.enabledTrails.put(target.getUniqueId(), currentTrails);
337 |
338 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.removeTrailSenderMessage").replaceAll("&", "\u00A7").replaceAll("%Target%", args[1]));
339 | target.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.removeTrailTargetMessage").replaceAll("&", "\u00A7").replaceAll("%TrailName%", this.name));
340 | return true;
341 | }
342 | else
343 | {
344 | if (TrailGUI.oneTrailAtATime)
345 | {
346 | Util.clearTrails(target);
347 | }
348 | if ((TrailGUI.maxTrails < currentTrails.size() && TrailGUI.maxTrails != 0) || getPermLimit(target))
349 | {
350 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.tooManyTrailsMessage").replaceAll("&", "\u00A7").replaceAll("%TrailName%", this.name));
351 | return true;
352 | }
353 | currentTrails.add(this);
354 | TrailGUI.enabledTrails.put(target.getUniqueId(), currentTrails);
355 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.selectTrailSenderMessage").replaceAll("&", "\u00A7").replaceAll("%TrailName%", this.name).replaceAll("%Target%", args[1]));
356 | target.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.selectTrailTargetMessage").replaceAll("&", "\u00A7").replaceAll("%TrailName%", this.name));
357 | return true;
358 | }
359 | }
360 | else
361 | {
362 | player.sendMessage(TrailGUI.getPlugin().getConfig().getString("Commands.denyPermissionMessage").replaceAll("&", "\u00A7"));
363 | return true;
364 | }
365 |
366 | }
367 | return false;
368 | }
369 |
370 | TrailDisplayEvent displayEvent(String name, double location, int amount, int cooldown, float speed, int range, Particle type)
371 | {
372 | TrailDisplayEvent event = new TrailDisplayEvent(name,
373 | location, amount, cooldown, speed, range, type);
374 | TrailGUI.getPlugin().getServer().getPluginManager().callEvent(event);
375 | return event;
376 | }
377 |
378 | private static void enableEvent(Player player, Trail trail)
379 | {
380 | TrailEnableEvent event = new TrailEnableEvent(player, trail);
381 | TrailGUI.getPlugin().getServer().getPluginManager().callEvent(event);
382 | }
383 |
384 | public static void enableEvent(Player player, List trails)
385 | {
386 | TrailEnableEvent event = new TrailEnableEvent(player, trails);
387 | TrailGUI.getPlugin().getServer().getPluginManager().callEvent(event);
388 | }
389 |
390 | public static void disableEvent(Player player, Trail trail)
391 | {
392 | TrailDisableEvent event = new TrailDisableEvent(player, trail);
393 | TrailGUI.getPlugin().getServer().getPluginManager().callEvent(event);
394 | }
395 |
396 | public static void disableEvent(Player player, List trails)
397 | {
398 | TrailDisableEvent event = new TrailDisableEvent(player, trails);
399 | TrailGUI.getPlugin().getServer().getPluginManager().callEvent(event);
400 | }
401 |
402 | public boolean isGlowEnabled()
403 | {
404 | return glowEnabled;
405 | }
406 |
407 | public Particle getType()
408 | {
409 | return type;
410 | }
411 | }
412 |
--------------------------------------------------------------------------------
/src/main/resources/config.yml:
--------------------------------------------------------------------------------
1 | ############################################################
2 | # +------------------------------------------------------+ #
3 | # | Configuration: TrailGUI | #
4 | # +------------------------------------------------------+ #
5 | ############################################################
6 | # Don't touch this.
7 | configVersion: 5
8 |
9 | #The name of the GUI on page one. Do not use colour codes as it will break the inventory system
10 | inventoryName: "TrailGUI"
11 | #Show how many pages there are, Do not set to false unless there is only 1 page of trails, it will cause
12 | # errors otherwise.
13 | showPages: true
14 | #The prefix in game. Make sure to edit the messages too
15 | prefix: "&8[&cTrailGUI&8] "
16 |
17 | #Use MySQL for a common database instead of a local userdata. Primarily used for networks.
18 | mysql: false
19 |
20 | # Connection details to database if above is true
21 | mysql-conn:
22 | host: localhost
23 | user: user
24 | pass: pass
25 | database: database
26 | port: 3306
27 |
28 | #Whether or not the inventory will close if the player doesn't have permission.
29 | closeInventoryOnDenyPermission: false
30 |
31 | #Clear trails on logout.
32 | clearTrailsOnDisconnect: false
33 |
34 | #The worlds this plugin is disabled in. (You can add as many worlds as you want)
35 | disabledWorlds:
36 | - ExampleWorld
37 |
38 | #Whether or not the trail of the player hit will get removed. (Only when getting attacked by another player)
39 | removeTrailOnPlayerHit: false
40 |
41 | #Whether or not the trail will be displayed when spinning (The cursor). This is recommended strongly to decrease lag.
42 | disabledWhenSpinning: true
43 |
44 | #Whether or not the player can only have one trail at a time.
45 | oneTrailAtATime: false
46 |
47 | #Max number of concurrently equipped trails - Only used if the above is false - use 0 for no limit
48 | maxActiveTrails: 0
49 |
50 | ############################################################
51 | # +------------------------------------------------------+ #
52 | # | Configuration: GUI | #
53 | # +------------------------------------------------------+ #
54 | ############################################################
55 |
56 | GUI:
57 | #Whether or not the inventory will close after a trail has been selected.
58 | closeInventoryAferSelect: false
59 | #The message sent if the player does not have permission.
60 | denyPermissionMessage: "&4You do not have permission to do this."
61 | #The message sent when selecting a trail.
62 | selectTrailMessage: "&8[&CTrailGUI&8] &ASelected the &L%TrailName% &Atrail."
63 | #The message sent when removing your own trail.
64 | removeTrailMessage: "&8[&CTrailGUI&8] &ARemoved the &L%TrailName% &Atrail."
65 | #The item display name for no permissions.
66 | noPermMessage: "&4No Permissions"
67 |
68 | ############################################################
69 | # +------------------------------------------------------+ #
70 | # | Configuration: commands | #
71 | # +------------------------------------------------------+ #
72 | ############################################################
73 |
74 | Commands:
75 | #The message sent if the player does not have permission.
76 | denyPermissionMessage: "&4You do not have permission to use this command."
77 | #The message sent when selecting a trail.
78 | selectTrailMessage: "&8[&CTrailGUI&8] &ASelected the &L%TrailName% &Atrail."
79 | #The message sent when removing your own trail.
80 | removeTrailMessage: "&8[&CTrailGUI&8] &ARemoved the &L%TrailName% &Atrail."
81 | #The message sent when the target is offline. (Use %Target% to specify the target player)
82 | noTargetMessage: "&8[&CTrailGUI&8] &AThe player &L%Target% &Acould not be found."
83 | #The message sent when the target is the player himself.
84 | targetSelfMessage: "&8[&CTrailGUI&8] &APlease use /Trail %TrailName% instead."
85 | #The message sent to the sender when giving another player a trail. (Use %Target% to specify the target player)
86 | selectTrailSenderMessage: "&8[&CTrailGUI&8] &A&L%Target% &Anow has the %TrailName% trail."
87 | #The message sent to the target when receiving a trail. (Use %Sender% to specify the sender)
88 | selectTrailTargetMessage: "&8[&CTrailGUI&8] &AYou now have the &L%TrailName% &Atrail."
89 | #The message sent to the sender when getting their trail removed. (Use %Target% to specify the target player)
90 | removeTrailSenderMessage: "&8[&CTrailGUI&8] &A&L%Target% &Ano longer has the %TrailName% trail."
91 | #The message sent to the target when removing a players trail. (Use %Target% to specify the target player)
92 | tooManyTrailsMessage: "&8[&CTrailGUI&8] Too many trails active. Cannot activate trail."
93 |
94 |
95 | ############################################################
96 | # +------------------------------------------------------+ #
97 | # | Configuration: Trails | #
98 | # +------------------------------------------------------+ #
99 | ############################################################
100 | trails:
101 | AngryVillager:
102 | type: VILLAGER_ANGRY
103 | #The location the particle effect is displayed.
104 | displayLocation: 1.5
105 | #The amount of particles displayed.
106 | amount: 1
107 | #The speed the particles are displayed.
108 | speed: 0
109 | #The distance before unrendering the particle effect.
110 | range: 20
111 | #The cooldown time before the particle effect is displayed again. (20 ticks = 1 second)
112 | cooldown: 250
113 | #The inventory slot the item is put in.
114 | order: 0
115 | #The items type.
116 | itemType: emerald
117 | #The items name.
118 | itemName: "&6AngryVillager"
119 | #Whether or not the lore is enabled.
120 | loreEnabled: false
121 | glowEnabled: true
122 | lore:
123 | - "Example"
124 | - "Line2"
125 | - "Line3"
126 | Cloud:
127 | type: CLOUD
128 | #The location the particle effect is displayed.
129 | displayLocation: 0.5
130 | #The amount of particles displayed.
131 | amount: 4
132 | #The distance before unrendering the particle effect.
133 | range: 20
134 | #The inventory slot the item is put in.
135 | order: 1
136 | #The items type.
137 | itemType: COBWEB
138 | #The items name.
139 | itemName: "&6Cloud"
140 | #Whether or not the lore is enabled.
141 | loreEnabled: false
142 | glowEnabled: true
143 | lore:
144 | - "Example"
145 | - "Line2"
146 | - "Line3"
147 | Criticals:
148 | type: CRIT
149 | #The location the particle effect is displayed.
150 | displayLocation: 0.5
151 | #The amount of particles displayed.
152 | amount: 2
153 | #The speed the particles are displayed.
154 | speed: 1
155 | #The distance before unrendering the particle effect.
156 | range: 20
157 | #The inventory slot the item is put in.
158 | order: 2
159 | #The items type.
160 | itemType: iron_sword
161 | #The items name.
162 | itemName: "&6Criticals"
163 | #Whether or not the lore is enabled.
164 | loreEnabled: false
165 | glowEnabled: true
166 | lore:
167 | - "Example"
168 | - "Line2"
169 | - "Line3"
170 | DripLava:
171 | type: DRIP_LAVA
172 | #The location the particle effect is displayed.
173 | displayLocation: 0.2
174 | #The amount of particles displayed.
175 | amount: 5
176 | #The speed the particles are displayed.
177 | speed: 0
178 | #The distance before unrendering the particle effect.
179 | range: 20
180 | #The inventory slot the item is put in.
181 | order: 3
182 | #The items type.
183 | itemType: lava_bucket
184 | #The items name.
185 | itemName: "&6DripLava"
186 | #Whether or not the lore is enabled.
187 | loreEnabled: false
188 | glowEnabled: true
189 | lore:
190 | - "Example"
191 | - "Line2"
192 | - "Line3"
193 | DripWater:
194 | type: DRIP_WATER
195 | #The location the particle effect is displayed.
196 | displayLocation: 0.2
197 | #The amount of particles displayed.
198 | amount: 5
199 | #The speed the particles are displayed.
200 | speed: 0
201 | #The distance before unrendering the particle effect.
202 | range: 20
203 | #The inventory slot the item is put in.
204 | order: 4
205 | #The items type.
206 | itemType: water_bucket
207 | #The items name.
208 | itemName: "&6DripWater"
209 | #Whether or not the lore is enabled.
210 | loreEnabled: false
211 | glowEnabled: true
212 | lore:
213 | - "Example"
214 | - "Line2"
215 | - "Line3"
216 | Enchantment:
217 | type: ENCHANTMENT_TABLE
218 | #The location the particle effect is displayed.
219 | displayLocation: 0.2
220 | #The amount of particles displayed.
221 | amount: 10
222 | #The speed the particles are displayed.
223 | speed: 0.5
224 | #The distance before unrendering the particle effect.
225 | range: 20
226 | #The inventory slot the item is put in.
227 | order: 5
228 | #The items type.
229 | itemType: enchanting_table
230 | #The items name.
231 | itemName: "&6Enchantment"
232 | #Whether or not the lore is enabled.
233 | loreEnabled: false
234 | glowEnabled: true
235 | lore:
236 | - "Example"
237 | - "Line2"
238 | - "Line3"
239 | Spark:
240 | type: FIREWORKS_SPARK
241 | #The location the particle effect is displayed.
242 | displayLocation: 0.2
243 | #The amount of particles displayed.
244 | amount: 5
245 | #The speed the particles are displayed.
246 | speed: 0
247 | #The distance before unrendering the particle effect.
248 | range: 20
249 | #The inventory slot the item is put in.
250 | order: 6
251 | #The items type.
252 | itemType: firework_star
253 | #The items name.
254 | itemName: "&6Spark"
255 | #Whether or not the lore is enabled.
256 | loreEnabled: false
257 | glowEnabled: true
258 | lore:
259 | - "Example"
260 | - "Line2"
261 | - "Line3"
262 | Flame:
263 | type: FLAME
264 | #The location the particle effect is displayed.
265 | displayLocation: 0.2
266 | #The amount of particles displayed.
267 | amount: 5
268 | #The speed the particles are displayed.
269 | speed: 0
270 | #The distance before unrendering the particle effect.
271 | range: 20
272 | #The inventory slot the item is put in.
273 | order: 7
274 | #The items type.
275 | itemType: fire_charge
276 | #The items name.
277 | itemName: "&6Flame"
278 | #Whether or not the lore is enabled.
279 | loreEnabled: false
280 | glowEnabled: true
281 | lore:
282 | - "Example"
283 | - "Line2"
284 | - "Line3"
285 | HappyVillager:
286 | type: VILLAGER_HAPPY
287 | #The location the particle effect is displayed.
288 | displayLocation: 0.2
289 | #The amount of particles displayed.
290 | amount: 5
291 | #The speed the particles are displayed.
292 | speed: 0
293 | #The distance before unrendering the particle effect.
294 | range: 20
295 | #The inventory slot the item is put in.
296 | order: 8
297 | #The items type.
298 | itemType: book
299 | #The items name.
300 | itemName: "&6HappyVillager"
301 | #Whether or not the lore is enabled.
302 | loreEnabled: false
303 | glowEnabled: true
304 | lore:
305 | - "Example"
306 | - "Line2"
307 | - "Line3"
308 | InstantSpell:
309 | type: SPELL_INSTANT
310 | #The location the particle effect is displayed.
311 | displayLocation: 0.2
312 | #The amount of particles displayed.
313 | amount: 5
314 | #The speed the particles are displayed.
315 | speed: 0
316 | #The distance before unrendering the particle effect.
317 | range: 20
318 | #The inventory slot the item is put in.
319 | order: 9
320 | #The items type.
321 | itemType: glass_bottle
322 | #The items name.
323 | itemName: "&6InstantSpell"
324 | #Whether or not the lore is enabled.
325 | loreEnabled: false
326 | glowEnabled: true
327 | lore:
328 | - "Example"
329 | - "Line2"
330 | - "Line3"
331 | LargeSmoke:
332 | type: SMOKE_LARGE
333 | #The location the particle effect is displayed.
334 | displayLocation: 0.2
335 | #The amount of particles displayed.
336 | amount: 3
337 | #The speed the particles are displayed.
338 | speed: 0
339 | #The distance before unrendering the particle effect.
340 | range: 20
341 | #The inventory slot the item is put in.
342 | order: 10
343 | #The items type.
344 | itemType: furnace
345 | #The items name.
346 | itemName: "&6LargeSmoke"
347 | #Whether or not the lore is enabled.
348 | loreEnabled: false
349 | glowEnabled: true
350 | lore:
351 | - "Example"
352 | - "Line2"
353 | - "Line3"
354 | Lava:
355 | type: LAVA
356 | #The location the particle effect is displayed.
357 | displayLocation: 0.2
358 | #The amount of particles displayed.
359 | amount: 2
360 | #The speed the particles are displayed.
361 | speed: 0
362 | #The distance before unrendering the particle effect.
363 | range: 20
364 | #The inventory slot the item is put in.
365 | order: 11
366 | #The items type.
367 | itemType: flint_and_steel
368 | #The items name.
369 | itemName: "&6Lava"
370 | #Whether or not the lore is enabled.
371 | loreEnabled: false
372 | glowEnabled: true
373 | lore:
374 | - "Example"
375 | - "Line2"
376 | - "Line3"
377 | MagicCrit:
378 | type: CRIT_MAGIC
379 | #The location the particle effect is displayed.
380 | displayLocation: 0.2
381 | #The amount of particles displayed.
382 | amount: 2
383 | #The speed the particles are displayed.
384 | speed: 1
385 | #The distance before unrendering the particle effect.
386 | range: 20
387 | #The inventory slot the item is put in.
388 | order: 12
389 | #The items type.
390 | itemType: GLASS_BOTTLE
391 | #The items name.
392 | itemName: "&6MagicCrit"
393 | #Whether or not the lore is enabled.
394 | loreEnabled: false
395 | glowEnabled: true
396 | lore:
397 | - "Example"
398 | - "Line2"
399 | - "Line3"
400 | MobSpell:
401 | type: SPELL_MOB
402 | #The location the particle effect is displayed.
403 | displayLocation: 0.2
404 | #The amount of particles displayed.
405 | amount: 3
406 | #The speed the particles are displayed.
407 | speed: 1
408 | #The distance before unrendering the particle effect.
409 | range: 20
410 | #The inventory slot the item is put in.
411 | order: 13
412 | #The items type.
413 | itemType: blaze_rod
414 | #The items name.
415 | itemName: "&6MobSpell"
416 | #Whether or not the lore is enabled.
417 | loreEnabled: false
418 | glowEnabled: true
419 | lore:
420 | - "Example"
421 | - "Line2"
422 | - "Line3"
423 | MobSpellAmbient:
424 | type: SPELL_MOB_AMBIENT
425 | #The location the particle effect is displayed.
426 | displayLocation: 0.2
427 | #The amount of particles displayed.
428 | amount: 3
429 | #The speed the particles are displayed.
430 | speed: 1
431 | #The distance before unrendering the particle effect.
432 | range: 20
433 | #The inventory slot the item is put in.
434 | order: 14
435 | #The items type.
436 | itemType: blaze_rod
437 | #The items name.
438 | itemName: "&6MobSpellAmbient"
439 | #Whether or not the lore is enabled.
440 | loreEnabled: false
441 | glowEnabled: true
442 | lore:
443 | - "Example"
444 | - "Line2"
445 | - "Line3"
446 | Note:
447 | type: NOTE
448 | #The location the particle effect is displayed.
449 | displayLocation: 2.0
450 | #The amount of particles displayed.
451 | amount: 1
452 | #The speed the particles are displayed.
453 | speed: 1
454 | #The distance before unrendering the particle effect.
455 | range: 20
456 | #The cooldown time before the particle effect is displayed again. (20 ticks = 1 second)
457 | cooldown: 100
458 | #The inventory slot the item is put in.
459 | order: 15
460 | #The items type.
461 | itemType: note_block
462 | #The items name.
463 | itemName: "&6Note"
464 | #Whether or not the lore is enabled.
465 | loreEnabled: false
466 | glowEnabled: true
467 | lore:
468 | - "Example"
469 | - "Line2"
470 | - "Line3"
471 | Portal:
472 | type: PORTAL
473 | #The location the particle effect is displayed.
474 | displayLocation: 0.2
475 | #The amount of particles displayed.
476 | amount: 25
477 | #The speed the particles are displayed.
478 | speed: 0.2
479 | #The distance before unrendering the particle effect.
480 | range: 20
481 | #The inventory slot the item is put in.
482 | order: 16
483 | #The items type.
484 | itemType: obsidian
485 | #The items name.
486 | itemName: "&6Portal"
487 | #Whether or not the lore is enabled.
488 | loreEnabled: false
489 | glowEnabled: true
490 | lore:
491 | - "Example"
492 | - "Line2"
493 | - "Line3"
494 | RedDust:
495 | type: REDSTONE
496 | #The location the particle effect is displayed.
497 | displayLocation: 0.2
498 | #The amount of particles displayed.
499 | amount: 5
500 | #The speed the particles are displayed.
501 | speed: 0
502 | #The distance before unrendering the particle effect.
503 | range: 20
504 | #The inventory slot the item is put in.
505 | order: 17
506 | #The items type.
507 | itemType: redstone
508 | #Color of the dust.
509 | dustColor:
510 | ==: Color
511 | RED: 0xFF
512 | GREEN: 0x00
513 | BLUE: 0x00
514 | #Size of the dust.
515 | dustSize: 1
516 | #The items name.
517 | itemName: "&6RedDust"
518 | #Whether or not the lore is enabled.
519 | loreEnabled: false
520 | glowEnabled: true
521 | lore:
522 | - "Example"
523 | - "Line2"
524 | - "Line3"
525 | ColoredRedDust:
526 | type: REDSTONE
527 | #The location the particle effect is displayed.
528 | displayLocation: 0.2
529 | #The amount of particles displayed.
530 | amount: 5
531 | #The speed the particles are displayed.
532 | speed: 1
533 | #The distance before unrendering the particle effect.
534 | range: 20
535 | #The inventory slot the item is put in.
536 | order: 18
537 | #The items type.
538 | itemType: glowstone_dust
539 | #Color of the dust.
540 | dustColor:
541 | ==: Color
542 | RED: 0xFF
543 | GREEN: 0xA5
544 | BLUE: 0x00
545 | #Size of the dust.
546 | dustSize: 1
547 | #The items name.
548 | itemName: "&6ColoredRedDust"
549 | #Whether or not the lore is enabled.
550 | loreEnabled: false
551 | glowEnabled: true
552 | lore:
553 | - "Example"
554 | - "Line2"
555 | - "Line3"
556 | Slime:
557 | type: SLIME
558 | #The location the particle effect is displayed.
559 | displayLocation: 0.2
560 | #The amount of particles displayed.
561 | amount: 5
562 | #The speed the particles are displayed.
563 | speed: 0
564 | #The distance before unrendering the particle effect.
565 | range: 20
566 | #The inventory slot the item is put in.
567 | order: 19
568 | #The items type.
569 | itemType: slime_ball
570 | #The items name.
571 | itemName: "&6Slime"
572 | #Whether or not the lore is enabled.
573 | loreEnabled: false
574 | glowEnabled: true
575 | lore:
576 | - "Example"
577 | - "Line2"
578 | - "Line3"
579 | SnowShovel:
580 | type: SNOW_SHOVEL
581 | #The location the particle effect is displayed.
582 | displayLocation: 0.2
583 | #The amount of particles displayed.
584 | amount: 5
585 | #The speed the particles are displayed.
586 | speed: 0
587 | #The distance before unrendering the particle effect.
588 | range: 20
589 | #The inventory slot the item is put in.
590 | order: 20
591 | #The items type.
592 | itemType: diamond_shovel
593 | #The items name.
594 | itemName: "&6SnowShovel"
595 | #Whether or not the lore is enabled.
596 | loreEnabled: false
597 | glowEnabled: true
598 | lore:
599 | - "Example"
600 | - "Line2"
601 | - "Line3"
602 | SnowballPoof:
603 | type: SNOWBALL
604 | #The location the particle effect is displayed.
605 | displayLocation: 0.2
606 | #The amount of particles displayed.
607 | amount: 5
608 | #The speed the particles are displayed.
609 | speed: 0
610 | #The distance before unrendering the particle effect.
611 | range: 20
612 | #The inventory slot the item is put in.
613 | order: 21
614 | #The items type.
615 | itemType: snowball
616 | #The items name.
617 | itemName: "&6SnowballPoof"
618 | #Whether or not the lore is enabled.
619 | loreEnabled: false
620 | glowEnabled: true
621 | lore:
622 | - "Example"
623 | - "Line2"
624 | - "Line3"
625 | Spell:
626 | type: SPELL
627 | #The location the particle effect is displayed.
628 | displayLocation: 0.2
629 | #The amount of particles displayed.
630 | amount: 5
631 | #The speed the particles are displayed.
632 | speed: 0
633 | #The distance before unrendering the particle effect.
634 | range: 20
635 | #The inventory slot the item is put in.
636 | order: 22
637 | #The items type.
638 | itemType: milk_bucket
639 | #The items name.
640 | itemName: "&6Spell"
641 | #Whether or not the lore is enabled.
642 | loreEnabled: false
643 | glowEnabled: true
644 | lore:
645 | - "Example"
646 | - "Line2"
647 | - "Line3"
648 | Splash:
649 | type: WATER_SPLASH
650 | #The location the particle effect is displayed.
651 | displayLocation: 0.2
652 | #The amount of particles displayed.
653 | amount: 5
654 | #The speed the particles are displayed.
655 | speed: 0
656 | #The distance before unrendering the particle effect.
657 | range: 20
658 | #The inventory slot the item is put in.
659 | order: 23
660 | #The items type.
661 | itemType: stick
662 | #The items name.
663 | itemName: "&6Splash"
664 | #Whether or not the lore is enabled.
665 | loreEnabled: false
666 | glowEnabled: true
667 | lore:
668 | - "Example"
669 | - "Line2"
670 | - "Line3"
671 | TownAura:
672 | type: TOWN_AURA
673 | #The location the particle effect is displayed.
674 | displayLocation: 0.2
675 | #The amount of particles displayed.
676 | amount: 50
677 | #The speed the particles are displayed.
678 | speed: 0.1
679 | #The distance before unrendering the particle effect.
680 | range: 20
681 | #The inventory slot the item is put in.
682 | order: 24
683 | #The items type.
684 | itemType: mycelium
685 | #The items name.
686 | itemName: "&6TownAura"
687 | #Whether or not the lore is enabled.
688 | loreEnabled: false
689 | glowEnabled: true
690 | lore:
691 | - "Example"
692 | - "Line2"
693 | - "Line3"
694 | Wake:
695 | type: WATER_WAKE
696 | #The location the particle effect is displayed.
697 | displayLocation: 0.2
698 | #The amount of particles displayed.
699 | amount: 5
700 | #The speed the particles are displayed.
701 | speed: 0
702 | #The distance before unrendering the particle effect.
703 | range: 20
704 | #The inventory slot the item is put in.
705 | order: 25
706 | #The items type.
707 | itemType: tropical_fish
708 | #The items name.
709 | itemName: "&6Wake"
710 | #Whether or not the lore is enabled.
711 | loreEnabled: false
712 | glowEnabled: true
713 | lore:
714 | - "Example"
715 | - "Line2"
716 | - "Line3"
717 | WitchMagic:
718 | type: SPELL_WITCH
719 | #The location the particle effect is displayed.
720 | displayLocation: 0.2
721 | #The amount of particles displayed.
722 | amount: 5
723 | #The speed the particles are displayed.
724 | speed: 0
725 | #The distance before unrendering the particle effect.
726 | range: 20
727 | #The inventory slot the item is put in.
728 | order: 26
729 | #The items type.
730 | itemType: spider_eye
731 | #The items name.
732 | itemName: "&6WitchMagic"
733 | #Whether or not the lore is enabled.
734 | loreEnabled: false
735 | glowEnabled: true
736 | lore:
737 | - "Example"
738 | - "Line2"
739 | - "Line3"
740 | Hearts:
741 | type: HEART
742 | #The location the particle effect is displayed.
743 | displayLocation: 2.0
744 | #The amount of particles displayed.
745 | amount: 27
746 | #The speed the particles are displayed.
747 | speed: 0
748 | #The distance before unrendering the particle effect.
749 | range: 20
750 | #The cooldown time before the particle effect is displayed again. (20 ticks = 1 second)
751 | cooldown: 250
752 | #The inventory slot the item is put in.
753 | order: 0
754 | #The items type.
755 | itemType: poppy
756 | #The items name.
757 | itemName: "&6Hearts"
758 | #Whether or not the lore is enabled.
759 | loreEnabled: false
760 | glowEnabled: true
761 | lore:
762 | - "Example"
763 | - "Line2"
764 | - "Line3"
765 | IconCrack:
766 | type: ITEM_CRACK
767 | #The location the particle effect is displayed.
768 | displayLocation: 0.2
769 | #The speed at which the particles are displayed
770 | speed: 0
771 | #The distance before unrendering the particle effect.
772 | range: 10
773 | #The inventory slot the item is put in.
774 | order: 29
775 | #The items type. This is also the item which will be "cracked"
776 | itemType: baked_potato
777 | #The items name.
778 | itemName: "&6Potato"
779 | #The items amount.
780 | amount: 1
781 | BlockBreak:
782 | type: BLOCK_CRACK
783 | #The location the particle effect is displayed.
784 | displayLocation: 0.2
785 | #The speed at which the particles are displayed
786 | speed: 0
787 | #The distance before unrendering the particle effect.
788 | range: 10
789 | #The inventory slot the item is put in.
790 | order: 30
791 | #The items type. This is also the item which will be "cracked"
792 | itemType: melon
793 | #The items name.
794 | itemName: "&6Melon"
795 | #The items amount.
796 | amount: 1
797 | BlackDust:
798 | type: REDSTONE
799 | #The location the particle effect is displayed.
800 | displayLocation: 0.2
801 | #The amount of particles displayed.
802 | amount: 7
803 | #The speed the particles are displayed.
804 | speed: 0.00000000001
805 | #The distance before unrendering the particle effect.
806 | range: 20
807 | #The inventory slot the item is put in.
808 | order: 31
809 | #The items type.
810 | itemType: coal
811 | #Color of the dust.
812 | dustColor:
813 | ==: Color
814 | RED: 0x00
815 | GREEN: 0x00
816 | BLUE: 0x00
817 | #Size of the dust.
818 | dustSize: 3
819 | #The items name.
820 | itemName: "&6BlackDust"
821 | #Whether or not the lore is enabled.
822 | loreEnabled: false
823 | glowEnabled: true
824 | lore:
825 | - "Example"
826 | - "Line2"
827 | - "Line3"
828 | BlackPotion:
829 | type: SPELL_MOB
830 | #The location the particle effect is displayed.
831 | displayLocation: 0.2
832 | #The amount of particles displayed.
833 | amount: 5
834 | #The speed the particles are displayed.
835 | speed: 0
836 | #The distance before unrendering the particle effect.
837 | range: 20
838 | #The inventory slot the item is put in.
839 | order: 33
840 | #The items type.
841 | itemType: GLASS_BOTTLE
842 | #The items name.
843 | itemName: "&6BlackPotion"
844 | #Whether or not the lore is enabled.
845 | loreEnabled: false
846 | glowEnabled: true
847 | lore:
848 | - "Example"
849 | - "Line2"
850 | - "Line3"
851 | Dragonbreath:
852 | type: DRAGON_BREATH
853 | #The location the particle effect is displayed.
854 | displayLocation: 0.2
855 | #The amount of particles displayed.
856 | amount: 10
857 | #The speed the particles are displayed.
858 | speed: 0
859 | #The distance before unrendering the particle effect.
860 | range: 10
861 | #The inventory slot the item is put in.
862 | order: 34
863 | #The items type.
864 | itemType: DRAGON_BREATH
865 | #The items name.
866 | itemName: "&6DragonBreath"
867 | #Whether or not the lore is enabled.
868 | loreEnabled: false
869 | glowEnabled: true
870 | lore:
871 | - "Example"
872 | - "Line2"
873 | - "Line3"
874 | EndRod:
875 | type: END_ROD
876 | #The location the particle effect is displayed.
877 | displayLocation: 0.2
878 | #The amount of particles displayed.
879 | amount: 5
880 | #The speed the particles are displayed.
881 | speed: 0
882 | #The distance before unrendering the particle effect.
883 | range: 20
884 | #The inventory slot the item is put in.
885 | order: 35
886 | #The items type.
887 | itemType: END_ROD
888 | #The items name.
889 | itemName: "&6EndRod"
890 | #Whether or not the lore is enabled.
891 | loreEnabled: false
892 | glowEnabled: true
893 | lore:
894 | - "Example"
895 | - "Line2"
896 | - "Line3"
897 | DamageIndicator:
898 | type: DAMAGE_INDICATOR
899 | #The location the particle effect is displayed.
900 | displayLocation: 2
901 | #The amount of particles displayed.
902 | amount: 5
903 | #The speed the particles are displayed.
904 | speed: 0
905 | #The distance before unrendering the particle effect.
906 | range: 20
907 | #The inventory slot the item is put in.
908 | order: 36
909 | #The items type.
910 | itemType: DIAMOND_SWORD
911 | #The items name.
912 | itemName: "&6DamageIndicator"
913 | #Whether or not the lore is enabled.
914 | loreEnabled: false
915 | glowEnabled: true
916 | lore:
917 | - "Example"
918 | - "Line2"
919 | - "Line3"
920 | SweepAttack:
921 | type: SWEEP_ATTACK
922 | #The location the particle effect is displayed.
923 | displayLocation: 2
924 | #The amount of particles displayed.
925 | amount: 3
926 | #The speed the particles are displayed.
927 | speed: 1
928 | #The distance before unrendering the particle effect.
929 | range: 20
930 | #The inventory slot the item is put in.
931 | order: 37
932 | #The items type.
933 | itemType: GOLDEN_SWORD
934 | #The items name.
935 | itemName: "&6SweepAttack"
936 | #Whether or not the lore is enabled.
937 | loreEnabled: false
938 | glowEnabled: true
939 | lore:
940 | - "Example"
941 | - "Line2"
942 | - "Line3"
943 | FallingDust:
944 | type: FALLING_DUST
945 | #The location the particle effect is displayed.
946 | displayLocation: 2
947 | #The amount of particles displayed.
948 | amount: 3
949 | #The speed the particles are displayed.
950 | speed: 1
951 | #The distance before unrendering the particle effect.
952 | range: 20
953 | #The inventory slot the item is put in.
954 | order: 38
955 | #The items type.
956 | itemType: gravel
957 | #The items name.
958 | itemName: "&6FallingDust"
959 | #Whether or not the lore is enabled.
960 | loreEnabled: false
961 | glowEnabled: true
962 | lore:
963 | - "Example"
964 | - "Line2"
965 | - "Line3"
966 | Spit:
967 | type: SPIT
968 | #The location the particle effect is displayed.
969 | displayLocation: 2
970 | #The amount of particles displayed.
971 | amount: 3
972 | #The speed the particles are displayed.
973 | speed: 1
974 | #The distance before unrendering the particle effect.
975 | range: 20
976 | #The inventory slot the item is put in.
977 | order: 39
978 | #The items type.
979 | itemType: GHAST_TEAR
980 | #The items name.
981 | itemName: "&6Spit"
982 | #Whether or not the lore is enabled.
983 | loreEnabled: false
984 | glowEnabled: true
985 | lore:
986 | - "Example"
987 | - "Line2"
988 | - "Line3"
989 | Totem:
990 | type: TOTEM
991 | #The location the particle effect is displayed.
992 | displayLocation: 2
993 | #The amount of particles displayed.
994 | amount: 3
995 | #The speed the particles are displayed.
996 | speed: 1
997 | #The distance before unrendering the particle effect.
998 | range: 20
999 | #The inventory slot the item is put in.
1000 | order: 40
1001 | #The items type.
1002 | itemType: STICK
1003 | #The items name.
1004 | itemName: "&6Totem"
1005 | #Whether or not the lore is enabled.
1006 | loreEnabled: false
1007 | glowEnabled: true
1008 | lore:
1009 | - "Example"
1010 | - "Line2"
1011 | - "Line3"
1012 | BubbleColumnUp:
1013 | type: BUBBLE_COLUMN_UP
1014 | #The location the particle effect is displayed.
1015 | displayLocation: 0.3
1016 | #The amount of particles displayed.
1017 | amount: 3
1018 | #The speed the particles are displayed.
1019 | speed: 1
1020 | #The distance before unrendering the particle effect.
1021 | range: 20
1022 | #The inventory slot the item is put in.
1023 | order: 41
1024 | #The items type.
1025 | itemType: HEART_OF_THE_SEA
1026 | #The items name.
1027 | itemName: "&6Bubble Column Up"
1028 | #Whether or not the lore is enabled.
1029 | loreEnabled: false
1030 | glowEnabled: true
1031 | lore:
1032 | - "Example"
1033 | - "Line2"
1034 | - "Line3"
1035 | BubblePop:
1036 | type: BUBBLE_POP
1037 | #The location the particle effect is displayed.
1038 | displayLocation: 0.3
1039 | #The amount of particles displayed.
1040 | amount: 0
1041 | #The speed the particles are displayed.
1042 | speed: 0.5
1043 | #The distance before unrendering the particle effect.
1044 | range: 20
1045 | #The inventory slot the item is put in.
1046 | order: 42
1047 | #The items type.
1048 | itemType: TRIDENT
1049 | #The items name.
1050 | itemName: "&6Bubble Pop"
1051 | #Whether or not the lore is enabled.
1052 | loreEnabled: false
1053 | glowEnabled: true
1054 | lore:
1055 | - "Example"
1056 | - "Line2"
1057 | - "Line3"
1058 | CurrentDown:
1059 | type: CURRENT_DOWN
1060 | #The location the particle effect is displayed.
1061 | displayLocation: 0.3
1062 | #The amount of particles displayed.
1063 | amount: 3
1064 | #The speed the particles are displayed.
1065 | speed: 1
1066 | #The distance before unrendering the particle effect.
1067 | range: 20
1068 | #The inventory slot the item is put in.
1069 | order: 43
1070 | #The items type.
1071 | itemType: KELP
1072 | #The items name.
1073 | itemName: "&6Current Down"
1074 | #Whether or not the lore is enabled.
1075 | loreEnabled: false
1076 | glowEnabled: true
1077 | lore:
1078 | - "Example"
1079 | - "Line2"
1080 | - "Line3"
1081 | SquidInk:
1082 | type: SQUID_INK
1083 | #The location the particle effect is displayed.
1084 | displayLocation: 0.2
1085 | #The amount of particles displayed.
1086 | amount: 0
1087 | #The speed the particles are displayed.
1088 | speed: 0.5
1089 | #The distance before unrendering the particle effect.
1090 | range: 20
1091 | #The inventory slot the item is put in.
1092 | order: 44
1093 | #The items type.
1094 | itemType: INK_SAC
1095 | #The items name.
1096 | itemName: "&6Squid Ink"
1097 | #Whether or not the lore is enabled.
1098 | loreEnabled: false
1099 | glowEnabled: true
1100 | lore:
1101 | - "Example"
1102 | - "Line2"
1103 | - "Line3"
1104 | Sneeze:
1105 | type: SNEEZE
1106 | #The location the particle effect is displayed.
1107 | displayLocation: 2
1108 | #The amount of particles displayed.
1109 | amount: 3
1110 | #The speed the particles are displayed.
1111 | speed: 0.5
1112 | #The distance before unrendering the particle effect.
1113 | range: 20
1114 | #The inventory slot the item is put in.
1115 | order: 45
1116 | #The items type.
1117 | itemType: SLIME_BALL
1118 | #The items name.
1119 | itemName: "&6Sneeze"
1120 | #Whether or not the lore is enabled.
1121 | loreEnabled: false
1122 | glowEnabled: true
1123 | lore:
1124 | - "Example"
1125 | - "Line2"
1126 | - "Line3"
1127 | CosyCampfire:
1128 | type: CAMPFIRE_COSY_SMOKE
1129 | #The location the particle effect is displayed.
1130 | displayLocation: 0.2
1131 | #The amount of particles displayed.
1132 | amount: 3
1133 | #The speed the particles are displayed.
1134 | speed: 0.1
1135 | #The distance before unrendering the particle effect.
1136 | range: 20
1137 | #The inventory slot the item is put in.
1138 | order: 46
1139 | #The items type.
1140 | itemType: CAMPFIRE
1141 | #The items name.
1142 | itemName: "&6Cosy Campfire"
1143 | #Whether or not the lore is enabled.
1144 | loreEnabled: false
1145 | glowEnabled: true
1146 | lore:
1147 | - "Example"
1148 | - "Line2"
1149 | - "Line3"
1150 | SignalCampfire:
1151 | type: CAMPFIRE_SIGNAL_SMOKE
1152 | #The location the particle effect is displayed.
1153 | displayLocation: 0.2
1154 | #The amount of particles displayed.
1155 | amount: 3
1156 | #The speed the particles are displayed.
1157 | speed: 0.1
1158 | #The distance before unrendering the particle effect.
1159 | range: 20
1160 | #The inventory slot the item is put in.
1161 | order: 47
1162 | #The items type.
1163 | itemType: CAMPFIRE
1164 | #The items name.
1165 | itemName: "&6Signal Campfire"
1166 | #Whether or not the lore is enabled.
1167 | loreEnabled: false
1168 | glowEnabled: true
1169 | lore:
1170 | - "Example"
1171 | - "Line2"
1172 | - "Line3"
1173 | FallingNectar:
1174 | type: FALLING_NECTAR
1175 | #The location the particle effect is displayed.
1176 | displayLocation: 2
1177 | #The amount of particles displayed.
1178 | amount: 3
1179 | #The speed the particles are displayed.
1180 | speed: 0.1
1181 | #The distance before unrendering the particle effect.
1182 | range: 20
1183 | #The inventory slot the item is put in.
1184 | order: 48
1185 | #The items type.
1186 | itemType: CORNFLOWER
1187 | #The items name.
1188 | itemName: "&6Falling Nectar"
1189 | #Whether or not the lore is enabled.
1190 | loreEnabled: false
1191 | glowEnabled: true
1192 | lore:
1193 | - "Example"
1194 | - "Line2"
1195 | - "Line3"
1196 | DrippingHoney:
1197 | type: DRIPPING_HONEY
1198 | #The location the particle effect is displayed.
1199 | displayLocation: 0.1
1200 | #The amount of particles displayed.
1201 | amount: 3
1202 | #The speed the particles are displayed.
1203 | speed: 0.1
1204 | #The distance before unrendering the particle effect.
1205 | range: 20
1206 | #The inventory slot the item is put in.
1207 | order: 49
1208 | #The items type.
1209 | itemType: HONEY_BOTTLE
1210 | #The items name.
1211 | itemName: "&6Dripping Honey"
1212 | #Whether or not the lore is enabled.
1213 | loreEnabled: false
1214 | glowEnabled: true
1215 | lore:
1216 | - "Example"
1217 | - "Line2"
1218 | - "Line3"
1219 | DrippingObsidian:
1220 | type: DRIPPING_OBSIDIAN_TEAR
1221 | #The location the particle effect is displayed.
1222 | displayLocation: 0.1
1223 | #The amount of particles displayed.
1224 | amount: 50
1225 | #The speed the particles are displayed.
1226 | speed: 0.1
1227 | #The distance before unrendering the particle effect.
1228 | range: 20
1229 | #The inventory slot the item is put in.
1230 | order: 50
1231 | #The items type.
1232 | itemType: CRYING_OBSIDIAN
1233 | #The items name.
1234 | itemName: "&6Dripping Obsidian Tear"
1235 | #Whether or not the lore is enabled.
1236 | loreEnabled: false
1237 | glowEnabled: true
1238 | lore:
1239 | - "Example"
1240 | - "Line2"
1241 | - "Line3"
1242 | Ash:
1243 | type: ASH
1244 | #The location the particle effect is displayed.
1245 | displayLocation: 0.4
1246 | #The amount of particles displayed.
1247 | amount: 50
1248 | #The speed the particles are displayed.
1249 | speed: 0.1
1250 | #The distance before unrendering the particle effect.
1251 | range: 20
1252 | #The inventory slot the item is put in.
1253 | order: 51
1254 | #The items type.
1255 | itemType: BASALT
1256 | #The items name.
1257 | itemName: "&6Ash"
1258 | #Whether or not the lore is enabled.
1259 | loreEnabled: false
1260 | glowEnabled: true
1261 | lore:
1262 | - "Example"
1263 | - "Line2"
1264 | - "Line3"
1265 | CrimsonSpore:
1266 | type: CRIMSON_SPORE
1267 | #The location the particle effect is displayed.
1268 | displayLocation: 0.4
1269 | #The amount of particles displayed.
1270 | amount: 25
1271 | #The speed the particles are displayed.
1272 | speed: 0.2
1273 | #The distance before unrendering the particle effect.
1274 | range: 20
1275 | #The inventory slot the item is put in.
1276 | order: 52
1277 | #The items type.
1278 | itemType: CRIMSON_FUNGUS
1279 | #The items name.
1280 | itemName: "&6Crimson Spore"
1281 | #Whether or not the lore is enabled.
1282 | loreEnabled: false
1283 | glowEnabled: true
1284 | lore:
1285 | - "Example"
1286 | - "Line2"
1287 | - "Line3"
1288 | WarpedSpore:
1289 | type: WARPED_SPORE
1290 | #The location the particle effect is displayed.
1291 | displayLocation: 0.4
1292 | #The amount of particles displayed.
1293 | amount: 25
1294 | #The speed the particles are displayed.
1295 | speed: 0.2
1296 | #The distance before unrendering the particle effect.
1297 | range: 20
1298 | #The inventory slot the item is put in.
1299 | order: 53
1300 | #The items type.
1301 | itemType: WARPED_FUNGUS
1302 | #The items name.
1303 | itemName: "&6Warped Spore"
1304 | #Whether or not the lore is enabled.
1305 | loreEnabled: false
1306 | glowEnabled: true
1307 | lore:
1308 | - "Example"
1309 | - "Line2"
1310 | - "Line3"
1311 | SoulFireFlame:
1312 | type: SOUL_FIRE_FLAME
1313 | #The location the particle effect is displayed.
1314 | displayLocation: 0.4
1315 | #The amount of particles displayed.
1316 | amount: 0
1317 | #The speed the particles are displayed.
1318 | speed: 0.2
1319 | #The distance before unrendering the particle effect.
1320 | range: 20
1321 | #The inventory slot the item is put in.
1322 | order: 54
1323 | #The items type.
1324 | itemType: SOUL_CAMPFIRE
1325 | #The items name.
1326 | itemName: "&6Soul Fire Flame"
1327 | #Whether or not the lore is enabled.
1328 | loreEnabled: false
1329 | glowEnabled: true
1330 | lore:
1331 | - "Example"
1332 | - "Line2"
1333 | - "Line3"
1334 | Soul:
1335 | type: SOUL
1336 | #The location the particle effect is displayed.
1337 | displayLocation: 0.4
1338 | #The amount of particles displayed.
1339 | amount: 3
1340 | #The speed the particles are displayed.
1341 | speed: 0.5
1342 | #The distance before unrendering the particle effect.
1343 | range: 20
1344 | #The inventory slot the item is put in.
1345 | order: 55
1346 | #The items type.
1347 | itemType: SOUL_SOIL
1348 | #The items name.
1349 | itemName: "&6Soul"
1350 | #Whether or not the lore is enabled.
1351 | loreEnabled: false
1352 | glowEnabled: true
1353 | lore:
1354 | - "Example"
1355 | - "Line2"
1356 | - "Line3"
1357 | DrippingDripstoneLava:
1358 | type: DRIPPING_DRIPSTONE_LAVA
1359 | #The location the particle effect is displayed.
1360 | displayLocation: 0.2
1361 | #The amount of particles displayed.
1362 | amount: 5
1363 | #The speed the particles are displayed.
1364 | speed: 0
1365 | #The distance before unrendering the particle effect.
1366 | range: 20
1367 | #The inventory slot the item is put in.
1368 | order: 56
1369 | #The items type.
1370 | itemType: lava_bucket
1371 | #The items name.
1372 | itemName: "&6DrippingDripstoneLava"
1373 | #Whether or not the lore is enabled.
1374 | loreEnabled: false
1375 | glowEnabled: true
1376 | lore:
1377 | - "Example"
1378 | - "Line2"
1379 | - "Line3"
1380 | DrippingDripstoneWater:
1381 | type: DRIPPING_DRIPSTONE_WATER
1382 | #The location the particle effect is displayed.
1383 | displayLocation: 0.2
1384 | #The amount of particles displayed.
1385 | amount: 5
1386 | #The speed the particles are displayed.
1387 | speed: 0
1388 | #The distance before unrendering the particle effect.
1389 | range: 20
1390 | #The inventory slot the item is put in.
1391 | order: 57
1392 | #The items type.
1393 | itemType: water_bucket
1394 | #The items name.
1395 | itemName: "&6DrippingDripstoneWater"
1396 | #Whether or not the lore is enabled.
1397 | loreEnabled: false
1398 | glowEnabled: true
1399 | lore:
1400 | - "Example"
1401 | - "Line2"
1402 | - "Line3"
1403 | ElectricSpark:
1404 | type: ELECTRIC_SPARK
1405 | #The location the particle effect is displayed.
1406 | displayLocation: 0.2
1407 | #The amount of particles displayed.
1408 | amount: 10
1409 | #The speed the particles are displayed.
1410 | speed: 0.5
1411 | #The distance before unrendering the particle effect.
1412 | range: 20
1413 | #The inventory slot the item is put in.
1414 | order: 58
1415 | #The items type.
1416 | itemType: lightning_rod
1417 | #The items name.
1418 | itemName: "&6ElectricSpark"
1419 | #Whether or not the lore is enabled.
1420 | loreEnabled: false
1421 | glowEnabled: true
1422 | lore:
1423 | - "Example"
1424 | - "Line2"
1425 | - "Line3"
1426 | FallingDripstoneLava:
1427 | type: FALLING_DRIPSTONE_LAVA
1428 | #The location the particle effect is displayed.
1429 | displayLocation: 0.2
1430 | #The amount of particles displayed.
1431 | amount: 5
1432 | #The speed the particles are displayed.
1433 | speed: 0
1434 | #The distance before unrendering the particle effect.
1435 | range: 20
1436 | #The inventory slot the item is put in.
1437 | order: 59
1438 | #The items type.
1439 | itemType: lava_bucket
1440 | #The items name.
1441 | itemName: "&6FallingDripstoneLava"
1442 | #Whether or not the lore is enabled.
1443 | loreEnabled: false
1444 | glowEnabled: true
1445 | lore:
1446 | - "Example"
1447 | - "Line2"
1448 | - "Line3"
1449 | FallingDripstoneWater:
1450 | type: FALLING_DRIPSTONE_WATER
1451 | #The location the particle effect is displayed.
1452 | displayLocation: 0.2
1453 | #The amount of particles displayed.
1454 | amount: 5
1455 | #The speed the particles are displayed.
1456 | speed: 0
1457 | #The distance before unrendering the particle effect.
1458 | range: 20
1459 | #The inventory slot the item is put in.
1460 | order: 60
1461 | #The items type.
1462 | itemType: water_bucket
1463 | #The items name.
1464 | itemName: "&6FallingDripstoneWater"
1465 | #Whether or not the lore is enabled.
1466 | loreEnabled: false
1467 | glowEnabled: true
1468 | lore:
1469 | - "Example"
1470 | - "Line2"
1471 | - "Line3"
1472 | FallingSporeBlossom:
1473 | type: FALLING_SPORE_BLOSSOM
1474 | #The location the particle effect is displayed.
1475 | displayLocation: 0.2
1476 | #The amount of particles displayed.
1477 | amount: 10
1478 | #The speed the particles are displayed.
1479 | speed: 0.5
1480 | #The distance before unrendering the particle effect.
1481 | range: 20
1482 | #The inventory slot the item is put in.
1483 | order: 61
1484 | #The items type.
1485 | itemType: spore_blossom
1486 | #The items name.
1487 | itemName: "&6FallingSporeBlossom"
1488 | #Whether or not the lore is enabled.
1489 | loreEnabled: false
1490 | glowEnabled: true
1491 | lore:
1492 | - "Example"
1493 | - "Line2"
1494 | - "Line3"
1495 | Glow:
1496 | type: GLOW
1497 | #The location the particle effect is displayed.
1498 | displayLocation: 0.2
1499 | #The amount of particles displayed.
1500 | amount: 10
1501 | #The speed the particles are displayed.
1502 | speed: 0.5
1503 | #The distance before unrendering the particle effect.
1504 | range: 20
1505 | #The inventory slot the item is put in.
1506 | order: 62
1507 | #The items type.
1508 | itemType: glow_ink_sac
1509 | #The items name.
1510 | itemName: "&6Glow"
1511 | #Whether or not the lore is enabled.
1512 | loreEnabled: false
1513 | glowEnabled: true
1514 | lore:
1515 | - "Example"
1516 | - "Line2"
1517 | - "Line3"
1518 | GlowSquidInk:
1519 | type: GLOW_SQUID_INK
1520 | #The location the particle effect is displayed.
1521 | displayLocation: 0.2
1522 | #The amount of particles displayed.
1523 | amount: 0
1524 | #The speed the particles are displayed.
1525 | speed: 0.5
1526 | #The distance before unrendering the particle effect.
1527 | range: 20
1528 | #The inventory slot the item is put in.
1529 | order: 63
1530 | #The items type.
1531 | itemType: glow_ink_sac
1532 | #The items name.
1533 | itemName: "&6GlowSquidInk"
1534 | #Whether or not the lore is enabled.
1535 | loreEnabled: false
1536 | glowEnabled: true
1537 | lore:
1538 | - "Example"
1539 | - "Line2"
1540 | - "Line3"
1541 | Scrape:
1542 | type: SCRAPE
1543 | #The location the particle effect is displayed.
1544 | displayLocation: 0.2
1545 | #The amount of particles displayed.
1546 | amount: 10
1547 | #The speed the particles are displayed.
1548 | speed: 0.5
1549 | #The distance before unrendering the particle effect.
1550 | range: 20
1551 | #The inventory slot the item is put in.
1552 | order: 64
1553 | #The items type.
1554 | itemType: iron_axe
1555 | #The items name.
1556 | itemName: "&6Scrape"
1557 | #Whether or not the lore is enabled.
1558 | loreEnabled: false
1559 | glowEnabled: true
1560 | lore:
1561 | - "Example"
1562 | - "Line2"
1563 | - "Line3"
1564 | SmallFlame:
1565 | type: SMALL_FLAME
1566 | #The location the particle effect is displayed.
1567 | displayLocation: 0.2
1568 | #The amount of particles displayed.
1569 | amount: 10
1570 | #The speed the particles are displayed.
1571 | speed: 0.5
1572 | #The distance before unrendering the particle effect.
1573 | range: 20
1574 | #The inventory slot the item is put in.
1575 | order: 65
1576 | #The items type.
1577 | itemType: candle
1578 | #The items name.
1579 | itemName: "&6SmallFlame"
1580 | #Whether or not the lore is enabled.
1581 | loreEnabled: false
1582 | glowEnabled: true
1583 | lore:
1584 | - "Example"
1585 | - "Line2"
1586 | - "Line3"
1587 | Snowflake:
1588 | type: SNOWFLAKE
1589 | #The location the particle effect is displayed.
1590 | displayLocation: 0.2
1591 | #The amount of particles displayed.
1592 | amount: 10
1593 | #The speed the particles are displayed.
1594 | speed: 0.5
1595 | #The distance before unrendering the particle effect.
1596 | range: 20
1597 | #The inventory slot the item is put in.
1598 | order: 66
1599 | #The items type.
1600 | itemType: snow
1601 | #The items name.
1602 | itemName: "&6Snowflake"
1603 | #Whether or not the lore is enabled.
1604 | loreEnabled: false
1605 | glowEnabled: true
1606 | lore:
1607 | - "Example"
1608 | - "Line2"
1609 | - "Line3"
1610 | SporeBlossomAir:
1611 | type: SPORE_BLOSSOM_AIR
1612 | #The location the particle effect is displayed.
1613 | displayLocation: 0.2
1614 | #The amount of particles displayed.
1615 | amount: 10
1616 | #The speed the particles are displayed.
1617 | speed: 0.5
1618 | #The distance before unrendering the particle effect.
1619 | range: 20
1620 | #The inventory slot the item is put in.
1621 | order: 67
1622 | #The items type.
1623 | itemType: spore_blossom
1624 | #The items name.
1625 | itemName: "&6SporeBlossomAir"
1626 | #Whether or not the lore is enabled.
1627 | loreEnabled: false
1628 | glowEnabled: true
1629 | lore:
1630 | - "Example"
1631 | - "Line2"
1632 | - "Line3"
1633 | WaxOff:
1634 | type: WAX_OFF
1635 | #The location the particle effect is displayed.
1636 | displayLocation: 0.2
1637 | #The amount of particles displayed.
1638 | amount: 10
1639 | #The speed the particles are displayed.
1640 | speed: 0.5
1641 | #The distance before unrendering the particle effect.
1642 | range: 20
1643 | #The inventory slot the item is put in.
1644 | order: 68
1645 | #The items type.
1646 | itemType: oxidized_copper
1647 | #The items name.
1648 | itemName: "&6WaxOff"
1649 | #Whether or not the lore is enabled.
1650 | loreEnabled: false
1651 | glowEnabled: true
1652 | lore:
1653 | - "Example"
1654 | - "Line2"
1655 | - "Line3"
1656 | WaxOn:
1657 | type: WAX_ON
1658 | #The location the particle effect is displayed.
1659 | displayLocation: 0.2
1660 | #The amount of particles displayed.
1661 | amount: 10
1662 | #The speed the particles are displayed.
1663 | speed: 0.5
1664 | #The distance before unrendering the particle effect.
1665 | range: 20
1666 | #The inventory slot the item is put in.
1667 | order: 69
1668 | #The items type.
1669 | itemType: copper_block
1670 | #The items name.
1671 | itemName: "&6WaxOn"
1672 | #Whether or not the lore is enabled.
1673 | loreEnabled: false
1674 | glowEnabled: true
1675 | lore:
1676 | - "Example"
1677 | - "Line2"
1678 | - "Line3"
1679 | SculkSoul:
1680 | type: SCULK_SOUL
1681 | #The location the particle effect is displayed.
1682 | displayLocation: 2
1683 | #The amount of particles displayed.
1684 | amount: 2
1685 | #The speed the particles are displayed.
1686 | speed: 0.25
1687 | #The distance before unrendering the particle effect.
1688 | range: 20
1689 | #The inventory slot the item is put in.
1690 | order: 70
1691 | #The items type.
1692 | itemType: sculk_vein
1693 | #The items name.
1694 | itemName: "&6SculkSoul"
1695 | #Whether or not the lore is enabled.
1696 | loreEnabled: false
1697 | glowEnabled: true
1698 | lore:
1699 | - "Example"
1700 | - "Line2"
1701 | - "Line3"
1702 | SculkCharge:
1703 | type: SCULK_CHARGE
1704 | #The location the particle effect is displayed.
1705 | displayLocation: 0.2
1706 | #The amount of particles displayed.
1707 | amount: 3
1708 | #The speed the particles are displayed.
1709 | speed: 0.05
1710 | #The distance before unrendering the particle effect.
1711 | range: 20
1712 | #The inventory slot the item is put in.
1713 | order: 71
1714 | #The items type.
1715 | itemType: sculk
1716 | #The items name.
1717 | itemName: "&6SculkCharge"
1718 | #Whether or not the lore is enabled.
1719 | loreEnabled: false
1720 | glowEnabled: true
1721 | lore:
1722 | - "Example"
1723 | - "Line2"
1724 | - "Line3"
1725 | SculkChargePop:
1726 | type: SCULK_CHARGE_POP
1727 | #The location the particle effect is displayed.
1728 | displayLocation: 0.2
1729 | #The amount of particles displayed.
1730 | amount: 3
1731 | #The speed the particles are displayed.
1732 | speed: 0.05
1733 | #The distance before unrendering the particle effect.
1734 | range: 20
1735 | #The inventory slot the item is put in.
1736 | order: 72
1737 | #The items type.
1738 | itemType: sculk
1739 | #The items name.
1740 | itemName: "&6SculkChargePop"
1741 | #Whether or not the lore is enabled.
1742 | loreEnabled: false
1743 | glowEnabled: true
1744 | lore:
1745 | - "Example"
1746 | - "Line2"
1747 | - "Line3"
1748 | Shriek:
1749 | type: SHRIEK
1750 | #The location the particle effect is displayed.
1751 | displayLocation: 2
1752 | #The amount of particles displayed.
1753 | amount: 1
1754 | #The speed the particles are displayed.
1755 | speed: 1
1756 | #The distance before unrendering the particle effect.
1757 | range: 20
1758 | #The inventory slot the item is put in.
1759 | order: 73
1760 | #The items type.
1761 | itemType: sculk_shrieker
1762 | #The items name.
1763 | itemName: "&6Shriek"
1764 | #Whether or not the lore is enabled.
1765 | loreEnabled: false
1766 | glowEnabled: true
1767 | lore:
1768 | - "Example"
1769 | - "Line2"
1770 | - "Line3"
1771 | ############################################################
1772 | # +------------------------------------------------------+ #
1773 | # | Configuration: Inventory Pagination | #
1774 | # +------------------------------------------------------+ #
1775 | ############################################################
1776 | #### @ClearAll
1777 | ClearAll:
1778 | #The message sent when you clear all of your own trails. (When typing /Trail ClearAll)
1779 | message: "&8[&CTrailGUI&8] &AYou cleared all your current trails."
1780 | #The message sent to the target player getting their trails removed.
1781 | targetMessage: "&8[&CTrailGUI&8] &A&L%Sender% &Ahas removed your trails."
1782 | #The message sent to the sender.
1783 | senderMessage: "&8[&CTrailGUI&8] &A&L%Target% &Ano longer has any trail."
1784 |
1785 | #### @RemoveTrails
1786 |
1787 | RemoveTrails:
1788 | #The message sent when you clear all of your own trails. (Inside the GUI)
1789 | message: "&8[&CTrailGUI&8] &AYou cleared all your current trails."
1790 | #The inventory slot the item is put in.
1791 | inventorySlot: 40
1792 | #The items type.
1793 | itemType: redstone_block
1794 | #The items name.
1795 | itemName: "&6Remove Trails"
1796 | #Whether or not the lore is enabled.
1797 | loreEnabled: false
1798 | glowEnabled: true
1799 | #Lore
1800 | lore:
1801 | - "Line1"
1802 |
1803 | #### @NextPage
1804 | NextPage:
1805 | #The inventory slot the item is put in.
1806 | inventorySlot: 41
1807 | #The items type.
1808 | itemType: arrow
1809 | #The items name.
1810 | itemName: "&6Next Page"
1811 | #Whether or not the lore is enabled.
1812 | loreEnabled: false
1813 | glowEnabled: true
1814 | #Lore
1815 | lore:
1816 | - "Line1"
1817 |
1818 | #### @PreviousPage
1819 | PreviousPage:
1820 | #The inventory slot the item is put in.
1821 | inventorySlot: 39
1822 | #The items type.
1823 | itemType: arrow
1824 | #The items name.
1825 | itemName: "&6Previous Page"
1826 | #Whether or not the lore is enabled.
1827 | loreEnabled: false
1828 | glowEnabled: true
1829 | #Lore
1830 | lore:
1831 | - "Line1"
1832 |
--------------------------------------------------------------------------------
/src/main/resources/plugin.yml:
--------------------------------------------------------------------------------
1 | name: TrailGUI
2 | main: ca.jamiesinn.trailgui.TrailGUI
3 | version: ${project.version}
4 | author: JamieSinn
5 | softdepend: [Essentials]
6 | api-version: 1.19
7 |
8 | commands:
9 | trail:
10 | description: Give yourself or another player the specified trail.
11 | trails:
12 | description: Opens the TrailGUI.
13 | trailgui:
14 | description: Basic information about the plugin.
15 |
16 | permissions:
17 | trailgui.inventory.angryvillager:
18 | description: Allows the player to select the angryvillager trail in the GUI.
19 | default: op
20 | trailgui.inventory.cloud:
21 | description: Allows the player to select the cloud trail in the GUI.
22 | default: op
23 | trailgui.inventory.criticals:
24 | description: Allows the player to select the criticals trail in the GUI.
25 | default: op
26 | trailgui.inventory.driplava:
27 | description: Allows the player to select the driplava trail in the GUI.
28 | default: op
29 | trailgui.inventory.dripwater:
30 | description: Allows the player to select the dripwater trail in the GUI.
31 | default: op
32 | trailgui.inventory.enchantment:
33 | description: Allows the player to select the enchantment trail in the GUI.
34 | default: op
35 | trailgui.inventory.spark:
36 | description: Allows the player to select the spark trail in the GUI.
37 | default: op
38 | trailgui.inventory.flame:
39 | description: Allows the player to select the flame trail in the GUI.
40 | default: op
41 | trailgui.inventory.happyvillager:
42 | description: Allows the player to select the happyvillager trail in the GUI.
43 | default: op
44 | trailgui.inventory.instantspell:
45 | description: Allows the player to select the instantspell trail in the GUI.
46 | default: op
47 | trailgui.inventory.largesmoke:
48 | description: Allows the player to select the largesmoke trail in the GUI.
49 | default: op
50 | trailgui.inventory.lava:
51 | description: Allows the player to select the lava trail in the GUI.
52 | default: op
53 | trailgui.inventory.magiccrit:
54 | description: Allows the player to select the magiccrit trail in the GUI.
55 | default: op
56 | trailgui.inventory.mobspell:
57 | description: Allows the player to select the mobspell trail in the GUI.
58 | default: op
59 | trailgui.inventory.mobspellambient:
60 | description: Allows the player to select the mobspellambient trail in the GUI.
61 | default: op
62 | trailgui.inventory.note:
63 | description: Allows the player to select the note trail in the GUI.
64 | default: op
65 | trailgui.inventory.portal:
66 | description: Allows the player to select the portal trail in the GUI.
67 | default: op
68 | trailgui.inventory.reddust:
69 | description: Allows the player to select the reddust trail in the GUI.
70 | default: op
71 | trailgui.inventory.coloredreddust:
72 | description: Allows the player to select the coloredreddust trail in the GUI.
73 | default: op
74 | trailgui.inventory.slime:
75 | description: Allows the player to select the slime trail in the GUI.
76 | default: op
77 | trailgui.inventory.snowshovel:
78 | description: Allows the player to select the snowshovel trail in the GUI.
79 | default: op
80 | trailgui.inventory.snowballpoof:
81 | description: Allows the player to select the snowballpoof trail in the GUI.
82 | default: op
83 | trailgui.inventory.spell:
84 | description: Allows the player to select the spell trail in the GUI.
85 | default: op
86 | trailgui.inventory.splash:
87 | description: Allows the player to select the splash trail in the GUI.
88 | default: op
89 | trailgui.inventory.townaura:
90 | description: Allows the player to select the townaura trail in the GUI.
91 | default: op
92 | trailgui.inventory.wake:
93 | description: Allows the player to select the wake trail in the GUI.
94 | default: op
95 | trailgui.inventory.witchmagic:
96 | description: Allows the player to select the witchmagic trail in the GUI.
97 | default: op
98 | trailgui.inventory.hearts:
99 | description: Allows the player to select the hearts trail in the GUI.
100 | default: op
101 | trailgui.inventory.endersignal:
102 | description: Allows the player to select the endersignal trail in the GUI.
103 | default: op
104 | trailgui.inventory.iconcrack:
105 | description: Allows the player to select the iconcrack trail in the GUI.
106 | default: op
107 | trailgui.inventory.blockbreak:
108 | description: Allows the player to select the blockbreak trail in the GUI.
109 | default: op
110 | trailgui.inventory.blackdust:
111 | description: Allows the player to select the blackdust trail in the GUI.
112 | default: op
113 | trailgui.inventory.footstep:
114 | description: Allows the player to select the footstep trail in the GUI.
115 | default: op
116 | trailgui.inventory.blackpotion:
117 | description: Allows the player to select the blackpotion trail in the GUI.
118 | default: op
119 | trailgui.inventory.clearall:
120 | description: Allows the player to clear all their current trails when selecting the item in the GUI.
121 | default: op
122 | trailgui.inventory.nextpage:
123 | description: Allows the player to select the nextpage item in the GUI.
124 | default: op
125 | trailgui.inventory.previouspage:
126 | description: Allows the player to select the previouspage item in the GUI.
127 | default: op
128 | trailgui.trails.angryvillager:
129 | description: Allows the player to select the specified trail.
130 | default: op
131 | trailgui.trails.cloud:
132 | description: Allows the player to select the specified trail.
133 | default: op
134 | trailgui.trails.criticals:
135 | description: Allows the player to select the specified trail.
136 | default: op
137 | trailgui.trails.driplava:
138 | description: Allows the player to select the specified trail.
139 | default: op
140 | trailgui.trails.dripwater:
141 | description: Allows the player to select the specified trail.
142 | default: op
143 | trailgui.trails.enchantment:
144 | description: Allows the player to select the specified trail.
145 | default: op
146 | trailgui.trails.spark:
147 | description: Allows the player to select the specified trail.
148 | default: op
149 | trailgui.trails.flame:
150 | description: Allows the player to select the specified trail.
151 | default: op
152 | trailgui.trails.happyvillager:
153 | description: Allows the player to select the specified trail.
154 | default: op
155 | trailgui.trails.instantspell:
156 | description: Allows the player to select the specified trail.
157 | default: op
158 | trailgui.trails.largesmoke:
159 | description: Allows the player to select the specified trail.
160 | default: op
161 | trailgui.trails.lava:
162 | description: Allows the player to select the specified trail.
163 | default: op
164 | trailgui.trails.magiccrit:
165 | description: Allows the player to select the specified trail.
166 | default: op
167 | trailgui.trails.mobspell:
168 | description: Allows the player to select the specified trail.
169 | default: op
170 | trailgui.trails.mobspellambient:
171 | description: Allows the player to select the specified trail.
172 | default: op
173 | trailgui.trails.note:
174 | description: Allows the player to select the specified trail.
175 | default: op
176 | trailgui.trails.portal:
177 | description: Allows the player to select the specified trail.
178 | default: op
179 | trailgui.trails.reddust:
180 | description: Allows the player to select the specified trail.
181 | default: op
182 | trailgui.trails.coloredreddust:
183 | description: Allows the player to select the specified trail.
184 | default: op
185 | trailgui.trails.slime:
186 | description: Allows the player to select the specified trail.
187 | default: op
188 | trailgui.trails.snowshovel:
189 | description: Allows the player to select the specified trail.
190 | default: op
191 | trailgui.trails.snowballpoof:
192 | description: Allows the player to select the specified trail.
193 | default: op
194 | trailgui.trails.spell:
195 | description: Allows the player to select the specified trail.
196 | default: op
197 | trailgui.trails.splash:
198 | description: Allows the player to select the specified trail.
199 | default: op
200 | trailgui.trails.townaura:
201 | description: Allows the player to select the specified trail.
202 | default: op
203 | trailgui.trails.wake:
204 | description: Allows the player to select the specified trail.
205 | default: op
206 | trailgui.trails.witchmagic:
207 | description: Allows the player to select the specified trail.
208 | default: op
209 | trailgui.trails.hearts:
210 | description: Allows the player to select the specified trail.
211 | default: op
212 | trailgui.trails.endersignal:
213 | description: Allows the player to select the specified trail.
214 | default: op
215 | trailgui.trails.blockbreak:
216 | description: Allows the player to select the specified trail.
217 | default: op
218 | trailgui.trails.blackdust:
219 | description: Allows the player to select the specified trail.
220 | default: op
221 | trailgui.trails.footstep:
222 | description: Allows the player to select the specified trail.
223 | default: op
224 | trailgui.trails.blackpotion:
225 | description: Allows the player to select the specified trail.
226 | default: op
227 | trailgui.trails.iconcrack:
228 | description: Allows the player to select the specified trail.
229 | default: op
230 | trailgui.trails.bubbles:
231 | description: Allows the player to select the specified trail.
232 | default: op
233 | trailgui.trails.bubblecolumnup:
234 | description: Allows the player to select the specified trail.
235 | default: op
236 | trailgui.trails.bubblepop:
237 | description: Allows the player to select the specified trail.
238 | default: op
239 | trailgui.trails.currentdown:
240 | description: Allows the player to select the specified trail.
241 | default: op
242 | trailgui.trails.squidink:
243 | description: Allows the player to select the specified trail.
244 | default: op
245 | trailgui.trails.sneeze:
246 | description: Allows the player to select the specified trail.
247 | default: op
248 | trailgui.trails.cosycampfire:
249 | description: Allows the player to select the specified trail.
250 | default: op
251 | trailgui.trails.signalcampfire:
252 | description: Allows the player to select the specified trail.
253 | default: op
254 | trailgui.trails.fallingnectar:
255 | description: Allows the player to select the specified trail.
256 | default: op
257 | trailgui.trails.drippinghoney:
258 | description: Allows the player to select the specified trail.
259 | default: op
260 | trailgui.trails.drippingobsidian:
261 | description: Allows the player to select the specified trail.
262 | default: op
263 | trailgui.trails.ash:
264 | description: Allows the player to select the specified trail.
265 | default: op
266 | trailgui.trails.crimsonspore:
267 | description: Allows the player to select the specified trail.
268 | default: op
269 | trailgui.trails.warpedspore:
270 | description: Allows the player to select the specified trail.
271 | default: op
272 | trailgui.trails.soulfire:
273 | description: Allows the player to select the specified trail.
274 | default: op
275 | trailgui.trails.soul:
276 | description: Allows the player to select the specified trail.
277 | default: op
278 | trailgui.trails.drippingdripstonelava:
279 | description: Allows the player to select the specified trail.
280 | default: op
281 | trailgui.trails.drippingdripstonewater:
282 | description: Allows the player to select the specified trail.
283 | default: op
284 | trailgui.trails.electricspark:
285 | description: Allows the player to select the specified trail.
286 | default: op
287 | trailgui.trails.fallingdripstonelava:
288 | description: Allows the player to select the specified trail.
289 | default: op
290 | trailgui.trails.fallingsporeblossom:
291 | description: Allows the player to select the specified trail.
292 | default: op
293 | trailgui.trails.glow:
294 | description: Allows the player to select the specified trail.
295 | default: op
296 | trailgui.trails.glowsquidink:
297 | description: Allows the player to select the specified trail.
298 | default: op
299 | trailgui.trails.scrape:
300 | description: Allows the player to select the specified trail.
301 | default: op
302 | trailgui.trails.smallflame:
303 | description: Allows the player to select the specified trail.
304 | default: op
305 | trailgui.trails.snowflake:
306 | description: Allows the player to select the specified trail.
307 | default: op
308 | trailgui.trails.sporeblossomair:
309 | description: Allows the player to select the specified trail.
310 | default: op
311 | trailgui.trails.waxoff:
312 | description: Allows the player to select the specified trail.
313 | default: op
314 | trailgui.trails.waxon:
315 | description: Allows the player to select the specified trail.
316 | default: op
317 | trailgui.trails.sculksoul:
318 | description: Allows the player to select the specified trail.
319 | default: op
320 | trailgui.trails.sculkcharge:
321 | description: Allows the player to select the specified trail.
322 | default: op
323 | trailgui.trails.sculkchargepop:
324 | description: Allows the player to select the specified trail.
325 | default: op
326 | trailgui.trails.shriek:
327 | description: Allows the player to select the specified trail.
328 | default: op
329 |
330 | trailgui.commands.clearall:
331 | description: Allows the player to use the clearall trails command.
332 | default: op
333 | trailgui.commands.trails:
334 | description: Allows the player to use the trails command.
335 | default: op
336 | trailgui.commands.inventory:
337 | description: Allows the player to use the trails command.
338 | default: op
339 | trailgui.commands.version:
340 | description: Allows the player to view the plugins version.
341 | default: op
342 | trailgui.commands.reloadconfigs:
343 | description: Allows the player to reload all configuration files.
344 | default: op
345 |
346 | trailgui.trails.angryvillager.other:
347 | description: Allows the player to give another player the specified trail.
348 | default: op
349 | trailgui.trails.cloud.other:
350 | description: Allows the player to give another player the specified trail.
351 | default: op
352 | trailgui.trails.criticals.other:
353 | description: Allows the player to give another player the specified trail.
354 | default: op
355 | trailgui.trails.driplava.other:
356 | description: Allows the player to give another player the specified trail.
357 | default: op
358 | trailgui.trails.dripwater.other:
359 | description: Allows the player to give another player the specified trail.
360 | default: op
361 | trailgui.trails.enchantment.other:
362 | description: Allows the player to give another player the specified trail.
363 | default: op
364 | trailgui.trails.spark.other:
365 | description: Allows the player to give another player the specified trail.
366 | default: op
367 | trailgui.trails.flame.other:
368 | description: Allows the player to give another player the specified trail.
369 | default: op
370 | trailgui.trails.happyvillager.other:
371 | description: Allows the player to give another player the specified trail.
372 | default: op
373 | trailgui.trails.instantspell.other:
374 | description: Allows the player to give another player the specified trail.
375 | default: op
376 | trailgui.trails.largesmoke.other:
377 | description: Allows the player to give another player the specified trail.
378 | default: op
379 | trailgui.trails.lava.other:
380 | description: Allows the player to give another player the specified trail.
381 | default: op
382 | trailgui.trails.magiccrit.other:
383 | description: Allows the player to give another player the specified trail.
384 | default: op
385 | trailgui.trails.mobspell.other:
386 | description: Allows the player to give another player the specified trail.
387 | default: op
388 | trailgui.trails.mobspellambient.other:
389 | description: Allows the player to give another player the specified trail.
390 | default: op
391 | trailgui.trails.note.other:
392 | description: Allows the player to give another player the specified trail.
393 | default: op
394 | trailgui.trails.portal.other:
395 | description: Allows the player to give another player the specified trail.
396 | default: op
397 | trailgui.trails.reddust.other:
398 | description: Allows the player to give another player the specified trail.
399 | default: op
400 | trailgui.trails.coloredreddust.other:
401 | description: Allows the player to give another player the specified trail.
402 | default: op
403 | trailgui.trails.slime.other:
404 | description: Allows the player to give another player the specified trail.
405 | default: op
406 | trailgui.trails.snowshovel.other:
407 | description: Allows the player to give another player the specified trail.
408 | default: op
409 | trailgui.trails.snowballpoof.other:
410 | description: Allows the player to give another player the specified trail.
411 | default: op
412 | trailgui.trails.spell.other:
413 | description: Allows the player to give another player the specified trail.
414 | default: op
415 | trailgui.trails.splash.other:
416 | description: Allows the player to give another player the specified trail.
417 | default: op
418 | trailgui.trails.townaura.other:
419 | description: Allows the player to give another player the specified trail.
420 | default: op
421 | trailgui.trails.wake.other:
422 | description: Allows the player to give another player the specified trail.
423 | default: op
424 | trailgui.trails.witchmagic.other:
425 | description: Allows the player to give another player the specified trail.
426 | default: op
427 | trailgui.trails.hearts.other:
428 | description: Allows the player to give another player the specified trail.
429 | default: op
430 | trailgui.trails.iconcrack.other:
431 | description: Allows the player to give another player the specified trail.
432 | default: op
433 | trailgui.trails.endersignal.other:
434 | description: Allows the player to give another player the specified trail.
435 | default: op
436 | trailgui.trails.blockbreak.other:
437 | description: Allows the player to select the specified trail.
438 | default: op
439 | trailgui.trails.blackdust.other:
440 | description: Allows the player to select the specified trail.
441 | default: op
442 | trailgui.trails.footstep.other:
443 | description: Allows the player to select the specified trail.
444 | default: op
445 | trailgui.trails.blackpotion.other:
446 | description: Allows the player to select the specified trail.
447 | default: op
448 | trailgui.trails.bubbles.other:
449 | description: Allows the player to select the specified trail.
450 | default: op
451 | trailgui.trails.bubblecolumnup.other:
452 | description: Allows the player to select the specified trail.
453 | default: op
454 | trailgui.trails.bubblepop.other:
455 | description: Allows the player to select the specified trail.
456 | default: op
457 | trailgui.trails.currentdown.other:
458 | description: Allows the player to select the specified trail.
459 | default: op
460 | trailgui.trails.squidink.other:
461 | description: Allows the player to select the specified trail.
462 | default: op
463 | trailgui.trails.sneeze.other:
464 | description: Allows the player to select the specified trail.
465 | default: op
466 | trailgui.trails.cosycampfire.other:
467 | description: Allows the player to select the specified trail.
468 | default: op
469 | trailgui.trails.signalcampfire.other:
470 | description: Allows the player to select the specified trail.
471 | default: op
472 | trailgui.trails.fallingnectar.other:
473 | description: Allows the player to select the specified trail.
474 | default: op
475 | trailgui.trails.drippinghoney.other:
476 | description: Allows the player to select the specified trail.
477 | default: op
478 | trailgui.trails.drippingobsidian.other:
479 | description: Allows the player to select the specified trail.
480 | default: op
481 | trailgui.trails.ash.other:
482 | description: Allows the player to select the specified trail.
483 | default: op
484 | trailgui.trails.crimsonspore.other:
485 | description: Allows the player to select the specified trail.
486 | default: op
487 | trailgui.trails.warpedspore.other:
488 | description: Allows the player to select the specified trail.
489 | default: op
490 | trailgui.trails.soulfire.other:
491 | description: Allows the player to select the specified trail.
492 | default: op
493 | trailgui.trails.soul.other:
494 | description: Allows the player to select the specified trail.
495 | default: op
496 | trailgui.trails.droppingdripstonelava.other:
497 | description: Allows the player to select the specified trail.
498 | default: op
499 | trailgui.trails.drippingdripstonewater.other:
500 | description: Allows the player to select the specified trail.
501 | default: op
502 | trailgui.trails.electricspark.other:
503 | description: Allows the player to select the specified trail.
504 | default: op
505 | trailgui.trails.fallingdripstonelava.other:
506 | description: Allows the player to select the specified trail.
507 | default: op
508 | trailgui.trails.fallingdripstonewater.other:
509 | description: Allows the player to select the specified trail.
510 | default: op
511 | trailgui.trails.fallingsporeblossom.other:
512 | description: Allows the player to select the specified trail.
513 | default: op
514 | trailgui.trails.glow.other:
515 | description: Allows the player to select the specified trail.
516 | default: op
517 | trailgui.trails.glowsquidink.other:
518 | description: Allows the player to select the specified trail.
519 | default: op
520 | trailgui.trails.scrape.other:
521 | description: Allows the player to select the specified trail.
522 | default: op
523 | trailgui.trails.smallflame.other:
524 | description: Allows the player to select the specified trail.
525 | default: op
526 | trailgui.trails.snowflake.other:
527 | description: Allows the player to select the specified trail.
528 | default: op
529 | trailgui.trails.sporeblossomair.other:
530 | description: Allows the player to select the specified trail.
531 | default: op
532 | trailgui.trails.waxoff.other:
533 | description: Allows the player to select the specified trail.
534 | default: op
535 | trailgui.trails.waxon.other:
536 | description: Allows the player to select the specified trail.
537 | default: op
538 | trailgui.trails.sculksoul.other:
539 | description: Allows the player to select the specified trail.
540 | default: op
541 | trailgui.trails.sculkcharge.other:
542 | description: Allows the player to select the specified trail.
543 | default: op
544 | trailgui.trails.sculkchargepop.other:
545 | description: Allows the player to select the specified trail.
546 | default: op
547 | trailgui.trails.shriek.other:
548 | description: Allows the player to select the specified trail.
549 | default: op
550 |
551 |
552 | trailgui.commands.clearall.other:
553 | description: Allows the player to clear all of the specified players trails.
554 | default: op
555 |
556 | trailgui.commands.*:
557 | description: Allows the player to use all commands
558 | default: op
559 | children:
560 | trailgui.commands.clearall: true
561 | trailgui.commands.version: true
562 | trailgui.commands.reloadconfigs: true
563 | trailgui.commands.clearall.other: true
564 | trailgui.commands.trails: true
565 | trailgui.commands.trail: true
566 | trailgui.commands.trailgui: true
567 |
568 | trailgui.trails.*:
569 | description: Allows the player to use all the trails.
570 | default: op
571 | children:
572 | trailgui.trails.angryvillager: true
573 | trailgui.trails.cloud: true
574 | trailgui.trails.criticals: true
575 | trailgui.trails.driplava: true
576 | trailgui.trails.dripwater: true
577 | trailgui.trails.enchantment: true
578 | trailgui.trails.spark: true
579 | trailgui.trails.flame: true
580 | trailgui.trails.happyvillager: true
581 | trailgui.trails.instantspell: true
582 | trailgui.trails.largesmoke: true
583 | trailgui.trails.lava: true
584 | trailgui.trails.magiccrit: true
585 | trailgui.trails.mobspell: true
586 | trailgui.trails.mobspellambient: true
587 | trailgui.trails.note: true
588 | trailgui.trails.portal: true
589 | trailgui.trails.reddust: true
590 | trailgui.trails.coloredreddust: true
591 | trailgui.trails.slime: true
592 | trailgui.trails.snowshovel: true
593 | trailgui.trails.snowballpoof: true
594 | trailgui.trails.spell: true
595 | trailgui.trails.splash: true
596 | trailgui.trails.townaura: true
597 | trailgui.trails.wake: true
598 | trailgui.trails.witchmagic: true
599 | trailgui.trails.iconcrack: true
600 | trailgui.trails.hearts: true
601 | trailgui.trails.endersignal: true
602 | trailgui.trails.blockbreak: true
603 | trailgui.trails.blackdust: true
604 | trailgui.trails.footstep: true
605 | trailgui.trails.bubbles: true
606 | trailgui.trails.blackpotion: true
607 | trailgui.trails.bubblecolumnup: true
608 | trailgui.trails.bubblepop: true
609 | trailgui.trails.currentdown: true
610 | trailgui.trails.squidink: true
611 | trailgui.trails.sneeze: true
612 | trailgui.trails.cosycampfire: true
613 | trailgui.trails.signalcampfire: true
614 | trailgui.trails.fallingnectar: true
615 | trailgui.trails.drippinghoney: true
616 | trailgui.trails.drippingobsidian: true
617 | trailgui.trails.ash: true
618 | trailgui.trails.crimsonspore: true
619 | trailgui.trails.warpedspore: true
620 | trailgui.trails.soulfire: true
621 | trailgui.trails.soul: true
622 | trailgui.trails.drippingdripstonelava: true
623 | trailgui.trails.drippingdripstonewater: true
624 | trailgui.trails.electricspark: true
625 | trailgui.trails.fallingdripstonelava: true
626 | trailgui.trails.fallingdripstonewater: true
627 | trailgui.trails.fallingsporeblossom: true
628 | trailgui.trails.glow: true
629 | trailgui.trails.glowsquidink: true
630 | trailgui.trails.scrape: true
631 | trailgui.trails.smallflame: true
632 | trailgui.trails.snowflake: true
633 | trailgui.trails.sporeblossomair: true
634 | trailgui.trails.waxoff: true
635 | trailgui.trails.waxon: true
636 | trailgui.trails.sculksoul: true
637 | trailgui.trails.sculkcharge: true
638 | trailgui.trails.sculkchargepop: true
639 | trailgui.trails.shriek: true
640 |
641 | trailgui.trails.clearall: true
642 | trailgui.inventory.*:
643 | description: Allows the player to select all the trails in the GUI.
644 | default: op
645 | children:
646 | trailgui.inventory.angryvillager: true
647 | trailgui.inventory.cloud: true
648 | trailgui.inventory.criticals: true
649 | trailgui.inventory.driplava: true
650 | trailgui.inventory.dripwater: true
651 | trailgui.inventory.enchantment: true
652 | trailgui.inventory.spark: true
653 | trailgui.inventory.flame: true
654 | trailgui.inventory.happyvillager: true
655 | trailgui.inventory.instantspell: true
656 | trailgui.inventory.largesmoke: true
657 | trailgui.inventory.lava: true
658 | trailgui.inventory.magiccrit: true
659 | trailgui.inventory.mobspell: true
660 | trailgui.inventory.mobspellambient: true
661 | trailgui.inventory.note: true
662 | trailgui.inventory.portal: true
663 | trailgui.inventory.reddust: true
664 | trailgui.inventory.coloredreddust: true
665 | trailgui.inventory.slime: true
666 | trailgui.inventory.snowshovel: true
667 | trailgui.inventory.snowballpoof: true
668 | trailgui.inventory.spell: true
669 | trailgui.inventory.splash: true
670 | trailgui.inventory.townaura: true
671 | trailgui.inventory.wake: true
672 | trailgui.inventory.witchmagic: true
673 | trailgui.inventory.hearts: true
674 | trailgui.inventory.iconcrack: true
675 | trailgui.inventory.endersignal: true
676 | trailgui.inventory.blockbreak: true
677 | trailgui.inventory.blackdust: true
678 | trailgui.inventory.footstep: true
679 | trailgui.inventory.bubbles: true
680 | trailgui.inventory.blackpotion: true
681 | trailgui.trails.bubblecolumnup: true
682 | trailgui.trails.bubblepop: true
683 | trailgui.trails.currentdown: true
684 | trailgui.trails.squidink: true
685 | trailgui.trails.sneeze: true
686 | trailgui.trails.cosycampfire: true
687 | trailgui.trails.signalcampfire: true
688 | trailgui.trails.fallingnectar: true
689 | trailgui.trails.drippinghoney: true
690 | trailgui.trails.drippingobsidian: true
691 | trailgui.trails.ash: true
692 | trailgui.trails.crimsonspore: true
693 | trailgui.trails.warpedspore: true
694 | trailgui.trails.soulfire: true
695 | trailgui.trails.soul: true
696 | trailgui.trails.drippingdripstonelava: true
697 | trailgui.trails.drippingdripstonewater: true
698 | trailgui.trails.electricspark: true
699 | trailgui.trails.fallingdripstonelava: true
700 | trailgui.trails.fallingdripstonewater: true
701 | trailgui.trails.fallingsporeblossom: true
702 | trailgui.trails.glow: true
703 | trailgui.trails.glowsquidink: true
704 | trailgui.trails.scrape: true
705 | trailgui.trails.smallflame: true
706 | trailgui.trails.snowflake: true
707 | trailgui.trails.sporeblossomair: true
708 | trailgui.trails.waxoff: true
709 | trailgui.trails.waxon: true
710 | trailgui.inventory.sculksoul: true
711 | trailgui.inventory.sculkcharge: true
712 | trailgui.inventory.sculkchargepop: true
713 | trailgui.inventory.shriek: true
714 |
715 | trailgui.inventory.clearall: true
716 | trailgui.inventory.nextpage: true
717 | trailgui.inventory.previouspage: true
718 |
--------------------------------------------------------------------------------
/src/test/java/MaterialsTest.java:
--------------------------------------------------------------------------------
1 | import ca.jamiesinn.trailgui.trails.*;
2 | import org.bukkit.configuration.ConfigurationSection;
3 | import org.bukkit.configuration.InvalidConfigurationException;
4 | import org.bukkit.configuration.file.FileConfiguration;
5 | import org.bukkit.configuration.file.YamlConfiguration;
6 | import org.junit.Assert;
7 | import org.junit.Rule;
8 | import org.junit.Test;
9 | import org.junit.rules.ErrorCollector;
10 |
11 | import java.io.File;
12 | import java.io.IOException;
13 |
14 | public class MaterialsTest
15 | {
16 | private FileConfiguration config;
17 |
18 | @Rule
19 | public ErrorCollector errors = new ErrorCollector();
20 |
21 | public MaterialsTest()
22 | {
23 | ClassLoader classLoader = getClass().getClassLoader();
24 | File file = new File(classLoader.getResource("config.yml").getFile());
25 | System.out.println(file.toString());
26 | config = new YamlConfiguration();
27 | try
28 | {
29 | config.load(file);
30 | }
31 | catch (IOException | InvalidConfigurationException e)
32 | {
33 | e.printStackTrace();
34 | }
35 | }
36 |
37 |
38 | @Test
39 | public void TestConfigMaterials()
40 | {
41 | System.out.println("Checking config for Material validation");
42 | if (getConfig().isConfigurationSection("trails"))
43 | {
44 | ConfigurationSection section = getConfig().getConfigurationSection("trails");
45 | for (String key : section.getKeys(false))
46 | {
47 | if (section.isConfigurationSection(key))
48 | {
49 | ConfigurationSection trailTypeSection = section.getConfigurationSection(key);
50 | System.out.println("Loading section: " + trailTypeSection.getName());
51 | try
52 | {
53 | Trail trail;
54 | if (trailTypeSection.getString("type").equalsIgnoreCase("ITEM_CRACK"))
55 | {
56 | trail = new ItemTrail(trailTypeSection);
57 | }
58 | else if (trailTypeSection.getString("type").equalsIgnoreCase("BLOCK_CRACK")
59 | || trailTypeSection.getString("type").equalsIgnoreCase("BLOCK_DUST")
60 | || trailTypeSection.getString("type").equalsIgnoreCase("FALLING_DUST"))
61 | {
62 | trail = new BlockTrail(trailTypeSection);
63 | }
64 | else if (trailTypeSection.getString("type").equalsIgnoreCase("REDSTONE"))
65 | {
66 | trail = new RedstoneTrail(trailTypeSection);
67 | }
68 | else if (trailTypeSection.getBoolean("is_effect", false))
69 | {
70 | trail = new EffectTrail(trailTypeSection);
71 | }
72 | else if (trailTypeSection.getString("type").equalsIgnoreCase("SCULK_CHARGE"))
73 | {
74 | trail = new SculkChargeTrail(trailTypeSection);
75 | }
76 | else if (trailTypeSection.getString("type").equalsIgnoreCase("SHRIEK"))
77 | {
78 | trail = new ShriekTrail(trailTypeSection);
79 | }
80 | else
81 | {
82 | trail = new NormalTrail(trailTypeSection);
83 | }
84 |
85 | Assert.assertNotNull(trail.getType());
86 | System.out.println("Loaded trail with type: "+trail.getType());
87 | }
88 | catch (Exception ex)
89 | {
90 | Assert.fail("Failed to load '" + trailTypeSection.getName() + "'. Error: " + ex.getMessage());
91 | }
92 | }
93 | }
94 | }
95 | }
96 |
97 | private FileConfiguration getConfig()
98 | {
99 | return config;
100 | }
101 | }
102 |
--------------------------------------------------------------------------------