Implement loot system

This commit is contained in:
dfsek
2020-10-09 16:30:34 -07:00
parent 9a54f364be
commit 2b460f8617
14 changed files with 151 additions and 61 deletions

View File

@@ -4,7 +4,7 @@ import com.dfsek.terra.Terra;
import com.dfsek.terra.config.lang.LangUtil;
import com.dfsek.terra.util.structure.WorldEditUtil;
import com.dfsek.terra.command.type.PlayerCommand;
import com.dfsek.terra.structure.GaeaStructure;
import com.dfsek.terra.structure.Structure;
import com.dfsek.terra.structure.InitializationException;
import org.bukkit.Location;
import org.bukkit.command.Command;
@@ -24,9 +24,9 @@ public class ExportCommand extends PlayerCommand {
if(l == null) return true;
Location l1 = l[0];
Location l2 = l[1];
GaeaStructure structure;
Structure structure;
try {
structure = new GaeaStructure(l1, l2, args[0]);
structure = new Structure(l1, l2, args[0]);
} catch(InitializationException e) {
sender.sendMessage(e.getMessage());
return true;

View File

@@ -4,7 +4,7 @@ import com.dfsek.terra.Terra;
import com.dfsek.terra.command.type.DebugCommand;
import com.dfsek.terra.command.type.PlayerCommand;
import com.dfsek.terra.config.lang.LangUtil;
import com.dfsek.terra.structure.GaeaStructure;
import com.dfsek.terra.structure.Structure;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -19,14 +19,14 @@ public class LoadCommand extends PlayerCommand implements DebugCommand {
@Override
public boolean execute(@NotNull Player sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
try {
GaeaStructure.Rotation r;
Structure.Rotation r;
try {
r =GaeaStructure.Rotation.fromDegrees(Integer.parseInt(args[1]));
r = Structure.Rotation.fromDegrees(Integer.parseInt(args[1]));
} catch(NumberFormatException e) {
LangUtil.send("command.structure.invalid-rotation", sender, args[1]);
return true;
}
GaeaStructure struc = GaeaStructure.load(new File(Terra.getInstance().getDataFolder() + File.separator + "export" + File.separator + "structures", args[0] + ".tstructure"));
Structure struc = Structure.load(new File(Terra.getInstance().getDataFolder() + File.separator + "export" + File.separator + "structures", args[0] + ".tstructure"));
if("true".equals(args[2])) struc.paste(sender.getLocation(), r);
else struc.paste(sender.getLocation(), sender.getLocation().getChunk(), r);
//sender.sendMessage(String.valueOf(struc.checkSpawns(sender.getLocation(), r)));