Search in sources :

Example 66 with Colony

use of com.minecolonies.coremod.colony.Colony in project minecolonies by Minecolonies.

the class DisableBarbarianSpawnsCommand method execute.

@Override
public void execute(@NotNull final MinecraftServer server, @NotNull final ICommandSender sender, @NotNull final ActionMenu actionMenu) throws CommandException {
    final Colony colony = actionMenu.getColonyForArgument("colony");
    final boolean canHaveBarbEvents = !actionMenu.getBooleanValueForArgument("disableSpawns", true);
    if (colony == null) {
        final String noColonyFoundMessage = String.format(NO_COLONY_FOUND_MESSAGE);
        sender.sendMessage(new TextComponentString(noColonyFoundMessage));
        return;
    }
    executeShared(server, sender, colony, canHaveBarbEvents);
}
Also used : Colony(com.minecolonies.coremod.colony.Colony) TextComponentString(net.minecraft.util.text.TextComponentString) TextComponentString(net.minecraft.util.text.TextComponentString)

Example 67 with Colony

use of com.minecolonies.coremod.colony.Colony in project minecolonies by Minecolonies.

the class DoRaidNowCommand method execute.

@Override
public void execute(@NotNull final MinecraftServer server, @NotNull final ICommandSender sender, @NotNull final ActionMenu actionMenu) throws CommandException {
    final Colony colony = actionMenu.getColonyForArgument("colony");
    if (colony == null) {
        sender.sendMessage(NO_COLONY_FOUND_MESSAGE);
        return;
    }
    executeShared(server, sender, colony);
}
Also used : Colony(com.minecolonies.coremod.colony.Colony)

Example 68 with Colony

use of com.minecolonies.coremod.colony.Colony in project minecolonies by Minecolonies.

the class DoRaidNowCommand method execute.

@Override
public void execute(@NotNull final MinecraftServer server, @NotNull final ICommandSender sender, @NotNull final String... args) throws CommandException {
    Colony colony = null;
    if (args.length != 0) {
        colony = ColonyManager.getColony(Integer.parseInt(args[0]));
        if (colony == null) {
            sender.sendMessage(NO_COLONY_FOUND_MESSAGE);
            return;
        }
    } else {
        sender.sendMessage(NO_ARGUMENTS);
        return;
    }
    executeShared(server, sender, colony);
}
Also used : Colony(com.minecolonies.coremod.colony.Colony)

Example 69 with Colony

use of com.minecolonies.coremod.colony.Colony in project minecolonies by Minecolonies.

the class DoRaidTonightCommand method execute.

@Override
public void execute(@NotNull final MinecraftServer server, @NotNull final ICommandSender sender, @NotNull final ActionMenu actionMenu) throws CommandException {
    final Colony colony = actionMenu.getColonyForArgument("colony");
    if (colony == null) {
        sender.sendMessage(NO_COLONY_FOUND_MESSAGE);
        return;
    }
    executeShared(server, sender, colony);
}
Also used : Colony(com.minecolonies.coremod.colony.Colony)

Example 70 with Colony

use of com.minecolonies.coremod.colony.Colony in project minecolonies by Minecolonies.

the class DoRaidTonightCommand method execute.

@Override
public void execute(@NotNull final MinecraftServer server, @NotNull final ICommandSender sender, @NotNull final String... args) throws CommandException {
    Colony colony = null;
    if (args.length != 0) {
        colony = ColonyManager.getColony(Integer.parseInt(args[0]));
        if (colony == null) {
            sender.sendMessage(NO_COLONY_FOUND_MESSAGE);
            return;
        }
    } else {
        sender.sendMessage(NO_ARGUMENTS);
        return;
    }
    executeShared(server, sender, colony);
}
Also used : Colony(com.minecolonies.coremod.colony.Colony)

Aggregations

Colony (com.minecolonies.coremod.colony.Colony)81 TextComponentString (net.minecraft.util.text.TextComponentString)29 IColony (com.minecolonies.api.colony.IColony)21 EntityPlayer (net.minecraft.entity.player.EntityPlayer)20 BlockPos (net.minecraft.util.math.BlockPos)19 Nullable (org.jetbrains.annotations.Nullable)16 CitizenData (com.minecolonies.coremod.colony.CitizenData)13 AbstractBuilding (com.minecolonies.coremod.colony.buildings.AbstractBuilding)13 NotNull (org.jetbrains.annotations.NotNull)11 ItemStack (net.minecraft.item.ItemStack)9 Entity (net.minecraft.entity.Entity)8 TileEntity (net.minecraft.tileentity.TileEntity)8 World (net.minecraft.world.World)6 List (java.util.List)5 UUID (java.util.UUID)5 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)5 ILocation (com.minecolonies.api.colony.requestsystem.location.ILocation)4 Delivery (com.minecolonies.api.colony.requestsystem.requestable.Delivery)4 IToken (com.minecolonies.api.colony.requestsystem.token.IToken)4 AbstractBlockHut (com.minecolonies.coremod.blocks.AbstractBlockHut)4