Add per-arena setting auto-ignite-fuse.
This new setting allows changing the fuse time for auto-ignited TNT, which is normally a hardcoded 80 ticks in Minecraft. Note the somewhat weak safeguarding without any sort of error message - with great power comes great responsibility... Closes #715
This commit is contained in:
@@ -123,6 +123,7 @@ public class ArenaListener
|
||||
private boolean allowTeleport,
|
||||
canShare,
|
||||
autoIgniteTNT;
|
||||
private int autoIgniteFuse;
|
||||
|
||||
private Set<Player> banned;
|
||||
|
||||
@@ -146,6 +147,7 @@ public class ArenaListener
|
||||
this.allowTeleport = s.getBoolean("allow-teleporting", false);
|
||||
this.canShare = s.getBoolean("share-items-in-arena", true);
|
||||
this.autoIgniteTNT = s.getBoolean("auto-ignite-tnt", false);
|
||||
this.autoIgniteFuse = s.getInt("auto-ignite-fuse", 80);
|
||||
this.useClassChests = s.getBoolean("use-class-chests", false);
|
||||
|
||||
this.classLimits = arena.getClassLimitManager();
|
||||
@@ -284,6 +286,7 @@ public class ArenaListener
|
||||
stack.setAmount(stack.getAmount() - 1);
|
||||
TNTPrimed tnt = b.getWorld().spawn(b.getRelative(BlockFace.UP).getLocation(), TNTPrimed.class);
|
||||
tnt.setSource(event.getPlayer());
|
||||
tnt.setFuseTicks(Math.max(0, autoIgniteFuse));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ food-regen: false
|
||||
lock-food-level: true
|
||||
player-time-in-arena: world
|
||||
auto-ignite-tnt: false
|
||||
auto-ignite-fuse: 80
|
||||
auto-start-timer: 0
|
||||
start-delay-timer: 0
|
||||
auto-ready: false
|
||||
|
||||
Reference in New Issue
Block a user