-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bootswithdefer
committed
Dec 18, 2010
1 parent
9157288
commit bcf763d
Showing
6 changed files
with
440 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import java.util.logging.Logger; | ||
import java.util.logging.Level; | ||
|
||
public class Achievement | ||
{ | ||
public boolean modified = false; | ||
private int count; | ||
static final Logger log = Logger.getLogger("Minecraft"); | ||
|
||
Achievement() | ||
{ | ||
count = 0; | ||
modified = false; | ||
} | ||
|
||
public int getCount() | ||
{ | ||
return count; | ||
} | ||
|
||
public void put(int value) | ||
{ | ||
count = value; | ||
modified = true; | ||
} | ||
|
||
public void incrementCount() | ||
{ | ||
count++; | ||
modified = true; | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
import java.util.List; | ||
import java.util.logging.Logger; | ||
|
||
import net.minecraft.server.MinecraftServer; | ||
|
||
public class EntityClean extends Plugin | ||
{ | ||
private String name = "EntityClean"; | ||
private int version = 1; | ||
|
||
static final Logger log = Logger.getLogger("Minecraft"); | ||
|
||
public void enable() | ||
{ | ||
log.info(name + " v" + version + " Plugin Enabled."); | ||
etc.getInstance().addCommand("/eclean", " - Clean Entities."); | ||
} | ||
|
||
public void disable() | ||
{ | ||
log.info(name + " v" + version + " Plugin Disabled."); | ||
} | ||
|
||
public void initialize() | ||
{ | ||
new VersionCheck(name, version); | ||
|
||
ECListener listener = new ECListener(); | ||
etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.MEDIUM); | ||
} | ||
|
||
public class ECListener extends PluginListener | ||
{ | ||
public boolean onCommand(Player player, String[] split) | ||
{ | ||
if (!player.canUseCommand("/eclean")) | ||
return false; | ||
|
||
if (split[0].equalsIgnoreCase("/eclean")) | ||
{ | ||
try { | ||
List<Mob> ml = etc.getServer().getMobList(); | ||
for (Mob m: ml) | ||
m.setHealth(-1); | ||
ml = etc.getServer().getAnimalList(); | ||
for (Mob m: ml) | ||
m.setHealth(-1); | ||
player.sendMessage(Colors.Rose + "Done."); | ||
} catch (NoSuchMethodError ex) { | ||
} | ||
|
||
return true; | ||
} | ||
|
||
if (split[0].equalsIgnoreCase("/etpvh")) | ||
{ | ||
List<BaseVehicle> vehl = etc.getServer().getVehicleEntityList(); | ||
for (BaseVehicle v: vehl) | ||
{ | ||
v.teleportTo(player); | ||
} | ||
player.sendMessage("Done."); | ||
return true; | ||
} | ||
|
||
if (split[0].equalsIgnoreCase("/etpmob")) | ||
{ | ||
List<Mob> ml = etc.getServer().getMobList(); | ||
for (Mob m: ml) | ||
m.teleportTo(player); | ||
player.sendMessage("Done."); | ||
return true; | ||
} | ||
|
||
if (split[0].equalsIgnoreCase("/etpani")) | ||
{ | ||
List<Mob> ml = etc.getServer().getAnimalList(); | ||
for (Mob m: ml) | ||
m.teleportTo(player); | ||
player.sendMessage("Done."); | ||
return true; | ||
} | ||
|
||
if (split[0].equalsIgnoreCase("/ecount")) | ||
{ | ||
player.sendMessage("Mob spawn rate: " + etc.getInstance().getMobSpawnRate()); | ||
|
||
try { | ||
List<Player> pl = etc.getServer().getPlayerList(); | ||
player.sendMessage("Player count: " + pl.size()); | ||
} catch (NoSuchMethodError ex) { | ||
} | ||
|
||
try { | ||
List<Mob> ml = etc.getServer().getMobList(); | ||
player.sendMessage("Mob count: " + ml.size()); | ||
} catch (NoSuchMethodError ex) { | ||
} | ||
|
||
try { | ||
List<Mob> al = etc.getServer().getAnimalList(); | ||
player.sendMessage("Animal count: " + al.size()); | ||
} catch (NoSuchMethodError ex) { | ||
} | ||
|
||
try { | ||
List<Minecart> mcl = etc.getServer().getMinecartList(); | ||
player.sendMessage("Minecart count: " + mcl.size()); | ||
} catch (NoSuchMethodError ex) { | ||
} | ||
|
||
try { | ||
List<Boat> bl = etc.getServer().getBoatList(); | ||
player.sendMessage("Boat count: " + bl.size()); | ||
} catch (NoSuchMethodError ex) { | ||
} | ||
|
||
try { | ||
List<BaseEntity> basel = etc.getServer().getEntityList(); | ||
player.sendMessage("Base count: " + basel.size()); | ||
} catch (NoSuchMethodError ex) { | ||
} | ||
|
||
try { | ||
List<LivingEntity> livingl = etc.getServer().getLivingEntityList(); | ||
player.sendMessage("Living count: " + livingl.size()); | ||
} catch (NoSuchMethodError ex) { | ||
} | ||
|
||
try { | ||
List<BaseVehicle> vehl = etc.getServer().getVehicleEntityList(); | ||
player.sendMessage("Vehicle count: " + vehl.size()); | ||
} catch (NoSuchMethodError ex) { | ||
} | ||
|
||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import java.util.ArrayList; | ||
import java.util.logging.Logger; | ||
|
||
import net.minecraft.server.MinecraftServer; | ||
|
||
|
||
public class NoTp extends Plugin | ||
{ | ||
private String name = "NoTp"; | ||
private int version = 1; | ||
private ArrayList<String> notps = new ArrayList<String>(); | ||
|
||
static final Logger log = Logger.getLogger("Minecraft"); | ||
|
||
public void enable() | ||
{ | ||
log.info(name + " v" + version + " Plugin Enabled."); | ||
etc.getInstance().addCommand("/notp", " - Prevent someone from teleporting."); | ||
} | ||
|
||
public void disable() | ||
{ | ||
log.info(name + " v" + version + " Plugin Disabled."); | ||
} | ||
|
||
public void initialize() | ||
{ | ||
new VersionCheck(name, version); | ||
|
||
NoTpListener listener = new NoTpListener(); | ||
etc.getLoader().addListener(PluginLoader.Hook.COMMAND, listener, this, PluginListener.Priority.MEDIUM); | ||
etc.getLoader().addListener(PluginLoader.Hook.TELEPORT, listener, this, PluginListener.Priority.HIGH); | ||
} | ||
|
||
public class NoTpListener extends PluginListener | ||
{ | ||
public boolean onCommand(Player player, String[] split) | ||
{ | ||
if (!player.canUseCommand("/notp")) | ||
return false; | ||
if (split[0].equalsIgnoreCase("/notp")) | ||
{ | ||
if (split.length < 2) | ||
{ | ||
player.sendMessage(Colors.Rose + "Usage: /notp [player]"); | ||
return true; | ||
} | ||
|
||
Player target = etc.getServer().matchPlayer(split[1]); | ||
|
||
if (!player.isAdmin() && !player.hasControlOver(target)) | ||
{ | ||
player.sendMessage(Colors.Rose + "You can't do that to them."); | ||
target.sendMessage(Colors.Rose + player.getName() + " just tried to /notp you."); | ||
return true; | ||
} | ||
|
||
if (notps.contains(target.getName())) | ||
{ | ||
player.sendMessage(Colors.Rose + "Removed."); | ||
notps.remove(target.getName()); | ||
return true; | ||
} | ||
|
||
notps.add(target.getName()); | ||
player.sendMessage(Colors.Rose + "Added."); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
public boolean onTeleport(Player player, Location from, Location to) | ||
{ | ||
if (player.isAdmin()) | ||
return false; | ||
if (notps.contains(player.getName())) | ||
return true; | ||
return false; | ||
} | ||
} | ||
} |
Binary file not shown.
Oops, something went wrong.