Changed HelloWorldPlugin to ButtonHardcorePlugin
This commit is contained in:
parent
b17822976e
commit
4bdb9603a0
7 changed files with 25 additions and 25 deletions
|
@ -1,5 +1,5 @@
|
||||||
main: iie.HelloWorldPlugin
|
main: iie.ButtonHardcorePlugin
|
||||||
version: 1.0.0
|
version: 1.0.1
|
||||||
name: ButtonHardcorePlugin
|
name: ButtonHardcorePlugin
|
||||||
commands:
|
commands:
|
||||||
hardcore:
|
hardcore:
|
||||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import iie.HelloWorldPlugin;
|
import iie.ButtonHardcorePlugin;
|
||||||
|
|
||||||
public class RandomTPModule{
|
public class RandomTPModule{
|
||||||
private static int conflictX;
|
private static int conflictX;
|
||||||
|
@ -19,8 +19,8 @@ public class RandomTPModule{
|
||||||
private static boolean eastUsed;
|
private static boolean eastUsed;
|
||||||
private static boolean westUsed;
|
private static boolean westUsed;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private HelloWorldPlugin helloWorldPlugin;
|
private ButtonHardcorePlugin helloWorldPlugin;
|
||||||
public RandomTPModule(HelloWorldPlugin helloWorldPlugin) {
|
public RandomTPModule(ButtonHardcorePlugin helloWorldPlugin) {
|
||||||
this.helloWorldPlugin = helloWorldPlugin;
|
this.helloWorldPlugin = helloWorldPlugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@ import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
|
|
||||||
public class BoundaryListener implements Listener {
|
public class BoundaryListener implements Listener {
|
||||||
|
|
||||||
HelloWorldPlugin plugin;
|
ButtonHardcorePlugin plugin;
|
||||||
public BoundaryListener(HelloWorldPlugin plugin){
|
public BoundaryListener(ButtonHardcorePlugin plugin){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import alisolarflare.listeners.ConflictCompassCraftingListener;
|
||||||
import alisolarflare.listeners.DiamondArmorBlocker;
|
import alisolarflare.listeners.DiamondArmorBlocker;
|
||||||
|
|
||||||
|
|
||||||
public class HelloWorldPlugin extends JavaPlugin {
|
public class ButtonHardcorePlugin extends JavaPlugin {
|
||||||
|
|
||||||
public static Player iie;
|
public static Player iie;
|
||||||
|
|
|
@ -11,8 +11,8 @@ import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
|
|
||||||
public class DeathListener implements Listener {
|
public class DeathListener implements Listener {
|
||||||
|
|
||||||
HelloWorldPlugin plugin;
|
ButtonHardcorePlugin plugin;
|
||||||
public DeathListener(HelloWorldPlugin plugin){
|
public DeathListener(ButtonHardcorePlugin plugin){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ public class DeathListener implements Listener {
|
||||||
|
|
||||||
if (Objects.equals(worldString, "hardcore")){
|
if (Objects.equals(worldString, "hardcore")){
|
||||||
|
|
||||||
HelloWorldPlugin.hardcoreTimeDead.getScore(playername).setScore(currentTime);
|
ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername).setScore(currentTime);
|
||||||
HelloWorldPlugin.hardcoreInvite.getScore(playername).setScore(0);
|
ButtonHardcorePlugin.hardcoreInvite.getScore(playername).setScore(0);
|
||||||
|
|
||||||
//player.sendMessage("death detected");
|
//player.sendMessage("death detected");
|
||||||
//player.sendMessage("hardcoreTimeDead score = " + String.valueOf(HelloWorldPlugin.hardcoreTimeDead.getScore(playername).getScore()));
|
//player.sendMessage("hardcoreTimeDead score = " + String.valueOf(HelloWorldPlugin.hardcoreTimeDead.getScore(playername).getScore()));
|
||||||
|
|
|
@ -14,8 +14,8 @@ import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class HelloWorld implements CommandExecutor {
|
public class HelloWorld implements CommandExecutor {
|
||||||
|
|
||||||
HelloWorldPlugin plugin;
|
ButtonHardcorePlugin plugin;
|
||||||
public HelloWorld(HelloWorldPlugin plugin){
|
public HelloWorld(ButtonHardcorePlugin plugin){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ public class HelloWorld implements CommandExecutor {
|
||||||
int currentTime = (int) ((System.currentTimeMillis())/1000);
|
int currentTime = (int) ((System.currentTimeMillis())/1000);
|
||||||
int deathTime = 0;
|
int deathTime = 0;
|
||||||
|
|
||||||
if (HelloWorldPlugin.hardcoreTimeDead.getScore(playername) != null) //null check - if score exists
|
if (ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername) != null) //null check - if score exists
|
||||||
deathTime = HelloWorldPlugin.hardcoreTimeDead.getScore(playername).getScore(); //set deathTime to that score
|
deathTime = ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername).getScore(); //set deathTime to that score
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,8 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
public class JoinListener implements Listener {
|
public class JoinListener implements Listener {
|
||||||
|
|
||||||
HelloWorldPlugin plugin;
|
ButtonHardcorePlugin plugin;
|
||||||
public JoinListener(HelloWorldPlugin plugin){
|
public JoinListener(ButtonHardcorePlugin plugin){
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,22 +21,22 @@ public class JoinListener implements Listener {
|
||||||
String playername = (String) player.getName();
|
String playername = (String) player.getName();
|
||||||
|
|
||||||
|
|
||||||
if (HelloWorldPlugin.hardcoreInvite.getScore(playername) == null){ //null check
|
if (ButtonHardcorePlugin.hardcoreInvite.getScore(playername) == null){ //null check
|
||||||
HelloWorldPlugin.hardcoreInvite.getScore(playername).setScore(0); //convert null to 0
|
ButtonHardcorePlugin.hardcoreInvite.getScore(playername).setScore(0); //convert null to 0
|
||||||
}
|
}
|
||||||
if (HelloWorldPlugin.hardcoreTimeDead.getScore(playername) == null){ //null check
|
if (ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername) == null){ //null check
|
||||||
HelloWorldPlugin.hardcoreTimeDead.getScore(playername).setScore(0); //convert null to 0
|
ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername).setScore(0); //convert null to 0
|
||||||
}
|
}
|
||||||
|
|
||||||
int invite = HelloWorldPlugin.hardcoreInvite.getScore(playername).getScore();
|
int invite = ButtonHardcorePlugin.hardcoreInvite.getScore(playername).getScore();
|
||||||
int deathTime = HelloWorldPlugin.hardcoreTimeDead.getScore(playername).getScore();
|
int deathTime = ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername).getScore();
|
||||||
int currentTime = (int) ((System.currentTimeMillis())/1000);
|
int currentTime = (int) ((System.currentTimeMillis())/1000);
|
||||||
|
|
||||||
|
|
||||||
if (currentTime - deathTime >= 86400 && deathTime != 0 && invite == 0){
|
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(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?");
|
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){
|
}else if (currentTime - deathTime <= 86400){
|
||||||
player.sendMessage(String.valueOf((86400 - (currentTime - deathTime)) /3600) + " hours of death remaining in hardcore");
|
player.sendMessage(String.valueOf((86400 - (currentTime - deathTime)) /3600) + " hours of death remaining in hardcore");
|
||||||
}else if (deathTime == 0){
|
}else if (deathTime == 0){
|
||||||
|
|
Loading…
Reference in a new issue