Skip to content

Commit 191ea31

Browse files
authored
Merge pull request #656 from Multiverse/feat-bucketFilling
Add bucketFilling config option
2 parents 1c4cf65 + b639f66 commit 191ea31

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

src/main/java/com/onarandombox/MultiversePortals/MultiversePortals.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public class MultiversePortals extends JavaPlugin implements MVPlugin {
8989
private long portalCooldown = 0;
9090
private final static int requiresProtocol = 24;
9191
public static boolean UseOnMove = true;
92+
public static boolean bucketFilling = true;
9293
public static boolean EnforcePortalAccess = true;
9394
public static boolean WandEnabled = true;
9495
public static boolean ClearOnRemove = false;
@@ -275,12 +276,14 @@ public void loadConfig() {
275276
this.MVPConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "config.yml"));
276277

277278
MultiversePortals.UseOnMove = this.MVPConfig.getBoolean("useonmove", true);
279+
MultiversePortals.bucketFilling = this.MVPConfig.getBoolean("bucketfilling", true);
278280
MultiversePortals.EnforcePortalAccess = this.MVPConfig.getBoolean("enforceportalaccess", true);
279281
this.portalCooldown = this.MVPConfig.getInt("portalcooldown", 1000);
280282
MultiversePortals.ClearOnRemove = this.MVPConfig.getBoolean("clearonremove", false);
281283
MultiversePortals.TeleportVehicles = this.MVPConfig.getBoolean("teleportvehicles", true);
282284
MultiversePortals.NetherAnimation = this.MVPConfig.getBoolean("netheranimation", true);
283285
MultiversePortals.FrameMaterials = migrateFrameMaterials(this.MVPConfig);
286+
284287
// Migrate useportalaccess -> enforceportalaccess
285288
if (this.MVPConfig.get("useportalaccess") != null) {
286289
this.MVPConfig.set("enforceportalaccess", this.MVPConfig.getBoolean("useportalaccess", true));
@@ -519,6 +522,7 @@ public String getVersionInfo() {
519522
+ "[Multiverse-Portals] Dumping Portal Values: (version " + this.getMainConfig().getDouble("version", -1) + ')' + '\n'
520523
+ "[Multiverse-Portals] wand: " + this.getMainConfig().get("wand", "NOT SET") + '\n'
521524
+ "[Multiverse-Portals] useonmove: " + this.getMainConfig().get("useonmove", "NOT SET") + '\n'
525+
+ "[Multiverse-Portals] bucketfilling: " + this.getMainConfig().get("bucketfilling", "NOT SET") + '\n'
522526
+ "[Multiverse-Portals] portalsdefaulttonether: " + this.getMainConfig().get("portalsdefaulttonether", "NOT SET") + '\n'
523527
+ "[Multiverse-Portals] enforceportalaccess: " + this.getMainConfig().get("enforceportalaccess", "NOT SET") + '\n'
524528
+ "[Multiverse-Portals] portalcooldown: " + this.getMainConfig().get("portalcooldown", "NOT SET") + '\n'

src/main/java/com/onarandombox/MultiversePortals/listeners/MVPPlayerListener.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ public void playerBucketEmpty(PlayerBucketEmptyEvent event) {
101101
return;
102102
}
103103

104+
if (!MultiversePortals.bucketFilling) {
105+
Logging.fine("The bucket filling functionality has been disabled in config, doing nothing");
106+
return;
107+
}
108+
104109
Location translatedLocation = this.getTranslatedLocation(event.getBlockClicked(), event.getBlockFace());
105110
Logging.finer("Fill: ");
106111
Logging.finer("Block Clicked: " + event.getBlockClicked() + ":" + event.getBlockClicked().getType());

src/main/java/com/onarandombox/MultiversePortals/listeners/MVPPlayerMoveListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public void blockFromTo(BlockFromToEvent event) {
5757
event.setCancelled(true);
5858
return;
5959
}
60-
// If something is trying to flow out, stop that too.
61-
if (plugin.getPortalManager().isPortal(event.getBlock().getLocation())) {
60+
// If something is trying to flow out, stop that too, unless bucketFilling has been disabled
61+
if (plugin.getPortalManager().isPortal(event.getBlock().getLocation()) && MultiversePortals.bucketFilling) {
6262
event.setCancelled(true);
6363
}
6464
}

src/main/resources/defaults/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
wand: 271
99
useonmove: true
10+
bucketfilling: true
1011
portalsdefaulttonether: false
1112
enforceportalaccess: true
1213
portalcooldown: 1000

0 commit comments

Comments
 (0)