Changed HelloWorldPlugin to ButtonHardcorePlugin #5

Merged
alisolarflare merged 1 commit from Ali into master 2016-10-23 04:13:46 +00:00
7 changed files with 25 additions and 25 deletions
Showing only changes of commit 4bdb9603a0 - Show all commits

View file

@ -1,5 +1,5 @@
main: iie.HelloWorldPlugin
version: 1.0.0
main: iie.ButtonHardcorePlugin
version: 1.0.1
name: ButtonHardcorePlugin
commands:
hardcore:

View file

@ -8,7 +8,7 @@ import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Player;
import iie.HelloWorldPlugin;
import iie.ButtonHardcorePlugin;
public class RandomTPModule{
private static int conflictX;
@ -19,8 +19,8 @@ public class RandomTPModule{
private static boolean eastUsed;
private static boolean westUsed;
@SuppressWarnings("unused")
private HelloWorldPlugin helloWorldPlugin;
public RandomTPModule(HelloWorldPlugin helloWorldPlugin) {
private ButtonHardcorePlugin helloWorldPlugin;
public RandomTPModule(ButtonHardcorePlugin helloWorldPlugin) {
this.helloWorldPlugin = helloWorldPlugin;
}

View file

@ -14,8 +14,8 @@ import org.bukkit.event.player.PlayerMoveEvent;
public class BoundaryListener implements Listener {
HelloWorldPlugin plugin;
public BoundaryListener(HelloWorldPlugin plugin){
ButtonHardcorePlugin plugin;
public BoundaryListener(ButtonHardcorePlugin plugin){
this.plugin = plugin;
}

View file

@ -16,7 +16,7 @@ import alisolarflare.listeners.ConflictCompassCraftingListener;
import alisolarflare.listeners.DiamondArmorBlocker;
public class HelloWorldPlugin extends JavaPlugin {
public class ButtonHardcorePlugin extends JavaPlugin {
public static Player iie;

View file

@ -11,8 +11,8 @@ import org.bukkit.event.entity.PlayerDeathEvent;
public class DeathListener implements Listener {
HelloWorldPlugin plugin;
public DeathListener(HelloWorldPlugin plugin){
ButtonHardcorePlugin plugin;
public DeathListener(ButtonHardcorePlugin plugin){
this.plugin = plugin;
}
@ -31,8 +31,8 @@ public class DeathListener implements Listener {
if (Objects.equals(worldString, "hardcore")){
HelloWorldPlugin.hardcoreTimeDead.getScore(playername).setScore(currentTime);
HelloWorldPlugin.hardcoreInvite.getScore(playername).setScore(0);
ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername).setScore(currentTime);
ButtonHardcorePlugin.hardcoreInvite.getScore(playername).setScore(0);
//player.sendMessage("death detected");
//player.sendMessage("hardcoreTimeDead score = " + String.valueOf(HelloWorldPlugin.hardcoreTimeDead.getScore(playername).getScore()));

View file

@ -14,8 +14,8 @@ import org.bukkit.entity.Player;
public class HelloWorld implements CommandExecutor {
HelloWorldPlugin plugin;
public HelloWorld(HelloWorldPlugin plugin){
ButtonHardcorePlugin plugin;
public HelloWorld(ButtonHardcorePlugin plugin){
this.plugin = plugin;
}
@ -41,8 +41,8 @@ public class HelloWorld implements CommandExecutor {
int currentTime = (int) ((System.currentTimeMillis())/1000);
int deathTime = 0;
if (HelloWorldPlugin.hardcoreTimeDead.getScore(playername) != null) //null check - if score exists
deathTime = HelloWorldPlugin.hardcoreTimeDead.getScore(playername).getScore(); //set deathTime to that score
if (ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername) != null) //null check - if score exists
deathTime = ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername).getScore(); //set deathTime to that score

View file

@ -8,8 +8,8 @@ import org.bukkit.event.player.PlayerJoinEvent;
public class JoinListener implements Listener {
HelloWorldPlugin plugin;
public JoinListener(HelloWorldPlugin plugin){
ButtonHardcorePlugin plugin;
public JoinListener(ButtonHardcorePlugin plugin){
this.plugin = plugin;
}
@ -21,22 +21,22 @@ public class JoinListener implements Listener {
String playername = (String) player.getName();
if (HelloWorldPlugin.hardcoreInvite.getScore(playername) == null){ //null check
HelloWorldPlugin.hardcoreInvite.getScore(playername).setScore(0); //convert null to 0
if (ButtonHardcorePlugin.hardcoreInvite.getScore(playername) == null){ //null check
ButtonHardcorePlugin.hardcoreInvite.getScore(playername).setScore(0); //convert null to 0
}
if (HelloWorldPlugin.hardcoreTimeDead.getScore(playername) == null){ //null check
HelloWorldPlugin.hardcoreTimeDead.getScore(playername).setScore(0); //convert null to 0
if (ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername) == null){ //null check
ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername).setScore(0); //convert null to 0
}
int invite = HelloWorldPlugin.hardcoreInvite.getScore(playername).getScore();
int deathTime = HelloWorldPlugin.hardcoreTimeDead.getScore(playername).getScore();
int invite = ButtonHardcorePlugin.hardcoreInvite.getScore(playername).getScore();
int deathTime = ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername).getScore();
int currentTime = (int) ((System.currentTimeMillis())/1000);
if (currentTime - deathTime >= 86400 && deathTime != 0 && invite == 0){
player.sendMessage(playername + ", your death has lifted in Hardcore world. (You died " + String.valueOf((currentTime - deathTime) /3600) + " hours ago)");
player.sendMessage("Are you ready to give life another shot?");
HelloWorldPlugin.hardcoreInvite.getScore(playername).setScore(1);
ButtonHardcorePlugin.hardcoreInvite.getScore(playername).setScore(1);
}else if (currentTime - deathTime <= 86400){
player.sendMessage(String.valueOf((86400 - (currentTime - deathTime)) /3600) + " hours of death remaining in hardcore");
}else if (deathTime == 0){