Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
|
b32970956d |
8 changed files with 32 additions and 35 deletions
|
@ -1,5 +1,5 @@
|
|||
main: iie.ButtonHardcorePlugin
|
||||
version: 1.0.1
|
||||
main: iie.HelloWorldPlugin
|
||||
version: 1.0.0
|
||||
name: ButtonHardcorePlugin
|
||||
commands:
|
||||
hardcore:
|
||||
|
|
13
pom.xml
13
pom.xml
|
@ -8,16 +8,13 @@
|
|||
<resources>
|
||||
<resource>
|
||||
<directory>src</directory>
|
||||
<includes>
|
||||
<include>*.yml</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/*.java</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>.</directory>
|
||||
<includes>
|
||||
<include>*.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.Material;
|
|||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import iie.ButtonHardcorePlugin;
|
||||
import iie.HelloWorldPlugin;
|
||||
|
||||
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 ButtonHardcorePlugin helloWorldPlugin;
|
||||
public RandomTPModule(ButtonHardcorePlugin helloWorldPlugin) {
|
||||
private HelloWorldPlugin helloWorldPlugin;
|
||||
public RandomTPModule(HelloWorldPlugin helloWorldPlugin) {
|
||||
this.helloWorldPlugin = helloWorldPlugin;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ import org.bukkit.event.player.PlayerMoveEvent;
|
|||
|
||||
public class BoundaryListener implements Listener {
|
||||
|
||||
ButtonHardcorePlugin plugin;
|
||||
public BoundaryListener(ButtonHardcorePlugin plugin){
|
||||
HelloWorldPlugin plugin;
|
||||
public BoundaryListener(HelloWorldPlugin plugin){
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ import org.bukkit.event.entity.PlayerDeathEvent;
|
|||
|
||||
public class DeathListener implements Listener {
|
||||
|
||||
ButtonHardcorePlugin plugin;
|
||||
public DeathListener(ButtonHardcorePlugin plugin){
|
||||
HelloWorldPlugin plugin;
|
||||
public DeathListener(HelloWorldPlugin plugin){
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,8 @@ public class DeathListener implements Listener {
|
|||
|
||||
if (Objects.equals(worldString, "hardcore")){
|
||||
|
||||
ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername).setScore(currentTime);
|
||||
ButtonHardcorePlugin.hardcoreInvite.getScore(playername).setScore(0);
|
||||
HelloWorldPlugin.hardcoreTimeDead.getScore(playername).setScore(currentTime);
|
||||
HelloWorldPlugin.hardcoreInvite.getScore(playername).setScore(0);
|
||||
|
||||
//player.sendMessage("death detected");
|
||||
//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 {
|
||||
|
||||
ButtonHardcorePlugin plugin;
|
||||
public HelloWorld(ButtonHardcorePlugin plugin){
|
||||
HelloWorldPlugin plugin;
|
||||
public HelloWorld(HelloWorldPlugin plugin){
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,8 @@ public class HelloWorld implements CommandExecutor {
|
|||
int currentTime = (int) ((System.currentTimeMillis())/1000);
|
||||
int deathTime = 0;
|
||||
|
||||
if (ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername) != null) //null check - if score exists
|
||||
deathTime = ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername).getScore(); //set deathTime to that score
|
||||
if (HelloWorldPlugin.hardcoreTimeDead.getScore(playername) != null) //null check - if score exists
|
||||
deathTime = HelloWorldPlugin.hardcoreTimeDead.getScore(playername).getScore(); //set deathTime to that score
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import alisolarflare.listeners.ConflictCompassCraftingListener;
|
|||
import alisolarflare.listeners.DiamondArmorBlocker;
|
||||
|
||||
|
||||
public class ButtonHardcorePlugin extends JavaPlugin {
|
||||
public class HelloWorldPlugin extends JavaPlugin {
|
||||
|
||||
public static Player iie;
|
||||
|
||||
|
@ -51,7 +51,7 @@ public class ButtonHardcorePlugin extends JavaPlugin {
|
|||
|
||||
getServer().getPluginManager().registerEvents(new DiamondArmorBlocker(), this);
|
||||
getServer().getPluginManager().registerEvents(new ConflictCompassCraftingListener(), this);
|
||||
//getServer().getPluginManager().registerEvents(new CompassLobby(), this);
|
||||
getServer().getPluginManager().registerEvents(new CompassLobby(), this);
|
||||
|
||||
|
||||
}
|
|
@ -8,8 +8,8 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||
|
||||
public class JoinListener implements Listener {
|
||||
|
||||
ButtonHardcorePlugin plugin;
|
||||
public JoinListener(ButtonHardcorePlugin plugin){
|
||||
HelloWorldPlugin plugin;
|
||||
public JoinListener(HelloWorldPlugin plugin){
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
@ -21,22 +21,22 @@ public class JoinListener implements Listener {
|
|||
String playername = (String) player.getName();
|
||||
|
||||
|
||||
if (ButtonHardcorePlugin.hardcoreInvite.getScore(playername) == null){ //null check
|
||||
ButtonHardcorePlugin.hardcoreInvite.getScore(playername).setScore(0); //convert null to 0
|
||||
if (HelloWorldPlugin.hardcoreInvite.getScore(playername) == null){ //null check
|
||||
HelloWorldPlugin.hardcoreInvite.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
|
||||
if (HelloWorldPlugin.hardcoreTimeDead.getScore(playername) == null){ //null check
|
||||
HelloWorldPlugin.hardcoreTimeDead.getScore(playername).setScore(0); //convert null to 0
|
||||
}
|
||||
|
||||
int invite = ButtonHardcorePlugin.hardcoreInvite.getScore(playername).getScore();
|
||||
int deathTime = ButtonHardcorePlugin.hardcoreTimeDead.getScore(playername).getScore();
|
||||
int invite = HelloWorldPlugin.hardcoreInvite.getScore(playername).getScore();
|
||||
int deathTime = HelloWorldPlugin.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?");
|
||||
ButtonHardcorePlugin.hardcoreInvite.getScore(playername).setScore(1);
|
||||
HelloWorldPlugin.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){
|
||||
|
|
Loading…
Reference in a new issue