Skip to content

Commit

Permalink
1.20.6 (#633)
Browse files Browse the repository at this point in the history
* First cut at 1.20.5 update

* Update CI to Java 21

* Update to 1.20.6
  • Loading branch information
TylerS1066 authored May 3, 2024
1 parent 774013a commit 65833e2
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 92 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,61 +125,61 @@ jobs:
if: steps.wild.outputs.sucess != 'true' || steps.wildMojang.outputs.sucess != 'true' || steps.wildObf.outputs.sucess != 'true'
run: cd BuildTools && java -jar BuildTools.jar --rev 1.19.4 --remapped

# Build 1.20.4 NMS
v1_20_R3:
# Build 1.20.6 NMS
v1_20_R4:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17 # 1.20.4 can only be built with Java 17
- name: Set up JDK 21 # 1.20.6 can only be built with Java 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Cache 1.20.4 Maven package
java-version: '21'
- name: Cache 1.20.6 Maven package
id: cacheWild_r2
uses: actions/cache@v3
with:
path: |
~/.m2/repository/org/spigotmc/spigot/1.20.4-R0.1-SNAPSHOT/
~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/
~/.m2/repository/org/spigotmc/spigot-parent/
~/.m2/repository/org/spigotmc/minecraft-server/
key: ${{ runner.os }}-v1_20_R3
restore-keys: ${{ runner.os }}-v1_20_R3
key: ${{ runner.os }}-v1_20_R4
restore-keys: ${{ runner.os }}-v1_20_R4
- name: Cache Maven packages
id: cacheMain
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-v1_20_R3
restore-keys: ${{ runner.os }}-m2-v1_20_R3
key: ${{ runner.os }}-m2-v1_20_R4
restore-keys: ${{ runner.os }}-m2-v1_20_R4

- name: Setup BuildTools
run: mkdir BuildTools && wget -O BuildTools/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
- name: Check 1.20.4 Spigot
- name: Check 1.20.6 Spigot
id: wild
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.4-R0.1-SNAPSHOT/spigot-1.20.4-R0.1-SNAPSHOT.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT
- name: Check 1.20.4 Spigot (Mojang)
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/spigot-1.20.6-R0.1-SNAPSHOT.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT
- name: Check 1.20.6 Spigot (Mojang)
id: wildMojang
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.4-R0.1-SNAPSHOT/spigot-1.20.4-R0.1-SNAPSHOT-remapped-mojang.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT
- name: Check 1.20.4 Spigot (Obf)
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/spigot-1.20.6-R0.1-SNAPSHOT-remapped-mojang.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT
- name: Check 1.20.6 Spigot (Obf)
id: wildObf
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.4-R0.1-SNAPSHOT/spigot-1.20.4-R0.1-SNAPSHOT-remapped-obf.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT
- name: Build 1.20.4
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/spigot-1.20.6-R0.1-SNAPSHOT-remapped-obf.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT
- name: Build 1.20.6
if: steps.wild.outputs.sucess != 'true' || steps.wildMojang.outputs.sucess != 'true' || steps.wildObf.outputs.sucess != 'true'
run: cd BuildTools && java -jar BuildTools.jar --rev 1.20.4 --remapped
run: cd BuildTools && java -jar BuildTools.jar --rev 1.20.6 --remapped

# Build Movecraft
build:
runs-on: ubuntu-latest
needs: [v1_16_R3, v1_18_R2, v1_19_R3, v1_20_R3]
needs: [v1_16_R3, v1_18_R2, v1_19_R3, v1_20_R4]

steps:
- name: Checkout Movecraft
uses: actions/checkout@v1
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
- name: Cache Maven packages
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -210,15 +210,15 @@ jobs:
~/.m2/repository/org/spigotmc/minecraft-server/
key: ${{ runner.os }}-v1_19_R3
restore-keys: ${{ runner.os }}-v1_19_R3
- name: Cache 1.20.4 Maven package
- name: Cache 1.20.6 Maven package
uses: actions/cache@v3
with:
path: |
~/.m2/repository/org/spigotmc/spigot/1.20.4-R0.1-SNAPSHOT/
~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/
~/.m2/repository/org/spigotmc/spigot-parent/
~/.m2/repository/org/spigotmc/minecraft-server/
key: ${{ runner.os }}-v1_20_R3
restore-keys: ${{ runner.os }}-v1_20_R3
key: ${{ runner.os }}-v1_20_R4
restore-keys: ${{ runner.os }}-v1_20_R4

- name: Build with Maven
run: mvn -T 1C -B package --file pom.xml
Expand Down
50 changes: 25 additions & 25 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,61 +123,61 @@ jobs:
if: steps.wild.outputs.sucess != 'true' || steps.wildMojang.outputs.sucess != 'true' || steps.wildObf.outputs.sucess != 'true'
run: cd BuildTools && java -jar BuildTools.jar --rev 1.19.4 --remapped

# Build 1.20.4 NMS
v1_20_R3:
# Build 1.20.6 NMS
v1_20_R4:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17 # 1.20.4 can only be built with Java 17
- name: Set up JDK 21 # 1.20.6 can only be built with Java 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Cache 1.20.4 Maven package
java-version: '21'
- name: Cache 1.20.6 Maven package
id: cacheWild_r2
uses: actions/cache@v3
with:
path: |
~/.m2/repository/org/spigotmc/spigot/1.20.4-R0.1-SNAPSHOT/
~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/
~/.m2/repository/org/spigotmc/spigot-parent/
~/.m2/repository/org/spigotmc/minecraft-server/
key: ${{ runner.os }}-v1_20_R3
restore-keys: ${{ runner.os }}-v1_20_R3
key: ${{ runner.os }}-v1_20_R4
restore-keys: ${{ runner.os }}-v1_20_R4
- name: Cache Maven packages
id: cacheMain
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-v1_20_R3
restore-keys: ${{ runner.os }}-m2-v1_20_R3
key: ${{ runner.os }}-m2-v1_20_R4
restore-keys: ${{ runner.os }}-m2-v1_20_R4

- name: Setup BuildTools
run: mkdir BuildTools && wget -O BuildTools/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
- name: Check 1.20.4 Spigot
- name: Check 1.20.6 Spigot
id: wild
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.4-R0.1-SNAPSHOT/spigot-1.20.4-R0.1-SNAPSHOT.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT
- name: Check 1.20.4 Spigot (Mojang)
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/spigot-1.20.6-R0.1-SNAPSHOT.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT
- name: Check 1.20.6 Spigot (Mojang)
id: wildMojang
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.4-R0.1-SNAPSHOT/spigot-1.20.4-R0.1-SNAPSHOT-remapped-mojang.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT
- name: Check 1.20.4 Spigot (Obf)
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/spigot-1.20.6-R0.1-SNAPSHOT-remapped-mojang.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT
- name: Check 1.20.6 Spigot (Obf)
id: wildObf
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.4-R0.1-SNAPSHOT/spigot-1.20.4-R0.1-SNAPSHOT-remapped-obf.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT
- name: Build 1.20.4
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/spigot-1.20.6-R0.1-SNAPSHOT-remapped-obf.jar && echo "sucess=true" >> $GITHUB_OUTPUT || echo "sucess=false" >> $GITHUB_OUTPUT
- name: Build 1.20.6
if: steps.wild.outputs.sucess != 'true' || steps.wildMojang.outputs.sucess != 'true' || steps.wildObf.outputs.sucess != 'true'
run: cd BuildTools && java -jar BuildTools.jar --rev 1.20.4 --remapped
run: cd BuildTools && java -jar BuildTools.jar --rev 1.20.6 --remapped

# Build Movecraft
build:
runs-on: ubuntu-latest
needs: [v1_16_R3, v1_18_R2, v1_19_R3, v1_20_R3]
needs: [v1_16_R3, v1_18_R2, v1_19_R3, v1_20_R4]

steps:
- name: Checkout Movecraft
uses: actions/checkout@v1
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
- name: Cache Maven packages
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -208,15 +208,15 @@ jobs:
~/.m2/repository/org/spigotmc/minecraft-server/
key: ${{ runner.os }}-v1_19_R3
restore-keys: ${{ runner.os }}-v1_19_R3
- name: Cache 1.20.4 Maven package
- name: Cache 1.20.6 Maven package
uses: actions/cache@v3
with:
path: |
~/.m2/repository/org/spigotmc/spigot/1.20.4-R0.1-SNAPSHOT/
~/.m2/repository/org/spigotmc/spigot/1.20.6-R0.1-SNAPSHOT/
~/.m2/repository/org/spigotmc/spigot-parent/
~/.m2/repository/org/spigotmc/minecraft-server/
key: ${{ runner.os }}-v1_20_R3
restore-keys: ${{ runner.os }}-v1_20_R3
key: ${{ runner.os }}-v1_20_R4
restore-keys: ${{ runner.os }}-v1_20_R4

- name: Build with Maven
run: mvn -T 1C -B package --file pom.xml
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ Please check the [Wiki](https://github.com/APDevTeam/Movecraft/wiki) and [FAQ](h
[Discord](http://bit.ly/JoinAP-Dev)

## Development Environment
Movecraft uses multiple versions of the Spigot server software for legacy support. As such, you need to run [BuildTools](https://www.spigotmc.org/wiki/buildtools/) for several versions before building the plugin. It doesn't matter where you do this, but inside the Movecraft directory is probably a bad place. We recommend building Spigot 1.16.5 with Java 13 and Java 17 to build 1.18.2, 1.19.4 & 1.20.4. Alternatively, you can use GitHub codespaces and run the `setup.sh` script to build all the needed versions automatically.
Movecraft uses multiple versions of the Spigot server software for legacy support. As such, you need to run [BuildTools](https://www.spigotmc.org/wiki/buildtools/) for several versions before building the plugin. It doesn't matter where you do this, but inside the Movecraft directory is probably a bad place. We recommend building Spigot 1.16.5 with Java 13, 1.18.2 and 1.19.4 with Java 17, and 1.20.6 with Java 21.

```
java -jar BuildTools.jar --rev 1.16.5 --compile craftbukkit
java -jar BuildTools.jar --rev 1.18.2 --remapped
java -jar BuildTools.jar --rev 1.19.4 --remapped
java -jar BuildTools.jar --rev 1.20.4 --remapped
java -jar BuildTools.jar --rev 1.20.6 --remapped
```

Once you have compiled CraftBukkit, it should continue to exist in your local maven repository, and thus you should need to compile each version at most one time. Once complete, run the following to build Movecraft through `maven`.
Expand Down
4 changes: 2 additions & 2 deletions modules/Movecraft/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</dependency>
<dependency>
<groupId>net.countercraft</groupId>
<artifactId>movecraft-v1_20_R3</artifactId>
<artifactId>movecraft-v1_20_R4</artifactId>
<version>${revision}</version>
<type>jar</type>
</dependency>
Expand Down Expand Up @@ -190,7 +190,7 @@
</includes>
</filter>
<filter>
<artifact>net.countercraft:movecraft-v1_20_R3</artifact>
<artifact>net.countercraft:movecraft-v1_20_R4</artifact>
<includes>
<include>**</include>
</includes>
Expand Down
2 changes: 1 addition & 1 deletion modules/v1_18_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<version>2.0.3</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
2 changes: 1 addition & 1 deletion modules/v1_19_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<version>2.0.3</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
26 changes: 13 additions & 13 deletions modules/v1_20_R3/pom.xml → modules/v1_20_R4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>movecraft-v1_20_R3</artifactId>
<name>Movecraft-v1_20_R3</name>
<artifactId>movecraft-v1_20_R4</artifactId>
<name>Movecraft-v1_20_R4</name>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<version>1.20.6-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
<!-- Mappings: https://piston-data.mojang.com/v1/objects/c1cafe916dd8b58ed1fe0564fc8f786885224e62/server.txt -->
<!-- Mappings: https://piston-data.mojang.com/v1/objects/9e96100f573a46ef44caab3e716d5eb974594bb7/server.txt -->
</dependency>
<dependency>
<groupId>net.countercraft</groupId>
Expand All @@ -38,8 +38,8 @@
<version>3.8.1</version>
<configuration>
<includes>
<include>net/countercraft/movecraft/compat/v1_20_R3/**</include>
<include>net/countercraft/movecraft/support/v1_20_R3/**</include>
<include>net/countercraft/movecraft/compat/v1_20_R4/**</include>
<include>net/countercraft/movecraft/support/v1_20_R4/**</include>
</includes>
<source>13</source>
<target>13</target>
Expand All @@ -51,15 +51,15 @@
<version>2.4</version>
<configuration>
<includes>
<include>net/countercraft/movecraft/compat/v1_20_R3/**</include>
<include>net/countercraft/movecraft/support/v1_20_R3/**</include>
<include>net/countercraft/movecraft/compat/v1_20_R4/**</include>
<include>net/countercraft/movecraft/support/v1_20_R4/**</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<version>2.0.3</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -68,9 +68,9 @@
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.20.4-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<srgIn>org.spigotmc:minecraft-server:1.20.6-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedDependencies>org.spigotmc:spigot:1.20.6-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
Expand All @@ -83,8 +83,8 @@
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.20.4-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
<srgIn>org.spigotmc:minecraft-server:1.20.6-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.20.6-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.countercraft.movecraft.compat.v1_20_R3;
package net.countercraft.movecraft.compat.v1_20_R4;

import net.countercraft.movecraft.MovecraftLocation;
import net.countercraft.movecraft.MovecraftRotation;
Expand All @@ -24,10 +24,10 @@
import org.bukkit.Material;
import org.bukkit.block.Sign;
import org.bukkit.block.data.BlockData;
import org.bukkit.craftbukkit.v1_20_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_20_R3.block.data.CraftBlockData;
import org.bukkit.craftbukkit.v1_20_R3.inventory.CraftInventoryView;
import org.bukkit.craftbukkit.v1_20_R3.util.CraftMagicNumbers;
import org.bukkit.craftbukkit.v1_20_R4.CraftWorld;
import org.bukkit.craftbukkit.v1_20_R4.block.data.CraftBlockData;
import org.bukkit.craftbukkit.v1_20_R4.inventory.CraftInventoryView;
import org.bukkit.craftbukkit.v1_20_R4.util.CraftMagicNumbers;
import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand All @@ -54,7 +54,7 @@ public class IWorldHandler extends WorldHandler {

public IWorldHandler() {
String mappings = ((CraftMagicNumbers) CraftMagicNumbers.INSTANCE).getMappingsVersion();
if (!mappings.equals("60a2bb6bf2684dc61c56b90d7c41bddc"))
if (!mappings.equals("ee13f98a43b9c5abffdcc0bb24154460"))
throw new IllegalStateException("Movecraft is not compatible with this version of Minecraft 1.20: " + mappings);
}

Expand Down Expand Up @@ -283,7 +283,7 @@ public void setAccessLocation(@NotNull InventoryView inventoryView, @NotNull Loc
private void moveBlockEntity(@NotNull Level nativeWorld, @NotNull BlockPos newPosition, @NotNull BlockEntity tile) {
LevelChunk chunk = nativeWorld.getChunkAt(newPosition);
try {
var positionField = BlockEntity.class.getDeclaredField("p"); // p is obfuscated worldPosition
var positionField = BlockEntity.class.getDeclaredField("o"); // o is obfuscated worldPosition
UnsafeUtils.setField(positionField, tile, newPosition);
}
catch (NoSuchFieldException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.countercraft.movecraft.compat.v1_20_R3;
package net.countercraft.movecraft.compat.v1_20_R4;

import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
Expand Down
Loading

0 comments on commit 65833e2

Please sign in to comment.