Skip to content

Commit

Permalink
null
Browse files Browse the repository at this point in the history
  • Loading branch information
nullaqua committed Mar 21, 2022
1 parent 4427aa3 commit 6d57c55
Show file tree
Hide file tree
Showing 13 changed files with 181 additions and 140 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.lanzhi</groupId>
<artifactId>BluestarGame</artifactId>
<version>2.3.2</version>
<version>2.3.4</version>
<packaging>jar</packaging>

<name>BluestarGame</name>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/me/lanzhi/bluestargame/BluestarGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void onEnable()
lavasponge = lavasponge.shape("a");
lavasponge = lavasponge.setIngredient('a', new RecipeChoice.ExactChoice(superSponge.getSuperSponge().getItem()));
Bukkit.addRecipe(lavasponge);
CtrlSponge.set((List<superSponge>) config.getList("superSponges"));
CtrlSponge.set((List<superSponge>) Data.getList("superSponges"));
this.task = CtrlSponge.ctrlsponge.runTaskTimer(plugin, 0L, 2L);

System.out.println("BluestarGame已加载");
Expand All @@ -91,8 +91,8 @@ public void onDisable()
CTRL.theend();
CTRL.all(false);
Bukkit.clearRecipes();
config.set("superSponges",CtrlSponge.get());
config.save();
Data.set("superSponges",CtrlSponge.get());
Data.save();
PlayerMap.save();
Data.save();
System.out.println("BluestarGame已卸载");
Expand Down
80 changes: 38 additions & 42 deletions src/main/java/me/lanzhi/bluestargame/Ctrls/AutoCtrl.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,95 +5,91 @@
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.scheduler.BukkitRunnable;

public class AutoCtrl
public class AutoCtrl extends BukkitRunnable
{
public int on = 0;
public BukkitRunnable thread = new BukkitRunnable()
public static int on = 0;
@Override
public void run()
{
@Override
public void run()
if (!BluestarGame.config.getBoolean("auto"))
{
if(Bukkit.getServer().getOnlinePlayers().size()<=0)
if (on != 0)
{
return;
AutoCtrl.change(false);
on = 0;
}
if (!BluestarGame.config.getBoolean("auto"))
return;
}
if (on == 0)
{
on = ((int)(Math.random() * 12) + 1);
if(Bukkit.getServer().getOnlinePlayers().size()<=0&&on!=4)
{
if (AutoCtrl.this.on != 0)
{
AutoCtrl.this.change(false);
AutoCtrl.this.on = 0;
}
CTRL.task=(new AutoCtrl()).runTaskLaterAsynchronously(BluestarGame.plugin,12000);
return;
}
if (AutoCtrl.this.on == 0)
{
AutoCtrl.this.on = ((int)(Math.random() * 12) + 1);
if(Bukkit.getServer().getOnlinePlayers().size()<=0&&on!=4)
{
return;
}
AutoCtrl.this.change(true);
}
else
{
AutoCtrl.this.change(false);
AutoCtrl.this.on = 0;
}
AutoCtrl.change(true);
CTRL.task=(new AutoCtrl()).runTaskLaterAsynchronously(BluestarGame.plugin,12000);
}
};

public void change(boolean b)
else
{
AutoCtrl.change(false);
on=0;
CTRL.task=(new AutoCtrl()).runTaskLaterAsynchronously(BluestarGame.plugin,24000);
}
}
public static synchronized void change(boolean b)
{
if (this.on == 1)
if (on == 1)
{
CTRL.randdamage(b);
}
else if (this.on == 2)
else if (on == 2)
{
CTRL.randchat(b);
}
else if (this.on == 3)
else if (on == 3)
{
CTRL.randsheep(b);
}
else if (this.on == 4)
else if (on == 4)
{
CTRL.the24(b);
}
else if (this.on == 5)
else if (on == 5)
{
CTRL.morediamond(b);
}
else if (this.on == 6)
else if (on == 6)
{
CTRL.morecoal(b);
}
else if (this.on == 7)
else if (on == 7)
{
CTRL.morecopper(b);
}
else if (this.on == 8)
else if (on == 8)
{
CTRL.moregold(b);
}
else if (this.on == 9)
else if (on == 9)
{
CTRL.moreemerald(b);
}
else if (this.on == 10)
else if (on == 10)
{
CTRL.morelapis(b);
}
else if (this.on == 11)
else if (on == 11)
{
CTRL.moreiron(b);
}
else if (this.on == 12)
else if (on == 12)
{
CTRL.respawn(b);
}
}

}


Expand Down
Loading

0 comments on commit 6d57c55

Please sign in to comment.