Search in sources :

Example 1 with ShipUUIDToPosData

use of ValkyrienWarfareBase.Interaction.ShipUUIDToPosData in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class AirshipMapCommand method execute.

@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
    String term = args[0];
    if (term.equals("tpto")) {
        String shipName = args[1];
        if (args.length > 2) {
            for (int i = 2; i < args.length; i++) {
                shipName += " " + args[i];
            }
        }
        Entity player = sender.getCommandSenderEntity();
        World world = player.worldObj;
        ShipNameUUIDData data = ShipNameUUIDData.get(world);
        if (data.ShipNameToLongMap.containsKey(shipName)) {
            long shipUUIDMostSig = data.ShipNameToLongMap.get(shipName);
            ShipUUIDToPosData posData = ShipUUIDToPosData.get(world);
            ShipPositionData positionData = posData.getShipPositionData(shipUUIDMostSig);
            double posX = positionData.shipPosition.X;
            double posY = positionData.shipPosition.Y;
            double posZ = positionData.shipPosition.Z;
            if (player instanceof EntityPlayerMP) {
                EntityPlayerMP playerMP = (EntityPlayerMP) player;
                ((EntityPlayerMP) player).connection.setPlayerLocation(posX, posY, posZ, 0, 0);
            }
        }
    }
    if (term.equals("help")) {
        sender.addChatMessage(new TextComponentString("tpto"));
    }
}
Also used : Entity(net.minecraft.entity.Entity) ShipUUIDToPosData(ValkyrienWarfareBase.Interaction.ShipUUIDToPosData) ShipNameUUIDData(ValkyrienWarfareBase.Interaction.ShipNameUUIDData) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) TextComponentString(net.minecraft.util.text.TextComponentString) ShipPositionData(ValkyrienWarfareBase.Interaction.ShipUUIDToPosData.ShipPositionData) World(net.minecraft.world.World) TextComponentString(net.minecraft.util.text.TextComponentString)

Example 2 with ShipUUIDToPosData

use of ValkyrienWarfareBase.Interaction.ShipUUIDToPosData in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class DimensionPhysicsChunkManager method updateShipPosition.

public void updateShipPosition(PhysicsWrapperEntity wrapper) {
    World shipWorld = wrapper.worldObj;
    ShipUUIDToPosData data = ShipUUIDToPosData.get(shipWorld);
    data.updateShipPosition(wrapper);
}
Also used : ShipUUIDToPosData(ValkyrienWarfareBase.Interaction.ShipUUIDToPosData) World(net.minecraft.world.World)

Example 3 with ShipUUIDToPosData

use of ValkyrienWarfareBase.Interaction.ShipUUIDToPosData in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class DimensionPhysicsChunkManager method removeShipPosition.

public void removeShipPosition(PhysicsWrapperEntity wrapper) {
    World shipWorld = wrapper.worldObj;
    ShipUUIDToPosData data = ShipUUIDToPosData.get(shipWorld);
    data.removeShipFromMap(wrapper);
}
Also used : ShipUUIDToPosData(ValkyrienWarfareBase.Interaction.ShipUUIDToPosData) World(net.minecraft.world.World)

Aggregations

ShipUUIDToPosData (ValkyrienWarfareBase.Interaction.ShipUUIDToPosData)3 World (net.minecraft.world.World)3 ShipNameUUIDData (ValkyrienWarfareBase.Interaction.ShipNameUUIDData)1 ShipPositionData (ValkyrienWarfareBase.Interaction.ShipUUIDToPosData.ShipPositionData)1 Entity (net.minecraft.entity.Entity)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 TextComponentString (net.minecraft.util.text.TextComponentString)1