Skip to content

Commit f39e79f

Browse files
joshi1999SchpammerFireInstall
authored
Multiple Bugfixes and Features (#363)
* Fixing not visible tool-points * Fixing Loadout for Offhand Offhand can now be placed without errors * Adding new 1.16 materials Adding new 1.16 materials and prevent outdating through new materials. * MatchTeamColor Condidtion showing matching item to color * Fixes PlayerHasItemCondition * Fixing AsyncInventoryEvent Calls * Adding GameTickTrigger * Fixing Region Select NoSuchElementError * Adding keep inventory option * Update to 1.19 - Change RegionDisplay to Barrier and imporved performance issues, when many and big regions were displayed * Update minigamesdistribution to 1.19 * Update Mavenworkflow to Java 17 * Adding potionFriendlyFire configuration * T::28 Correcting GUI information Action "Take Item" had another name in the gui -> "Give Item" * T::32,39,42 Translation strings missing Several translation string were missed or were not correctly used. * Added every possible vanilla potion effekt. * Fixes T::45, T::46, T::49, T::53 - TakeFlagTrigger wasn't triggered - Only Oak-Signs worked as Flags - Broadcasts wasn't working - CTF-Broadcasts are now a seperate option - Flag Home-Returns were announced, even though broadcasts were disabled * T::44 Support for signs * T::9 Autocomplete Commands: set node/region * T::22 Wrong message when there's no lobby * T::18 Flag falling in lava does not respawn * Replaced deprecated MinigameUtils.formStr call * Fixed reset of Blocks in Minigames. (#3) * Fixed reset of Blocks in Minigames. * Rebuilt how the regeneration region works (#4) RegenRegions can now be splittet into several smaller regions. This allows to be more flexible: Big Regions with eg. 4 million blocks are crashing the server. If only small fitting regions are set, there is no need for 4 million blocks to regen. Also a block limit is implemented to ensure that a crash is not going to happen. This limit can be changed within the minigames config file and is default set to 300k. * Rebuilt FloorDegeneration to use the new Regeneration Regions (#7) * Code cleanup (#5) * Merging Memory and Region Actions from Turidus (#8) Co-authored-by: joshi1999 <[email protected]> * Fix MemorySwapBlock for unordered created regions * Updating actions to use a cache for faster building (#10) * fix regen regions and lists not getting saved * fix regen regions not regenerating properly * added feedback how many blocks are in a regenregion total fix update of regions resulting in wrong feedback * added a new trigger to fire whenever a player moves inside a region (for better kill boxes) remove unused code * fix binding to first item in inventory instead of in hands * fix minigame objective error (rolling back the lines, still have to get a future-proof modern version working) * fix false calculation, if one coord was 0 * Fixing PullRequest Template --------- Co-authored-by: Schpammer <[email protected]> Co-authored-by: FireInstall <[email protected]> Co-authored-by: FireInstall <[email protected]>
1 parent 28d677b commit f39e79f

File tree

472 files changed

+8781
-6762
lines changed

Some content is hidden

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

472 files changed

+8781
-6762
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ _Describe the problem or feature in addition to a link to the issues._
55
_How does this change address the problem?_
66

77
#### Open Questions and Pre-Merge TODOs
8-
- [ ] Use github checklists. When solved, check the box and explain the answer.
8+
- [ ] Use GitHub checklists. When solved, check the box and explain the answer.
99

1010
## Learning
1111
_Describe the research stage_
1212

1313
_Links to blog posts, patterns, libraries or addons used to solve this problem_
1414

1515
#### Blog Posts
16-
- [How to Pull Request](https://github.com/flexyford/pull-request) Github Repo with Learning focused Pull Request Template.
16+
- [How to Pull Request](https://github.com/flexyford/pull-request) GitHub Repo with Learning focused Pull Request
17+
Template.

.github/workflows/maven.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v1
12-
- name: Set up JDK 1.8
13-
uses: actions/setup-java@v1
11+
- uses: actions/checkout@v3
12+
- name: Set up JDK 17
13+
uses: actions/setup-java@v3
1414
with:
15-
java-version: 1.8
15+
distribution: 'temurin'
16+
java-version: 17
17+
cache: 'maven'
1618
- name: Build with Maven
1719
run: mvn -B package --file pom.xml

Minigames/pom.xml

+20-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>au.com.mineauz</groupId>
77
<artifactId>MinigamesProject</artifactId>
8-
<version>1.16-SNAPSHOT</version>
8+
<version>1.19-SNAPSHOT</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111
<artifactId>Minigames</artifactId>
@@ -75,9 +75,9 @@
7575
<scope>compile</scope>
7676
</dependency>
7777
<dependency>
78-
<groupId>be.seeseemelk</groupId>
79-
<artifactId>MockBukkit</artifactId>
80-
<version>0.2.1-SNAPSHOT</version>
78+
<groupId>com.github.seeseemelk</groupId>
79+
<artifactId>MockBukkit-v1.19</artifactId>
80+
<version>2.29.0</version>
8181
<scope>test</scope>
8282
<exclusions>
8383
<exclusion>
@@ -89,7 +89,7 @@
8989
<dependency>
9090
<groupId>mysql</groupId>
9191
<artifactId>mysql-connector-java</artifactId>
92-
<version>5.1.47</version>
92+
<version>8.0.28</version>
9393
<scope>test</scope>
9494
</dependency>
9595
<dependency>
@@ -109,6 +109,12 @@
109109
<artifactId>paste-gg-api</artifactId>
110110
<version>1.0.0-SNAPSHOT</version>
111111
</dependency>
112+
<dependency>
113+
<groupId>commons-lang</groupId>
114+
<artifactId>commons-lang</artifactId>
115+
<version>2.5</version>
116+
<scope>compile</scope>
117+
</dependency>
112118
</dependencies>
113119
<build>
114120
<resources>
@@ -141,7 +147,7 @@
141147
<plugin>
142148
<groupId>org.apache.maven.plugins</groupId>
143149
<artifactId>maven-shade-plugin</artifactId>
144-
<version>3.2.4</version>
150+
<version>3.4.0</version>
145151
<configuration>
146152
<filters>
147153
<filter>
@@ -221,6 +227,14 @@
221227
<artifactId>versions-maven-plugin</artifactId>
222228
<version>2.8.1</version>
223229
</plugin>
230+
<plugin>
231+
<groupId>org.apache.maven.plugins</groupId>
232+
<artifactId>maven-compiler-plugin</artifactId>
233+
<configuration>
234+
<source>17</source>
235+
<target>17</target>
236+
</configuration>
237+
</plugin>
224238
</plugins>
225239
</build>
226240
<profiles>

Minigames/src/main/java/au/com/mineauz/minigames/ComparableVersion.java

+32-58
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@
2222
import org.jetbrains.annotations.NotNull;
2323

2424
import java.math.BigInteger;
25-
import java.util.ArrayList;
26-
import java.util.Arrays;
27-
import java.util.Iterator;
28-
import java.util.List;
29-
import java.util.Locale;
30-
import java.util.Properties;
31-
import java.util.Stack;
25+
import java.util.*;
3226

3327
/**
3428
* Generic implementation of version comparison.
@@ -181,8 +175,7 @@ private interface Item {
181175
/**
182176
* Represents a numeric item in the version item list.
183177
*/
184-
private static class IntegerItem
185-
implements Item {
178+
private static class IntegerItem implements Item {
186179
public static final IntegerItem ZERO = new IntegerItem();
187180
private static final BigInteger BIG_INTEGER_ZERO = new BigInteger("0");
188181
private final BigInteger value;
@@ -205,22 +198,16 @@ public boolean isNull() {
205198

206199
public int compareTo(Item item) {
207200
if (item == null) {
208-
return BIG_INTEGER_ZERO.equals(value) ? 0 : 1; // 1.0 == 1, 1.1 > 1
201+
//todo whatever this was supposed to do, it always returned 0.
202+
return 0; // 1.0 == 1, 1.1 > 1
209203
}
210204

211-
switch (item.getType()) {
212-
case INTEGER_ITEM:
213-
return value.compareTo(((IntegerItem) item).value);
214-
215-
case STRING_ITEM:
216-
return 1; // 1.1 > 1-sp
217-
218-
case LIST_ITEM:
219-
return 1; // 1.1 > 1-1
220-
221-
default:
222-
throw new RuntimeException("invalid item: " + item.getClass());
223-
}
205+
return switch (item.getType()) {
206+
case INTEGER_ITEM -> value.compareTo(((IntegerItem) item).value);
207+
case STRING_ITEM -> 1; // 1.1 > 1-sp
208+
case LIST_ITEM -> 1; // 1.1 > 1-1
209+
default -> throw new RuntimeException("invalid item: " + item.getClass());
210+
};
224211
}
225212

226213
public String toString() {
@@ -237,36 +224,30 @@ private static class StringItem
237224

238225
@SuppressWarnings("checkstyle:constantname")
239226
private static final List<String> _QUALIFIERS = Arrays.asList(QUALIFIERS);
240-
241-
private static final Properties ALIASES = new Properties();
242227
/**
243228
* A comparable value for the empty-string qualifier. This one is used to determine if a given qualifier makes
244229
* the version older than one without a qualifier, or more recent.
245230
*/
246231
private static final String RELEASE_VERSION_INDEX = String.valueOf(_QUALIFIERS.indexOf(""));
232+
private static final Properties ALIASES = new Properties();
247233

248234
static {
249235
ALIASES.put("ga", "");
250236
ALIASES.put("final", "");
251237
ALIASES.put("cr", "rc");
252238
}
253239

254-
private String value;
240+
private final String value;
255241

256242
public StringItem(String value, boolean followedByDigit) {
257243
if (followedByDigit && value.length() == 1) {
258244
// a1 = alpha-1, b1 = beta-1, m1 = milestone-1
259245
switch (value.charAt(0)) {
260-
case 'a':
261-
value = "alpha";
262-
break;
263-
case 'b':
264-
value = "beta";
265-
break;
266-
case 'm':
267-
value = "milestone";
268-
break;
269-
default:
246+
case 'a' -> value = "alpha";
247+
case 'b' -> value = "beta";
248+
case 'm' -> value = "milestone";
249+
default -> {
250+
}
270251
}
271252
}
272253
this.value = ALIASES.getProperty(value, value);
@@ -304,19 +285,13 @@ public int compareTo(Item item) {
304285
// 1-rc < 1, 1-ga > 1
305286
return comparableQualifier(value).compareTo(RELEASE_VERSION_INDEX);
306287
}
307-
switch (item.getType()) {
308-
case INTEGER_ITEM:
309-
return -1; // 1.any < 1.1 ?
310-
311-
case STRING_ITEM:
312-
return comparableQualifier(value).compareTo(comparableQualifier(((StringItem) item).value));
313-
314-
case LIST_ITEM:
315-
return -1; // 1.any < 1-1
316-
317-
default:
318-
throw new RuntimeException("invalid item: " + item.getClass());
319-
}
288+
return switch (item.getType()) {
289+
case INTEGER_ITEM -> -1; // 1.any < 1.1 ?
290+
case STRING_ITEM ->
291+
comparableQualifier(value).compareTo(comparableQualifier(((StringItem) item).value));
292+
case LIST_ITEM -> -1; // 1.any < 1-1
293+
default -> throw new RuntimeException("invalid item: " + item.getClass());
294+
};
320295
}
321296

322297
public String toString() {
@@ -361,13 +336,13 @@ public int compareTo(Item item) {
361336
return first.compareTo(null);
362337
}
363338
switch (item.getType()) {
364-
case INTEGER_ITEM:
339+
case INTEGER_ITEM -> {
365340
return -1; // 1-1 < 1.0.x
366-
367-
case STRING_ITEM:
341+
}
342+
case STRING_ITEM -> {
368343
return 1; // 1-1 > 1-sp
369-
370-
case LIST_ITEM:
344+
}
345+
case LIST_ITEM -> {
371346
Iterator<Item> left = iterator();
372347
Iterator<Item> right = ((ListItem) item).iterator();
373348

@@ -376,17 +351,16 @@ public int compareTo(Item item) {
376351
Item r = right.hasNext() ? right.next() : null;
377352

378353
// if this is shorter, then invert the compare and mul with -1
379-
int result = l == null ? (r == null ? 0 : -1 * r.compareTo(l)) : l.compareTo(r);
354+
int result = l == null ? (r == null ? 0 : -1 * r.compareTo(null)) : l.compareTo(r);
380355

381356
if (result != 0) {
382357
return result;
383358
}
384359
}
385360

386361
return 0;
387-
388-
default:
389-
throw new RuntimeException("invalid item: " + item.getClass());
362+
}
363+
default -> throw new RuntimeException("invalid item: " + item.getClass());
390364
}
391365
}
392366

0 commit comments

Comments
 (0)