Search in sources :

Example 6 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project LogisticsPipes by RS485.

the class EntitySparkleFX method onUpdate.

/**
	 * Called to update the entity's position/logic.
	 */
@Override
public void onUpdate() {
    try {
        EntityClientPlayerMP var1 = Minecraft.getMinecraft().thePlayer;
        if (var1.getDistance(posX, posY, posZ) > 50) {
            setDead();
        }
        prevPosX = posX;
        prevPosY = posY;
        prevPosZ = posZ;
        if (particleAge++ >= particleMaxAge) {
            setDead();
        }
        motionX -= 0.05D * particleGravity - 0.1D * particleGravity * new Random().nextDouble();
        motionY -= 0.05D * particleGravity - 0.1D * particleGravity * new Random().nextDouble();
        motionZ -= 0.05D * particleGravity - 0.1D * particleGravity * new Random().nextDouble();
        moveEntity(motionX, motionY, motionZ);
        motionX *= 0.9800000190734863D;
        motionY *= 0.9800000190734863D;
        motionZ *= 0.9800000190734863D;
        if (onGround) {
            motionX *= 0.699999988079071D;
            motionZ *= 0.699999988079071D;
        }
    } catch (Exception var3) {
        ;
    }
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) Random(java.util.Random)

Example 7 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project ArsMagica2 by Mithion.

the class AMPacketProcessorClient method handleRemoveBuffEffect.

private void handleRemoveBuffEffect(byte[] data) {
    AMDataReader rdr = new AMDataReader(data, false);
    int buffID = rdr.getInt();
    EntityClientPlayerMP localPlayer = Minecraft.getMinecraft().thePlayer;
    if (buffID == BuffList.temporalAnchor.id) {
        localPlayer.prevTimeInPortal = 1f;
        localPlayer.timeInPortal = 1f;
    } else if (buffID == BuffList.flight.id || buffID == BuffList.levitation.id) {
        localPlayer.capabilities.allowFlying = false;
        localPlayer.capabilities.isFlying = false;
        localPlayer.fallDistance = 0f;
    }
    localPlayer.removePotionEffect(buffID);
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP)

Example 8 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project ArsMagica2 by Mithion.

the class AMGuiHelper method overrideKeyboardInput.

public static void overrideKeyboardInput() {
    Minecraft mc = Minecraft.getMinecraft();
    if (mc.thePlayer != null && mc.theWorld != null && ExtendedProperties.For(mc.thePlayer).shouldReverseInput()) {
        EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
        if (mc.gameSettings.keyBindLeft.getIsKeyPressed()) {
            LogHelper.info("Override Left");
            player.movementInput.moveStrafe -= 2;
        }
        if (mc.gameSettings.keyBindRight.getIsKeyPressed()) {
            LogHelper.info("Override Rights");
            player.movementInput.moveStrafe += 2;
        }
        if (mc.thePlayer.isPotionActive(BuffList.scrambleSynapses)) {
            if (mc.gameSettings.keyBindForward.getIsKeyPressed()) {
                player.movementInput.moveForward -= 2;
            }
            if (mc.gameSettings.keyBindBack.getIsKeyPressed()) {
                player.movementInput.moveForward += 2;
            }
        }
    }
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) Minecraft(net.minecraft.client.Minecraft)

Example 9 with EntityClientPlayerMP

use of net.minecraft.client.entity.EntityClientPlayerMP in project SecurityCraft by Geforce132.

the class GuiRetinalScannerSetup method actionPerformed.

protected void actionPerformed(GuiButton guibutton) {
    switch(guibutton.id) {
        case 0:
            String players = this.textboxAllowedPlayers.getText();
            World W = Minecraft.getMinecraft().theWorld;
            MinecraftServer minecraftserver = MinecraftServer.getServer();
            try {
                if (this.mc.isSingleplayer()) {
                // String string = "saves/" + BlockRetinalScanner.worldObj.getSaveHandler().getWorldDirectoryName() + "/SecurityCraft/retScanner/players/" + BlockRetinalScanner.lastScannerX + "-" + BlockRetinalScanner.lastScannerY + "-" + BlockRetinalScanner.lastScannerZ;
                // File file = new File(string);
                // file.mkdirs();
                // file.createNewFile();
                // PrintWriter out = new PrintWriter("saves/" + BlockRetinalScanner.worldObj.getSaveHandler().getWorldDirectoryName() + "/SecurityCraft/retScanner/players/" + BlockRetinalScanner.lastScannerX + "-" + BlockRetinalScanner.lastScannerY + "-" + BlockRetinalScanner.lastScannerZ + "/players.txt");
                // out.println(players);
                // out.close();
                } else {
                // String string = minecraftserver.getWorldName() + "/SecurityCraft/retScanner/players/" + BlockRetinalScanner.lastScannerX + "-" + BlockRetinalScanner.lastScannerY + "-" + BlockRetinalScanner.lastScannerZ;
                // File file = new File(string);
                // file.mkdirs();
                // file.createNewFile();
                // PrintWriter out = new PrintWriter(minecraftserver.getWorldName() + "/SecurityCraft/retScanner/players/" + BlockRetinalScanner.lastScannerX + "-" + BlockRetinalScanner.lastScannerY + "-" + BlockRetinalScanner.lastScannerZ + "/players.txt");
                // out.println(players);
                // out.close();
                }
                if (this.mc.isSingleplayer()) {
                    EntityClientPlayerMP P = Minecraft.getMinecraft().thePlayer;
                    P.closeScreen();
                    P.openGui(mod_SecurityCraft.instance, 3, W, (int) P.posX, (int) P.posY, (int) P.posZ);
                } else {
                // HelpfulMethods.closePlayerScreen(BlockRetinalScanner.playerObj);
                // BlockRetinalScanner.playerObj.openGui(mod_SecurityCraft.instance, 3, W, (int) BlockRetinalScanner.playerObj.posX, (int) BlockRetinalScanner.playerObj.posY, (int) BlockRetinalScanner.playerObj.posZ);
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            break;
    }
}
Also used : EntityClientPlayerMP(net.minecraft.client.entity.EntityClientPlayerMP) World(net.minecraft.world.World) MinecraftServer(net.minecraft.server.MinecraftServer)

Aggregations

EntityClientPlayerMP (net.minecraft.client.entity.EntityClientPlayerMP)9 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)2 ChatComponentText (net.minecraft.util.ChatComponentText)2 EntityAirSled (am2.entities.EntityAirSled)1 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 EntitySeat (ebf.tim.entities.EntitySeat)1 EntityTrainCore (ebf.tim.entities.EntityTrainCore)1 GenericRailTransport (ebf.tim.entities.GenericRailTransport)1 PacketKeyPress (ebf.tim.networking.PacketKeyPress)1 Random (java.util.Random)1 VersionChecker (logisticspipes.ticks.VersionChecker)1 Minecraft (net.minecraft.client.Minecraft)1 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)1 C03PacketPlayer (net.minecraft.network.play.client.C03PacketPlayer)1 C0CPacketInput (net.minecraft.network.play.client.C0CPacketInput)1 MinecraftServer (net.minecraft.server.MinecraftServer)1 World (net.minecraft.world.World)1