Java Reference
In-Depth Information
All these squid piling up are probably messing up your world a bit, so we
need a way to quickly purge the world of all squid. To launch the Great Squid
Purge, I added a command squidpurge to this plugin (we'll look at the source
in just a second). Give it a try.
You can also change the behavior of plugins, not just change limits and
quantities. Go back to the SquidBombConfig.cfg file and change setFire to true .
Restart the server, and now when you purge squid they'll be set on fire instead
of just dying.
A dozen flaming squid.
Plugin: SquidBombConfig
Let's look at the full code for our final SquidBombConfig plugin.
SquidBombConfig/src/squidbombconfig/SquidBombConfig.java
package squidbombconfig;
import java.util.Collection;
import java.util.Iterator;
import net.canarymod.plugin.Plugin;
import net.canarymod.logger.Logman;
import net.canarymod.Canary;
import net.canarymod.commandsys.*;
import net.canarymod.chat.MessageReceiver;
import net.canarymod.api.entity.living.humanoid.Player;
import net.canarymod.api.world.position.Location;
import net.canarymod.api.world.blocks.Block;
import net.canarymod.api.world.blocks.BlockType;
import net.canarymod.api.entity.EntityType;
import net.canarymod.api.entity.living.EntityLiving;
import net.canarymod.api.entity.living.animal.Squid;
import com.pragprog.ahmine.ez.EZPlugin;
import net.visualillusionsent.utils.PropertiesFile;
public class SquidBombConfig extends EZPlugin {
private static int numSquids;
private static double squidDropHeight;
private static boolean setFire;
// Server/config/SquidBombConfig/SquidBombConfig.cfg:
//
numSquids=6
//
squidDropHeight=5
//
setFire=false
public boolean enable() {
super.enable(); //Compiler will call this if you don't
logger.info( "Getting config data" );
 
 
 
Search WWH ::




Custom Search