Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit e463538

Browse files
committed
1 parent b4052e9 commit e463538

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/main/java/cat/nyaa/HamsterEcoHelper/database/Database.java

+5-8
Original file line numberDiff line numberDiff line change
@@ -229,19 +229,16 @@ public Sign createLottoSign(OfflinePlayer player, Block block, ShopMode mode, do
229229
public boolean removeShopSign(Block block) {
230230
Sign shopLocation = new Sign();
231231
shopLocation.setLocation(block.getLocation());
232-
try (Query<Sign> sign = database.query(Sign.class).whereEq("id", shopLocation.id)) {
233-
if (sign != null) {
234-
sign.delete();
235-
sign.commit();
236-
return true;
237-
}
238-
}
239-
return false;
232+
return removeShopSign(shopLocation);
240233
}
241234

242235
public boolean removeShopSign(String world, int x, int y, int z) {
243236
Sign shopLocation = new Sign();
244237
shopLocation.setLocation(world, x, y, z);
238+
return removeShopSign(shopLocation);
239+
}
240+
241+
private boolean removeShopSign(Sign shopLocation) {
245242
try (Query<Sign> sign = database.queryTransactional(Sign.class).whereEq("id", shopLocation.id)) {
246243
if (sign != null) {
247244
sign.delete();

0 commit comments

Comments
 (0)