mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-24 17:39:52 -05:00
Refactor: Adapt the stru after refactored
Former-commit-id: 47c589a1c0e86984c9e0da3a4ae9b45721655467
This commit is contained in:
1 parent
f1a7fb2a26
commit
e54b8f8a47
3 files changed
+11
-12
No files matched your search
@@ -47,7 +47,7 @@ public class SubCommand_Clean implements CommandProcesser {
|
||||
MsgUtil.sendMessage(sender,MsgUtil.getMessage("command.cleaning", sender));
|
||||
|
||||
final Iterator<Shop> shIt = plugin.getShopManager().getShopIterator();
|
||||
final ArrayList<Shop> pendingRemoval = new java.util.ArrayList<>();
|
||||
final List<Shop> pendingRemoval = new ArrayList<>();
|
||||
int i = 0;
|
||||
|
||||
while (shIt.hasNext()) {
|
||||
@@ -72,9 +72,7 @@ public class SubCommand_Clean implements CommandProcesser {
|
||||
}
|
||||
}
|
||||
|
||||
for (Shop shop : pendingRemoval) {
|
||||
shop.delete();
|
||||
}
|
||||
pendingRemoval.forEach(Shop::delete);
|
||||
|
||||
MsgUtil.clean();
|
||||
MsgUtil.sendMessage(sender,MsgUtil.getMessage("command.cleaned", sender, "" + i));
|
||||
|
||||
@@ -19,22 +19,23 @@
|
||||
|
||||
package org.maxgamer.quickshop.command.subcommand;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.maxgamer.quickshop.command.CommandProcesser;
|
||||
import org.maxgamer.quickshop.QuickShop;
|
||||
import org.maxgamer.quickshop.command.CommandProcesser;
|
||||
import org.maxgamer.quickshop.shop.Shop;
|
||||
import org.maxgamer.quickshop.util.MsgUtil;
|
||||
import org.maxgamer.quickshop.util.Util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class SubCommand_Find implements CommandProcesser {
|
||||
|
||||
private final QuickShop plugin = QuickShop.instance;
|
||||
@@ -80,7 +81,7 @@ public class SubCommand_Find implements CommandProcesser {
|
||||
for (int x = -chunkRadius + c.getX(); x < chunkRadius + c.getX(); x++) {
|
||||
for (int z = -chunkRadius + c.getZ(); z < chunkRadius + c.getZ(); z++) {
|
||||
final Chunk d = c.getWorld().getChunkAt(x, z);
|
||||
final HashMap<Location, Shop> inChunk = plugin.getShopManager().getShops(d);
|
||||
final Map<Location, Shop> inChunk = plugin.getShopManager().getShops(d);
|
||||
|
||||
if (inChunk == null) {
|
||||
continue;
|
||||
|
||||
@@ -131,7 +131,7 @@ public class ShopManager {
|
||||
*
|
||||
* @return a map of World - Chunk - Shop
|
||||
*/
|
||||
public Map<String, Map<ShopChunk, Map<Location, Shop>>> getShops() {
|
||||
public @NotNull Map<String, Map<ShopChunk, Map<Location, Shop>>> getShops() {
|
||||
return this.shops;
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public class ShopManager {
|
||||
*
|
||||
* @return a new shop iterator object.
|
||||
*/
|
||||
public Iterator<Shop> getShopIterator() {
|
||||
public @NotNull Iterator<Shop> getShopIterator() {
|
||||
return new ShopIterator();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user