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
public boolean onCommand(CommandSender sender1, Command cmd1, String label, String[] args) { | |
if(sender1 instanceof Player) { | |
Player p = (Player)sender; | |
if (CommandLabel.equalsIgnoreCase("fly")) { | |
if (!p.isFlying()) { | |
p.setFlying(true); | |
p.sendMessage(ChatColor.DARK_AQUA + "[Fly] " + ChatColor.YELLOW + "Flight mode enabled!"); | |
} else { | |
p.setFlying(false); | |
p.sendMessage(ChatColor.DARK_AQUA + "[Fly] " + ChatColor.YELLOW + "Flight mode disabled!"); |
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
package me.PlayinCOD3142.Reef; | |
import org.bukkit.ChatColor; | |
import org.bukkit.command.Command; | |
import org.bukkit.command.CommandSender; | |
import org.bukkit.entity.Player; | |
import org.bukkit.plugin.java.JavaPlugin; | |
import org.bukkit.event.player.PlayerJoinEvent; | |
import org.bukkit.event.EventHandler; |
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
public class MyPlugin extends JavaPlugin { | |
Connection c = null; | |
DatabaseInterface dbi; | |
public void onEnable() { | |
dbi = new DatabaseInterface(); | |
c = dbi.openConnection(this, String DBHost, String DBPort, String DBDatabase, String DBUser, String DBPass); | |
doTheExample("boink"); | |
} |
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
package net.aerenserve.melded.requirements; | |
import org.bukkit.plugin.Plugin; | |
public abstract class Requirement { | |
protected Plugin plugin; | |
public RequirementType type; | |
protected Requirement(Plugin plugin, RequirementType type) { |
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
package net.aerenserve.melded.requirements; | |
import org.bukkit.Location; | |
import org.bukkit.plugin.Plugin; | |
public class LocationRequirement extends Requirement { | |
String name; | |
Location loc; | |
double distance; |
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
public enum KitType { | |
MEMBER, | |
VIP, | |
VIPPLUS, | |
MVP, | |
} | |
@EventHandler | |
public void onInventoryClick(InventoryClickEvent e) { | |
Player p = e.getWhoClicked(); |
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
//REGION CLASS | |
import org.bukkit.Location; | |
public class Region { | |
private Selection sel; | |
public Region(Selection sel) { | |
this.sel = sel; |
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
package net.aerenserve.example; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import org.bukkit.ChatColor; | |
import org.bukkit.Material; | |
import org.bukkit.inventory.Inventory; |
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
public void drawMap(Player player) { | |
MapCanvas myCanvas; | |
int playerX = player.getLocation().getX(); //the 'true' coordinates | |
int playerZ = player.getLocation().getZ(); | |
/* Assumes that you have a class PartyManager which has a method to get the Party of a player | |
The Party class has a method called getPlayers(), which returns an ArrayList of players in the party. Simple. | |
*/ |
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
package net.aerenserve.teamapi; | |
import java.util.ArrayList; | |
public class Team { | |
String name = null; | |
Game game = null; | |
ArrayList<String> players = new ArrayList<String>(); | |
OlderNewer