mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-17 22:00:08 +00:00
BiomeInfoCommand
This commit is contained in:
@@ -3,9 +3,16 @@ package com.dfsek.terra.commands.biome;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Argument;
|
||||
import com.dfsek.terra.api.command.annotation.Command;
|
||||
import com.dfsek.terra.api.command.annotation.inject.ArgumentTarget;
|
||||
import com.dfsek.terra.api.platform.CommandSender;
|
||||
import com.dfsek.terra.api.world.biome.TerraBiome;
|
||||
import com.dfsek.terra.api.world.biome.UserDefinedBiome;
|
||||
import com.dfsek.terra.commands.biome.arg.BiomeArgumentParser;
|
||||
import com.dfsek.terra.commands.biome.tab.BiomeTabCompleter;
|
||||
import com.dfsek.terra.config.templates.BiomeTemplate;
|
||||
import com.dfsek.terra.world.population.items.TerraStructure;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Command(
|
||||
arguments = {
|
||||
@@ -17,8 +24,29 @@ import com.dfsek.terra.commands.biome.tab.BiomeTabCompleter;
|
||||
}
|
||||
)
|
||||
public class BiomeInfoCommand implements CommandTemplate {
|
||||
@ArgumentTarget("biome")
|
||||
private TerraBiome biome;
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender) {
|
||||
|
||||
sender.sendMessage("Biome info for \"" + biome.getID() + "\".");
|
||||
sender.sendMessage("Vanilla biome: " + biome.getVanillaBiomes());
|
||||
|
||||
if(biome instanceof UserDefinedBiome) {
|
||||
BiomeTemplate bio = ((UserDefinedBiome) biome).getConfig();
|
||||
|
||||
if(bio.getExtend() != null) sender.sendMessage("Extends: " + bio.getExtend());
|
||||
|
||||
List<TerraStructure> structureConfigs = bio.getStructures();
|
||||
|
||||
if(structureConfigs.size() == 0) sender.sendMessage("No Structures");
|
||||
else {
|
||||
sender.sendMessage("-------Structures-------");
|
||||
for(TerraStructure c : structureConfigs) {
|
||||
sender.sendMessage(" - " + c.getTemplate().getID());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user