mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Rename command Status to Health
This commit is contained in:
parent
975e6d4daa
commit
bf86259b4b
5 changed files with 8 additions and 8 deletions
|
|
@ -5,14 +5,14 @@ using System.Text;
|
|||
|
||||
namespace MinecraftClient.Commands
|
||||
{
|
||||
class Status : Command
|
||||
class Health : Command
|
||||
{
|
||||
public override string CMDName { get { return "status"; } }
|
||||
public override string CMDDesc { get { return "status: Display Health and Food saturation."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
return "Health: " + handler.GetHealth() + "\n[MCC] Saturation: " + handler.GetSaturation(); // any good ways to print multiple lines?
|
||||
return "Health: " + handler.GetHealth() + ", Saturation: " + handler.GetSaturation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1542,10 +1542,10 @@ namespace MinecraftClient
|
|||
/// Called when client player's health changed, e.g. getting attack
|
||||
/// </summary>
|
||||
/// <param name="health">Player current health</param>
|
||||
public void OnUpdateHealth(float health, int Food)
|
||||
public void OnUpdateHealth(float health, int food)
|
||||
{
|
||||
playerHealth = health;
|
||||
playerFoodSaturation = Food;
|
||||
playerFoodSaturation = food;
|
||||
if (health <= 0)
|
||||
{
|
||||
if (Settings.AutoRespawn)
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@
|
|||
<Compile Include="Commands\Script.cs" />
|
||||
<Compile Include="Commands\Send.cs" />
|
||||
<Compile Include="Commands\Set.cs" />
|
||||
<Compile Include="Commands\Status.cs" />
|
||||
<Compile Include="Commands\Health.cs" />
|
||||
<Compile Include="Commands\UseItem.cs" />
|
||||
<Compile Include="Inventory\Container.cs" />
|
||||
<Compile Include="Inventory\ContainerType.cs" />
|
||||
|
|
|
|||
|
|
@ -725,10 +725,10 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
break;
|
||||
case PacketIncomingType.UpdateHealth:
|
||||
float health = dataTypes.ReadNextFloat(packetData);
|
||||
int Food = dataTypes.ReadNextVarInt(packetData);
|
||||
int food = dataTypes.ReadNextVarInt(packetData);
|
||||
// Food Saturation, not useful
|
||||
dataTypes.ReadNextFloat(packetData);
|
||||
handler.OnUpdateHealth(health, Food);
|
||||
handler.OnUpdateHealth(health, food);
|
||||
break;
|
||||
default:
|
||||
return false; //Ignored packet
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ namespace MinecraftClient.Protocol
|
|||
/// <param name="item">Item (may be null for empty slot)</param>
|
||||
void OnSetSlot(byte inventoryID, short slotID, Item item);
|
||||
|
||||
void OnUpdateHealth(float health, int Food);
|
||||
void OnUpdateHealth(float health, int food);
|
||||
|
||||
/// <summary>
|
||||
/// Called when the Player entity ID has been received from the server
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue