mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Fixed explosion radius.
Added /mp - mob purge.
This commit is contained in:
parent
c769f98c8a
commit
bb2e32519b
File diff suppressed because it is too large
Load Diff
@ -1,17 +1,19 @@
|
||||
package me.StevenLawson.TotalFreedomMod;
|
||||
|
||||
//import org.bukkit.ChatColor;
|
||||
//import org.bukkit.Material;
|
||||
//import org.bukkit.entity.Player;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.BlockBurnEvent;
|
||||
import org.bukkit.event.block.BlockIgniteEvent;
|
||||
import org.bukkit.event.block.BlockListener;
|
||||
//import org.bukkit.event.block.BlockPlaceEvent;
|
||||
//import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class TotalFreedomModBlockListener extends BlockListener
|
||||
{
|
||||
public static TotalFreedomMod plugin;
|
||||
private static final Logger log = Logger.getLogger("Minecraft");
|
||||
|
||||
TotalFreedomModBlockListener(TotalFreedomMod instance)
|
||||
{
|
||||
@ -38,43 +40,41 @@ public class TotalFreedomModBlockListener extends BlockListener
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void onBlockPlace(BlockPlaceEvent event)
|
||||
// {
|
||||
// ItemStack is = new ItemStack(event.getBlockPlaced().getType(), 1, (short) 0, event.getBlockPlaced().getData());
|
||||
// if (is.getType() == Material.LAVA || is.getType() == Material.STATIONARY_LAVA || is.getType() == Material.LAVA_BUCKET)
|
||||
// {
|
||||
// Player p = event.getPlayer();
|
||||
//
|
||||
// plugin.tfBroadcastMessage(String.format("%s placed lava @ %s",
|
||||
// p.getName(),
|
||||
// plugin.formatLocation(p.getLocation())
|
||||
// ), ChatColor.GRAY);
|
||||
// }
|
||||
// else if (is.getType() == Material.WATER || is.getType() == Material.STATIONARY_WATER || is.getType() == Material.WATER_BUCKET)
|
||||
// {
|
||||
// Player p = event.getPlayer();
|
||||
//
|
||||
// plugin.tfBroadcastMessage(String.format("%s placed water @ %s",
|
||||
// p.getName(),
|
||||
// plugin.formatLocation(p.getLocation())
|
||||
// ), ChatColor.GRAY);
|
||||
// }
|
||||
// else if (is.getType() == Material.TNT)
|
||||
// {
|
||||
// Player p = event.getPlayer();
|
||||
//
|
||||
// plugin.tfBroadcastMessage(String.format("%s placed TNT @ %s",
|
||||
// p.getName(),
|
||||
// plugin.formatLocation(p.getLocation())
|
||||
// ), ChatColor.GRAY);
|
||||
//
|
||||
// if (!plugin.allowExplosions)
|
||||
// {
|
||||
// p.sendMessage(ChatColor.GRAY + "TNT is currently disabled.");
|
||||
// event.setCancelled(true);
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@Override
|
||||
public void onBlockPlace(BlockPlaceEvent event)
|
||||
{
|
||||
ItemStack is = new ItemStack(event.getBlockPlaced().getType(), 1, (short) 0, event.getBlockPlaced().getData());
|
||||
if (is.getType() == Material.LAVA || is.getType() == Material.STATIONARY_LAVA)
|
||||
{
|
||||
log.info(String.format("%s placed lava @ %s",
|
||||
event.getPlayer().getName(),
|
||||
plugin.formatLocation(event.getBlock().getLocation())
|
||||
));
|
||||
}
|
||||
else if (is.getType() == Material.WATER || is.getType() == Material.STATIONARY_WATER)
|
||||
{
|
||||
log.info(String.format("%s placed water @ %s",
|
||||
event.getPlayer().getName(),
|
||||
plugin.formatLocation(event.getBlock().getLocation())
|
||||
));
|
||||
}
|
||||
else if (is.getType() == Material.TNT)
|
||||
{
|
||||
Player p = event.getPlayer();
|
||||
|
||||
if (!plugin.allowExplosions)
|
||||
{
|
||||
p.sendMessage(ChatColor.GRAY + "TNT is currently disabled.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.info(String.format("%s placed TNT @ %s",
|
||||
p.getName(),
|
||||
plugin.formatLocation(event.getBlock().getLocation())
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.EntityListener;
|
||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
|
||||
public class TotalFreedomModEntityListener extends EntityListener
|
||||
{
|
||||
@ -23,8 +24,18 @@ public class TotalFreedomModEntityListener extends EntityListener
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
event.setYield((float)plugin.explosiveRadius);
|
||||
@Override
|
||||
public void onExplosionPrime(ExplosionPrimeEvent event)
|
||||
{
|
||||
if (!plugin.allowExplosions)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
event.setRadius((float)plugin.explosiveRadius);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: TotalFreedomMod
|
||||
main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod
|
||||
version: 1.2.0
|
||||
version: 1.3
|
||||
description: Plugin for the Total Freedom server
|
||||
author: StevenLawson / Madgeek1450
|
||||
commands:
|
||||
@ -11,7 +11,7 @@ commands:
|
||||
description: Superadmin command - Deop everyone on the server.
|
||||
usage: /<command>
|
||||
explosives:
|
||||
description: Superadmin command - Enable/disable explosives and set yield radius.
|
||||
description: Superadmin command - Enable/disable explosives and set effect radius.
|
||||
usage: /<command> <on|off> [radius]
|
||||
fire:
|
||||
description: Superadmin command - Enable/disable fire.
|
||||
@ -28,9 +28,12 @@ commands:
|
||||
listreal:
|
||||
description: Lists the real names of all online players.
|
||||
usage: /<command>
|
||||
opall:
|
||||
description: Superadmin command - Op everyone on the server.
|
||||
mp:
|
||||
description: Use moblimiter to purge all mobs.
|
||||
usage: /<command>
|
||||
opall:
|
||||
description: Superadmin command - Op everyone on the server, optionally change everyone's gamemode at the same time.
|
||||
usage: /<command> [-c|-s]
|
||||
opme:
|
||||
description: Superadmin command - Automatically ops user.
|
||||
usage: /<command>
|
||||
@ -44,7 +47,7 @@ commands:
|
||||
description: Shows nearby people sorted by distance.
|
||||
usage: /<command>
|
||||
rd:
|
||||
description: Removes drops, arrows, etc.
|
||||
description: Use WorldEdit to remove drops, arrows, and primed TNT.
|
||||
usage: /<command>
|
||||
say:
|
||||
description: Broadcasts the given message as the console, includes sender.
|
||||
|
Loading…
Reference in New Issue
Block a user