Skip to content

Commit

Permalink
Version 3.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsLewizzz committed Jul 7, 2020
1 parent d92cdee commit 19bd492
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 28 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>fun.lewisdev</groupId>
<artifactId>DeluxeHub</artifactId>
<version>3.3.5</version>
<version>3.3.7</version>
<packaging>jar</packaging>

<name>DeluxeHub</name>
Expand Down Expand Up @@ -93,6 +93,10 @@
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>bgm</id>
<url>https://bgmp.cl/</url>
</repository>
<repository>
<id>CodeMC</id>
<url>https://repo.codemc.org/repository/maven-public</url>
Expand All @@ -105,10 +109,6 @@
<id>mojang</id>
<url>https://libraries.minecraft.net/</url>
</repository>
<repository>
<id>bgm</id>
<url>https://bgmp.cl/</url>
</repository>
</repositories>

<dependencies>
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/fun/lewisdev/deluxehub/DeluxeHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public class DeluxeHub extends JavaPlugin {

private static final int BSTATS_ID = 3151;
public static int SERVER_VERSION;
private boolean loaded = false;

private ConfigManager configManager;
private ActionManager actionManager;
Expand Down Expand Up @@ -103,16 +102,14 @@ public void onEnable() {

getLogger().log(Level.INFO, "");
getLogger().log(Level.INFO, "Successfully loaded in " + (System.currentTimeMillis() - start) + "ms");
loaded = true;
}

public void onDisable() {
Bukkit.getScheduler().cancelTasks(this);
if (loaded) {
moduleManager.unloadModules();
inventoryManager.onDisable();
configManager.saveFiles();
}
moduleManager.unloadModules();
inventoryManager.onDisable();
configManager.saveFiles();

}

public void reload() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import de.tr7zw.changeme.nbtapi.NBTItem;
import fun.lewisdev.deluxehub.DeluxeHub;
import fun.lewisdev.deluxehub.utility.ItemStackBuilder;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -139,14 +140,16 @@ public void hotbarPlayerQuit(PlayerQuitEvent event) {
if (!getHotbarManager().inDisabledWorld(player.getLocation())) removeItem(player);
}

@EventHandler
@EventHandler(priority = EventPriority.HIGHEST)
public void hotbarWorldChange(PlayerChangedWorldEvent event) {
Player player = event.getPlayer();
if (getHotbarManager().inDisabledWorld(player.getLocation())) {
removeItem(player);
} else {
giveItem(player);
}
Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), () -> {
if (getHotbarManager().inDisabledWorld(player.getLocation())) {
removeItem(player);
} else {
giveItem(player);
}
}, 5L);
}

@EventHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import fun.lewisdev.deluxehub.config.ConfigType;
import fun.lewisdev.deluxehub.module.Module;
import fun.lewisdev.deluxehub.module.ModuleType;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
Expand All @@ -23,8 +24,10 @@ public LobbySpawn(DeluxeHub plugin) {

@Override
public void onEnable() {
FileConfiguration config = getConfig(ConfigType.DATA);
if (config.contains("spawn")) location = (Location) config.get("spawn");
Bukkit.getScheduler().scheduleSyncDelayedTask(getPlugin(), () -> {
FileConfiguration config = getConfig(ConfigType.DATA);
if (config.contains("spawn")) location = (Location) config.get("spawn");
});
spawnJoin = getConfig(ConfigType.SETTINGS).getBoolean("join_settings.spawn_join", false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@
* XMaterial v1: https://www.spigotmc.org/threads/329630/
*
* @author Crypto Morin
* @version 5.0.0
* @version 5.0.1
* @see Material
* @see ItemStack
*/
public enum XMaterial {
ACACIA_BOAT("BOAT_ACACIA"),
ACACIA_BUTTON("WOOD_BUTTON"),
ACACIA_DOOR("ACACIA_DOOR_ITEM"),
ACACIA_DOOR("ACACIA_DOOR_ITEM", "ACACIA_DOOR"),
ACACIA_FENCE,
ACACIA_FENCE_GATE,
ACACIA_LEAVES("LEAVES_2"),
Expand Down Expand Up @@ -124,7 +124,7 @@ public enum XMaterial {
BELL("1.14"),
BIRCH_BOAT("BOAT_BIRCH"),
BIRCH_BUTTON("WOOD_BUTTON"),
BIRCH_DOOR("BIRCH_DOOR_ITEM"),
BIRCH_DOOR("BIRCH_DOOR_ITEM", "BIRCH_DOOR"),
BIRCH_FENCE,
BIRCH_FENCE_GATE,
BIRCH_LEAVES(2, "LEAVES"),
Expand Down Expand Up @@ -338,7 +338,7 @@ public enum XMaterial {
DANDELION("YELLOW_FLOWER"),
DARK_OAK_BOAT("BOAT_DARK_OAK"),
DARK_OAK_BUTTON("WOOD_BUTTON"),
DARK_OAK_DOOR("DARK_OAK_DOOR_ITEM"),
DARK_OAK_DOOR("DARK_OAK_DOOR_ITEM", "DARK_OAK_DOOR"),
DARK_OAK_FENCE,
DARK_OAK_FENCE_GATE,
DARK_OAK_LEAVES(4, "LEAVES", "LEAVES_2"),
Expand Down Expand Up @@ -574,7 +574,7 @@ public enum XMaterial {
JUKEBOX,
JUNGLE_BOAT("BOAT_JUNGLE"),
JUNGLE_BUTTON("WOOD_BUTTON"),
JUNGLE_DOOR("JUNGLE_DOOR_ITEM"),
JUNGLE_DOOR("JUNGLE_DOOR_ITEM", "JUNGLE_DOOR"),
JUNGLE_FENCE,
JUNGLE_FENCE_GATE,
JUNGLE_LEAVES(3, "LEAVES"),
Expand Down Expand Up @@ -1029,7 +1029,7 @@ public enum XMaterial {
SPONGE,
SPRUCE_BOAT("BOAT_SPRUCE"),
SPRUCE_BUTTON("WOOD_BUTTON"),
SPRUCE_DOOR("SPRUCE_DOOR_ITEM"),
SPRUCE_DOOR("SPRUCE_DOOR_ITEM", "SPRUCE_DOOR"),
SPRUCE_FENCE,
SPRUCE_FENCE_GATE,
SPRUCE_LEAVES(1, "LEAVES"),
Expand Down Expand Up @@ -1211,11 +1211,11 @@ public enum XMaterial {
YELLOW_WOOL(4, "WOOL"),
ZOMBIE_HEAD(2, "SKULL", "SKULL_ITEM"),
ZOMBIE_HORSE_SPAWN_EGG(29, "MONSTER_EGG"),
ZOMBIE_PIGMAN_SPAWN_EGG(57, "MONSTER_EGG"),
ZOMBIE_SPAWN_EGG(54, "MONSTER_EGG"),
ZOMBIE_VILLAGER_SPAWN_EGG(27, "MONSTER_EGG"),
ZOMBIE_WALL_HEAD(2, "SKULL", "SKULL_ITEM"),
ZOMBIFIED_PIGLIN_SPAWN_EGG(54, "MONSTER_EGG");
PIGLIN_SPAWN_EGG(57, "MONSTER_EGG"),
ZOMBIFIED_PIGLIN_SPAWN_EGG(57, "MONSTER_EGG", "ZOMBIE_PIGMAN_SPAWN_EGG");


/**
Expand Down Expand Up @@ -1265,6 +1265,7 @@ public enum XMaterial {
// for 1.12 to parse the material, but it needs <type>_DOOR_ITEM.
// We'll trick XMaterial into thinking this needs to be parsed
// using the old methods.
// These materials have their enum name added to the legacy list as well.
.put(DARK_OAK_DOOR, DARK_OAK_DOOR)
.put(ACACIA_DOOR, ACACIA_DOOR)
.put(BIRCH_DOOR, BIRCH_DOOR)
Expand Down

0 comments on commit 19bd492

Please sign in to comment.