Search in sources :

Example 6 with ITeleportHandler

use of net.dyeo.teleporter.capabilities.ITeleportHandler in project VanillaTeleporter by dyeo.

the class CommandTeleportReset method execute.

@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
    EntityPlayerMP entity = getCommandSenderAsPlayer(sender);
    if (entity.hasCapability(CapabilityTeleportHandler.TELEPORT_CAPABILITY, null)) {
        ITeleportHandler handler = ((ITeleportHandler) entity.getCapability(CapabilityTeleportHandler.TELEPORT_CAPABILITY, null));
        handler.setOnTeleporter(false);
        handler.setTeleportStatus(EnumTeleportStatus.INACTIVE);
    }
}
Also used : ITeleportHandler(net.dyeo.teleporter.capabilities.ITeleportHandler) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP)

Aggregations

ITeleportHandler (net.dyeo.teleporter.capabilities.ITeleportHandler)6 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)3 EntityLivingBase (net.minecraft.entity.EntityLivingBase)2 TeleportEvent (net.dyeo.teleporter.event.TeleportEvent)1 TeleporterNode (net.dyeo.teleporter.teleport.TeleporterNode)1 TileEntityTeleporter (net.dyeo.teleporter.tileentity.TileEntityTeleporter)1 IBlockState (net.minecraft.block.state.IBlockState)1 EntityMob (net.minecraft.entity.monster.EntityMob)1 EntityAnimal (net.minecraft.entity.passive.EntityAnimal)1 EntityWolf (net.minecraft.entity.passive.EntityWolf)1 WorldServer (net.minecraft.world.WorldServer)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1