Skip to content

Commit 753e35c

Browse files
authored
Merge pull request Ghost-chu#1598 from Ghost-chu/master
5.0.0.14
2 parents 917c8b1 + 71493d0 commit 753e35c

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<artifactId>QuickShop</artifactId>
2626

2727
<properties>
28-
<pluginver>5.0.0.13</pluginver>
28+
<pluginver>5.0.0.14</pluginver>
2929
<package>org.maxgamer.quickshop</package>
3030
<developer>Ghost-chu</developer>
3131
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

src/main/java/org/maxgamer/quickshop/QuickShop.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ private void load3rdParty() {
352352
}
353353
}
354354
if (getConfiguration().getBoolean("plugin.WorldEdit")) {
355-
String nmsVersion = ReflectFactory.getNMSVersion();
356355
// GameVersion gameVersion = GameVersion.get(nmsVersion);
357356
this.worldEditPlugin = Bukkit.getPluginManager().getPlugin("WorldEdit");
358357
if (this.worldEditPlugin != null) {

src/main/java/org/maxgamer/quickshop/integration/advancedregionmarket/AdvancedShopRegionMarketIntegration.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
package org.maxgamer.quickshop.integration.advancedregionmarket;
2121

22+
import net.alex9849.arm.events.RemoveRegionEvent;
2223
import net.alex9849.arm.events.RestoreRegionEvent;
23-
import net.alex9849.arm.events.UnsellRegionEvent;
2424
import net.alex9849.arm.regions.Region;
2525
import org.bukkit.Chunk;
2626
import org.bukkit.Location;
@@ -90,16 +90,17 @@ public boolean canTradeShopHere(@NotNull Player player, @NotNull Location locati
9090
*/
9191
@Override
9292
public void load() {
93+
//scanAndUnregister();
9394
registerListener();
9495
}
95-
96+
//
9697
// @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
9798
// public void onPluginLoad(PluginEnableEvent event) {
9899
// if ("ArmShopBridge".equals(event.getPlugin().getName())) {
99100
// scanAndUnregister();
100101
// }
101102
// }
102-
//
103+
103104
// private void scanAndUnregister() {
104105
// try {
105106
// if (Bukkit.getPluginManager().getPlugin("ArmShopBridge") == null || ArmShopBridge.getInstance() == null) {
@@ -131,9 +132,9 @@ public void unload() {
131132

132133
private void handleDeletion(Region region) {
133134
Vector minPoint = region.getRegion().getMinPoint();
134-
Vector maxPoint = region.getRegion().getMinPoint();
135+
Vector maxPoint = region.getRegion().getMaxPoint();
135136
World world = region.getRegionworld();
136-
Set<Chunk> chuckLocations = new HashSet<Chunk>();
137+
Set<Chunk> chuckLocations = new HashSet<>();
137138

138139
for (int x = minPoint.getBlockX(); x <= maxPoint.getBlockX() + 16; x += 16) {
139140
for (int z = minPoint.getBlockZ(); z <= maxPoint.getBlockZ() + 16; z += 16) {
@@ -150,10 +151,12 @@ private void handleDeletion(Region region) {
150151
shopMap.putAll(shopsInChunk);
151152
}
152153
}
153-
for (Location shopLocation : shopMap.keySet()) {
154+
for (Map.Entry<Location, Shop> shopEntry : shopMap.entrySet()) {
155+
Location shopLocation = shopEntry.getKey();
154156
if (region.getRegion().contains(shopLocation.getBlockX(), shopLocation.getBlockY(), shopLocation.getBlockZ())) {
155-
Shop shop = shopMap.get(shopLocation);
157+
Shop shop = shopEntry.getValue();
156158
if (shop != null) {
159+
shop.onUnload();
157160
shop.delete(false);
158161
}
159162
}
@@ -165,13 +168,8 @@ public void onShopNeedDeletion(RestoreRegionEvent event) {
165168
handleDeletion(event.getRegion());
166169
}
167170

168-
// @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
169-
// public void onShopNeedDeletion(RemoveRegionEvent event) {
170-
// handleDeletion(event.getRegion());
171-
// }
172-
173171
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
174-
public void onShopNeedDeletion(UnsellRegionEvent event) {
172+
public void onShopNeedDeletion(RemoveRegionEvent event) {
175173
handleDeletion(event.getRegion());
176174
}
177175

0 commit comments

Comments
 (0)