Skip to content

Commit

Permalink
Refractor bukkit to v1_21_3
Browse files Browse the repository at this point in the history
  • Loading branch information
duplexsystem committed Oct 29, 2024
1 parent 1929239 commit 710bbc3
Show file tree
Hide file tree
Showing 27 changed files with 28 additions and 36 deletions.
2 changes: 1 addition & 1 deletion platforms/bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

dependencies {
shaded(project(":platforms:bukkit:common"))
shaded(project(":platforms:bukkit:nms:v1_21", configuration = "reobf"))
shaded(project(":platforms:bukkit:nms:v1_21_3", configuration = "reobf"))
shaded("xyz.jpenilla", "reflection-remapper", Versions.Bukkit.reflectionRemapper)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private boolean doVersionCheck() {
@Override
public @Nullable
ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, String id) {
if(id == null || id.trim().equals("")) { return null; }
if(id == null || id.trim().isEmpty()) { return null; }
return new BukkitChunkGeneratorWrapper(generatorMap.computeIfAbsent(worldName, name -> {
ConfigPack pack = platform.getConfigRegistry().getByID(id).orElseThrow(
() -> new IllegalArgumentException("No such config pack \"" + id + "\""));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ static BukkitAddon nmsAddon(PlatformImpl platform) {
private static Initializer constructInitializer() {
try {
String packageVersion = NMS;
if(NMS.equals("v1_21_3")) {
packageVersion = "v1_21"; // TODO: Refactor nms package to v1_21_3
}

Class<?> initializerClass = Class.forName(TERRA_PACKAGE + "." + packageVersion + ".NMSInitializer");
try {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.dfsek.terra.bukkit.nms.v1_21;
package com.dfsek.terra.bukkit.nms.v1_21_3;

import com.dfsek.terra.bukkit.nms.v1_21.config.VanillaBiomeProperties;
import com.dfsek.terra.bukkit.nms.v1_21_3.config.VanillaBiomeProperties;

import com.google.common.collect.ImmutableMap;
import net.minecraft.core.Holder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.dfsek.terra.bukkit.nms.v1_21;
package com.dfsek.terra.bukkit.nms.v1_21_3;

import com.dfsek.terra.api.event.events.config.ConfigurationLoadEvent;
import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
import com.dfsek.terra.api.world.biome.Biome;
import com.dfsek.terra.bukkit.BukkitAddon;
import com.dfsek.terra.bukkit.PlatformImpl;
import com.dfsek.terra.bukkit.nms.v1_21.config.VanillaBiomeProperties;
import com.dfsek.terra.bukkit.nms.v1_21_3.config.VanillaBiomeProperties;


public class NMSAddon extends BukkitAddon {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21;
package com.dfsek.terra.bukkit.nms.v1_21_3;

import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.biome.Biome;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21;
package com.dfsek.terra.bukkit.nms.v1_21_3;

import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
Expand All @@ -11,7 +11,7 @@
import java.util.Optional;

import com.dfsek.terra.api.config.ConfigPack;
import com.dfsek.terra.bukkit.nms.v1_21.config.VanillaBiomeProperties;
import com.dfsek.terra.bukkit.nms.v1_21_3.config.VanillaBiomeProperties;


public class NMSBiomeInjector {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21;
package com.dfsek.terra.bukkit.nms.v1_21_3;

import com.mojang.serialization.MapCodec;
import net.minecraft.core.Holder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21;
package com.dfsek.terra.bukkit.nms.v1_21_3;

import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21;
package com.dfsek.terra.bukkit.nms.v1_21_3;

import com.dfsek.terra.bukkit.BukkitAddon;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21;
package com.dfsek.terra.bukkit.nms.v1_21_3;

import net.minecraft.server.level.ChunkMap;
import net.minecraft.server.level.ServerLevel;
Expand All @@ -17,7 +17,6 @@
import java.util.concurrent.locks.ReentrantLock;

import com.dfsek.terra.api.config.ConfigPack;
import com.dfsek.terra.api.util.reflection.ReflectionUtil;
import com.dfsek.terra.bukkit.generator.BukkitChunkGeneratorWrapper;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21;
package com.dfsek.terra.bukkit.nms.v1_21_3;

import net.minecraft.world.level.LevelHeightAccessor;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21;
package com.dfsek.terra.bukkit.nms.v1_21_3;

import net.minecraft.core.Holder;
import net.minecraft.core.Holder.Reference;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21;
package com.dfsek.terra.bukkit.nms.v1_21_3;

import net.minecraft.core.Registry;
import net.minecraft.core.registries.Registries;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21.config;
package com.dfsek.terra.bukkit.nms.v1_21_3.config;

import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21.config;
package com.dfsek.terra.bukkit.nms.v1_21_3.config;

import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21.config;
package com.dfsek.terra.bukkit.nms.v1_21_3.config;

import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.dfsek.terra.bukkit.nms.v1_21.config;
package com.dfsek.terra.bukkit.nms.v1_21_3.config;

import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EntityType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21.config;
package com.dfsek.terra.bukkit.nms.v1_21_3.config;

import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21.config;
package com.dfsek.terra.bukkit.nms.v1_21_3.config;

import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21.config;
package com.dfsek.terra.bukkit.nms.v1_21_3.config;

import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21.config;
package com.dfsek.terra.bukkit.nms.v1_21_3.config;

import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21.config;
package com.dfsek.terra.bukkit.nms.v1_21_3.config;

import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21.config;
package com.dfsek.terra.bukkit.nms.v1_21_3.config;

import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.dfsek.terra.bukkit.nms.v1_21.config;
package com.dfsek.terra.bukkit.nms.v1_21_3.config;

import com.dfsek.tectonic.api.config.template.ConfigTemplate;
import com.dfsek.tectonic.api.config.template.annotations.Default;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package com.dfsek.terra.bukkit.nms.v1_21.config;
package com.dfsek.terra.bukkit.nms.v1_21_3.config;

import com.dfsek.tectonic.api.config.template.annotations.Default;
import com.dfsek.tectonic.api.config.template.annotations.Value;
import com.dfsek.tectonic.api.config.template.object.ObjectTemplate;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryCodecs;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.npc.VillagerType;

Expand Down

0 comments on commit 710bbc3

Please sign in to comment.