Package com.khorn.terraincontrol.customobjects

Examples of com.khorn.terraincontrol.customobjects.CustomObject


        // Read from BiomeObjects setting
        List<String> customObjectStrings = readSettings(BiomeStandardValues.BIOME_OBJECTS);
        for (String customObjectString : customObjectStrings)
        {
            CustomObject object = worldConfig.worldObjects.parseCustomObject(customObjectString);
            if (object != null && !(object instanceof UseBiome))
            {
                biomeObjects.add(object);
                biomeObjectStrings.add(customObjectString);
            }
View Full Code Here


        }
        objects = new ArrayList<CustomObject>();
        objectNames = new ArrayList<String>();
        for (String arg : args)
        {
            CustomObject object = getHolder().worldConfig.worldObjects.parseCustomObject(arg);
            if (object == null || !object.canSpawnAsObject())
            {
                throw new InvalidConfigException("No custom object found with the name " + arg);
            }
            objects.add(object);
            objectNames.add(arg);
View Full Code Here

        if (args.isEmpty())
        {
            me.sendMessage(ERROR_COLOR + "You must enter the name of the BO2.");
            return true;
        }
        CustomObject spawnObject = null;

        if (bukkitWorld != null)
            spawnObject = bukkitWorld.getConfigs().getCustomObjects().parseCustomObject(args.get(0));

        if (spawnObject == null)
        {
            sender.sendMessage(ERROR_COLOR + "Object not found, use '/tc list' to list the available ones.");
            return true;
        }

        Block block = this.getWatchedBlock(me, true);
        if (block == null)
            return true;
       
        if (spawnObject.spawnForced(bukkitWorld, random, Rotation.NORTH, block.getX(), block.getY(), block.getZ()))
        {
            me.sendMessage(BaseCommand.MESSAGE_COLOR + spawnObject.getName() + " was spawned.");
        } else
        {
            me.sendMessage(BaseCommand.ERROR_COLOR + "Object can't be spawned over there.");
        }
View Full Code Here

        treeNames = new ArrayList<String>();
        treeChances = new ArrayList<Integer>();

        for (int i = 1; i < args.size() - 1; i += 2)
        {
            CustomObject object = getHolder().worldConfig.worldObjects.parseCustomObject(args.get(i));
            if (object == null)
            {
                throw new InvalidConfigException("Custom object " + args.get(i) + " not found!");
            }
            if (!object.canSpawnAsTree())
            {
                throw new InvalidConfigException("Custom object " + args.get(i) + " is not a tree!");
            }
            trees.add(object);
            treeNames.add(args.get(i));
View Full Code Here

        objects = new ArrayList<StructuredCustomObject>();
        objectNames = new ArrayList<String>();
        objectChances = new ArrayList<Double>();
        for (int i = 0; i < args.size() - 1; i += 2)
        {
            CustomObject object = getHolder().worldConfig.worldObjects.parseCustomObject(args.get(i));
            if (object == null || !object.canSpawnAsObject())
            {
                throw new InvalidConfigException("No custom object found with the name " + args.get(i));
            }
            if (!(object instanceof StructuredCustomObject) || ((StructuredCustomObject) object).getBranches(Rotation.NORTH).length == 0)
            {
View Full Code Here

        z = readInt(args.get(2), -32, 32);
        int i;
        double cumulativeChance = 0;
        for (i = 3; i < args.size() - 2; i += 3)
        {
            CustomObject object = getHolder().otherObjectsInDirectory.get(args.get(i).toLowerCase());
            if (object == null)
            {
                throw new InvalidConfigException("The " + this.getConfigName() + " `" + args.get(i) + "` was not found. Make sure to place it in the same directory.");
            } else
            {
                TerrainControl.log(LogMarker.TRACE, "{} Initialized", (Object) object.getName());
            }
            double branchChance = readDouble(args.get(i + 2), 0, Double.MAX_VALUE);
            if (accumulateChances)
            {
                cumulativeChance += branchChance;
View Full Code Here

        treeNames = new ArrayList<String>();
        treeChances = new ArrayList<Integer>();

        for (int i = 1; i < args.size() - 1; i += 2)
        {
            CustomObject object = getHolder().worldConfig.worldObjects.parseCustomObject(args.get(i));
            if (object == null)
            {
                throw new InvalidConfigException("Custom object " + args.get(i) + " not found!");
            }
            if (!object.canSpawnAsTree())
            {
                throw new InvalidConfigException("Custom object " + args.get(i) + " is not a tree!");
            }
            trees.add(object);
            treeNames.add(args.get(i));
View Full Code Here

TOP

Related Classes of com.khorn.terraincontrol.customobjects.CustomObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.