Examples of DropItemStack


Examples of com.sk89q.craftbook.mechanics.drops.DropItemStack

                            List<DropItemStack> stacks = new ArrayList<DropItemStack>();

                            boolean append = false;

                            for(DropDefinition dd : drops) {
                                DropItemStack nstack = new DropItemStack(dd.stack);
                                nstack.setChance(dd.chance);
                                nstack.setMaximum(dd.countMax);
                                nstack.setMinimum(dd.countMin);
                                stacks.add(nstack);
                                if(dd.append)
                                    append = true;
                            }

                            BlockCustomDropDefinition converted = new BlockCustomDropDefinition(sourceId + "" + data + "" + this.converted++,stacks, null, new ItemInfo(sourceId, data));
                            converted.setAppend(append);

                            ((CustomDrops) CraftBookPlugin.inst().getMechanic(CustomDrops.class)).addDefinition(converted);
                        } else {
                            itemsSource = ChatColor.translateAlternateColorCodes('&', itemsSource.toLowerCase(Locale.ENGLISH));
                            if (mobDropDefinitions.containsKey(itemsSource)) {
                                reader.close();
                                throw new CustomDropParseException(prelude + "double drop definition");
                            }
                            mobDropDefinitions.put(itemsSource, drops);
                        }
                    }

                    reader.close();

                    if (isMobDrop) {
                        this.mobDropDefinitions = mobDropDefinitions;

                        for(Entry<String, DropDefinition[]> def : mobDropDefinitions.entrySet()) {

                            List<DropItemStack> stacks = new ArrayList<DropItemStack>();

                            boolean append = false;

                            for(DropDefinition dd : def.getValue()) {
                                DropItemStack nstack = new DropItemStack(dd.stack);
                                nstack.setChance(dd.chance);
                                nstack.setMaximum(dd.countMax);
                                nstack.setMinimum(dd.countMin);
                                stacks.add(nstack);
                                if(dd.append)
                                    append = true;
                            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.