Changed: Renamed the main class from "DungeonsXL" to "P"

This commit is contained in:
Grafe 2013-01-11 03:37:48 +01:00
parent 7fe5dd337a
commit 5394d7cf8f
17 changed files with 53 additions and 74 deletions

View File

@ -1,6 +1,6 @@
name: DungeonsXL
version: 2.9
main: com.dre.dungeonsxl.DungeonsXL
main: com.dre.dungeonsxl.P
authors: [Frank Baumann]
softdepend: [Vault]
commands:

View File

@ -16,7 +16,7 @@ import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
public class ConfigReader {
public static DungeonsXL p=DungeonsXL.p;
public static P p=P.p;
public File file;

View File

@ -244,11 +244,11 @@ public class DGSign {
}
}
else{
File file=new File(DungeonsXL.p.getDataFolder()+"/dungeons/"+dgsign.dungeonName, "config.yml");
File file=new File(P.p.getDataFolder()+"/dungeons/"+dgsign.dungeonName, "config.yml");
if(file!=null){
ConfigReader confReader=new ConfigReader(file);
if(confReader!=null){
DungeonsXL.p.msg(player, ChatColor.RED+"Du kannst den Dungeon nur alle "+ChatColor.GOLD+confReader.timeToNextPlay+ChatColor.RED+" Stunden betreten!");
P.p.msg(player, ChatColor.RED+"Du kannst den Dungeon nur alle "+ChatColor.GOLD+confReader.timeToNextPlay+ChatColor.RED+" Stunden betreten!");
}
}
}
@ -316,7 +316,7 @@ public class DGSign {
}
public static void load(FileConfiguration configFile) {
for(World world:DungeonsXL.p.getServer().getWorlds()){
for(World world:P.p.getServer().getWorlds()){
if(configFile.contains("groupsign."+world.getName())){
int id=0;
String preString;

View File

@ -178,7 +178,7 @@ public class DMobType {
itemMeta.addEnchant(Enchantment.getByName(splittedEnchantment[0].toUpperCase()), 1, true);
}
} else {
DungeonsXL.p.log(Level.WARNING,"Error at loading mob.yml: Enchantmet '"+splittedEnchantment[0]+"' doesn't exist!");
P.p.log(Level.WARNING,"Error at loading mob.yml: Enchantmet '"+splittedEnchantment[0]+"' doesn't exist!");
}
}
}
@ -205,7 +205,7 @@ public class DMobType {
}
}
} else {
DungeonsXL.p.log(Level.WARNING,"Error at loading mob.yml: Mob '"+configFile.getString(mobName+".Type")+"' doesn't exist!");
P.p.log(Level.WARNING,"Error at loading mob.yml: Mob '"+configFile.getString(mobName+".Type")+"' doesn't exist!");
}
}
}

View File

@ -20,7 +20,7 @@ import com.dre.dungeonsxl.game.GameCheckpoint;
import com.dre.dungeonsxl.game.GameWorld;
public class DPlayer {
public DungeonsXL p=DungeonsXL.p;
public P p=P.p;
public static CopyOnWriteArrayList<DPlayer> players=new CopyOnWriteArrayList<DPlayer>();
@ -54,7 +54,7 @@ public class DPlayer {
public int invItemInHand;
public CopyOnWriteArrayList<ItemStack> respawnInventory=new CopyOnWriteArrayList<ItemStack>();
public Inventory treasureInv = DungeonsXL.p.getServer().createInventory(player, 45, "Belohnungen");
public Inventory treasureInv = P.p.getServer().createInventory(player, 45, "Belohnungen");
public DPlayer(Player player, World world, Location teleport, boolean isEditing){
players.add(this);
@ -174,7 +174,7 @@ public class DPlayer {
}
}
}
//DungeonsXL.p.updateInventory(groupplayer);
//P.p.updateInventory(groupplayer);
}
i++;
}while(groupplayer==null);
@ -188,7 +188,7 @@ public class DPlayer {
//DungeonsXL.p.updateInventory(this.player);
//P.p.updateInventory(this.player);
}
public void ready(){
@ -230,11 +230,11 @@ public class DPlayer {
}
}
this.respawnInventory.clear();
//DungeonsXL.p.updateInventory(this.player);
//P.p.updateInventory(this.player);
}
public void finish(){
DungeonsXL.p.msg(this.player, ChatColor.YELLOW+"Du hast den Dungeon erfolgreich beendet!");
P.p.msg(this.player, ChatColor.YELLOW+"Du hast den Dungeon erfolgreich beendet!");
this.isFinished=true;
DGroup dgroup=DGroup.get(this.player);
@ -243,7 +243,7 @@ public class DPlayer {
for(Player player:dgroup.players){
DPlayer dplayer=get(player);
if(!dplayer.isFinished){
DungeonsXL.p.msg(this.player, ChatColor.YELLOW+"Noch auf Mitspieler warten...");
P.p.msg(this.player, ChatColor.YELLOW+"Noch auf Mitspieler warten...");
return;
}
}
@ -304,7 +304,7 @@ public class DPlayer {
this.player.getInventory().clear();
this.player.getInventory().setArmorContents(null);
player.getInventory().setItemInHand(new ItemStack(0));
//DungeonsXL.p.updateInventory(this.player);
//P.p.updateInventory(this.player);
//Set Inventory
for(ItemStack istack:dclass.items){
@ -352,7 +352,7 @@ public class DPlayer {
//DungeonsXL.p.updateInventory(this.player);
//P.p.updateInventory(this.player);
}
for(int i=0;i<36;i++){
@ -363,7 +363,7 @@ public class DPlayer {
}
//DungeonsXL.p.updateInventory(this.player);
//P.p.updateInventory(this.player);
}
}
@ -451,7 +451,6 @@ public class DPlayer {
}
}
dplayer.respawnInventory.clear();
//DungeonsXL.p.updateInventory(dplayer.player);
}
}
}

View File

@ -12,7 +12,7 @@ import org.bukkit.entity.Player;
import com.dre.dungeonsxl.game.GameWorld;
public class DPortal {
public static DungeonsXL p=DungeonsXL.p;
public static P p=P.p;
public static CopyOnWriteArrayList<DPortal> portals = new CopyOnWriteArrayList<DPortal>();

View File

@ -18,7 +18,7 @@ import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
public class EditWorld {
private static DungeonsXL p=DungeonsXL.p;
private static P p=P.p;
public static CopyOnWriteArrayList<EditWorld> eworlds=new CopyOnWriteArrayList<EditWorld>();
//Variables
@ -62,10 +62,10 @@ public class EditWorld {
public void save(){
this.world.save();
p.copyDirectory(new File("DXL_Edit_"+this.id),new File("plugins/DungeonsXL/dungeons/"+this.dungeonname));
p.deletenotusingfiles(new File("plugins/DungeonsXL/dungeons/"+this.dungeonname));
p.copyDirectory(new File("DXL_Edit_"+this.id),new File(p.getDataFolder(),"/dungeons/"+this.dungeonname));
p.deletenotusingfiles(new File(p.getDataFolder(),"/dungeons/"+this.dungeonname));
try {
ObjectOutputStream out=new ObjectOutputStream(new FileOutputStream(new File("plugins/DungeonsXL/dungeons/"+this.dungeonname+"/DXLData.data")));
ObjectOutputStream out=new ObjectOutputStream(new FileOutputStream(new File(p.getDataFolder(),"/dungeons/"+this.dungeonname+"/DXLData.data")));
out.writeInt(this.sign.size());
for(Block sign:this.sign){
out.writeInt(sign.getX());
@ -81,26 +81,6 @@ public class EditWorld {
// TODO Auto-generated catch block
e.printStackTrace();
}
//Check Configuration
/*File file=new File("plugins/DungeonsXL/dungeons/"+this.dungeonname+"/config.yml");
if(!file.exists()){
File copyfile=new File("plugins/DungeonsXL/config.yml");
if(copyfile.exists()){
try {
DungeonsXL.p.copyFile(copyfile,file);
} catch (IOException e) {
e.printStackTrace();
}
}else{
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
}*/
}
public void checkSign(Block block){
@ -169,7 +149,7 @@ public class EditWorld {
}
}
File file=new File("plugins/DungeonsXL/dungeons/"+name);
File file=new File(p.getDataFolder(),"/dungeons/"+name);
if(file.exists()){
EditWorld eworld = new EditWorld();
@ -180,7 +160,7 @@ public class EditWorld {
eworld.world=p.getServer().createWorld(WorldCreator.name("DXL_Edit_"+eworld.id));
try {
ObjectInputStream os=new ObjectInputStream(new FileInputStream(new File("plugins/DungeonsXL/dungeons/"+eworld.dungeonname+"/DXLData.data")));
ObjectInputStream os=new ObjectInputStream(new FileInputStream(new File(p.getDataFolder(),"/dungeons/"+eworld.dungeonname+"/DXLData.data")));
int length=os.readInt();
for(int i=0; i<length; i++){
int x=os.readInt();
@ -215,7 +195,7 @@ public class EditWorld {
}
//Cheack Unloaded Worlds
File file=new File("plugins/DungeonsXL/dungeons/"+name);
File file=new File(p.getDataFolder(),"/dungeons/"+name);
if(file.exists()){
return true;

View File

@ -42,7 +42,7 @@ public class LeaveSign{
DGroup dgroup=DGroup.get(player);
if(dgroup!=null){
dgroup.removePlayer(player);
DungeonsXL.p.msg(player,ChatColor.YELLOW+"Du hast deine Gruppe erfolgreich verlassen!");
P.p.msg(player,ChatColor.YELLOW+"Du hast deine Gruppe erfolgreich verlassen!");
return true;
}
}
@ -88,7 +88,7 @@ public class LeaveSign{
}
public static void load(FileConfiguration configFile) {
for(World world:DungeonsXL.p.getServer().getWorlds()){
for(World world:P.p.getServer().getWorlds()){
if(configFile.contains("leavesign."+world.getName())){
int id=0;
String preString;

View File

@ -33,8 +33,8 @@ import com.dre.dungeonsxl.listener.CommandListener;
import com.dre.dungeonsxl.listener.EntityListener;
import com.dre.dungeonsxl.listener.PlayerListener;
public class DungeonsXL extends JavaPlugin{
public static DungeonsXL p;
public class P extends JavaPlugin{
public static P p;
//Listener
private static Listener entitylistener;
@ -341,9 +341,9 @@ public class DungeonsXL extends JavaPlugin{
if (e.getMessage().contains("Zugriff")
|| e.getMessage().contains("Access"))
DungeonsXL.p.log("Error: " + e.getMessage() + " // Access denied");
P.p.log("Error: " + e.getMessage() + " // Access denied");
else
DungeonsXL.p.log("Error: " + e.getMessage());
P.p.log("Error: " + e.getMessage());
}
}
}

View File

@ -3,10 +3,10 @@ package com.dre.dungeonsxl.commands;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import com.dre.dungeonsxl.DungeonsXL;
import com.dre.dungeonsxl.P;
public abstract class DCommand {
public DungeonsXL p=DungeonsXL.p;
public P p=P.p;
public Player player;
public boolean costsMoney;
@ -29,7 +29,7 @@ public abstract class DCommand {
if(this.permissions==null){
return true;
}
if(DungeonsXL.p.permission.has(player, this.permissions)||player.isOp()){
if(p.permission.has(player, this.permissions)||player.isOp()){
return true;
}

View File

@ -6,7 +6,7 @@ import org.bukkit.ChatColor;
import org.bukkit.Location;
import com.dre.dungeonsxl.DPlayer;
import com.dre.dungeonsxl.DungeonsXL;
import com.dre.dungeonsxl.P;
public class GameCheckpoint {
@ -38,7 +38,7 @@ public class GameCheckpoint {
if(!gpoint.dplayerHasUsed.contains(dplayer)){
if(dplayer.player.getLocation().distance(gpoint.location)<=gpoint.radius){
dplayer.setCheckpoint(gpoint);
DungeonsXL.p.msg(dplayer.player, ChatColor.GOLD+"Checkpoint erreicht!");
P.p.msg(dplayer.player, ChatColor.GOLD+"Checkpoint erreicht!");
gpoint.dplayerHasUsed.add(dplayer);
}
}

View File

@ -10,7 +10,7 @@ import org.bukkit.inventory.ItemStack;
import com.dre.dungeonsxl.DGroup;
import com.dre.dungeonsxl.DPlayer;
import com.dre.dungeonsxl.DungeonsXL;
import com.dre.dungeonsxl.P;
public class GameChest {
@ -45,7 +45,7 @@ public class GameChest {
msg=msg.substring(0,msg.length()-1);
msg=msg+" hinzugefügt worden!";
DungeonsXL.p.msg(player, msg);
P.p.msg(player, msg);
}
}
}
@ -70,7 +70,7 @@ public class GameChest {
event.setCancelled(true);
}
}else{
DungeonsXL.p.msg(DungeonsXL.p.getServer().getPlayer(event.getPlayer().getName()), ChatColor.RED+"Diese Kiste wurde schon geöffnet!");
P.p.msg(P.p.getServer().getPlayer(event.getPlayer().getName()), ChatColor.RED+"Diese Kiste wurde schon geöffnet!");
event.setCancelled(true);
}
}

View File

@ -5,7 +5,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import org.bukkit.block.Block;
import com.dre.dungeonsxl.DPlayer;
import com.dre.dungeonsxl.DungeonsXL;
import com.dre.dungeonsxl.P;
public class GameMessage {
public static CopyOnWriteArrayList<GameMessage> gmessages=new CopyOnWriteArrayList<GameMessage>();
@ -37,7 +37,7 @@ public class GameMessage {
for(DPlayer dplayer:DPlayer.get(gmessage.gworld.world)){
if(!gmessage.playerDone.contains(dplayer)){
if(dplayer.player.getLocation().distance(gmessage.block.getLocation())<gmessage.radius+1){
DungeonsXL.p.msg(dplayer.player, gmessage.msg);
P.p.msg(dplayer.player, gmessage.msg);
gmessage.playerDone.add(dplayer);
}
}

View File

@ -26,10 +26,10 @@ import com.dre.dungeonsxl.ConfigReader;
import com.dre.dungeonsxl.DClass;
import com.dre.dungeonsxl.DGSign;
import com.dre.dungeonsxl.DPlayer;
import com.dre.dungeonsxl.DungeonsXL;
import com.dre.dungeonsxl.P;
public class GameWorld {
private static DungeonsXL p=DungeonsXL.p;
private static P p=P.p;
public static CopyOnWriteArrayList<GameWorld> gworlds=new CopyOnWriteArrayList<GameWorld>();
//Variables placeable
@ -322,7 +322,7 @@ public class GameWorld {
public static GameWorld load(String name){
File file=new File("plugins/DungeonsXL/dungeons/"+name);
File file=new File(p.getDataFolder(),"/dungeons/"+name);
if(file.exists()){
GameWorld gworld = new GameWorld();

View File

@ -14,7 +14,7 @@ import org.bukkit.event.block.SignChangeEvent;
import com.dre.dungeonsxl.DGSign;
import com.dre.dungeonsxl.DPortal;
import com.dre.dungeonsxl.DungeonsXL;
import com.dre.dungeonsxl.P;
import com.dre.dungeonsxl.EditWorld;
import com.dre.dungeonsxl.LeaveSign;
import com.dre.dungeonsxl.game.GameWorld;
@ -108,7 +108,7 @@ public class BlockListener implements Listener {
//Group Signs
if(eworld==null){
if(player.isOp() || DungeonsXL.p.permission.has(player, "dxl.sign")){
if(player.isOp() || P.p.permission.has(player, "dxl.sign")){
if(lines[0].equalsIgnoreCase("[DXL]")){

View File

@ -6,7 +6,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.dre.dungeonsxl.DungeonsXL;
import com.dre.dungeonsxl.P;
import com.dre.dungeonsxl.commands.DCommand;
import com.dre.dungeonsxl.commands.DCommandRoot;
@ -31,14 +31,14 @@ public class CommandListener implements CommandExecutor {
}
}
else{
DungeonsXL.p.msg(player, ChatColor.RED+"Du hast keine Permissions dazu!");
P.p.msg(player, ChatColor.RED+"Du hast keine Permissions dazu!");
}
return true;
}
}
DungeonsXL.p.msg(player, ChatColor.RED+"Befehl "+ChatColor.GOLD+cmd+ChatColor.RED+" existiert nicht!");
DungeonsXL.p.msg(player, ChatColor.RED+"Bitte gib "+ChatColor.GOLD+"/dxl help"+ChatColor.RED+" für Hilfe ein!");
P.p.msg(player, ChatColor.RED+"Befehl "+ChatColor.GOLD+cmd+ChatColor.RED+" existiert nicht!");
P.p.msg(player, ChatColor.RED+"Bitte gib "+ChatColor.GOLD+"/dxl help"+ChatColor.RED+" für Hilfe ein!");
}else{
DCommandRoot.root.cmdHelp.onExecute(args,player);
}

View File

@ -28,14 +28,14 @@ import com.dre.dungeonsxl.DGroup;
import com.dre.dungeonsxl.DLootInventory;
import com.dre.dungeonsxl.DPlayer;
import com.dre.dungeonsxl.DPortal;
import com.dre.dungeonsxl.DungeonsXL;
import com.dre.dungeonsxl.P;
import com.dre.dungeonsxl.EditWorld;
import com.dre.dungeonsxl.LeaveSign;
import com.dre.dungeonsxl.game.GameChest;
import com.dre.dungeonsxl.game.GameWorld;
public class PlayerListener implements Listener{
public DungeonsXL p=DungeonsXL.p;
public P p=P.p;
@EventHandler(priority = EventPriority.HIGHEST)
@ -305,7 +305,7 @@ public class PlayerListener implements Listener{
//Deny Player Cmds
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerCommand(PlayerCommandPreprocessEvent event){
if(DungeonsXL.p.permission.has(event.getPlayer(), "dungeonsxl.cmd")||event.getPlayer().isOp()){
if(p.permission.has(event.getPlayer(), "dungeonsxl.cmd")||event.getPlayer().isOp()){
return;
}