Skip to content

Commit 35d0572

Browse files
[Repo back online] Revert "Remove fabledskyblock support since it repo down"
This reverts commit 0016337
1 parent 3849558 commit 35d0572

File tree

3 files changed

+145
-132
lines changed

3 files changed

+145
-132
lines changed

pom.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -866,18 +866,18 @@
866866
<version>4.9.2</version>
867867
<systemPath>${project.basedir}/lib/TNE.jar</systemPath>
868868
</dependency>
869-
<!-- <dependency>-->
870-
<!-- <groupId>com.songoda</groupId>-->
871-
<!-- <artifactId>skyblock</artifactId>-->
872-
<!-- <version>2.2.13</version>-->
873-
<!-- <scope>provided</scope>-->
874-
<!-- <exclusions>-->
875-
<!-- <exclusion>-->
876-
<!-- <artifactId>MVdWPlaceholderAPI</artifactId>-->
877-
<!-- <groupId>be.maximvdw</groupId>-->
878-
<!-- </exclusion>-->
879-
<!-- </exclusions>-->
880-
<!-- </dependency>-->
869+
<dependency>
870+
<groupId>com.songoda</groupId>
871+
<artifactId>skyblock</artifactId>
872+
<version>2.2.13</version>
873+
<scope>provided</scope>
874+
<exclusions>
875+
<exclusion>
876+
<artifactId>MVdWPlaceholderAPI</artifactId>
877+
<groupId>be.maximvdw</groupId>
878+
</exclusion>
879+
</exclusions>
880+
</dependency>
881881
<!-- <dependency>-->
882882
<!-- <groupId>team.aura_dev.lib.slf4j-plugin.spigot</groupId>-->
883883
<!-- <artifactId>slf4j-plugin-spigot</artifactId>-->

src/main/java/org/maxgamer/quickshop/integration/IntegrationHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.jetbrains.annotations.NotNull;
2727
import org.maxgamer.quickshop.QuickShop;
2828
import org.maxgamer.quickshop.integration.advancedregionmarket.AdvancedShopRegionMarketIntegration;
29+
import org.maxgamer.quickshop.integration.fabledskyblock.FabledIntegration;
2930
import org.maxgamer.quickshop.integration.factionsuuid.FactionsUUIDIntegration;
3031
import org.maxgamer.quickshop.integration.griefprevention.GriefPreventionIntegration;
3132
import org.maxgamer.quickshop.integration.iridiumskyblock.IridiumSkyblockIntegration;
@@ -56,7 +57,7 @@ public class IntegrationHelper extends QuickShopInstanceHolder {
5657
integratedPluginNameMap.put("Residence", ResidenceIntegration.class);
5758
integratedPluginNameMap.put("Towny", TownyIntegration.class);
5859
integratedPluginNameMap.put("WorldGuard", WorldGuardIntegration.class);
59-
//integratedPluginNameMap.put("FabledSkyblock", FabledIntegration.class);
60+
integratedPluginNameMap.put("FabledSkyblock", FabledIntegration.class);
6061
integratedPluginNameMap.put("IridiumSkyblock", IridiumSkyblockIntegration.class);
6162
integratedPluginNameMap.put("SuperiorSkyblock", SuperiorSkyblock2Integration.class);
6263
integratedPluginNameMap.put("AdvancedRegionMarket", AdvancedShopRegionMarketIntegration.class);
Lines changed: 131 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,131 @@
1-
///*
2-
// * This file is a part of project QuickShop, the name is FabledIntegration.java
3-
// * Copyright (C) PotatoCraft Studio and contributors
4-
// *
5-
// * This program is free software: you can redistribute it and/or modify it
6-
// * under the terms of the GNU General Public License as published by the
7-
// * Free Software Foundation, either version 3 of the License, or
8-
// * (at your option) any later version.
9-
// *
10-
// * This program is distributed in the hope that it will be useful, but WITHOUT
11-
// * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12-
// * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13-
// * for more details.
14-
// *
15-
// * You should have received a copy of the GNU General Public License
16-
// * along with this program. If not, see <http://www.gnu.org/licenses/>.
17-
// *
18-
// */
19-
//
20-
//package org.maxgamer.quickshop.integration.fabledskyblock;
21-
//
22-
//import com.songoda.skyblock.SkyBlock;
23-
//import com.songoda.skyblock.island.Island;
24-
//import com.songoda.skyblock.island.IslandRole;
25-
//import org.bukkit.Location;
26-
//import org.bukkit.entity.Player;
27-
//import org.jetbrains.annotations.NotNull;
28-
//import org.maxgamer.quickshop.QuickShop;
29-
//import org.maxgamer.quickshop.integration.IntegrateStage;
30-
//import org.maxgamer.quickshop.integration.IntegrationStage;
31-
//import org.maxgamer.quickshop.integration.QSIntegratedPlugin;
32-
//
33-
//@IntegrationStage(loadStage = IntegrateStage.onEnableAfter)
34-
//public class FabledIntegration extends QSIntegratedPlugin {
35-
//
36-
// private final boolean ignoreDisabledWorlds;
37-
// private final boolean whitelist;
38-
//
39-
// public FabledIntegration(QuickShop plugin) {
40-
// super(plugin);
41-
// ignoreDisabledWorlds = plugin.getConfig().getBoolean("integration.fabledskyblock.ignore-disabled-worlds");
42-
// whitelist = plugin.getConfig().getBoolean("integration.fabledskyblock.whitelist-mode");
43-
// this.registerListener();
44-
// }
45-
//
46-
// /**
47-
// * Return the integrated plugin name.
48-
// * For example, Residence
49-
// *
50-
// * @return integrated plugin
51-
// */
52-
// @Override
53-
// public @NotNull String getName() {
54-
// return "FabledSkyblock";
55-
// }
56-
//
57-
// /**
58-
// * Check if a player can create shop here
59-
// *
60-
// * @param player the player want to create shop
61-
// * @param location shop location
62-
// * @return If you can create shop here
63-
// */
64-
// @Override
65-
// public boolean canCreateShopHere(@NotNull Player player, @NotNull Location location) {
66-
// Island island = SkyBlock.getInstance().getIslandManager().getIslandAtLocation(location);
67-
// if (island == null) return whitelist;
68-
// return island.getRole(player).equals(IslandRole.Member) || island.getRole(player).equals(IslandRole.Owner)
69-
// || island.getRole(player).equals(IslandRole.Operator);
70-
// }
71-
//
72-
// /**
73-
// * Check if a player can trade with shop here
74-
// *
75-
// * @param player the player want to trade with shop
76-
// * @param location shop location
77-
// * @return If you can trade with shop here
78-
// */
79-
// @Override
80-
// public boolean canTradeShopHere(@NotNull Player player, @NotNull Location location) {
81-
// if (SkyBlock.getInstance().getIslandManager().getIslandAtLocation(location) == null) {
82-
// return ignoreDisabledWorlds;
83-
// }
84-
// return true;
85-
// }
86-
//
87-
// /**
88-
// * Check if a player can delete a shop here
89-
// *
90-
// * @param player the player want to delete the shop
91-
// * @param location shop location
92-
// * @return If you can delete the shop here
93-
// */
94-
// @Override
95-
// public boolean canDeleteShopHere(@NotNull Player player, @NotNull Location location) {
96-
// Island island = SkyBlock.getInstance().getIslandManager().getIslandAtLocation(location);
97-
// if (island == null) return whitelist;
98-
// return island.getRole(player).equals(IslandRole.Member) || island.getRole(player).equals(IslandRole.Owner)
99-
// || island.getRole(player).equals(IslandRole.Operator);
100-
// }
101-
//
102-
// /**
103-
// * Loading logic
104-
// * Execute Stage defined by IntegrationStage
105-
// */
106-
// @Override
107-
// public void load() {
108-
//
109-
// }
110-
//
111-
// /**
112-
// * Unloding logic
113-
// * Will execute when Quickshop unloading
114-
// */
115-
// @Override
116-
// public void unload() {
117-
//
118-
// }
119-
//}
1+
/*
2+
* This file is a part of project QuickShop, the name is FabledIntegration.java
3+
* Copyright (C) PotatoCraft Studio and contributors
4+
*
5+
* This program is free software: you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License as published by the
7+
* Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful, but WITHOUT
11+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13+
* for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*
18+
*/
19+
20+
package org.maxgamer.quickshop.integration.fabledskyblock;
21+
22+
import com.songoda.skyblock.SkyBlock;
23+
import com.songoda.skyblock.island.Island;
24+
import com.songoda.skyblock.island.IslandRole;
25+
import org.bukkit.Location;
26+
import org.bukkit.entity.Player;
27+
import org.jetbrains.annotations.NotNull;
28+
import org.maxgamer.quickshop.QuickShop;
29+
import org.maxgamer.quickshop.integration.IntegrateStage;
30+
import org.maxgamer.quickshop.integration.IntegrationStage;
31+
import org.maxgamer.quickshop.integration.QSIntegratedPlugin;
32+
import org.maxgamer.quickshop.util.reload.ReloadResult;
33+
import org.maxgamer.quickshop.util.reload.ReloadStatus;
34+
35+
@IntegrationStage(loadStage = IntegrateStage.onEnableAfter)
36+
public class FabledIntegration extends QSIntegratedPlugin {
37+
38+
private boolean ignoreDisabledWorlds;
39+
private boolean whitelist;
40+
41+
public FabledIntegration(QuickShop plugin) {
42+
super(plugin);
43+
loadConfiguration();
44+
registerListener();
45+
}
46+
47+
private void loadConfiguration() {
48+
ignoreDisabledWorlds = plugin.getConfig().getBoolean("integration.fabledskyblock.ignore-disabled-worlds");
49+
whitelist = plugin.getConfig().getBoolean("integration.fabledskyblock.whitelist-mode");
50+
}
51+
52+
/**
53+
* Return the integrated plugin name.
54+
* For example, Residence
55+
*
56+
* @return integrated plugin
57+
*/
58+
@Override
59+
public @NotNull String getName() {
60+
return "FabledSkyblock";
61+
}
62+
63+
/**
64+
* Check if a player can create shop here
65+
*
66+
* @param player the player want to create shop
67+
* @param location shop location
68+
* @return If you can create shop here
69+
*/
70+
@Override
71+
public boolean canCreateShopHere(@NotNull Player player, @NotNull Location location) {
72+
Island island = SkyBlock.getInstance().getIslandManager().getIslandAtLocation(location);
73+
if (island == null) return whitelist;
74+
return island.getRole(player).equals(IslandRole.Member) || island.getRole(player).equals(IslandRole.Owner)
75+
|| island.getRole(player).equals(IslandRole.Operator);
76+
}
77+
78+
/**
79+
* Check if a player can trade with shop here
80+
*
81+
* @param player the player want to trade with shop
82+
* @param location shop location
83+
* @return If you can trade with shop here
84+
*/
85+
@Override
86+
public boolean canTradeShopHere(@NotNull Player player, @NotNull Location location) {
87+
if (SkyBlock.getInstance().getIslandManager().getIslandAtLocation(location) == null) {
88+
return ignoreDisabledWorlds;
89+
}
90+
return true;
91+
}
92+
93+
/**
94+
* Check if a player can delete a shop here
95+
*
96+
* @param player the player want to delete the shop
97+
* @param location shop location
98+
* @return If you can delete the shop here
99+
*/
100+
@Override
101+
public boolean canDeleteShopHere(@NotNull Player player, @NotNull Location location) {
102+
Island island = SkyBlock.getInstance().getIslandManager().getIslandAtLocation(location);
103+
if (island == null) return whitelist;
104+
return island.getRole(player).equals(IslandRole.Member) || island.getRole(player).equals(IslandRole.Owner)
105+
|| island.getRole(player).equals(IslandRole.Operator);
106+
}
107+
108+
/**
109+
* Loading logic
110+
* Execute Stage defined by IntegrationStage
111+
*/
112+
@Override
113+
public void load() {
114+
115+
}
116+
117+
/**
118+
* Unloding logic
119+
* Will execute when Quickshop unloading
120+
*/
121+
@Override
122+
public void unload() {
123+
124+
}
125+
126+
@Override
127+
public ReloadResult reloadModule() throws Exception {
128+
loadConfiguration();
129+
return ReloadResult.builder().status(ReloadStatus.SUCCESS).build();
130+
}
131+
}

0 commit comments

Comments
 (0)