Search in sources :

Example 1 with ShipNameUUIDData

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

the class DimensionPhysicsChunkManager method removeShipNameRegistry.

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

Example 2 with ShipNameUUIDData

use of ValkyrienWarfareBase.Interaction.ShipNameUUIDData 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)

Aggregations

ShipNameUUIDData (ValkyrienWarfareBase.Interaction.ShipNameUUIDData)2 World (net.minecraft.world.World)2 ShipUUIDToPosData (ValkyrienWarfareBase.Interaction.ShipUUIDToPosData)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