Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
441 changes: 224 additions & 217 deletions data/mcswitch_functions.csv

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/DecompUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

// this can be depracated if musl is fixed

inline __attribute__((__always_inline__)) float decomp_fmax1(float x, float y) {
__asm__("fmax %s0, %s1, %s2" : "=w"(x) : "w"(x), "w"(y));
return x;
}

inline __attribute__((__always_inline__)) float decomp_fmax(float x, float y) {
__asm__("fmaxnm %s0, %s1, %s2" : "=w"(x) : "w"(x), "w"(y));
return x;
Expand Down
2 changes: 1 addition & 1 deletion src/Minecraft.Client/net/minecraft/client/Minecraft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "net/minecraft/client/gui/screens/TitleScreen.h"
#include "net/minecraft/client/multiplayer/ClientPacketListener.h"
#include "net/minecraft/client/particle/ParticleEngine.h"
#include "net/minecraft/client/particle/ParticleType.h"
#include "net/minecraft/client/renderer/GameRenderer.h"
#include "net/minecraft/client/renderer/LevelRenderer.h"
#include "net/minecraft/client/renderer/ProgressRenderer.h"
Expand All @@ -35,7 +36,6 @@
#include "net/minecraft/client/ui/scene/scenes/UIScene_CreativeMenu.h"
#include "net/minecraft/client/ui/scene/scenes/UIScene_LeaderboardsMenu.h"
#include "net/minecraft/core/System.h"
#include "net/minecraft/core/particles/ParticleType.h"
#include "net/minecraft/stats/Stats.h"
#include "net/minecraft/stats/StatsCounter.h"
#include "net/minecraft/util/datafix/DataFixers.h"
Expand Down
43 changes: 23 additions & 20 deletions src/Minecraft.Client/net/minecraft/client/particle/ParticleType.cpp
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
#include "net/minecraft/client/particle/ParticleType.h"

#include "net/minecraft/client/particle/ParticleTypes.h"
#include "net/minecraft/world/level/LevelListener.h"

ParticleType ParticleType::EXPLODE = ParticleType("explode", ePARTICLE_TYPE_Explode, true, 0);
ParticleType ParticleType::SPIT = ParticleType("spit", ePARTICLE_TYPE_Spit, true, 0);
ParticleType ParticleType::BUBBLE = ParticleType("bubble", ePARTICLE_TYPE_Bubble, false, 0);
ParticleType ParticleType::SPLASH = ParticleType("splash", ePARTICLE_TYPE_Splash, false, 0);
ParticleType ParticleType::WAKE = ParticleType("wake", ePARTICLE_TYPE_Wake, false, 0);
ParticleType ParticleType::DROPLET = ParticleType("droplet", ePARTICLE_TYPE_Droplet, false, 0);
ParticleType ParticleType::SUSPENDED = ParticleType("suspended", ePARTICLE_TYPE_Suspended, false, 0);
ParticleType ParticleType::DEPTHSUSPEND = ParticleType("depthsuspend", ePARTICLE_TYPE_Depthsuspend, false, 0);
ParticleType ParticleType::CRIT = ParticleType("crit", ePARTICLE_TYPE_Crit, false, 0);
ParticleType ParticleType::MAGIC_CRIT = ParticleType("magicCrit", ePARTICLE_TYPE_MagicCrit, false, 0);
ParticleType ParticleType::SMOKE = ParticleType("smoke", ePARTICLE_TYPE_Smoke, false, 0);
ParticleType ParticleType::LARGE_SMOKE = ParticleType("largesmoke", ePARTICLE_TYPE_LargeSmoke, false, 0);
ParticleType ParticleType::SPELL = ParticleType("spell", ePARTICLE_TYPE_Spell, false, 0);
ParticleType ParticleType::INSTANT_SPELL
= ParticleType("instantSpell", ePARTICLE_TYPE_InstantSpell, false, 0);
ParticleType* ParticleTypes::EXPLODE = new ParticleType("explode", ePARTICLE_TYPE_Explode, true, 0);
ParticleType* ParticleTypes::SPIT = new ParticleType("spit", ePARTICLE_TYPE_Spit, true, 0);
ParticleType* ParticleTypes::BUBBLE = new ParticleType("bubble", ePARTICLE_TYPE_Bubble, false, 0);
ParticleType* ParticleTypes::SPLASH = new ParticleType("splash", ePARTICLE_TYPE_Splash, false, 0);
ParticleType* ParticleTypes::WAKE = new ParticleType("wake", ePARTICLE_TYPE_Wake, false, 0);
ParticleType* ParticleTypes::DROPLET = new ParticleType("droplet", ePARTICLE_TYPE_Droplet, false, 0);
ParticleType* ParticleTypes::SUSPENDED = new ParticleType("suspended", ePARTICLE_TYPE_Suspended, false, 0);
ParticleType* ParticleTypes::DEPTHSUSPEND
= new ParticleType("depthsuspend", ePARTICLE_TYPE_Depthsuspend, false, 0);
ParticleType* ParticleTypes::CRIT = new ParticleType("crit", ePARTICLE_TYPE_Crit, false, 0);
ParticleType* ParticleTypes::MAGIC_CRIT = new ParticleType("magicCrit", ePARTICLE_TYPE_MagicCrit, false, 0);
ParticleType* ParticleTypes::SMOKE = new ParticleType("smoke", ePARTICLE_TYPE_Smoke, false, 0);
ParticleType* ParticleTypes::LARGE_SMOKE
= new ParticleType("largesmoke", ePARTICLE_TYPE_LargeSmoke, false, 0);
ParticleType* ParticleTypes::SPELL = new ParticleType("spell", ePARTICLE_TYPE_Spell, false, 0);
ParticleType* ParticleTypes::INSTANT_SPELL
= new ParticleType("instantSpell", ePARTICLE_TYPE_InstantSpell, false, 0);

ParticleType::ParticleType(const std::string name, ePARTICLE_TYPE id, bool unk1, int unk2) {
mName = name;
mId = id;
mUnk1 = unk1;
mUnk2 = unk2;
this->mName = name;
this->mId = id;
this->mUnk1 = unk1;
this->mUnk2 = unk2;
}

ePARTICLE_TYPE ParticleType::getId() const {
return mId;
return this->mId;
}
17 changes: 2 additions & 15 deletions src/Minecraft.Client/net/minecraft/client/particle/ParticleType.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,13 @@ class ParticleType {
public:
ParticleType(const std::string, ePARTICLE_TYPE, bool, int);

static void staticCtor();

ePARTICLE_TYPE getId() const;

std::string mName;
ePARTICLE_TYPE mId;
bool mUnk1;
char idk[3];
int mUnk2;

static ParticleType EXPLODE;
static ParticleType SPIT;
static ParticleType BUBBLE;
static ParticleType SPLASH;
static ParticleType WAKE;
static ParticleType DROPLET;
static ParticleType SUSPENDED;
static ParticleType DEPTHSUSPEND;
static ParticleType CRIT;
static ParticleType MAGIC_CRIT;
static ParticleType SMOKE;
static ParticleType LARGE_SMOKE;
static ParticleType SPELL;
static ParticleType INSTANT_SPELL;
};
23 changes: 23 additions & 0 deletions src/Minecraft.Client/net/minecraft/client/particle/ParticleTypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once

#include "net/minecraft/client/particle/ParticleType.h"

class ParticleTypes {
public:
static ParticleType* SMOKE;
static ParticleType* LARGE_SMOKE;
static ParticleType* FALLING_DUST;
static ParticleType* HAPPY_VILLAGER;
static ParticleType* EXPLODE;
static ParticleType* SPIT;
static ParticleType* BUBBLE;
static ParticleType* SPLASH;
static ParticleType* WAKE;
static ParticleType* DROPLET;
static ParticleType* SUSPENDED;
static ParticleType* DEPTHSUSPEND;
static ParticleType* CRIT;
static ParticleType* MAGIC_CRIT;
static ParticleType* SPELL;
static ParticleType* INSTANT_SPELL;
};
1 change: 1 addition & 0 deletions src/Minecraft.Client/net/minecraft/core/Vec3i.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Vec3i {
int getX() const;
int getY() const;
int getZ() const;
double distSqr(const Vec3i&) const;

int x;
int y;
Expand Down

This file was deleted.

10 changes: 0 additions & 10 deletions src/Minecraft.Client/net/minecraft/core/particles/ParticleTypes.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
template <typename T>
class EntityDataSerializer;

class EntityDataAccessor_Base {};
class EntityDataAccessor_Base {
public:
bool is(const EntityDataAccessor_Base*) const;
};

template <typename T>
class EntityDataAccessor : public EntityDataAccessor_Base {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,11 @@ class SynchedEntityData {
// defineId<bool>(a1, a2, nullptr);
}

template <typename T>
void set(const EntityDataAccessor<T>*, T, bool);

template <typename T>
T get(const EntityDataAccessor<T>*);

void* padding[0x101];
};
10 changes: 6 additions & 4 deletions src/Minecraft.World/net/minecraft/world/MinecraftWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "net/minecraft/util/datafix/walker/ItemInstanceBlockEntityTagWalker.h"
#include "net/minecraft/world/DefaultVertexFormat.h"
#include "net/minecraft/world/DispenserBootstrap.h"
#include "net/minecraft/world/eINSTANCEOF.h"
#include "net/minecraft/world/effect/MobEffect.h"
#include "net/minecraft/world/effect/MobEffects.h"
#include "net/minecraft/world/entity/EntityIO.h"
Expand Down Expand Up @@ -177,7 +178,8 @@ void MinecraftWorld_RunStaticCtors() {
LivingEntity::staticCtor();
ArmorStand::staticCtor();
Mob::staticCtor();
SynchedEntityData::defineId(eMob, eUnknownMob); // I wonder if these just register categories or whatever
SynchedEntityData::defineId(eMob,
ePathfinderMob); // I wonder if these just register categories or whatever
AgableMob::staticCtor();
Animal::staticCtor();
Villager::staticCtor();
Expand All @@ -190,18 +192,18 @@ void MinecraftWorld_RunStaticCtors() {
AbstractChestedHorse::staticCtor();
Horse::staticCtor();
Llama::staticCtor();
SynchedEntityData::defineId(eAnimal, eUnknownAnimal);
SynchedEntityData::defineId(eAnimal, eTamableAnimal);
Parrot::staticCtor();
Sheep::staticCtor();
Pig::staticCtor();
Chicken::staticCtor();
Rabbit::staticCtor();
PolarBear::staticCtor();
SynchedEntityData::defineId(eUnknownMob, eGolem);
SynchedEntityData::defineId(ePathfinderMob, eGolem);
SnowMan::staticCtor();
VillagerGolem::staticCtor();
Shulker::staticCtor();
SynchedEntityData::defineId(eUnknownMob, eMonster);
SynchedEntityData::defineId(ePathfinderMob, eMonster);
Spider::staticCtor();
Zombie::staticCtor();
ZombieVillager::staticCtor();
Expand Down
6 changes: 3 additions & 3 deletions src/Minecraft.World/net/minecraft/world/eINSTANCEOF.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,16 @@ enum eINSTANCEOF {
eAmbientCreature = 0x0D004000,
eWaterCreature = 0x0D102000,
eSquid = 0x0D102001,
eUnknownMob = 0x0D400000,
eGolem = 0x0D580000, // GUESSED
ePathfinderMob = 0x0D400000, // GUESSED
eGolem = 0x0D580000, // GUESSED
eVillagerGolem = 0x0D580002,
eAgableMob = 0x0D600000,
eVillager = 0x0D600001,
eAnimal = 0x0D680000,
eChicken = 0x0D680004,
eAbstractHorse = 0x0D690000,
eAbstractChestedHorse = 0x0D698000,
eUnknownAnimal = 0x0D6C0000,
eTamableAnimal = 0x0D6C0000,
eWolf = 0x0D6C0002,
eBat = 0x1D004001,
eCreature = 0x20000000,
Expand Down
8 changes: 5 additions & 3 deletions src/Minecraft.World/net/minecraft/world/entity/Entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ class Entity : public std::enable_shared_from_this<Entity>, public CommandSender
virtual void handleEntityEvent(unsigned char, int);
virtual void animateHurt();
virtual void getHandSlots();
virtual void getArmorSlots();
virtual void getAllSlots();
virtual NonNullList<not_null_ptr<ItemInstance>> getArmorSlots();
virtual NonNullList<not_null_ptr<ItemInstance>> getAllSlots();
virtual void setItemSlot(const EquipmentSlot*, not_null_ptr<ItemInstance>);
virtual bool isOnFire();
virtual bool isPassenger();
Expand Down Expand Up @@ -276,7 +276,7 @@ class Entity : public std::enable_shared_from_this<Entity>, public CommandSender
virtual bool isCreative();
virtual bool isDespawnProtected();
virtual void setDespawnProtected();
virtual void couldWander();
virtual bool couldWander();
virtual void canCreateParticles();
virtual void stopCurrentLerp();
virtual bool PositionLocked();
Expand All @@ -302,6 +302,8 @@ class Entity : public std::enable_shared_from_this<Entity>, public CommandSender
void moveRelative(float, float, float, float);
bool isFree(double, double, double);
void fjCheckDerivedConstruction();
bool isExtraWanderingEnabled();
float distanceTo(std::shared_ptr<Entity>);

int mId;
bool mBlocksBuilding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void LivingEntity::dropDeathLoot(bool, int) {}
void LivingEntity::hurtArmor(float) {}
void LivingEntity::hurtCurrentlyUsedShield(float) {}

// NON_MATCHING: a lot of stuff
void LivingEntity::travel(float x, float y, float z) {
Player* player = this->isType(ePlayer) ? (Player*)this : nullptr;
if (this->PositionLocked()) {
Expand Down
2 changes: 2 additions & 0 deletions src/Minecraft.World/net/minecraft/world/entity/LivingEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class LivingEntity : public Entity {
void lerpTo(double, double, double, float, float, int, bool) override;
void handleEntityEvent(unsigned char, int) override;
void animateHurt() override;
virtual NonNullList<not_null_ptr<ItemInstance>> getArmorSlots() = 0;
virtual void setItemSlot(const EquipmentSlot*, not_null_ptr<ItemInstance>) = 0;
void setSprinting(bool) override;
Team* getTeam() override;
void spawnEatParticles(const ItemInstance&, int) override;
Expand Down
6 changes: 6 additions & 0 deletions src/Minecraft.World/net/minecraft/world/entity/ai/Path.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

class Path {
public:
~Path();
};
29 changes: 29 additions & 0 deletions src/Minecraft.World/net/minecraft/world/entity/ai/PathNavigation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#pragma once

#include <memory>

class Path;
class Entity;
class BlockPos;

class PathNavigation {
public:
virtual ~PathNavigation();
virtual void pure_virt1() = 0;
virtual void createPath(const BlockPos& pos);
virtual void createPath(std::shared_ptr<Entity> entity);
virtual void moveTo(double x, double y, double z, double speed);
virtual void moveTo(std::shared_ptr<Entity> entity, double speed);
virtual void moveTo(Path* path, double speed);
virtual void tick();
virtual bool shouldAvoidSun() const;
virtual void updatePath();
virtual void pure_virt2() = 0;
virtual void pure_virt3() = 0;
virtual void trimPath();
virtual void pure_virt4() = 0;
virtual void getNodeEvaluator();
virtual bool isStableDestination(const BlockPos& pos);

bool isDone();
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
class GoalSelector {
public:
class InternalGoal {};

void disableControlFlag(int);
void enableControlFlag(int);

std::vector<GoalSelector::InternalGoal> internalGoals1;
std::vector<GoalSelector::InternalGoal> internalGoals2;
void* qword30;
Expand Down
Loading