Update 1.2.5

This commit is contained in:
Niels Vergucht 2018-12-18 00:01:34 +01:00
parent 8f7c6c1165
commit 02b03f10ee
6 changed files with 23 additions and 6 deletions

View File

@ -2,7 +2,7 @@
<groupId>com.songoda</groupId>
<artifactId>EpicBuckets</artifactId>
<modelVersion>4.0.0</modelVersion>
<version>1.2.4</version>
<version>1.2.5</version>
<build>
<defaultGoal>clean package</defaultGoal>
<plugins>
@ -121,7 +121,7 @@
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
</repository>
<repository>
<id>3_aikar</id>
<id>33_aikar</id>
<url>https://repo.aikar.co/content/groups/aikar/</url>
</repository>
<repository>

View File

@ -44,6 +44,7 @@ public class ConfigManager {
private int spongeRadius;
private int maxGenbucketsPerPlayer;
private boolean unlimitedGenbuckets;
private boolean infiniteUse;
private int maxVerticalHeight;
private int maxHorizontalLength;
private int delay;
@ -94,6 +95,7 @@ public class ConfigManager {
spongeRadius = epicBuckets.getConfig().getInt("SPONGE-RADIUS");
maxGenbucketsPerPlayer = epicBuckets.getConfig().getInt("MAX-ACTIVE-GEN-PER-PLAYER");
unlimitedGenbuckets = epicBuckets.getConfig().getBoolean("PLACE-UNLIMTED-GENS");
infiniteUse = epicBuckets.getConfig().getBoolean("INFINITE-USE");
maxVerticalHeight = epicBuckets.getConfig().getInt("MAX-VERTICAL-HEIGHT");
maxHorizontalLength = epicBuckets.getConfig().getInt("MAX-HORIZONTAL-LENGTH");
delay = epicBuckets.getConfig().getInt("DELAY");
@ -272,4 +274,8 @@ public class ConfigManager {
public List<BlockFace> getLogicalFacesForGenbucket(GenbucketType genbucketType) {
return genbucketLogicalFaces.get(genbucketType);
}
public boolean isInfiniteUse() {
return infiniteUse;
}
}

View File

@ -72,6 +72,7 @@ public class GenbucketManager {
}
public boolean canRegisterNewGenbucket(Player owner) {
if (epicBuckets.getConfigManager().isUnlimitedGenbuckets()) return true;
if (!activeGens.containsKey(owner.getUniqueId())) return true;
if (activeGens.get(owner.getUniqueId()).size() <= getMaxGenbucketsForPlayer(owner)) return true;
return false;

View File

@ -80,11 +80,12 @@ public class GenbucketPlaceListener implements Listener {
return;
}
if (e.getPlayer().getGameMode() != GameMode.CREATIVE && !EpicBuckets.getInstance().getConfigManager().isUnlimitedGenbuckets()) {
if (e.getPlayer().getGameMode() != GameMode.CREATIVE && !EpicBuckets.getInstance().getConfigManager().isInfiniteUse()) {
if (e.getItem().getAmount() > 1) {
e.getItem().setAmount(e.getItem().getAmount() - 1);
} else {
e.getItem().setAmount(0);
System.out.println("hi");
e.getPlayer().getInventory().remove(e.getItem());
}
}

View File

@ -32,11 +32,11 @@ public class Shop {
private boolean fillInventory;
private String inventoryName;
private boolean enabled = true;
private boolean enabled;
public Shop(String menuItem, String name, String path) {
this.epicBuckets = EpicBuckets.getInstance();
this.shops = EpicBuckets.getInstance().getConfigManager().getConfig("shops");;
this.shops = EpicBuckets.getInstance().getConfigManager().getConfig("shops");
this.subShops = new HashMap<>();
@ -45,6 +45,7 @@ public class Shop {
this.path = path;
this.shopPath = epicBuckets.getShopManager().getShopPath() + "." + shopName;
this.enabled = shops.getBoolean(shopPath + ".enabled");
loadData();
setupShopItem();

View File

@ -4,6 +4,8 @@ shops:
vertical:
enabled: true
goBackButton: 31 # back button will display if enabled in file.yml
trait: "VERTICAL" # Which genbucket type does this shop have?
@ -94,6 +96,8 @@ shops:
infused:
enabled: true
goBackButton: 31
trait: "INFUSED"
@ -191,6 +195,8 @@ shops:
psuedo:
enabled: true
goBackButton: 31
trait: "PSUEDO"
@ -281,6 +287,8 @@ shops:
horizontal:
enabled: true
goBackButton: 31
trait: "HORIZONTAL"