Search in sources :

Example 6 with ChunkProviderLands

use of com.mraof.minestuck.world.lands.gen.ChunkProviderLands in project Minestuck by mraof.

the class CommandCheckLand method execute.

@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
    if (!(sender instanceof EntityPlayerMP))
        throw new PlayerNotFoundException("commands.playerOnly");
    EntityPlayerMP player = (EntityPlayerMP) sender;
    if (MinestuckDimensionHandler.isLandDimension(player.dimension)) {
        LandAspectRegistry.AspectCombination aspects = MinestuckDimensionHandler.getAspects(player.dimension);
        ChunkProviderLands chunkProvider = (ChunkProviderLands) player.world.provider.createChunkGenerator();
        ITextComponent aspect1 = new TextComponentTranslation("land." + aspects.aspectTerrain.getNames()[chunkProvider.nameIndex1]);
        ITextComponent aspect2 = new TextComponentTranslation("land." + aspects.aspectTitle.getNames()[chunkProvider.nameIndex2]);
        ITextComponent toSend;
        if (chunkProvider.nameOrder)
            toSend = new TextComponentTranslation("land.message.check", aspect1, aspect2);
        else
            toSend = new TextComponentTranslation("land.message.check", aspect2, aspect1);
        player.sendMessage(toSend);
    } else {
        player.sendMessage(new TextComponentTranslation("land.message.checkFail"));
    }
}
Also used : ChunkProviderLands(com.mraof.minestuck.world.lands.gen.ChunkProviderLands) TextComponentTranslation(net.minecraft.util.text.TextComponentTranslation) ITextComponent(net.minecraft.util.text.ITextComponent) PlayerNotFoundException(net.minecraft.command.PlayerNotFoundException) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) LandAspectRegistry(com.mraof.minestuck.world.lands.LandAspectRegistry)

Aggregations

ChunkProviderLands (com.mraof.minestuck.world.lands.gen.ChunkProviderLands)6 LandAspectRegistry (com.mraof.minestuck.world.lands.LandAspectRegistry)3 PlayerIdentifier (com.mraof.minestuck.util.IdentifierHandler.PlayerIdentifier)2 Title (com.mraof.minestuck.util.Title)2 WorldProviderLands (com.mraof.minestuck.world.WorldProviderLands)2 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 ITextComponent (net.minecraft.util.text.ITextComponent)2 TextComponentTranslation (net.minecraft.util.text.TextComponentTranslation)2 SburbConnection (com.mraof.minestuck.network.skaianet.SburbConnection)1 IBlockState (net.minecraft.block.state.IBlockState)1 PlayerNotFoundException (net.minecraft.command.PlayerNotFoundException)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 ItemStack (net.minecraft.item.ItemStack)1 NBTTagList (net.minecraft.nbt.NBTTagList)1 BlockPos (net.minecraft.util.math.BlockPos)1 World (net.minecraft.world.World)1 IChunkGenerator (net.minecraft.world.gen.IChunkGenerator)1 WorldGenMinable (net.minecraft.world.gen.feature.WorldGenMinable)1