use of com.ferreusveritas.dynamictrees.items.DendroPotion in project DynamicTrees by DynamicTreesTeam.
the class CommandCreateTransformPotion method execute.
@Override
public void execute(World world, ICommandSender sender, String[] args) throws CommandException {
if (args.length < 4) {
throw new WrongUsageException("commands.dynamictrees.createtransformpotion.usage");
}
BlockPos pos = BlockPos.ORIGIN;
Species species = null;
for (int arg = 0; arg < args.length; arg++) {
switch(arg) {
case 3:
pos = CommandBase.parseBlockPos(sender, args, 1, false);
break;
case 4:
species = TreeRegistry.findSpeciesSloppy(args[4]);
if (species == Species.NULLSPECIES) {
throw new CommandException("commands.dynamictrees.setree.specieserror", args[4]);
}
break;
}
}
final DendroPotion dendroPotion = ModItems.dendroPotion;
// Create the transform potion.
final ItemStack dendroPotionStack = new ItemStack(dendroPotion, 1, DendroPotion.DendroPotionType.TRANSFORM.getIndex());
// Tell it to set the target species to the given species.
dendroPotion.setTargetSpecies(dendroPotionStack, species);
// Spawn potion in the world.
ItemUtils.spawnItemStack(world, pos, dendroPotionStack, true);
}
use of com.ferreusveritas.dynamictrees.items.DendroPotion in project DynamicTrees by DynamicTreesTeam.
the class ModItems method preInit.
public static void preInit() {
// Potions
dendroPotion = new DendroPotion();
// Dirt Bucket
dirtBucket = new DirtBucket();
// Creative Mode Staff
treeStaff = new Staff();
}
Aggregations