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) {
;
}
}
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);
}
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;
}
}
}
}
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;
}
}
Aggregations