Skip to content

Commit beac167

Browse files
authored
Merge pull request #1 from Cirkutry/refactor
Refactor
2 parents de66f94 + 253d96a commit beac167

Some content is hidden

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

47 files changed

+5510
-3271
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build Plugin
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch: {}
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-java@v4
18+
with:
19+
distribution: 'temurin'
20+
java-version: '21'
21+
22+
- name: Build with Maven
23+
run: mvn clean package
24+
25+
- name: Upload plugin jar
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: InfernalMobsReloaded
29+
path: |
30+
target/InfernalMobsReloaded-*.jar
31+
!target/original-*.jar

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This project is a fork of the [original](https://www.spigotmc.org/resources/infe
1515

1616
### 📦 Version Compatibility
1717

18-
Supports only 1.21 - 1.21.5 and as such issues in older versions will not be fixed in this fork.
18+
Supports only 1.21.7 and as such issues in older versions will not be fixed in this fork.
1919

2020
See below table to find the original Infernal Mobs plugin version that supports legacy Minecraft versions.
2121

pom.xml

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
42
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
53
<modelVersion>4.0.0</modelVersion>
64

@@ -28,18 +26,13 @@
2826
<dependency>
2927
<groupId>io.papermc.paper</groupId>
3028
<artifactId>paper-api</artifactId>
31-
<version>1.21.5-R0.1-SNAPSHOT</version>
29+
<version>1.21.11-R0.1-SNAPSHOT</version>
3230
<scope>provided</scope>
3331
</dependency>
34-
<dependency>
35-
<groupId>dev.dejvokep</groupId>
36-
<artifactId>boosted-yaml</artifactId>
37-
<version>1.3.6</version>
38-
</dependency>
32+
3933
</dependencies>
4034

4135
<build>
42-
<sourceDirectory>${project.basedir}/src</sourceDirectory>
4336
<resources>
4437
<resource>
4538
<directory>${project.basedir}/src/main/resources</directory>
@@ -50,11 +43,11 @@
5043
<plugin>
5144
<groupId>org.apache.maven.plugins</groupId>
5245
<artifactId>maven-compiler-plugin</artifactId>
53-
<version>3.12.1</version>
46+
<version>3.14.0</version>
5447
<configuration>
5548
<source>${java.version}</source>
5649
<target>${java.version}</target>
57-
<!--
50+
<!-- Debug only
5851
<compilerArgs>
5952
<arg>-Xlint:deprecation</arg>
6053
</compilerArgs>
@@ -64,19 +57,12 @@
6457
<plugin>
6558
<groupId>org.apache.maven.plugins</groupId>
6659
<artifactId>maven-jar-plugin</artifactId>
67-
<version>3.4.1</version>
68-
<configuration>
69-
<archive>
70-
<manifestEntries>
71-
<paperweight-mappings-namespace>mojang</paperweight-mappings-namespace>
72-
</manifestEntries>
73-
</archive>
74-
</configuration>
60+
<version>3.4.2</version>
7561
</plugin>
7662
<plugin>
7763
<groupId>org.apache.maven.plugins</groupId>
7864
<artifactId>maven-shade-plugin</artifactId>
79-
<version>3.5.2</version>
65+
<version>3.6.0</version>
8066
<executions>
8167
<execution>
8268
<phase>package</phase>
@@ -85,16 +71,26 @@
8571
</goals>
8672
<configuration>
8773
<createDependencyReducedPom>false</createDependencyReducedPom>
88-
<relocations>
89-
<relocation>
90-
<pattern>dev.dejvokep.boostedyaml</pattern>
91-
<shadedPattern>jacob_vejvoda.infernal_mobs.lib.boostedyaml</shadedPattern>
92-
</relocation>
93-
</relocations>
9474
</configuration>
9575
</execution>
9676
</executions>
9777
</plugin>
78+
<plugin>
79+
<groupId>com.diffplug.spotless</groupId>
80+
<artifactId>spotless-maven-plugin</artifactId>
81+
<version>2.46.0</version>
82+
<configuration>
83+
<java>
84+
<googleJavaFormat>
85+
<version>1.28.0</version>
86+
<style>AOSP</style>
87+
<reflowLongStrings>true</reflowLongStrings>
88+
<formatJavadoc>false</formatJavadoc>
89+
</googleJavaFormat>
90+
<removeUnusedImports />
91+
</java>
92+
</configuration>
93+
</plugin>
9894
</plugins>
9995
</build>
10096
</project>

src/main/java/jacob_vejvoda/infernal_mobs/ArrowHomingTask.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ public void run() {
2424
return;
2525
}
2626

27-
Vector toTarget = this.target.getLocation().clone().add(new Vector(0.0D, 0.5D, 0.0D)).subtract(this.arrow.getLocation()).toVector();
27+
Vector toTarget =
28+
this.target
29+
.getLocation()
30+
.clone()
31+
.add(new Vector(0.0D, 0.5D, 0.0D))
32+
.subtract(this.arrow.getLocation())
33+
.toVector();
2834

2935
Vector dirVelocity = this.arrow.getVelocity().clone().normalize();
3036
Vector dirToTarget = toTarget.clone().normalize();
@@ -36,7 +42,11 @@ public void run() {
3642
if (angle < 0.12D) {
3743
newVelocity = dirVelocity.clone().multiply(newSpeed);
3844
} else {
39-
Vector newDir = dirVelocity.clone().multiply((angle - 0.12D) / angle).add(dirToTarget.clone().multiply(0.12D / angle));
45+
Vector newDir =
46+
dirVelocity
47+
.clone()
48+
.multiply((angle - 0.12D) / angle)
49+
.add(dirToTarget.clone().multiply(0.12D / angle));
4050
newDir.normalize();
4151
newVelocity = newDir.clone().multiply(newSpeed);
4252
}
@@ -45,4 +55,4 @@ public void run() {
4555
} catch (Exception ignored) {
4656
}
4757
}
48-
}
58+
}

src/main/java/jacob_vejvoda/infernal_mobs/BoostedYamlAdapter.java

Lines changed: 0 additions & 99 deletions
This file was deleted.

src/main/java/jacob_vejvoda/infernal_mobs/ConfigManager.java

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)