Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Commit

Permalink
Remove useless code
Browse files Browse the repository at this point in the history
Former-commit-id: ef4e7e9
  • Loading branch information
sandtechnology committed Feb 29, 2020
1 parent 0913ff5 commit 84e336f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
7 changes: 0 additions & 7 deletions src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public class ContainerShop implements Shop {
private double price;
private ShopType shopType;
private boolean unlimited;
private boolean isDeleted;

private ContainerShop(@NotNull ContainerShop s) {
this.displayItem = s.displayItem;
Expand Down Expand Up @@ -399,7 +398,6 @@ public void delete(boolean fromMemory) {
if (isLoaded) {
this.onUnload();
}
isDeleted=true;
// Delete the display item
if (this.getDisplayItem() != null) {
this.getDisplayItem().remove();
Expand Down Expand Up @@ -877,11 +875,6 @@ public boolean isValid() {
return Util.canBeShop(this.getLocation().getBlock());
}

@Override
public boolean isDeleted() {
return isDeleted;
}

@Override
public @Nullable DisplayItem getDisplay() {
return this.displayItem;
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/org/maxgamer/quickshop/Shop/Shop.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,6 @@ public interface Shop {
*/
boolean isValid();

/**
* Shop is deleted
*
* @return true if deleted
*/
boolean isDeleted();

/**
* Get the shop display entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public class VirtualDisplayItem extends DisplayItem {

private static ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
private volatile boolean isDisplay;
private volatile boolean isLoaded;
//counter for ensuring ID is unique
private static final AtomicInteger counter = new AtomicInteger(0);
//server main version (1_13_R2->13)
Expand Down Expand Up @@ -92,11 +91,6 @@ public void onPacketSending(PacketEvent event) {
//is really full chunk data
boolean isFull = event.getPacket().getBooleans().read(0);

//if shop has deleted, unregister myself to ensure will be collected by GC
if (!shop.isDeleted()) {
unload();
return;
}
if (!shop.isLoaded() || !isDisplay || !isFull || !Util.isLoaded(shop.getLocation())) {
return;
}
Expand All @@ -105,7 +99,6 @@ public void onPacketSending(PacketEvent event) {
//chunk z
int z = event.getPacket().getIntegers().read(1);


World world = shop.getLocation().getWorld();
Chunk chunk = shop.getLocation().getChunk();
if (world.getName().equals(event.getPlayer().getWorld().getName())
Expand Down

0 comments on commit 84e336f

Please sign in to comment.