Skip to content

Commit

Permalink
Add support for 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DerFrZocker committed Nov 2, 2023
1 parent 23231a2 commit f0256b2
Show file tree
Hide file tree
Showing 32 changed files with 2,459 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
/impl/v1_20_R1/target/
/impl/v1_20_R1/.flattened-pom.xml
/impl/v1_20_R1/custom-ore-generator-impl-v1_20_R1.iml
/impl/v1_20_R2/target/
/impl/v1_20_R2/.flattened-pom.xml
/impl/v1_20_R2/custom-ore-generator-impl-v1_20_R2.iml
/impl/yaml/target/
/impl/yaml/.flattened-pom.xml
/impl/yaml/custom-ore-generator-impl-yaml.iml
Expand Down
6 changes: 6 additions & 0 deletions custom-ore-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.derfrzocker</groupId>
<artifactId>custom-ore-generator-impl-v1_20_R2</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
import de.derfrzocker.custom.ore.generator.impl.v1_19_R3.oregenerator.MinableGenerator_v1_19_R3;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R1.WorldHandler_v1_20_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R1.oregenerator.MinableGenerator_v1_20_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R2.WorldHandler_v1_20_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R2.oregenerator.MinableGenerator_v1_20_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R1.CustomOreBlockPopulator_v1_8_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R1.oregenerator.MinableGenerator_v1_8_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R2.CustomOreBlockPopulator_v1_8_R2;
Expand Down Expand Up @@ -138,8 +140,9 @@ public void onLoad() {
getLogger().warning("The Server version which you are running is unsupported, you are running version '" + version + "'");
getLogger().warning("The plugin supports following versions " + combineVersions(Version.v1_8_R1, Version.v1_8_R2, Version.v1_8_R3,
Version.v1_9_R1, Version.v1_9_R2, Version.v1_10_R1, Version.v1_11_R1, Version.v1_12_R1, Version.v1_13_R1, Version.v1_13_R2,
Version.v1_14_R1, Version.v1_15_R1, Version.v1_16_R1, Version.v1_16_R2, Version.v1_16_R3, Version.v1_17_R1, Version.v1_18_R1, Version.v1_18_R2, Version.v1_19_R1, Version.v1_19_R2, Version.v1_19_R3, Version.v1_20_R1));
getLogger().warning("(Spigot / Paper version 1.8 - 1.20.1), if you are running such a Minecraft version, than your bukkit implementation is unsupported, in this case please contact the developer, so he can resolve this Issue");
Version.v1_14_R1, Version.v1_15_R1, Version.v1_16_R1, Version.v1_16_R2, Version.v1_16_R3, Version.v1_17_R1, Version.v1_18_R1,
Version.v1_18_R2, Version.v1_19_R1, Version.v1_19_R2, Version.v1_19_R3, Version.v1_20_R1, Version.v1_20_R2));
getLogger().warning("(Spigot / Paper version 1.8 - 1.20.2), if you are running such a Minecraft version, than your bukkit implementation is unsupported, in this case please contact the developer, so he can resolve this Issue");

if (version == Version.UNKNOWN) {
getLogger().warning("The Version '" + version + "' can indicate, that you are using a newer Minecraft version than currently supported.");
Expand Down Expand Up @@ -240,6 +243,7 @@ private void registerStandardOreGenerators(@NotNull final RegisterUtil registerU
registerUtil.register(Version.v1_19_R2, Version.v1_19_R2, () -> new MinableGenerator_v1_19_R2(infoFunction, oreSettingInfoBiFunction), true);
registerUtil.register(Version.v1_19_R3, Version.v1_19_R3, () -> new MinableGenerator_v1_19_R3(infoFunction, oreSettingInfoBiFunction), true);
registerUtil.register(Version.v1_20_R1, Version.v1_20_R1, () -> new MinableGenerator_v1_20_R1(infoFunction, oreSettingInfoBiFunction), true);
registerUtil.register(Version.v1_20_R2, Version.v1_20_R2, () -> new MinableGenerator_v1_20_R2(infoFunction, oreSettingInfoBiFunction), true);
}

private void registerStandardBlockSelector(@NotNull final RegisterUtil registerUtil) {
Expand Down Expand Up @@ -274,6 +278,9 @@ private void registerStandardCustomDatas(@NotNull final RegisterUtil registerUti

private void initWorldHandler() {
switch (version) {
case v1_20_R2:
new WorldHandler_v1_20_R2(this, CustomOreGeneratorServiceSupplier.INSTANCE);
break;
case v1_20_R1:
new WorldHandler_v1_20_R1(this, CustomOreGeneratorServiceSupplier.INSTANCE);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import de.derfrzocker.custom.ore.generator.impl.v1_19_R2.customdata.AutoApplier_v1_19_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_19_R3.customdata.AutoApplier_v1_19_R3;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R1.customdata.AutoApplier_v1_20_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R2.customdata.AutoApplier_v1_20_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_9_R1.customdata.AutoApplier_v1_9_R1;
import de.derfrzocker.custom.ore.generator.impl.v_1_9_R2.customdata.AutoApplier_v1_9_R2;
import de.derfrzocker.spigot.utils.Version;
Expand All @@ -63,6 +64,7 @@ public class AutoCustomData extends AbstractAutoCustomData {

static {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
case v1_20_R1:
case v1_19_R3:
case v1_19_R2:
Expand Down Expand Up @@ -113,6 +115,8 @@ public boolean hasCustomData(@NotNull final BlockState blockState) {
@Override
protected AutoApplier getCustomDataApplier0() {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
return new AutoApplier_v1_20_R2(this);
case v1_20_R1:
return new AutoApplier_v1_20_R1(this);
case v1_19_R3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import de.derfrzocker.custom.ore.generator.impl.v1_19_R2.customdata.BlockStateApplier_v1_19_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_19_R3.customdata.BlockStateApplier_v1_19_R3;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R1.customdata.BlockStateApplier_v1_20_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R2.customdata.BlockStateApplier_v1_20_R2;
import de.derfrzocker.spigot.utils.Version;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
Expand All @@ -69,6 +70,8 @@ public BlockStateCustomData(@NotNull final Supplier<CustomOreGeneratorService> s
@Override
protected AbstractBlockStateCustomData.BlockStateApplier getCustomDataApplier0() {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
return new BlockStateApplier_v1_20_R2(this.serviceSupplier, this);
case v1_20_R1:
return new BlockStateApplier_v1_20_R1(this.serviceSupplier, this);
case v1_19_R3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import de.derfrzocker.custom.ore.generator.impl.v1_19_R2.customdata.CommandApplier_v1_19_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_19_R3.customdata.CommandApplier_v1_19_R3;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R1.customdata.CommandApplier_v1_20_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R2.customdata.CommandApplier_v1_20_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R1.customdata.CommandApplier_v1_8_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R2.customdata.CommandApplier_v1_8_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R3.customdata.CommandApplier_v1_8_R3;
Expand All @@ -69,6 +70,7 @@ public class CommandCustomData extends AbstractCustomData<CustomDataApplier> {

static {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
case v1_20_R1:
case v1_19_R3:
case v1_19_R2:
Expand Down Expand Up @@ -143,6 +145,8 @@ public String getCustomData(@NotNull final BlockState blockState) {
@Override
protected CustomDataApplier getCustomDataApplier0() {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
return new CommandApplier_v1_20_R2(this);
case v1_20_R1:
return new CommandApplier_v1_20_R1(this);
case v1_19_R3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import de.derfrzocker.custom.ore.generator.impl.v1_19_R2.customdata.DirectionApplier_v1_19_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_19_R3.customdata.DirectionApplier_v1_19_R3;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R1.customdata.DirectionApplier_v1_20_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R2.customdata.DirectionApplier_v1_20_R2;
import de.derfrzocker.spigot.utils.Version;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -126,6 +127,8 @@ public Boolean getCustomData(@NotNull final BlockState blockState) {
@Override
protected CustomDataApplier getCustomDataApplier0() {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
return new DirectionApplier_v1_20_R2(this, blockFace);
case v1_20_R1:
return new DirectionApplier_v1_20_R1(this, blockFace);
case v1_19_R3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import de.derfrzocker.custom.ore.generator.impl.v1_19_R2.customdata.FacingApplier_v1_19_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_19_R3.customdata.FacingApplier_v1_19_R3;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R1.customdata.FacingApplier_v1_20_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R2.customdata.FacingApplier_v1_20_R2;
import de.derfrzocker.spigot.utils.Version;
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -111,6 +112,8 @@ public BlockFace getCustomData(@NotNull final BlockState blockState) {
@Override
protected CustomDataApplier getCustomDataApplier0() {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
return new FacingApplier_v1_20_R2(this);
case v1_20_R1:
return new FacingApplier_v1_20_R1(this);
case v1_19_R3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import de.derfrzocker.custom.ore.generator.impl.v1_19_R2.customdata.ItemModsApplier_v1_19_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_19_R3.customdata.ItemModsApplier_v1_19_R3;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R1.customdata.ItemModsApplier_v1_20_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R2.customdata.ItemModsApplier_v1_20_R2;
import de.derfrzocker.spigot.utils.Version;
import dev.linwood.itemmods.ItemMods;
import dev.linwood.itemmods.api.block.CustomBlock;
Expand Down Expand Up @@ -108,6 +109,8 @@ public String getCustomData(@NotNull final BlockState blockState) {
@Override
protected CustomDataApplier getCustomDataApplier0() {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
return new ItemModsApplier_v1_20_R2(this);
case v1_20_R1:
return new ItemModsApplier_v1_20_R1(this);
case v1_19_R3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import de.derfrzocker.custom.ore.generator.impl.v1_19_R2.customdata.NBTTagApplier_v1_19_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_19_R3.customdata.NBTTagApplier_v1_19_R3;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R1.customdata.NBTTagApplier_v1_20_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R2.customdata.NBTTagApplier_v1_20_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R1.customdata.NBTTagApplier_v1_8_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R2.customdata.NBTTagApplier_v1_8_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R3.customdata.NBTTagApplier_v1_8_R3;
Expand All @@ -65,6 +66,8 @@ public NBTTagCustomData(@NotNull final Function<String, Info> infoFunction, @Not
@Override
protected NBTTagApplier getCustomDataApplier0() {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
return new NBTTagApplier_v1_20_R2(this);
case v1_20_R1:
return new NBTTagApplier_v1_20_R1(this);
case v1_19_R3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import de.derfrzocker.custom.ore.generator.impl.v1_19_R2.customdata.OraxenApplier_v1_19_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_19_R3.customdata.OraxenApplier_v1_19_R3;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R1.customdata.OraxenApplier_v1_20_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R2.customdata.OraxenApplier_v1_20_R2;
import de.derfrzocker.spigot.utils.Version;
import io.th0rgal.oraxen.api.OraxenBlocks;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -115,6 +116,8 @@ public Object getCustomData(@NotNull BlockState blockState) {
@Override
protected CustomDataApplier getCustomDataApplier0() {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
return new OraxenApplier_v1_20_R2(this);
case v1_20_R1:
return new OraxenApplier_v1_20_R1(this);
case v1_19_R3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import de.derfrzocker.custom.ore.generator.impl.v1_19_R2.customdata.SkullTextureApplier_v1_19_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_19_R3.customdata.SkullTextureApplier_v1_19_R3;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R1.customdata.SkullTextureApplier_v1_20_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R2.customdata.SkullTextureApplier_v1_20_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R1.customdata.SkullTextureApplier_v1_8_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R2.customdata.SkullTextureApplier_v1_8_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R3.customdata.SkullTextureApplier_v1_8_R3;
Expand All @@ -64,6 +65,7 @@ public class SkullTextureCustomData extends AbstractSkullTextureCustomData {

static {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
case v1_20_R1:
case v1_19_R3:
case v1_19_R2:
Expand Down Expand Up @@ -108,6 +110,8 @@ public boolean canApply(@NotNull final OreConfig oreConfig) {
@Override
protected SkullTextureApplier getCustomDataApplier0() {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
return new SkullTextureApplier_v1_20_R2(this);
case v1_20_R1:
return new SkullTextureApplier_v1_20_R1(this);
case v1_19_R3:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import de.derfrzocker.custom.ore.generator.impl.v1_19_R2.customdata.TickBlockApplier_v1_19_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_19_R3.customdata.TickBlockApplier_v1_19_R3;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R1.customdata.TickBlockApplier_v1_20_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_20_R2.customdata.TickBlockApplier_v1_20_R2;
import de.derfrzocker.spigot.utils.Version;
import org.bukkit.Bukkit;
import org.bukkit.Material;
Expand Down Expand Up @@ -90,6 +91,8 @@ public Boolean getCustomData(@NotNull final BlockState blockState) {
@Override
protected CustomDataApplier getCustomDataApplier0() {
switch (Version.getServerVersion(Bukkit.getServer())) {
case v1_20_R2:
return new TickBlockApplier_v1_20_R2(this);
case v1_20_R1:
return new TickBlockApplier_v1_20_R1(this);
case v1_19_R3:
Expand Down
1 change: 1 addition & 0 deletions impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<module>v1_19_R2</module>
<module>v1_19_R3</module>
<module>v1_20_R1</module>
<module>v1_20_R2</module>
</modules>

<artifactId>custom-ore-generator-impl</artifactId>
Expand Down
111 changes: 111 additions & 0 deletions impl/v1_20_R2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>custom-ore-generator-impl</artifactId>
<groupId>de.derfrzocker</groupId>
<version>${revision}</version>
</parent>

<artifactId>custom-ore-generator-impl-v1_20_R2</artifactId>
<repositories>
<repository>
<id>minecraft-libraries</id>
<name>Minecraft Libraries</name>
<url>https://libraries.minecraft.net</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>dev.linwood</groupId>
<artifactId>ItemMods</artifactId>
<version>${ItemMods.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.oraxen</groupId>
<artifactId>Oraxen</artifactId>
<version>${Oraxen.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>de.derfrzocker</groupId>
<artifactId>custom-ore-generator-api</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.2-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>de.derfrzocker</groupId>
<artifactId>custom-ore-generator-impl-abstract</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.20.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.20.2-R0.1-SNAPSHOT:jar:remapped-mojang
</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>
${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar
</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.20.2-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.20.2-R0.1-SNAPSHOT:jar:remapped-obf
</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Loading

0 comments on commit f0256b2

Please sign in to comment.