start working on error handling stuff

This commit is contained in:
dfsek
2025-12-29 22:18:44 -07:00
parent 9a16336f53
commit cb08401536
76 changed files with 212 additions and 165 deletions
@@ -4,7 +4,6 @@ package com.dfsek.terra.addons.commands.locate;
import com.dfsek.seismic.type.vector.Vector2Int;
import com.dfsek.seismic.type.vector.Vector3Int;
import com.dfsek.terra.api.util.function.FunctionUtils;
import com.dfsek.terra.api.util.generic.data.types.Maybe;
import org.incendo.cloud.CommandManager;
@@ -13,8 +12,6 @@ import org.incendo.cloud.context.CommandContext;
import org.incendo.cloud.description.Description;
import org.incendo.cloud.parser.standard.IntegerParser;
import java.util.Optional;
import com.dfsek.terra.addons.manifest.api.AddonInitializer;
import com.dfsek.terra.api.Platform;
import com.dfsek.terra.api.addon.BaseAddon;
@@ -41,7 +38,7 @@ public class LocateCommandAddon implements AddonInitializer {
private BaseAddon addon;
private static Registry<Biome> getBiomeRegistry(CommandContext<CommandSender> sender) {
return sender.sender().getEntity().orThrow().world().getPack().getRegistry(Biome.class);
return sender.sender().entity().orThrow().world().getPack().getRegistry(Biome.class);
}
@Override
@@ -69,7 +66,7 @@ public class LocateCommandAddon implements AddonInitializer {
.handler(context -> {
// 1. Gather Context & Arguments
Biome targetBiome = context.get("biome");
Entity sender = context.sender().getEntity().orThrow(
Entity sender = context.sender().entity().orThrow(
() -> new Error("Only entities can run this command."));
World world = sender.world();