This commit is contained in:
Zoe Gidiere
2024-09-18 12:43:41 -06:00
parent 8cf766e77b
commit b63f5f4a8f
45 changed files with 163 additions and 219 deletions

View File

@@ -17,14 +17,14 @@
package com.dfsek.terra.bukkit;
import io.papermc.lib.PaperLib;
import org.bukkit.Location;
import com.dfsek.terra.api.entity.Entity;
import com.dfsek.terra.api.util.vector.Vector3;
import com.dfsek.terra.api.world.ServerWorld;
import com.dfsek.terra.bukkit.world.BukkitAdapter;
import io.papermc.lib.PaperLib;
import org.bukkit.Location;
public class BukkitEntity implements Entity {
private final org.bukkit.entity.Entity entity;

View File

@@ -79,7 +79,7 @@ public class TerraBukkitPlugin extends JavaPlugin {
} catch(Exception e) { // This should never happen.
logger.error("""
TERRA HAS BEEN DISABLED
Errors occurred while registering commands.
Please report this to Terra.
""".strip(), e);
@@ -102,13 +102,13 @@ public class TerraBukkitPlugin extends JavaPlugin {
BukkitAdapter::adapt
));
if (commandManager.hasCapability(CloudBukkitCapabilities.NATIVE_BRIGADIER)) {
if(commandManager.hasCapability(CloudBukkitCapabilities.NATIVE_BRIGADIER)) {
commandManager.registerBrigadier();
final CloudBrigadierManager<?, ?> brigManager = commandManager.brigadierManager();
if(brigManager != null) {
brigManager.setNativeNumberSuggestions(false);
}
} else if (commandManager.hasCapability(CloudBukkitCapabilities.ASYNCHRONOUS_COMPLETION)) {
} else if(commandManager.hasCapability(CloudBukkitCapabilities.ASYNCHRONOUS_COMPLETION)) {
commandManager.registerAsynchronousCompletions();
}
@@ -181,7 +181,7 @@ public class TerraBukkitPlugin extends JavaPlugin {
logger.warn("""
You are using Mohist, so we will not give you any support for issues that may arise.
Since you enabled the "IKnowMohistCausesLotsOfIssuesButIWillUseItAnyways" flag, we won't disable Terra. But be warned.
> I felt a great disturbance in the JVM, as if millions of plugins suddenly cried out in stack traces and were suddenly silenced.
> I fear something terrible has happened.
> - Astrash
@@ -194,7 +194,7 @@ public class TerraBukkitPlugin extends JavaPlugin {
@Override
public @Nullable
ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, String id) {
if (id == null || id.trim().equals("")) { return null; }
if(id == null || id.trim().equals("")) { return null; }
return new BukkitChunkGeneratorWrapper(generatorMap.computeIfAbsent(worldName, name -> {
ConfigPack pack = platform.getConfigRegistry().getByID(id).orElseThrow(
() -> new IllegalArgumentException("No such config pack \"" + id + "\""));

View File

@@ -61,8 +61,9 @@ public class BukkitWorldHandle implements WorldHandle {
@Override
public @NotNull EntityType getEntity(@NotNull String id) {
if (!id.contains(":")) { //TODO: remove in 7.0
String newid = "minecraft:" + id.toLowerCase();;
if(!id.contains(":")) { //TODO: remove in 7.0
String newid = "minecraft:" + id.toLowerCase();
;
logger.warn(
"Translating " + id + " to " + newid + ". In 1.20.3 entity parsing was reworked" +
". You are advised to perform this rename in your config backs as this translation will be removed in the next major " +

View File

@@ -1,11 +1,10 @@
package com.dfsek.terra.bukkit.nms;
import com.dfsek.terra.bukkit.util.VersionUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.dfsek.terra.bukkit.PlatformImpl;
import com.dfsek.terra.bukkit.util.VersionUtil;
public interface Initializer {
@@ -16,7 +15,7 @@ public interface Initializer {
Logger logger = LoggerFactory.getLogger(Initializer.class);
try {
String packageVersion = NMS;
if (NMS.equals("v1_21_1")) {
if(NMS.equals("v1_21_1")) {
packageVersion = "v1_21";
}

View File

@@ -112,7 +112,7 @@ public final class VersionUtil {
if(major == -1 && minor == -1 && patch == -1)
return "Unknown";
if (patch >= 0) {
if(patch >= 0) {
return String.format("v%d.%d.%d", major, minor, patch);
} else {
return String.format("v%d.%d", major, minor);