Blocked TNT Minecarts from being placed

This commit is contained in:
Jerome van der Sar 2013-06-23 15:17:12 +02:00
parent f3684cc2ce
commit 4f6a0ca5d3
8 changed files with 35 additions and 20 deletions

View File

@ -1,5 +1,5 @@
#Sat, 22 Jun 2013 19:56:29 +0200 #Sun, 23 Jun 2013 15:16:34 +0200
program.VERSION=2.18 program.VERSION=2.19
program.BUILDNUM=218 program.BUILDNUM=221
program.BUILDDATE=06/22/2013 07\:56 PM program.BUILDDATE=06/23/2013 03\:16 PM

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Sat Jun 22 19:56:29 CEST 2013 #Sun Jun 23 15:16:34 CEST 2013
build.number=219 build.number=222

View File

@ -1,4 +1,4 @@
# TotalFreedomMod v2.18 Configuration # TotalFreedomMod v2.19 Configuration
# by Madgeek1450 and DarthSalamon # by Madgeek1450 and DarthSalamon
# Block placement prevention: # Block placement prevention:
@ -8,6 +8,7 @@ allow_lava_damage: false
allow_lava_place: false allow_lava_place: false
allow_water_place: false allow_water_place: false
allow_fluid_spread: false allow_fluid_spread: false
allow_tnt_minecarts: false
# Explosion management: # Explosion management:
allow_explosions: false allow_explosions: false

View File

@ -11,7 +11,6 @@ import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;

View File

@ -36,7 +36,7 @@ public class TFM_EntityListener implements Listener
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void onEntityCombust(EntityCombustEvent event) public void onEntityCombust(EntityCombustEvent event)
{ {
if (!TotalFreedomMod.allowFireSpread) if (!TotalFreedomMod.allowExplosions)
{ {
event.setCancelled(true); event.setCancelled(true);
} }

View File

@ -45,20 +45,34 @@ public class TFM_PlayerListener implements Listener
{ {
case WATER_BUCKET: case WATER_BUCKET:
{ {
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1)); if (!TotalFreedomMod.allowWaterPlace)
player.sendMessage(ChatColor.GRAY + "Water buckets are currently disabled."); {
event.setCancelled(true); player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
return; player.sendMessage(ChatColor.GRAY + "Water buckets are currently disabled.");
event.setCancelled(true);
return;
}
} }
case LAVA_BUCKET: case LAVA_BUCKET:
{ {
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1)); if (!TotalFreedomMod.allowLavaPlace)
player.sendMessage(ChatColor.GRAY + "Lava buckets are currently disabled."); {
event.setCancelled(true); player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
player.sendMessage(ChatColor.GRAY + "Lava buckets are currently disabled.");
event.setCancelled(true);
return;
}
} }
case POTION: case EXPLOSIVE_MINECART:
{ {
if (!TotalFreedomMod.allowTntMinecarts)
{
player.getInventory().clear(player.getInventory().getHeldItemSlot());
player.sendMessage(ChatColor.GRAY + "TNT minecarts are currently disabled.");
event.setCancelled(true);
}
} }
} }
break; break;
} }
@ -98,7 +112,6 @@ public class TFM_PlayerListener implements Listener
} }
event.setCancelled(true); event.setCancelled(true);
return;
} }
break; break;
} }

View File

@ -201,6 +201,8 @@ public class TotalFreedomMod extends JavaPlugin
public static boolean allowLavaPlace = false; public static boolean allowLavaPlace = false;
public static boolean allowWaterPlace = false; public static boolean allowWaterPlace = false;
public static Boolean allowExplosions = false; public static Boolean allowExplosions = false;
public static boolean allowFliudSpread = false;
public static boolean allowTntMinecarts = false;
public static double explosiveRadius = 4.0D; public static double explosiveRadius = 4.0D;
public static boolean autoEntityWipe = true; public static boolean autoEntityWipe = true;
public static boolean nukeMonitor = true; public static boolean nukeMonitor = true;
@ -222,7 +224,6 @@ public class TotalFreedomMod extends JavaPlugin
public static boolean tossmobEnabled = false; public static boolean tossmobEnabled = false;
public static boolean generateFlatlands = true; public static boolean generateFlatlands = true;
public static String flatlandsGenerationParams = "16,stone,32,dirt,1,grass"; public static String flatlandsGenerationParams = "16,stone,32,dirt,1,grass";
public static boolean allowFliudSpread = false;
public static boolean adminOnlyMode = false; public static boolean adminOnlyMode = false;
public static boolean protectedAreasEnabled = true; public static boolean protectedAreasEnabled = true;
public static boolean autoProtectSpawnpoints = true; public static boolean autoProtectSpawnpoints = true;
@ -245,6 +246,7 @@ public class TotalFreedomMod extends JavaPlugin
allowLavaPlace = config.getBoolean("allow_lava_place", allowLavaPlace); allowLavaPlace = config.getBoolean("allow_lava_place", allowLavaPlace);
allowWaterPlace = config.getBoolean("allow_water_place", allowWaterPlace); allowWaterPlace = config.getBoolean("allow_water_place", allowWaterPlace);
allowExplosions = config.getBoolean("allow_explosions", allowExplosions); allowExplosions = config.getBoolean("allow_explosions", allowExplosions);
allowTntMinecarts = config.getBoolean("allow_tnt_minecarts", allowTntMinecarts);
explosiveRadius = config.getDouble("explosiveRadius", explosiveRadius); explosiveRadius = config.getDouble("explosiveRadius", explosiveRadius);
autoEntityWipe = config.getBoolean("auto_wipe", autoEntityWipe); autoEntityWipe = config.getBoolean("auto_wipe", autoEntityWipe);
nukeMonitor = config.getBoolean("nuke_monitor", nukeMonitor); nukeMonitor = config.getBoolean("nuke_monitor", nukeMonitor);

View File

@ -1,6 +1,6 @@
name: TotalFreedomMod name: TotalFreedomMod
main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod
version: 2.18 version: 2.19
description: Plugin for the Total Freedom server. description: Plugin for the Total Freedom server.
authors: [StevenLawson / Madgeek1450, JeromSar / DarthSalamon] authors: [StevenLawson / Madgeek1450, JeromSar / DarthSalamon]