Search in sources :

Example 1 with WorldStructureGenerationData

use of ivorius.reccomplex.world.gen.feature.WorldStructureGenerationData in project RecurrentComplex by Ivorforce.

the class CommandSightAdd method execute.

@Override
public void execute(MinecraftServer server, ICommandSender commandSender, String[] args) throws CommandException {
    RCParameters parameters = RCParameters.of(args);
    WorldStructureGenerationData generationData = WorldStructureGenerationData.get(commandSender.getEntityWorld());
    SelectionOwner owner = RCCommands.getSelectionOwner(commandSender, null, true);
    String name = parameters.get().text().require();
    generationData.addEntry(WorldStructureGenerationData.CustomEntry.from(name, BlockAreas.toBoundingBox(owner.getSelection())));
    commandSender.sendMessage(ServerTranslations.format("commands.rcremember.success", name));
}
Also used : RCParameters(ivorius.reccomplex.commands.parameters.RCParameters) WorldStructureGenerationData(ivorius.reccomplex.world.gen.feature.WorldStructureGenerationData) SelectionOwner(ivorius.reccomplex.capability.SelectionOwner)

Example 2 with WorldStructureGenerationData

use of ivorius.reccomplex.world.gen.feature.WorldStructureGenerationData in project RecurrentComplex by Ivorforce.

the class CommandSightInfo method execute.

@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
    RCParameters parameters = RCParameters.of(args);
    WorldStructureGenerationData generationData = WorldStructureGenerationData.get(sender.getEntityWorld());
    WorldStructureGenerationData.Entry entry = generationData.getEntry(UUID.fromString(parameters.get().first().require()));
    if (entry == null)
        throw ServerTranslations.commandException("commands.rcsightinfo.unknown");
    else {
        ITextComponent area = RCTextStyle.area(RCBlockAreas.from(entry.getBoundingBox()));
        ITextComponent sight = RCTextStyle.sight(entry, true);
        if (entry instanceof WorldStructureGenerationData.StructureEntry) {
            WorldStructureGenerationData.StructureEntry structureEntry = (WorldStructureGenerationData.StructureEntry) entry;
            sender.sendMessage(new TextComponentTranslation("commands.rcsightinfo.structure", RCTextStyle.structure(structureEntry.getStructureID()), area, RCTextStyle.copy(String.valueOf(structureEntry.getSeed())), sight));
        } else
            sender.sendMessage(new TextComponentTranslation("commands.rcsightinfo.get", entry.description(), area, sight));
    }
}
Also used : RCParameters(ivorius.reccomplex.commands.parameters.RCParameters) TextComponentTranslation(net.minecraft.util.text.TextComponentTranslation) WorldStructureGenerationData(ivorius.reccomplex.world.gen.feature.WorldStructureGenerationData) ITextComponent(net.minecraft.util.text.ITextComponent)

Aggregations

RCParameters (ivorius.reccomplex.commands.parameters.RCParameters)2 WorldStructureGenerationData (ivorius.reccomplex.world.gen.feature.WorldStructureGenerationData)2 SelectionOwner (ivorius.reccomplex.capability.SelectionOwner)1 ITextComponent (net.minecraft.util.text.ITextComponent)1 TextComponentTranslation (net.minecraft.util.text.TextComponentTranslation)1