mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-19 19:42:53 +00:00
6th batch of changes
This commit is contained in:
parent
2e34f54ba7
commit
d63a688bec
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
#include "..\Minecraft.World\SmoothFloat.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.player.h"
|
||||
#include "..\Minecraft.World\Pos.h"
|
||||
#include "../Minecraft.World/SmoothFloat.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.player.h"
|
||||
#include "../Minecraft.World/Pos.h"
|
||||
class Level;
|
||||
class User;
|
||||
class CompoundTag;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#pragma once
|
||||
using namespace std;
|
||||
#include "..\Minecraft.World\HashExtension.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.level.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.h"
|
||||
#include "..\Minecraft.World\JavaIntHash.h"
|
||||
#include "../Minecraft.World/HashExtension.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.level.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.h"
|
||||
#include "../Minecraft.World/JavaIntHash.h"
|
||||
|
||||
class ClientConnection;
|
||||
class MultiPlayerChunkCache;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include "LocalPlayer.h"
|
||||
#include "..\Minecraft.World\SharedConstants.h"
|
||||
#include "../Minecraft.World/SharedConstants.h"
|
||||
|
||||
class ClientConnection;
|
||||
class Minecraft;
|
||||
|
|
|
|||
|
|
@ -1992,6 +1992,7 @@ target_compile_options(${PROJECT_NAME} PRIVATE
|
|||
-fpermissive
|
||||
-Wtemplate-body
|
||||
-Wshift-count-overflow
|
||||
-pthread
|
||||
-std=c++11
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -17,14 +17,17 @@
|
|||
#include "EntityPos.h"
|
||||
#include "Entity.h"
|
||||
#include "SoundTypes.h"
|
||||
#include "..\minecraft.Client\HumanoidModel.h"
|
||||
#include "..\Minecraft.Client\MinecraftServer.h"
|
||||
#include "..\Minecraft.Client\MultiPlayerLevel.h"
|
||||
#include "..\Minecraft.Client\MultiplayerLocalPlayer.h"
|
||||
#include "../Minecraft.Client/HumanoidModel.h"
|
||||
#include "../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../Minecraft.Client/MultiPlayerLevel.h"
|
||||
#include "../Minecraft.Client/MultiPlayerLocalPlayer.h"
|
||||
#include "../Minecraft.Client/Windows64/Windows64_App.h"
|
||||
|
||||
|
||||
int Entity::entityCounter = 2048; // 4J - changed initialiser to 2048, as we are using range 0 - 2047 as special unique smaller ids for things that need network tracked
|
||||
#ifdef _WIN32
|
||||
DWORD Entity::tlsIdx = TlsAlloc();
|
||||
#endif // _WIN32
|
||||
|
||||
// 4J - added getSmallId & freeSmallId methods
|
||||
unsigned int Entity::entityIdUsedFlags[2048/32] = {0};
|
||||
|
|
@ -44,7 +47,12 @@ int Entity::getSmallId()
|
|||
// for final notification to the client that the entities are removed. We can't go re-using these small Ids yet, as otherwise we will
|
||||
// potentially end up telling the client that the entity has been removed After we have already re-used its Id and created a new entity.
|
||||
// This ends up with newly created client-side entities being removed by accident, causing invisible mobs.
|
||||
#ifdef _WIN32
|
||||
if( ((size_t)TlsGetValue(tlsIdx) != 0 ) )
|
||||
#else
|
||||
pthread_key_create(&tlsKey, nullptr);
|
||||
if ( ((size_t)pthread_getspecific(tlsKey) != 0) )
|
||||
#endif
|
||||
{
|
||||
MinecraftServer *server = MinecraftServer::getInstance();
|
||||
if( server )
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using namespace std;
|
|||
#include "FloatTag.h"
|
||||
#include "Vec3.h"
|
||||
#include "Definitions.h"
|
||||
#include <pthread.h>
|
||||
|
||||
class Mob;
|
||||
class LightningBolt;
|
||||
|
|
@ -365,7 +366,11 @@ private:
|
|||
static int extraWanderIds[EXTRA_WANDER_MAX];
|
||||
static int extraWanderCount;
|
||||
static int extraWanderTicks;
|
||||
#if defined(_WIN32)
|
||||
static DWORD tlsIdx;
|
||||
#else
|
||||
static pthread_key_t tlsKey;
|
||||
#endif
|
||||
public:
|
||||
static void tickExtraWandering();
|
||||
static void countFlagsForPIX();
|
||||
|
|
|
|||
Loading…
Reference in a new issue