mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Merge branch 'main' into main
This commit is contained in:
commit
7d15599256
8
.gitattributes
vendored
8
.gitattributes
vendored
|
|
@ -1,8 +0,0 @@
|
||||||
*.png filter=lfs diff=lfs merge=lfs -text
|
|
||||||
*.jpg filter=lfs diff=lfs merge=lfs -text
|
|
||||||
*.ogg filter=lfs diff=lfs merge=lfs -text
|
|
||||||
*.binka filter=lfs diff=lfs merge=lfs -text
|
|
||||||
*.arc filter=lfs diff=lfs merge=lfs -text
|
|
||||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
|
||||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
|
||||||
*.ico filter=lfs diff=lfs merge=lfs -text
|
|
||||||
|
|
@ -46,6 +46,13 @@ However, we would accept changes that...
|
||||||
- Having workable multi-platform compilation for ARM, Consoles, Linux
|
- Having workable multi-platform compilation for ARM, Consoles, Linux
|
||||||
- Being a good base for further expansion and modding of LCE, such as backports and "modpacks".
|
- Being a good base for further expansion and modding of LCE, such as backports and "modpacks".
|
||||||
|
|
||||||
|
# Scope of PRs
|
||||||
|
All Pull Requests should fully document the changes they include in their file changes. They should also be limited to one general topic and not touch all over the codebase unless its justifiable.
|
||||||
|
|
||||||
|
For example, we would not accept a PR that reworks UI, multiplayer code, and furnace ticking even if its a "fixup" PR as its too difficult to review a ton of code changes that are all irrelevant from each other. However, a PR focused on adding a bunch of commands or fixes several crashes that are otherwise irrelevant to each other would be accepted.
|
||||||
|
|
||||||
|
If your PR includes any undocumented changes it will be closed.
|
||||||
|
|
||||||
# Use of AI and LLMs
|
# Use of AI and LLMs
|
||||||
We currently do not accept any new code into the project that was written largely, entirely, or even noticably by an LLM. All contributions should be made by humans that understand the codebase.
|
We currently do not accept any new code into the project that was written largely, entirely, or even noticably by an LLM. All contributions should be made by humans that understand the codebase.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -344,6 +344,7 @@ void GameRuleManager::writeRuleFile(DataOutputStream *dos)
|
||||||
// Write schematic files.
|
// Write schematic files.
|
||||||
unordered_map<wstring, ConsoleSchematicFile *> *files;
|
unordered_map<wstring, ConsoleSchematicFile *> *files;
|
||||||
files = getLevelGenerationOptions()->getUnfinishedSchematicFiles();
|
files = getLevelGenerationOptions()->getUnfinishedSchematicFiles();
|
||||||
|
dos->writeInt((int)files->size());
|
||||||
for ( auto& it : *files )
|
for ( auto& it : *files )
|
||||||
{
|
{
|
||||||
const wstring& filename = it.first;
|
const wstring& filename = it.first;
|
||||||
|
|
@ -497,17 +498,36 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
// subfile
|
// subfile
|
||||||
|
// Old saves didn't write a numFiles count before the schematic entries.
|
||||||
|
// Detect this: a real count is small, but a UTF filename prefix reads as a large int.
|
||||||
UINT numFiles = contentDis->readInt();
|
UINT numFiles = contentDis->readInt();
|
||||||
|
|
||||||
|
if (lgo->isFromSave() && numFiles > 100)
|
||||||
|
{
|
||||||
|
contentDis->skip(-4);
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
int peek = contentDis->readInt();
|
||||||
|
if (peek <= 100) { contentDis->skip(-4); break; }
|
||||||
|
contentDis->skip(-4);
|
||||||
|
|
||||||
|
wstring sFilename = contentDis->readUTF();
|
||||||
|
int length = contentDis->readInt();
|
||||||
|
byteArray ba( length );
|
||||||
|
contentDis->read(ba);
|
||||||
|
levelGenerator->loadSchematicFile(sFilename, ba.data, ba.length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
for (UINT i = 0; i < numFiles; i++)
|
for (UINT i = 0; i < numFiles; i++)
|
||||||
{
|
{
|
||||||
wstring sFilename = contentDis->readUTF();
|
wstring sFilename = contentDis->readUTF();
|
||||||
int length = contentDis->readInt();
|
int length = contentDis->readInt();
|
||||||
byteArray ba( length );
|
byteArray ba( length );
|
||||||
|
|
||||||
contentDis->read(ba);
|
contentDis->read(ba);
|
||||||
|
|
||||||
levelGenerator->loadSchematicFile(sFilename, ba.data, ba.length);
|
levelGenerator->loadSchematicFile(sFilename, ba.data, ba.length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LEVEL_GEN_ID lgoID = LEVEL_GEN_ID_NULL;
|
LEVEL_GEN_ID lgoID = LEVEL_GEN_ID_NULL;
|
||||||
|
|
|
||||||
|
|
@ -195,8 +195,8 @@ void IUIScene_HUD::renderPlayerHealth()
|
||||||
// Update health
|
// Update health
|
||||||
bool blink = pMinecraft->localplayers[iPad]->invulnerableTime / 3 % 2 == 1;
|
bool blink = pMinecraft->localplayers[iPad]->invulnerableTime / 3 % 2 == 1;
|
||||||
if (pMinecraft->localplayers[iPad]->invulnerableTime < 10) blink = false;
|
if (pMinecraft->localplayers[iPad]->invulnerableTime < 10) blink = false;
|
||||||
int currentHealth = pMinecraft->localplayers[iPad]->getHealth();
|
int currentHealth = static_cast<int>(ceil(pMinecraft->localplayers[iPad]->getHealth()));
|
||||||
int oldHealth = pMinecraft->localplayers[iPad]->lastHealth;
|
int oldHealth = static_cast<int>(ceil(pMinecraft->localplayers[iPad]->lastHealth));
|
||||||
bool bHasPoison = pMinecraft->localplayers[iPad]->hasEffect(MobEffect::poison);
|
bool bHasPoison = pMinecraft->localplayers[iPad]->hasEffect(MobEffect::poison);
|
||||||
bool bHasWither = pMinecraft->localplayers[iPad]->hasEffect(MobEffect::wither);
|
bool bHasWither = pMinecraft->localplayers[iPad]->hasEffect(MobEffect::wither);
|
||||||
AttributeInstance *maxHealthAttribute = pMinecraft->localplayers[iPad]->getAttribute(SharedMonsterAttributes::MAX_HEALTH);
|
AttributeInstance *maxHealthAttribute = pMinecraft->localplayers[iPad]->getAttribute(SharedMonsterAttributes::MAX_HEALTH);
|
||||||
|
|
|
||||||
|
|
@ -578,10 +578,13 @@ bool UIScene::handleMouseClick(F32 x, F32 y)
|
||||||
if (bestCtrl->getControlType() == UIControl::eCheckBox)
|
if (bestCtrl->getControlType() == UIControl::eCheckBox)
|
||||||
{
|
{
|
||||||
UIControl_CheckBox *cb = static_cast<UIControl_CheckBox*>(bestCtrl);
|
UIControl_CheckBox *cb = static_cast<UIControl_CheckBox*>(bestCtrl);
|
||||||
|
if (cb->IsEnabled())
|
||||||
|
{
|
||||||
bool newState = !cb->IsChecked();
|
bool newState = !cb->IsChecked();
|
||||||
cb->setChecked(newState);
|
cb->setChecked(newState);
|
||||||
handleCheckboxToggled((F64)bestId, newState);
|
handleCheckboxToggled((F64)bestId, newState);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
handlePress((F64)bestId, 0);
|
handlePress((F64)bestId, 0);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@ bool BonusChestFeature::place(Level *level, Random *random, int x, int y, int z)
|
||||||
|
|
||||||
bool BonusChestFeature::place(Level *level, Random *random, int x, int y, int z, bool force)
|
bool BonusChestFeature::place(Level *level, Random *random, int x, int y, int z, bool force)
|
||||||
{
|
{
|
||||||
|
//Will only spawn a bonus chest if the world is new and has never been saved.
|
||||||
|
if (level->isNew)
|
||||||
|
{
|
||||||
if( !force )
|
if( !force )
|
||||||
{
|
{
|
||||||
int t = 0;
|
int t = 0;
|
||||||
|
|
@ -85,4 +88,6 @@ bool BonusChestFeature::place(Level *level, Random *random, int x, int y, int z,
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -409,9 +409,14 @@ bool EnderMan::hurt(DamageSource *source, float damage)
|
||||||
setCreepy(true);
|
setCreepy(true);
|
||||||
|
|
||||||
if ( dynamic_cast<EntityDamageSource *>(source) != nullptr && source->getEntity()->instanceof(eTYPE_PLAYER))
|
if ( dynamic_cast<EntityDamageSource *>(source) != nullptr && source->getEntity()->instanceof(eTYPE_PLAYER))
|
||||||
|
{
|
||||||
|
if (!dynamic_pointer_cast<Player>(source->getEntity())->abilities.invulnerable)
|
||||||
{
|
{
|
||||||
aggroedByPlayer = true;
|
aggroedByPlayer = true;
|
||||||
}
|
}
|
||||||
|
else setCreepy(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (dynamic_cast<IndirectEntityDamageSource *>(source) != nullptr)
|
if (dynamic_cast<IndirectEntityDamageSource *>(source) != nullptr)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -515,6 +515,15 @@ bool EntityHorse::canSpawn()
|
||||||
return Animal::canSpawn();
|
return Animal::canSpawn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EntityHorse::removeWhenFarAway()
|
||||||
|
{
|
||||||
|
if (isTamed()) return false;
|
||||||
|
if (isSaddled()) return false;
|
||||||
|
if (isLeashed()) return false;
|
||||||
|
if (getArmorType() > 0) return false;
|
||||||
|
return Animal::removeWhenFarAway();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
shared_ptr<EntityHorse> EntityHorse::getClosestMommy(shared_ptr<Entity> baby, double searchRadius)
|
shared_ptr<EntityHorse> EntityHorse::getClosestMommy(shared_ptr<Entity> baby, double searchRadius)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,7 @@ private:
|
||||||
public:
|
public:
|
||||||
virtual void containerChanged();
|
virtual void containerChanged();
|
||||||
virtual bool canSpawn();
|
virtual bool canSpawn();
|
||||||
|
virtual bool removeWhenFarAway() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual shared_ptr<EntityHorse> getClosestMommy(shared_ptr<Entity> baby, double searchRadius);
|
virtual shared_ptr<EntityHorse> getClosestMommy(shared_ptr<Entity> baby, double searchRadius);
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,16 @@ bool Monster::hurt(DamageSource *source, float dmg)
|
||||||
if (rider.lock() == sourceEntity || riding == sourceEntity) return true;
|
if (rider.lock() == sourceEntity || riding == sourceEntity) return true;
|
||||||
|
|
||||||
if (sourceEntity != shared_from_this())
|
if (sourceEntity != shared_from_this())
|
||||||
|
{
|
||||||
|
if (sourceEntity->instanceof(eTYPE_PLAYER))
|
||||||
|
{
|
||||||
|
if (!dynamic_pointer_cast<Player>(sourceEntity)->abilities.invulnerable)
|
||||||
{
|
{
|
||||||
attackTarget = sourceEntity;
|
attackTarget = sourceEntity;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else attackTarget = sourceEntity;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
48
README.md
48
README.md
|
|
@ -9,7 +9,7 @@
|
||||||
This project contains the source code of Minecraft Legacy Console Edition v1.6.0560.0 (TU19) with some fixes and improvements applied.
|
This project contains the source code of Minecraft Legacy Console Edition v1.6.0560.0 (TU19) with some fixes and improvements applied.
|
||||||
|
|
||||||
## Download
|
## Download
|
||||||
Windows users can download our [Latest Build]([https://github.com/smartcmd/MinecraftConsoles/releases/tag/nightly](https://github.com/OliverLesen/MinecraftConsoles/releases))! Simply download the `.zip` file and extract it to a folder where you'd like to keep the game. You can set your username in `username.txt` (you'll have to make this file) and add servers to connect to in `servers.txt`
|
Windows users can download our [Nightly Build](https://github.com/smartcmd/MinecraftConsoles/releases/tag/nightly)! Simply download the `.zip` file and extract it to a folder where you'd like to keep the game. You can set your username in `username.txt` (you'll have to make this file)
|
||||||
|
|
||||||
## Platform Support
|
## Platform Support
|
||||||
|
|
||||||
|
|
@ -24,9 +24,49 @@ Windows users can download our [Latest Build]([https://github.com/smartcmd/Minec
|
||||||
|
|
||||||
- Skin without flag → Classic Steve model + 64x32 UV
|
- Skin without flag → Classic Steve model + 64x32 UV
|
||||||
|
|
||||||
- UI preview shows each skin correctly
|
- Hosting a multiplayer world automatically advertises it on the local network
|
||||||
|
- Other players on the same LAN can discover the session from the in-game Join Game menu
|
||||||
|
- Game connections use TCP port `25565` by default
|
||||||
|
- LAN discovery uses UDP port `25566`
|
||||||
|
- Add servers to your server list with the in-game Add Server button (temp)
|
||||||
|
- Rename yourself without losing data by keeping your `uid.dat`
|
||||||
|
|
||||||
- The menu no longer crashes the game
|
Parts of this feature are based on code from [LCEMP](https://github.com/LCEMP/LCEMP) (thanks!)
|
||||||
|
|
||||||
|
### Launch Arguments
|
||||||
|
|
||||||
|
| Argument | Description |
|
||||||
|
|--------------------|-----------------------------------------------------------------------------------------------------|
|
||||||
|
| `-name <username>` | Sets your in-game username. |
|
||||||
|
| `-fullscreen` | Launches the game in Fullscreen mode |
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
Minecraft.Client.exe -name Steve -fullscreen
|
||||||
|
```
|
||||||
|
|
||||||
|
## Controls (Keyboard & Mouse)
|
||||||
|
|
||||||
|
- **Movement**: `W` `A` `S` `D`
|
||||||
|
- **Jump / Fly (Up)**: `Space`
|
||||||
|
- **Sneak / Fly (Down)**: `Shift` (Hold)
|
||||||
|
- **Sprint**: `Ctrl` (Hold) or Double-tap `W`
|
||||||
|
- **Inventory**: `E`
|
||||||
|
- **Chat**: `T`
|
||||||
|
- **Drop Item**: `Q`
|
||||||
|
- **Crafting**: `C` Use `Q` and `E` to move through tabs (cycles Left/Right)
|
||||||
|
- **Toggle View (FPS/TPS)**: `F5`
|
||||||
|
- **Fullscreen**: `F11`
|
||||||
|
- **Pause Menu**: `Esc`
|
||||||
|
- **Attack / Destroy**: `Left Click`
|
||||||
|
- **Use / Place**: `Right Click`
|
||||||
|
- **Select Item**: `Mouse Wheel` or keys `1` to `9`
|
||||||
|
- **Accept or Decline Tutorial hints**: `Enter` to accept and `B` to decline
|
||||||
|
- **Game Info (Player list and Host Options)**: `TAB`
|
||||||
|
- **Toggle HUD**: `F1`
|
||||||
|
- **Toggle Debug Info**: `F3`
|
||||||
|
- **Open Debug Overlay**: `F4`
|
||||||
|
- **Toggle Debug Console**: `F6`
|
||||||
|
|
||||||
## Build & Run
|
## Build & Run
|
||||||
|
|
||||||
|
|
@ -34,7 +74,7 @@ Windows users can download our [Latest Build]([https://github.com/smartcmd/Minec
|
||||||
2. Clone the repository.
|
2. Clone the repository.
|
||||||
3. Open the project by double-clicking `MinecraftConsoles.sln`.
|
3. Open the project by double-clicking `MinecraftConsoles.sln`.
|
||||||
4. Make sure `Minecraft.Client` is set as the Startup Project.
|
4. Make sure `Minecraft.Client` is set as the Startup Project.
|
||||||
5. Set the build configuration to **Debug** (Release is also OK but has some bugs) and the target platform to **Windows64**, then build and run.
|
5. Set the build configuration to **Debug** (Release is also ok but missing some debug features) and the target platform to **Windows64**, then build and run.
|
||||||
|
|
||||||
### CMake (Windows x64)
|
### CMake (Windows x64)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue