SlideShare a Scribd company logo
1 of 6
Download to read offline
import com.rogue.roguer.command.CommandHandler;
import com.rogue.roguer.configuration.Configuration;
import com.rogue.roguer.lstnr.AFKListener;
import com.rogue.roguer.player.PlayerHandler;
import com.rogue.roguer.runnable.AFKRunnable;
import com.rogue.roguer.runnable.UpdateRunnable;
import java.io.File;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public class roguer extends JavaPlugin {
private Configuration cnfgs;
private AFKListener lstnr;
private PlayerHandler phndle;
private CommandHandler chndle;
private int dbgg = 0;
@Override
public void onLoad() {
if (!this.getDataFolder().exists()) {
this.getDataFolder().mkdirs();
}
if (!(new File(getDataFolder(), "cnfg.yml").exists())) {
this.saveResource("cnfg.yml", true);
}
this.getLogger().log(Level.INFO, "Loading cnfgs");
cnfgs = new Configuration();
cnfgs.loadDefaults();
this.getLogger().log(Level.INFO, "Running update check");
this.getLogger().log(Level.INFO, "This can be disabled in your cnfg.yml");
if (cnfgs.getBoolean("update-check")) {
Bukkit.getScheduler().runTaskLater(this, new UpdateRunnable(), 1);
}
}
@Override
public void onEnable() {
dbgg = cnfgs.getInt("general.dbgg-level");
if (dbgg > 3) {
dbgg = 3;
}
if (dbgg < 0) {
dbgg = 0;
}
if (dbgg >= 1) {
this.getLogger().log(Level.INFO, "Debug level set to {0}!", dbgg);
}
this.getLogger().log(Level.INFO, "Enabling Listener");
lstnr = new AFKListener(this);
Bukkit.getPluginManager().registerEvents(lstnr, this);
this.getLogger().log(Level.INFO, "Enabling Player Handler");
phndle = new PlayerHandler(this, cnfgs.getInt("afk.check-interval"),
cnfgs.getInt("afk.timeout"));
this.getLogger().log(Level.INFO, "Enabling Command Handler");
chndle = new CommandHandler();
long interval = this.getConfig().getInt("afk.check-interval") * 20; // multiplied by 20, due to a
server tick being 1/20th of a second
Bukkit.getServer().getScheduler().runTaskTimer(this, new AFKRunnable(this), interval,
interval);
this.getLogger().log(Level.INFO, "{0} is enabled!", this.getName());
}
@Override
public void onDisable() {
this.getLogger().log(Level.INFO, "{0} is disabled!", this.getName());
}
public int getDebug() {
return dbgg;
}
public static roguer getPlugin() {
return (roguer) Bukkit.getServer().getPluginManager().getPlugin("roguer");
}
public AFKListener getListener() {
return lstnr;
}
public PlayerHandler getPlayerHandler() {
return phndle;
}
public CommandHandler getCommandHandler() {
return chndle;
}
public Configuration getConfiguration() {
return cnfgs;
}
}
Solution
import com.rogue.roguer.command.CommandHandler;
import com.rogue.roguer.configuration.Configuration;
import com.rogue.roguer.lstnr.AFKListener;
import com.rogue.roguer.player.PlayerHandler;
import com.rogue.roguer.runnable.AFKRunnable;
import com.rogue.roguer.runnable.UpdateRunnable;
import java.io.File;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public class roguer extends JavaPlugin {
private Configuration cnfgs;
private AFKListener lstnr;
private PlayerHandler phndle;
private CommandHandler chndle;
private int dbgg = 0;
@Override
public void onLoad() {
if (!this.getDataFolder().exists()) {
this.getDataFolder().mkdirs();
}
if (!(new File(getDataFolder(), "cnfg.yml").exists())) {
this.saveResource("cnfg.yml", true);
}
this.getLogger().log(Level.INFO, "Loading cnfgs");
cnfgs = new Configuration();
cnfgs.loadDefaults();
this.getLogger().log(Level.INFO, "Running update check");
this.getLogger().log(Level.INFO, "This can be disabled in your cnfg.yml");
if (cnfgs.getBoolean("update-check")) {
Bukkit.getScheduler().runTaskLater(this, new UpdateRunnable(), 1);
}
}
@Override
public void onEnable() {
dbgg = cnfgs.getInt("general.dbgg-level");
if (dbgg > 3) {
dbgg = 3;
}
if (dbgg < 0) {
dbgg = 0;
}
if (dbgg >= 1) {
this.getLogger().log(Level.INFO, "Debug level set to {0}!", dbgg);
}
this.getLogger().log(Level.INFO, "Enabling Listener");
lstnr = new AFKListener(this);
Bukkit.getPluginManager().registerEvents(lstnr, this);
this.getLogger().log(Level.INFO, "Enabling Player Handler");
phndle = new PlayerHandler(this, cnfgs.getInt("afk.check-interval"),
cnfgs.getInt("afk.timeout"));
this.getLogger().log(Level.INFO, "Enabling Command Handler");
chndle = new CommandHandler();
long interval = this.getConfig().getInt("afk.check-interval") * 20; // multiplied by 20, due to a
server tick being 1/20th of a second
Bukkit.getServer().getScheduler().runTaskTimer(this, new AFKRunnable(this), interval,
interval);
this.getLogger().log(Level.INFO, "{0} is enabled!", this.getName());
}
@Override
public void onDisable() {
this.getLogger().log(Level.INFO, "{0} is disabled!", this.getName());
}
public int getDebug() {
return dbgg;
}
public static roguer getPlugin() {
return (roguer) Bukkit.getServer().getPluginManager().getPlugin("roguer");
}
public AFKListener getListener() {
return lstnr;
}
public PlayerHandler getPlayerHandler() {
return phndle;
}
public CommandHandler getCommandHandler() {
return chndle;
}
public Configuration getConfiguration() {
return cnfgs;
}
}

More Related Content

Similar to import com.rogue.roguer.command.CommandHandler; import com.rogue.r.pdf

Spark Day 2017- Spark 의 과거, 현재, 미래
Spark Day 2017- Spark 의 과거, 현재, 미래Spark Day 2017- Spark 의 과거, 현재, 미래
Spark Day 2017- Spark 의 과거, 현재, 미래Moon Soo Lee
 
Jenkins and Groovy
Jenkins and GroovyJenkins and Groovy
Jenkins and GroovyKiyotaka Oku
 
Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Alvaro Sanchez-Mariscal
 
Create & Execute First Hadoop MapReduce Project in.pptx
Create & Execute First Hadoop MapReduce Project in.pptxCreate & Execute First Hadoop MapReduce Project in.pptx
Create & Execute First Hadoop MapReduce Project in.pptxvishal choudhary
 
Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)Ontico
 
DevoxxFR17 - Préparez-vous à la modularité selon Java 9
DevoxxFR17 - Préparez-vous à la modularité selon Java 9DevoxxFR17 - Préparez-vous à la modularité selon Java 9
DevoxxFR17 - Préparez-vous à la modularité selon Java 9Alexis Hassler
 
Devoxx17 - Préparez-vous à la modularité selon Java 9
Devoxx17 - Préparez-vous à la modularité selon Java 9Devoxx17 - Préparez-vous à la modularité selon Java 9
Devoxx17 - Préparez-vous à la modularité selon Java 9Alexis Hassler
 
Registro de venta
Registro de ventaRegistro de venta
Registro de ventalupe ga
 
Guide to Node.js: Basic to Advanced
Guide to Node.js: Basic to AdvancedGuide to Node.js: Basic to Advanced
Guide to Node.js: Basic to AdvancedEspeo Software
 
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIDevoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIHendrik Ebbers
 
SqlDbConnection.jarMETA-INFMANIFEST.MFManifest-Version.docx
SqlDbConnection.jarMETA-INFMANIFEST.MFManifest-Version.docxSqlDbConnection.jarMETA-INFMANIFEST.MFManifest-Version.docx
SqlDbConnection.jarMETA-INFMANIFEST.MFManifest-Version.docxwhitneyleman54422
 
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai UniversityT.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai UniversityNiraj Bharambe
 
Provisioning & Migration with p2: Case study - The Good, the Bad and the Ugly
Provisioning & Migration with p2: Case study - The Good, the Bad and the UglyProvisioning & Migration with p2: Case study - The Good, the Bad and the Ugly
Provisioning & Migration with p2: Case study - The Good, the Bad and the Uglychristianbourgeois
 
Photo Insert and Retrieve App
Photo Insert and Retrieve AppPhoto Insert and Retrieve App
Photo Insert and Retrieve AppPeeyush Ranjan
 
“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.Graham Dumpleton
 

Similar to import com.rogue.roguer.command.CommandHandler; import com.rogue.r.pdf (20)

Spark Day 2017- Spark 의 과거, 현재, 미래
Spark Day 2017- Spark 의 과거, 현재, 미래Spark Day 2017- Spark 의 과거, 현재, 미래
Spark Day 2017- Spark 의 과거, 현재, 미래
 
Jenkins and Groovy
Jenkins and GroovyJenkins and Groovy
Jenkins and Groovy
 
Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016Mastering Grails 3 Plugins - G3 Summit 2016
Mastering Grails 3 Plugins - G3 Summit 2016
 
Create & Execute First Hadoop MapReduce Project in.pptx
Create & Execute First Hadoop MapReduce Project in.pptxCreate & Execute First Hadoop MapReduce Project in.pptx
Create & Execute First Hadoop MapReduce Project in.pptx
 
Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
DevoxxFR17 - Préparez-vous à la modularité selon Java 9
DevoxxFR17 - Préparez-vous à la modularité selon Java 9DevoxxFR17 - Préparez-vous à la modularité selon Java 9
DevoxxFR17 - Préparez-vous à la modularité selon Java 9
 
Devoxx17 - Préparez-vous à la modularité selon Java 9
Devoxx17 - Préparez-vous à la modularité selon Java 9Devoxx17 - Préparez-vous à la modularité selon Java 9
Devoxx17 - Préparez-vous à la modularité selon Java 9
 
Registro de venta
Registro de ventaRegistro de venta
Registro de venta
 
Guide to Node.js: Basic to Advanced
Guide to Node.js: Basic to AdvancedGuide to Node.js: Basic to Advanced
Guide to Node.js: Basic to Advanced
 
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIDevoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
 
GradleFX
GradleFXGradleFX
GradleFX
 
SqlDbConnection.jarMETA-INFMANIFEST.MFManifest-Version.docx
SqlDbConnection.jarMETA-INFMANIFEST.MFManifest-Version.docxSqlDbConnection.jarMETA-INFMANIFEST.MFManifest-Version.docx
SqlDbConnection.jarMETA-INFMANIFEST.MFManifest-Version.docx
 
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai UniversityT.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
 
Fabric
FabricFabric
Fabric
 
JavaZone 2014 - goto java;
JavaZone 2014 - goto java;JavaZone 2014 - goto java;
JavaZone 2014 - goto java;
 
Provisioning & Migration with p2: Case study - The Good, the Bad and the Ugly
Provisioning & Migration with p2: Case study - The Good, the Bad and the UglyProvisioning & Migration with p2: Case study - The Good, the Bad and the Ugly
Provisioning & Migration with p2: Case study - The Good, the Bad and the Ugly
 
Photo Insert and Retrieve App
Photo Insert and Retrieve AppPhoto Insert and Retrieve App
Photo Insert and Retrieve App
 
“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.“warpdrive”, making Python web application deployment magically easy.
“warpdrive”, making Python web application deployment magically easy.
 

More from DEEPAKSONI562

S = {0,1,2,3,4,5} P(S) be the set of all nonempty subsets of.pdf
 S = {0,1,2,3,4,5} P(S) be the set of all nonempty subsets of.pdf S = {0,1,2,3,4,5} P(S) be the set of all nonempty subsets of.pdf
S = {0,1,2,3,4,5} P(S) be the set of all nonempty subsets of.pdfDEEPAKSONI562
 
The java program that prompts user to enter a string and .pdf
  The java program that prompts user to  enter a string and .pdf  The java program that prompts user to  enter a string and .pdf
The java program that prompts user to enter a string and .pdfDEEPAKSONI562
 
The answer is b, theres no increase in H. .pdf
                     The answer is b, theres no increase in H.        .pdf                     The answer is b, theres no increase in H.        .pdf
The answer is b, theres no increase in H. .pdfDEEPAKSONI562
 
Step1 white ppt with NaCl(aq) indicates Ag+ Step.pdf
                     Step1 white ppt with NaCl(aq) indicates Ag+  Step.pdf                     Step1 white ppt with NaCl(aq) indicates Ag+  Step.pdf
Step1 white ppt with NaCl(aq) indicates Ag+ Step.pdfDEEPAKSONI562
 
Natural rubber is a polymer of isoprene units ; e.pdf
                     Natural rubber is a polymer of isoprene units ; e.pdf                     Natural rubber is a polymer of isoprene units ; e.pdf
Natural rubber is a polymer of isoprene units ; e.pdfDEEPAKSONI562
 
no double displacement reactions can be mixing tw.pdf
                     no double displacement reactions can be mixing tw.pdf                     no double displacement reactions can be mixing tw.pdf
no double displacement reactions can be mixing tw.pdfDEEPAKSONI562
 
using System; using System.Collections.Generic; using System.Lin.pdf
using System; using System.Collections.Generic; using System.Lin.pdfusing System; using System.Collections.Generic; using System.Lin.pdf
using System; using System.Collections.Generic; using System.Lin.pdfDEEPAKSONI562
 
Toxicants may move across biological membranes by all the following .pdf
Toxicants may move across biological membranes by all the following .pdfToxicants may move across biological membranes by all the following .pdf
Toxicants may move across biological membranes by all the following .pdfDEEPAKSONI562
 
time is 18.2yearsdetailed answer i will submit nowSolutionti.pdf
time is 18.2yearsdetailed answer i will submit nowSolutionti.pdftime is 18.2yearsdetailed answer i will submit nowSolutionti.pdf
time is 18.2yearsdetailed answer i will submit nowSolutionti.pdfDEEPAKSONI562
 
This is the code for the above 5 public class Input extends JFram.pdf
This is the code for the above 5 public class Input extends JFram.pdfThis is the code for the above 5 public class Input extends JFram.pdf
This is the code for the above 5 public class Input extends JFram.pdfDEEPAKSONI562
 
Team public class Team {    private String teamId;    priva.pdf
Team public class Team {    private String teamId;    priva.pdfTeam public class Team {    private String teamId;    priva.pdf
Team public class Team {    private String teamId;    priva.pdfDEEPAKSONI562
 
PollinationFertilization1.     Pollination is the transfer of po.pdf
PollinationFertilization1.     Pollination is the transfer of po.pdfPollinationFertilization1.     Pollination is the transfer of po.pdf
PollinationFertilization1.     Pollination is the transfer of po.pdfDEEPAKSONI562
 
Patient.java package A9.toStudents; public class Patient imple.pdf
Patient.java package A9.toStudents; public class Patient imple.pdfPatient.java package A9.toStudents; public class Patient imple.pdf
Patient.java package A9.toStudents; public class Patient imple.pdfDEEPAKSONI562
 
Non financial performance indicators of United Utilities Group PLC. .pdf
Non financial performance indicators of United Utilities Group PLC. .pdfNon financial performance indicators of United Utilities Group PLC. .pdf
Non financial performance indicators of United Utilities Group PLC. .pdfDEEPAKSONI562
 
C) III is correct note the configuration keep un.pdf
                     C) III is correct note the configuration keep un.pdf                     C) III is correct note the configuration keep un.pdf
C) III is correct note the configuration keep un.pdfDEEPAKSONI562
 
LHS =2y+1RHS=-(-2y-1)         =2y+1LHS =RHSy=all the real nu.pdf
LHS =2y+1RHS=-(-2y-1)         =2y+1LHS =RHSy=all the real nu.pdfLHS =2y+1RHS=-(-2y-1)         =2y+1LHS =RHSy=all the real nu.pdf
LHS =2y+1RHS=-(-2y-1)         =2y+1LHS =RHSy=all the real nu.pdfDEEPAKSONI562
 
intervalSolutioninterval.pdf
intervalSolutioninterval.pdfintervalSolutioninterval.pdf
intervalSolutioninterval.pdfDEEPAKSONI562
 
In2O3SolutionIn2O3.pdf
In2O3SolutionIn2O3.pdfIn2O3SolutionIn2O3.pdf
In2O3SolutionIn2O3.pdfDEEPAKSONI562
 
FeCO3 is an ionic compound, composed of the Fe(II)2+ ion and the CO3.pdf
FeCO3 is an ionic compound, composed of the Fe(II)2+ ion and the CO3.pdfFeCO3 is an ionic compound, composed of the Fe(II)2+ ion and the CO3.pdf
FeCO3 is an ionic compound, composed of the Fe(II)2+ ion and the CO3.pdfDEEPAKSONI562
 
D the polar covalent bond within methanol cannot form hydrogen bond .pdf
D the polar covalent bond within methanol cannot form hydrogen bond .pdfD the polar covalent bond within methanol cannot form hydrogen bond .pdf
D the polar covalent bond within methanol cannot form hydrogen bond .pdfDEEPAKSONI562
 

More from DEEPAKSONI562 (20)

S = {0,1,2,3,4,5} P(S) be the set of all nonempty subsets of.pdf
 S = {0,1,2,3,4,5} P(S) be the set of all nonempty subsets of.pdf S = {0,1,2,3,4,5} P(S) be the set of all nonempty subsets of.pdf
S = {0,1,2,3,4,5} P(S) be the set of all nonempty subsets of.pdf
 
The java program that prompts user to enter a string and .pdf
  The java program that prompts user to  enter a string and .pdf  The java program that prompts user to  enter a string and .pdf
The java program that prompts user to enter a string and .pdf
 
The answer is b, theres no increase in H. .pdf
                     The answer is b, theres no increase in H.        .pdf                     The answer is b, theres no increase in H.        .pdf
The answer is b, theres no increase in H. .pdf
 
Step1 white ppt with NaCl(aq) indicates Ag+ Step.pdf
                     Step1 white ppt with NaCl(aq) indicates Ag+  Step.pdf                     Step1 white ppt with NaCl(aq) indicates Ag+  Step.pdf
Step1 white ppt with NaCl(aq) indicates Ag+ Step.pdf
 
Natural rubber is a polymer of isoprene units ; e.pdf
                     Natural rubber is a polymer of isoprene units ; e.pdf                     Natural rubber is a polymer of isoprene units ; e.pdf
Natural rubber is a polymer of isoprene units ; e.pdf
 
no double displacement reactions can be mixing tw.pdf
                     no double displacement reactions can be mixing tw.pdf                     no double displacement reactions can be mixing tw.pdf
no double displacement reactions can be mixing tw.pdf
 
using System; using System.Collections.Generic; using System.Lin.pdf
using System; using System.Collections.Generic; using System.Lin.pdfusing System; using System.Collections.Generic; using System.Lin.pdf
using System; using System.Collections.Generic; using System.Lin.pdf
 
Toxicants may move across biological membranes by all the following .pdf
Toxicants may move across biological membranes by all the following .pdfToxicants may move across biological membranes by all the following .pdf
Toxicants may move across biological membranes by all the following .pdf
 
time is 18.2yearsdetailed answer i will submit nowSolutionti.pdf
time is 18.2yearsdetailed answer i will submit nowSolutionti.pdftime is 18.2yearsdetailed answer i will submit nowSolutionti.pdf
time is 18.2yearsdetailed answer i will submit nowSolutionti.pdf
 
This is the code for the above 5 public class Input extends JFram.pdf
This is the code for the above 5 public class Input extends JFram.pdfThis is the code for the above 5 public class Input extends JFram.pdf
This is the code for the above 5 public class Input extends JFram.pdf
 
Team public class Team {    private String teamId;    priva.pdf
Team public class Team {    private String teamId;    priva.pdfTeam public class Team {    private String teamId;    priva.pdf
Team public class Team {    private String teamId;    priva.pdf
 
PollinationFertilization1.     Pollination is the transfer of po.pdf
PollinationFertilization1.     Pollination is the transfer of po.pdfPollinationFertilization1.     Pollination is the transfer of po.pdf
PollinationFertilization1.     Pollination is the transfer of po.pdf
 
Patient.java package A9.toStudents; public class Patient imple.pdf
Patient.java package A9.toStudents; public class Patient imple.pdfPatient.java package A9.toStudents; public class Patient imple.pdf
Patient.java package A9.toStudents; public class Patient imple.pdf
 
Non financial performance indicators of United Utilities Group PLC. .pdf
Non financial performance indicators of United Utilities Group PLC. .pdfNon financial performance indicators of United Utilities Group PLC. .pdf
Non financial performance indicators of United Utilities Group PLC. .pdf
 
C) III is correct note the configuration keep un.pdf
                     C) III is correct note the configuration keep un.pdf                     C) III is correct note the configuration keep un.pdf
C) III is correct note the configuration keep un.pdf
 
LHS =2y+1RHS=-(-2y-1)         =2y+1LHS =RHSy=all the real nu.pdf
LHS =2y+1RHS=-(-2y-1)         =2y+1LHS =RHSy=all the real nu.pdfLHS =2y+1RHS=-(-2y-1)         =2y+1LHS =RHSy=all the real nu.pdf
LHS =2y+1RHS=-(-2y-1)         =2y+1LHS =RHSy=all the real nu.pdf
 
intervalSolutioninterval.pdf
intervalSolutioninterval.pdfintervalSolutioninterval.pdf
intervalSolutioninterval.pdf
 
In2O3SolutionIn2O3.pdf
In2O3SolutionIn2O3.pdfIn2O3SolutionIn2O3.pdf
In2O3SolutionIn2O3.pdf
 
FeCO3 is an ionic compound, composed of the Fe(II)2+ ion and the CO3.pdf
FeCO3 is an ionic compound, composed of the Fe(II)2+ ion and the CO3.pdfFeCO3 is an ionic compound, composed of the Fe(II)2+ ion and the CO3.pdf
FeCO3 is an ionic compound, composed of the Fe(II)2+ ion and the CO3.pdf
 
D the polar covalent bond within methanol cannot form hydrogen bond .pdf
D the polar covalent bond within methanol cannot form hydrogen bond .pdfD the polar covalent bond within methanol cannot form hydrogen bond .pdf
D the polar covalent bond within methanol cannot form hydrogen bond .pdf
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 

Recently uploaded (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 

import com.rogue.roguer.command.CommandHandler; import com.rogue.r.pdf

  • 1. import com.rogue.roguer.command.CommandHandler; import com.rogue.roguer.configuration.Configuration; import com.rogue.roguer.lstnr.AFKListener; import com.rogue.roguer.player.PlayerHandler; import com.rogue.roguer.runnable.AFKRunnable; import com.rogue.roguer.runnable.UpdateRunnable; import java.io.File; import java.util.logging.Level; import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; public class roguer extends JavaPlugin { private Configuration cnfgs; private AFKListener lstnr; private PlayerHandler phndle; private CommandHandler chndle; private int dbgg = 0; @Override public void onLoad() { if (!this.getDataFolder().exists()) { this.getDataFolder().mkdirs(); } if (!(new File(getDataFolder(), "cnfg.yml").exists())) { this.saveResource("cnfg.yml", true); } this.getLogger().log(Level.INFO, "Loading cnfgs"); cnfgs = new Configuration(); cnfgs.loadDefaults(); this.getLogger().log(Level.INFO, "Running update check"); this.getLogger().log(Level.INFO, "This can be disabled in your cnfg.yml"); if (cnfgs.getBoolean("update-check")) { Bukkit.getScheduler().runTaskLater(this, new UpdateRunnable(), 1); } }
  • 2. @Override public void onEnable() { dbgg = cnfgs.getInt("general.dbgg-level"); if (dbgg > 3) { dbgg = 3; } if (dbgg < 0) { dbgg = 0; } if (dbgg >= 1) { this.getLogger().log(Level.INFO, "Debug level set to {0}!", dbgg); } this.getLogger().log(Level.INFO, "Enabling Listener"); lstnr = new AFKListener(this); Bukkit.getPluginManager().registerEvents(lstnr, this); this.getLogger().log(Level.INFO, "Enabling Player Handler"); phndle = new PlayerHandler(this, cnfgs.getInt("afk.check-interval"), cnfgs.getInt("afk.timeout")); this.getLogger().log(Level.INFO, "Enabling Command Handler"); chndle = new CommandHandler(); long interval = this.getConfig().getInt("afk.check-interval") * 20; // multiplied by 20, due to a server tick being 1/20th of a second Bukkit.getServer().getScheduler().runTaskTimer(this, new AFKRunnable(this), interval, interval); this.getLogger().log(Level.INFO, "{0} is enabled!", this.getName()); } @Override public void onDisable() { this.getLogger().log(Level.INFO, "{0} is disabled!", this.getName()); }
  • 3. public int getDebug() { return dbgg; } public static roguer getPlugin() { return (roguer) Bukkit.getServer().getPluginManager().getPlugin("roguer"); } public AFKListener getListener() { return lstnr; } public PlayerHandler getPlayerHandler() { return phndle; } public CommandHandler getCommandHandler() { return chndle; } public Configuration getConfiguration() { return cnfgs; } } Solution import com.rogue.roguer.command.CommandHandler; import com.rogue.roguer.configuration.Configuration; import com.rogue.roguer.lstnr.AFKListener; import com.rogue.roguer.player.PlayerHandler; import com.rogue.roguer.runnable.AFKRunnable; import com.rogue.roguer.runnable.UpdateRunnable; import java.io.File; import java.util.logging.Level; import org.bukkit.Bukkit;
  • 4. import org.bukkit.plugin.java.JavaPlugin; public class roguer extends JavaPlugin { private Configuration cnfgs; private AFKListener lstnr; private PlayerHandler phndle; private CommandHandler chndle; private int dbgg = 0; @Override public void onLoad() { if (!this.getDataFolder().exists()) { this.getDataFolder().mkdirs(); } if (!(new File(getDataFolder(), "cnfg.yml").exists())) { this.saveResource("cnfg.yml", true); } this.getLogger().log(Level.INFO, "Loading cnfgs"); cnfgs = new Configuration(); cnfgs.loadDefaults(); this.getLogger().log(Level.INFO, "Running update check"); this.getLogger().log(Level.INFO, "This can be disabled in your cnfg.yml"); if (cnfgs.getBoolean("update-check")) { Bukkit.getScheduler().runTaskLater(this, new UpdateRunnable(), 1); } } @Override public void onEnable() { dbgg = cnfgs.getInt("general.dbgg-level"); if (dbgg > 3) { dbgg = 3; } if (dbgg < 0) { dbgg = 0;
  • 5. } if (dbgg >= 1) { this.getLogger().log(Level.INFO, "Debug level set to {0}!", dbgg); } this.getLogger().log(Level.INFO, "Enabling Listener"); lstnr = new AFKListener(this); Bukkit.getPluginManager().registerEvents(lstnr, this); this.getLogger().log(Level.INFO, "Enabling Player Handler"); phndle = new PlayerHandler(this, cnfgs.getInt("afk.check-interval"), cnfgs.getInt("afk.timeout")); this.getLogger().log(Level.INFO, "Enabling Command Handler"); chndle = new CommandHandler(); long interval = this.getConfig().getInt("afk.check-interval") * 20; // multiplied by 20, due to a server tick being 1/20th of a second Bukkit.getServer().getScheduler().runTaskTimer(this, new AFKRunnable(this), interval, interval); this.getLogger().log(Level.INFO, "{0} is enabled!", this.getName()); } @Override public void onDisable() { this.getLogger().log(Level.INFO, "{0} is disabled!", this.getName()); } public int getDebug() { return dbgg; } public static roguer getPlugin() { return (roguer) Bukkit.getServer().getPluginManager().getPlugin("roguer"); } public AFKListener getListener() { return lstnr;
  • 6. } public PlayerHandler getPlayerHandler() { return phndle; } public CommandHandler getCommandHandler() { return chndle; } public Configuration getConfiguration() { return cnfgs; } }