Files
minecraft-pe-0.6.1/src/client/player/LocalPlayer.h
Shredder d7d887f882 few additions and bug fixes
Added Hand Sway (not an option yet) from b1,8

Fire works properly in multiplayer now and also renders on undead mobs in sunlight now

hopefully fixed bow stuck bug on touchscreen devices

Fire on entites uses updated rendering from b1.6.6

Shadow bug fix attempt the 15th

Added looking at block in debug screen

Zombie Pigman now renders his hat layer

Temporarily disabled most randomlevelsource cave, canyon and tall grass code just for this commit to test performance
2026-05-23 05:29:47 +05:00

115 lines
3.0 KiB
C++
Executable File

#ifndef NET_MINECRAFT_CLIENT_PLAYER__LocalPlayer_H__
#define NET_MINECRAFT_CLIENT_PLAYER__LocalPlayer_H__
//package net.minecraft.client.player;
#include "input/IMoveInput.h"
#include "../../util/SmoothFloat.h"
#include "../../world/entity/player/Player.h"
class Minecraft;
class Stat;
class CompoundTag;
class LocalPlayer: public Player
{
typedef Player super;
public:
LocalPlayer(Minecraft* minecraft, Level* level, const std::string& username, int dimension, bool isCreative);
~LocalPlayer();
void _init();
virtual void reset();
void tick();
float yBob, xBob; // shredder added from b1.8/4j for the hand swaying animation
float yBobO, xBobO; // shredder added from b1.8/4j for the hand swaying animation
void move(float xa, float ya, float za);
void aiStep();
void updateAi();
void setKey(int eventKey, bool eventKeyState);
void releaseAllKeys();
void addAdditonalSaveData(CompoundTag* entityTag);
void readAdditionalSaveData(CompoundTag* entityTag);
void closeContainer();
void drop(ItemInstance* item, bool randomly);
void take(Entity* e, int orgCount);
void startCrafting(int x, int y, int z, int tableSize);
void startStonecutting(int x, int y, int z);
void openContainer(ChestTileEntity* container);
void openFurnace(FurnaceTileEntity* e);
bool isSneaking();
void actuallyHurt(int dmg);
void hurtTo(int newHealth);
void die(Entity* source);
void respawn();
void animateRespawn() {}
float getFieldOfViewModifier();
void chat(const std::string& message) {}
void displayClientMessage(const std::string& messageId);
void awardStat(Stat* stat, int count) {
//minecraft->stats.award(stat, count);
//minecraft->achievementPopup.popup("Achievement get!", stat.name);
}
void causeFallDamage( float distance );
virtual int startSleepInBed(int x, int y, int z);
virtual void stopSleepInBed(bool forcefulWakeUp, bool updateLevelList, bool saveRespawnPoint);
void swing();
virtual void openTextEdit( TileEntity* tileEntity );
virtual float getWalkingSpeedModifier();
private:
void calculateFlight(float xa, float ya, float za);
bool isSolidTile(int x, int y, int z);
void updateArmorTypeHash();
public:
IMoveInput* input;
bool autoJumpEnabled;
protected:
Minecraft* minecraft;
int jumpTriggerTime;
int ascendTriggerTime;
int descendTriggerTime;
bool ascending, descending;
private:
// local player fly
// -----------------------
float flyX, flyY, flyZ;
// smooth camera settings
SmoothFloat smoothFlyX;
SmoothFloat smoothFlyY;
SmoothFloat smoothFlyZ;
int autoJumpTime;
int sentInventoryItemId;
int sentInventoryItemData;
int armorTypeHash;
// sprinting
bool sprinting;
int sprintDoubleTapTimer;
bool prevForwardHeld;
public:
void setSprinting(bool sprint) { sprinting = sprint; }
};
#endif /*NET_MINECRAFT_CLIENT_PLAYER__LocalPlayer_H__*/