Skip to content

Commit 7698372

Browse files
authored
Merge pull request #4 from AzisabaNetwork/add-spotless
Add spotless
2 parents ecea4fd + d8f2a6f commit 7698372

File tree

145 files changed

+27268
-25138
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+27268
-25138
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838

3939
- name: Cache .m2 directory
4040
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
41+
id: cache
4142
with:
4243
path: ~/.m2
4344
key: m2-cache
@@ -48,6 +49,7 @@ jobs:
4849
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
4950

5051
- name: Setup BuildTools
52+
if: steps.cache.outputs.cache-hit != 'true'
5153
run: |
5254
wget "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar"
5355
java -jar BuildTools.jar --rev 1.14.4

build.gradle.kts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
`java-library`
44
`maven-publish`
55
alias(libs.plugins.runPaper)
6+
alias(libs.plugins.spotless)
67
}
78

89
group = "be4rjp"
@@ -93,3 +94,19 @@ publishing {
9394
}
9495
}
9596
}
97+
98+
spotless {
99+
format("misc") {
100+
target(".gitignore")
101+
trimTrailingWhitespace()
102+
indentWithSpaces(4)
103+
endWithNewline()
104+
}
105+
java {
106+
target("src/main/java/**/*.java", "src/test/java/**/*.java")
107+
toggleOffOn()
108+
removeUnusedImports()
109+
endWithNewline()
110+
eclipse()
111+
}
112+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
org.gradle.configuration-cache=true
1+
#org.gradle.configuration-cache=true
22

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[versions]
22
runPaper = "2.3.1" # 3.x.x can't run in Java8
3+
spotless = "6.13.0" # 6.14.0 can't run in Java8
34
protocolLib = "4.5.0"
45
paperApi = "1.14.4-R0.1-SNAPSHOT"
56
blockstudio = "-SNAPSHOT"
@@ -12,6 +13,7 @@ spigotApi = "1.14.4-R0.1-SNAPSHOT"
1213

1314
[plugins]
1415
runPaper = { id = "xyz.jpenilla.run-paper", version.ref = "runPaper" }
16+
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
1517

1618
[libraries]
1719
protocolLib = { module = "com.comphenix.protocol:ProtocolLib", version.ref = "protocolLib" }

src/main/java/be4rjp/sclat/Animation.java

Lines changed: 163 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -14,110 +14,167 @@
1414
* @author Be4rJP
1515
*/
1616
public class Animation {
17-
public static void ResultAnimation(Player p, int team0point, int team1point, String team0color, String team1color, Team winteam, Boolean hikiwake){
18-
BukkitRunnable task = new BukkitRunnable(){
19-
Player player = p;
20-
int i = 0;
21-
int g = 0;
22-
@Override
23-
public void run(){
24-
25-
if(i <= 15){
26-
player.sendTitle("", String.valueOf(g) + "% [" + GaugeAPI.toGauge(g,50,team0color,"§7") + GaugeAPI.toGauge(50 - g,50,"§7",team1color) + "] " + String.valueOf(g) + "%", 0, 40, 0);
27-
g = g + 2;
28-
}
29-
/*
30-
if(i >= 6 && i <= 10){
31-
player.sendTitle("", String.valueOf(g) + "% [" + GaugeAPI.toGauge(g,50,team0color,"§7") + GaugeAPI.toGauge(50 - g,50,"§7",team1color) + "] " + String.valueOf(g) + "%", 0, 40, 0);
32-
g++;
33-
}*/
34-
if(i == 35){
35-
if(hikiwake){
36-
player.sendTitle("引き分け!", "[" + GaugeAPI.toGauge(50,100, team0color, team1color) + "]", 0, 40, 10);
37-
}else{
38-
if(winteam == DataMgr.getPlayerData(player).getTeam())
39-
player.sendTitle(ChatColor.GREEN + "You Win!", String.valueOf(team0point) + "% [" + GaugeAPI.toGauge(team0point,100, team0color, team1color) + "] " + String.valueOf(100 - team0point) + "%", 0, 40, 10);
40-
else
41-
player.sendTitle(ChatColor.RED + "You Lose...", String.valueOf(team0point) + "% [" + GaugeAPI.toGauge(team0point,100, team0color, team1color) + "] " + String.valueOf(100 - team0point) + "%", 0, 40, 10);
42-
}
43-
player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_INFECT, 13.0F, 1.5F);
44-
}
45-
if(i == 40){
46-
if(winteam == DataMgr.getPlayerData(player).getTeam())
47-
Sclat.playGameSound(player, SoundType.CONGRATULATIONS);
48-
cancel();
49-
}
50-
i++;
51-
}
52-
};
53-
task.runTaskTimer(Main.getPlugin(), 0, 2);
54-
}
55-
56-
public static void AreaResultAnimation(Player p, int team0point, int team1point, String team0color, String team1color, Team winteam){
57-
BukkitRunnable task = new BukkitRunnable(){
58-
Player player = p;
59-
int i = 0;
60-
int g = 0;
61-
@Override
62-
public void run(){
63-
64-
if(i <= 15){
65-
player.sendTitle("", String.valueOf(g) + "% [" + GaugeAPI.toGauge(g,50,team0color,"§7") + GaugeAPI.toGauge(50 - g,50,"§7",team1color) + "] " + String.valueOf(g) + "%", 0, 40, 0);
66-
g = g + 2;
67-
}
68-
if(i == 35){
69-
if(winteam == DataMgr.getPlayerData(player).getTeam())
70-
player.sendTitle(ChatColor.GREEN + "Knock Out !!", String.valueOf(team0point) + "% [" + GaugeAPI.toGauge(team0point,100, team0color, team1color) + "] " + String.valueOf(100 - team0point) + "%", 0, 40, 10);
71-
else
72-
player.sendTitle(ChatColor.RED + "You Lose...", String.valueOf(team0point) + "% [" + GaugeAPI.toGauge(team0point,100, team0color, team1color) + "] " + String.valueOf(100 - team0point) + "%", 0, 40, 10);
73-
player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_INFECT, 13.0F, 1.5F);
74-
}
75-
if(i == 40){
76-
if(winteam == DataMgr.getPlayerData(player).getTeam())
77-
Sclat.playGameSound(player, SoundType.CONGRATULATIONS);
78-
cancel();
79-
}
80-
i++;
81-
}
82-
};
83-
task.runTaskTimer(Main.getPlugin(), 0, 2);
84-
}
85-
86-
87-
public static void TDMResultAnimation(Player p, int team0point, int team1point, String team0color, String team1color, Team winteam, Boolean hikiwake){
88-
BukkitRunnable task = new BukkitRunnable(){
89-
Player player = p;
90-
int i = 0;
91-
@Override
92-
public void run(){
93-
94-
if(i <= 15){
95-
player.sendTitle("", team0color + DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(new Random().nextInt(10)) + " Kill " + team1color + DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(new Random().nextInt(10)) + " Kill", 0, 40, 0);
96-
}
97-
/*
98-
if(i >= 6 && i <= 10){
99-
player.sendTitle("", String.valueOf(g) + "% [" + GaugeAPI.toGauge(g,50,team0color,"§7") + GaugeAPI.toGauge(50 - g,50,"§7",team1color) + "] " + String.valueOf(g) + "%", 0, 40, 0);
100-
g++;
101-
}*/
102-
if(i == 35){
103-
if(hikiwake){
104-
player.sendTitle("引き分け!", team0color + DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(team0point) + " Kill " + team1color + DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(team1point) + " Kill", 0, 40, 10);
105-
}else{
106-
if(winteam == DataMgr.getPlayerData(player).getTeam())
107-
player.sendTitle(ChatColor.GREEN + "You Win!", team0color + DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(team0point) + " Kill " + team1color + DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(team1point) + " Kill", 0, 40, 10);
108-
else
109-
player.sendTitle(ChatColor.RED + "You Lose...", team0color + DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(team0point) + " Kill " + team1color + DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor().getColorName() + "Team" + ChatColor.RESET + " : " + String.valueOf(team1point) + " Kill", 0, 40, 10);
110-
}
111-
player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_INFECT, 13.0F, 1.5F);
112-
}
113-
if(i == 40){
114-
if(winteam == DataMgr.getPlayerData(player).getTeam())
115-
Sclat.playGameSound(player, SoundType.CONGRATULATIONS);
116-
cancel();
117-
}
118-
i++;
119-
}
120-
};
121-
task.runTaskTimer(Main.getPlugin(), 0, 2);
122-
}
17+
public static void ResultAnimation(Player p, int team0point, int team1point, String team0color, String team1color,
18+
Team winteam, Boolean hikiwake) {
19+
BukkitRunnable task = new BukkitRunnable() {
20+
Player player = p;
21+
int i = 0;
22+
int g = 0;
23+
@Override
24+
public void run() {
25+
26+
if (i <= 15) {
27+
player.sendTitle("",
28+
String.valueOf(g) + "% [" + GaugeAPI.toGauge(g, 50, team0color, "§7")
29+
+ GaugeAPI.toGauge(50 - g, 50, "§7", team1color) + "] " + String.valueOf(g) + "%",
30+
0, 40, 0);
31+
g = g + 2;
32+
}
33+
/*
34+
* if(i >= 6 && i <= 10){ player.sendTitle("", String.valueOf(g) + "% [" +
35+
* GaugeAPI.toGauge(g,50,team0color,"§7") + GaugeAPI.toGauge(50 -
36+
* g,50,"§7",team1color) + "] " + String.valueOf(g) + "%", 0, 40, 0); g++; }
37+
*/
38+
if (i == 35) {
39+
if (hikiwake) {
40+
player.sendTitle("引き分け!", "[" + GaugeAPI.toGauge(50, 100, team0color, team1color) + "]", 0, 40,
41+
10);
42+
} else {
43+
if (winteam == DataMgr.getPlayerData(player).getTeam())
44+
player.sendTitle(ChatColor.GREEN + "You Win!",
45+
String.valueOf(team0point) + "% ["
46+
+ GaugeAPI.toGauge(team0point, 100, team0color, team1color) + "] "
47+
+ String.valueOf(100 - team0point) + "%",
48+
0, 40, 10);
49+
else
50+
player.sendTitle(ChatColor.RED + "You Lose...",
51+
String.valueOf(team0point) + "% ["
52+
+ GaugeAPI.toGauge(team0point, 100, team0color, team1color) + "] "
53+
+ String.valueOf(100 - team0point) + "%",
54+
0, 40, 10);
55+
}
56+
player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_INFECT, 13.0F, 1.5F);
57+
}
58+
if (i == 40) {
59+
if (winteam == DataMgr.getPlayerData(player).getTeam())
60+
Sclat.playGameSound(player, SoundType.CONGRATULATIONS);
61+
cancel();
62+
}
63+
i++;
64+
}
65+
};
66+
task.runTaskTimer(Main.getPlugin(), 0, 2);
67+
}
68+
69+
public static void AreaResultAnimation(Player p, int team0point, int team1point, String team0color,
70+
String team1color, Team winteam) {
71+
BukkitRunnable task = new BukkitRunnable() {
72+
Player player = p;
73+
int i = 0;
74+
int g = 0;
75+
@Override
76+
public void run() {
77+
78+
if (i <= 15) {
79+
player.sendTitle("",
80+
String.valueOf(g) + "% [" + GaugeAPI.toGauge(g, 50, team0color, "§7")
81+
+ GaugeAPI.toGauge(50 - g, 50, "§7", team1color) + "] " + String.valueOf(g) + "%",
82+
0, 40, 0);
83+
g = g + 2;
84+
}
85+
if (i == 35) {
86+
if (winteam == DataMgr.getPlayerData(player).getTeam())
87+
player.sendTitle(ChatColor.GREEN + "Knock Out !!",
88+
String.valueOf(team0point) + "% ["
89+
+ GaugeAPI.toGauge(team0point, 100, team0color, team1color) + "] "
90+
+ String.valueOf(100 - team0point) + "%",
91+
0, 40, 10);
92+
else
93+
player.sendTitle(ChatColor.RED + "You Lose...",
94+
String.valueOf(team0point) + "% ["
95+
+ GaugeAPI.toGauge(team0point, 100, team0color, team1color) + "] "
96+
+ String.valueOf(100 - team0point) + "%",
97+
0, 40, 10);
98+
player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_INFECT, 13.0F, 1.5F);
99+
}
100+
if (i == 40) {
101+
if (winteam == DataMgr.getPlayerData(player).getTeam())
102+
Sclat.playGameSound(player, SoundType.CONGRATULATIONS);
103+
cancel();
104+
}
105+
i++;
106+
}
107+
};
108+
task.runTaskTimer(Main.getPlugin(), 0, 2);
109+
}
110+
111+
public static void TDMResultAnimation(Player p, int team0point, int team1point, String team0color,
112+
String team1color, Team winteam, Boolean hikiwake) {
113+
BukkitRunnable task = new BukkitRunnable() {
114+
Player player = p;
115+
int i = 0;
116+
@Override
117+
public void run() {
118+
119+
if (i <= 15) {
120+
player.sendTitle("", team0color
121+
+ DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor().getColorName() + "Team"
122+
+ ChatColor.RESET + " : " + String.valueOf(new Random().nextInt(10)) + " Kill "
123+
+ team1color
124+
+ DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor().getColorName() + "Team"
125+
+ ChatColor.RESET + " : " + String.valueOf(new Random().nextInt(10)) + " Kill", 0, 40, 0);
126+
}
127+
/*
128+
* if(i >= 6 && i <= 10){ player.sendTitle("", String.valueOf(g) + "% [" +
129+
* GaugeAPI.toGauge(g,50,team0color,"§7") + GaugeAPI.toGauge(50 -
130+
* g,50,"§7",team1color) + "] " + String.valueOf(g) + "%", 0, 40, 0); g++; }
131+
*/
132+
if (i == 35) {
133+
if (hikiwake) {
134+
player.sendTitle("引き分け!",
135+
team0color
136+
+ DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor()
137+
.getColorName()
138+
+ "Team" + ChatColor.RESET + " : " + String.valueOf(team0point) + " Kill "
139+
+ team1color
140+
+ DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor()
141+
.getColorName()
142+
+ "Team" + ChatColor.RESET + " : " + String.valueOf(team1point) + " Kill",
143+
0, 40, 10);
144+
} else {
145+
if (winteam == DataMgr.getPlayerData(player).getTeam())
146+
player.sendTitle(ChatColor.GREEN + "You Win!",
147+
team0color
148+
+ DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor()
149+
.getColorName()
150+
+ "Team" + ChatColor.RESET + " : " + String.valueOf(team0point)
151+
+ " Kill " + team1color
152+
+ DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor()
153+
.getColorName()
154+
+ "Team" + ChatColor.RESET + " : " + String.valueOf(team1point) + " Kill",
155+
0, 40, 10);
156+
else
157+
player.sendTitle(ChatColor.RED + "You Lose...",
158+
team0color
159+
+ DataMgr.getPlayerData(player).getMatch().getTeam0().getTeamColor()
160+
.getColorName()
161+
+ "Team" + ChatColor.RESET + " : " + String.valueOf(team0point)
162+
+ " Kill " + team1color
163+
+ DataMgr.getPlayerData(player).getMatch().getTeam1().getTeamColor()
164+
.getColorName()
165+
+ "Team" + ChatColor.RESET + " : " + String.valueOf(team1point) + " Kill",
166+
0, 40, 10);
167+
}
168+
player.playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_INFECT, 13.0F, 1.5F);
169+
}
170+
if (i == 40) {
171+
if (winteam == DataMgr.getPlayerData(player).getTeam())
172+
Sclat.playGameSound(player, SoundType.CONGRATULATIONS);
173+
cancel();
174+
}
175+
i++;
176+
}
177+
};
178+
task.runTaskTimer(Main.getPlugin(), 0, 2);
179+
}
123180
}

0 commit comments

Comments
 (0)