mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
nuke Minecraft.World stdafx.h
This commit is contained in:
parent
70e93e57c3
commit
1ce8413cfa
|
|
@ -48,6 +48,8 @@
|
||||||
#include "Minecraft.Client/Common/Source Files/Localisation/StringTable.h"
|
#include "Minecraft.Client/Common/Source Files/Localisation/StringTable.h"
|
||||||
#include "Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.h"
|
#include "Minecraft.Client/Common/Source Files/UI/All Platforms/ArchiveFile.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/Minecraft.h"
|
#include "Minecraft.Client/net/minecraft/client/Minecraft.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/Leaderboards/LeaderboardManager.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/Colours/ColourTable.h"
|
||||||
|
|
||||||
#include "4J_Input.h"
|
#include "4J_Input.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/gui/Gui.h"
|
#include "Minecraft.Client/net/minecraft/client/gui/Gui.h"
|
||||||
|
|
@ -63,7 +65,6 @@
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
#include "Minecraft.Client/Common/Source Files/Leaderboards/LeaderboardManager.h"
|
|
||||||
|
|
||||||
// CMinecraftApp app;
|
// CMinecraftApp app;
|
||||||
unsigned int CMinecraftApp::m_uiLastSignInData = 0;
|
unsigned int CMinecraftApp::m_uiLastSignInData = 0;
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/entity/Mob.h"
|
#include "Minecraft.World/net/minecraft/world/entity/Mob.h"
|
||||||
#include "java/Random.h"
|
#include "java/Random.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/Minecraft.h"
|
#include "Minecraft.Client/net/minecraft/client/Minecraft.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
#define STB_VORBIS_HEADER_ONLY
|
#define STB_VORBIS_HEADER_ONLY
|
||||||
|
|
|
||||||
|
|
@ -82,18 +82,18 @@ void ApplySchematicRuleDefinition::addAttribute(
|
||||||
}
|
}
|
||||||
} else if (attributeName.compare(L"x") == 0) {
|
} else if (attributeName.compare(L"x") == 0) {
|
||||||
m_location.x = _fromString<int>(attributeValue);
|
m_location.x = _fromString<int>(attributeValue);
|
||||||
if (((int)abs(m_location.x)) % 2 != 0) m_location.x -= 1;
|
if (((int)std::abs(m_location.x)) % 2 != 0) m_location.x -= 1;
|
||||||
// app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter
|
// app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter
|
||||||
// x=%f\n",m_location->x);
|
// x=%f\n",m_location->x);
|
||||||
} else if (attributeName.compare(L"y") == 0) {
|
} else if (attributeName.compare(L"y") == 0) {
|
||||||
m_location.y = _fromString<int>(attributeValue);
|
m_location.y = _fromString<int>(attributeValue);
|
||||||
if (((int)abs(m_location.y)) % 2 != 0) m_location.y -= 1;
|
if (((int)std::abs(m_location.y)) % 2 != 0) m_location.y -= 1;
|
||||||
if (m_location.y < 0) m_location.y = 0;
|
if (m_location.y < 0) m_location.y = 0;
|
||||||
// app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter
|
// app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter
|
||||||
// y=%f\n",m_location->y);
|
// y=%f\n",m_location->y);
|
||||||
} else if (attributeName.compare(L"z") == 0) {
|
} else if (attributeName.compare(L"z") == 0) {
|
||||||
m_location.z = _fromString<int>(attributeValue);
|
m_location.z = _fromString<int>(attributeValue);
|
||||||
if (((int)abs(m_location.z)) % 2 != 0) m_location.z -= 1;
|
if (((int)std::abs(m_location.z)) % 2 != 0) m_location.z -= 1;
|
||||||
// app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter
|
// app.DebugPrintf("ApplySchematicRuleDefinition: Adding parameter
|
||||||
// z=%f\n",m_location->z);
|
// z=%f\n",m_location->z);
|
||||||
} else if (attributeName.compare(L"rot") == 0) {
|
} else if (attributeName.compare(L"rot") == 0) {
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,12 @@
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#include "Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
|
|
||||||
#include "Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeature.h"
|
#include "Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeature.h"
|
||||||
|
|
||||||
|
#include "Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/GameRuleDefinition.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/Localisation/StringTable.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/DLC/DLCPack.h"
|
||||||
|
|
||||||
class ApplySchematicRuleDefinition;
|
class ApplySchematicRuleDefinition;
|
||||||
class LevelChunk;
|
class LevelChunk;
|
||||||
class ConsoleGenerateStructure;
|
class ConsoleGenerateStructure;
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
#include "Minecraft.Client/Common/Source Files/Tutorial/Hints/AreaHint.h"
|
#include "Minecraft.Client/Common/Source Files/Tutorial/Hints/AreaHint.h"
|
||||||
#include "FullTutorial.h"
|
#include "FullTutorial.h"
|
||||||
#include "Minecraft.Client/Common/Source Files/Tutorial/Constraints/TutorialConstraints.h"
|
#include "Minecraft.Client/Common/Source Files/Tutorial/Constraints/TutorialConstraints.h"
|
||||||
|
#include "Minecraft.Client/Common/Potion_Macros.h"
|
||||||
|
|
||||||
FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/)
|
FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/)
|
||||||
: Tutorial(iPad, true) {
|
: Tutorial(iPad, true) {
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
#include "Minecraft.Client/Common/Source Files/Tutorial/Tasks/TutorialTasks.h"
|
#include "Minecraft.Client/Common/Source Files/Tutorial/Tasks/TutorialTasks.h"
|
||||||
#include "Minecraft.Client/Common/Source Files/Tutorial/Constraints/TutorialConstraints.h"
|
#include "Minecraft.Client/Common/Source Files/Tutorial/Constraints/TutorialConstraints.h"
|
||||||
#include "Minecraft.Client/Common/Source Files/Tutorial/Hints/TutorialHints.h"
|
#include "Minecraft.Client/Common/Source Files/Tutorial/Hints/TutorialHints.h"
|
||||||
|
#include "Minecraft.World/ConsoleHelpers/StringHelpers.h"
|
||||||
|
|
||||||
std::vector<int> Tutorial::s_completableTasks;
|
std::vector<int> Tutorial::s_completableTasks;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/stats/net.minecraft.stats.h"
|
#include "Minecraft.World/net/minecraft/stats/net.minecraft.stats.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/player/LocalPlayer.h"
|
#include "Minecraft.Client/net/minecraft/client/player/LocalPlayer.h"
|
||||||
#include "IUIScene_CraftingMenu.h"
|
#include "IUIScene_CraftingMenu.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/Console_Debug_enum.h"
|
||||||
|
|
||||||
Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeMapping4GridA
|
Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeMapping4GridA
|
||||||
[IUIScene_CraftingMenu::m_iMaxGroup2x2] = {
|
[IUIScene_CraftingMenu::m_iMaxGroup2x2] = {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h"
|
#include "Minecraft.World/net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h"
|
#include "Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h"
|
#include "Minecraft.World/net/minecraft/world/entity/animal/net.minecraft.world.entity.animal.h"
|
||||||
|
#include "Minecraft.Client/Common/Potion_Macros.h"
|
||||||
#include "java/JavaMath.h"
|
#include "java/JavaMath.h"
|
||||||
|
|
||||||
// 4J JEV - Images for each tab.
|
// 4J JEV - Images for each tab.
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ void UIScene_MainMenu::customDrawSplash(IggyCustomDrawCallbackRegion* region) {
|
||||||
glTranslatef(xo, yo, 0);
|
glTranslatef(xo, yo, 0);
|
||||||
|
|
||||||
glRotatef(-17, 0, 0, 1);
|
glRotatef(-17, 0, 0, 1);
|
||||||
float sss = 1.8f - Mth::abs(sinf(System::currentTimeMillis() % 1000 /
|
float sss = 1.8f - std::abs(sinf(System::currentTimeMillis() % 1000 /
|
||||||
1000.0f * std::numbers::pi * 2) *
|
1000.0f * std::numbers::pi * 2) *
|
||||||
0.1f);
|
0.1f);
|
||||||
sss *= (m_fScreenWidth / m_fRawWidth);
|
sss *= (m_fScreenWidth / m_fRawWidth);
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
#include "Minecraft.Client/net/minecraft/client/renderer/entity/EnderDragonRenderer.h"
|
#include "Minecraft.Client/net/minecraft/client/renderer/entity/EnderDragonRenderer.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h"
|
#include "Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLocalPlayer.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/title/TitleScreen.h"
|
#include "Minecraft.Client/net/minecraft/client/title/TitleScreen.h"
|
||||||
|
#include "Minecraft.World/ConsoleHelpers/PerformanceTimer.h"
|
||||||
#include "UIFontData.h"
|
#include "UIFontData.h"
|
||||||
#include "4J_Input.h"
|
#include "4J_Input.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,10 @@
|
||||||
#include "Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerGameMode.h"
|
#include "Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerGameMode.h"
|
||||||
#include "Minecraft.Client/Common/Source Files/DLC/DLCPack.h"
|
#include "Minecraft.Client/Common/Source Files/DLC/DLCPack.h"
|
||||||
#include "Minecraft.Client/Common/Source Files/ConsoleGameMode.h"
|
#include "Minecraft.Client/Common/Source Files/ConsoleGameMode.h"
|
||||||
|
#include "Minecraft.World/ConsoleHelpers/StringHelpers.h"
|
||||||
|
#include "Minecraft.Client/Common/Potion_Macros.h"
|
||||||
|
#include "Minecraft.Client/Common/Minecraft_Macros.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/Colours/ColourTable.h"
|
||||||
#include "4J_Input.h"
|
#include "4J_Input.h"
|
||||||
|
|
||||||
// #define DISABLE_SPU_CODE
|
// #define DISABLE_SPU_CODE
|
||||||
|
|
@ -3557,9 +3561,9 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) {
|
||||||
// Level::animateTickDoWork() so we can take into account multiple
|
// Level::animateTickDoWork() so we can take into account multiple
|
||||||
// players in the one level.
|
// players in the one level.
|
||||||
if (!pause && levels[i] != nullptr)
|
if (!pause && levels[i] != nullptr)
|
||||||
levels[i]->animateTick(Mth::floor(player->x),
|
levels[i]->animateTick(std::floor(player->x),
|
||||||
Mth::floor(player->y),
|
std::floor(player->y),
|
||||||
Mth::floor(player->z));
|
std::floor(player->z));
|
||||||
|
|
||||||
if (levelsTickedFlags & (1 << i))
|
if (levelsTickedFlags & (1 << i))
|
||||||
continue; // Don't tick further if we've already ticked this
|
continue; // Don't tick further if we've already ticked this
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
#include "Minecraft.Client/net/minecraft/client/gui/ScreenSizeCalculator.h"
|
#include "Minecraft.Client/net/minecraft/client/gui/ScreenSizeCalculator.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/ClientConstants.h"
|
#include "Minecraft.Client/net/minecraft/client/ClientConstants.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerGameMode.h"
|
#include "Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerGameMode.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
ResourceLocation Gui::PUMPKIN_BLUR_LOCATION =
|
ResourceLocation Gui::PUMPKIN_BLUR_LOCATION =
|
||||||
ResourceLocation(TN__BLUR__MISC_PUMPKINBLUR);
|
ResourceLocation(TN__BLUR__MISC_PUMPKINBLUR);
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,7 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot,
|
||||||
is = is * is * is;
|
is = is * is * is;
|
||||||
is = is * is * is;
|
is = is * is * is;
|
||||||
float iss = 1 - is;
|
float iss = 1 - is;
|
||||||
arm0->xRot = -Mth::abs(cosf(eating_t / 4.0f * std::numbers::pi) * 0.1f) *
|
arm0->xRot = -std::abs(cosf(eating_t / 4.0f * std::numbers::pi) * 0.1f) *
|
||||||
(eating_swing > 0.2 ? 1.0f : 0.0f) *
|
(eating_swing > 0.2 ? 1.0f : 0.0f) *
|
||||||
2.0f; // This factor is the chomping bit (conditional
|
2.0f; // This factor is the chomping bit (conditional
|
||||||
// factor is so that he doesn't eat whilst the
|
// factor is so that he doesn't eat whilst the
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/entity/LivingEntity.h"
|
#include "Minecraft.World/net/minecraft/world/entity/LivingEntity.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.h"
|
#include "Minecraft.World/net/minecraft/world/entity/animal/EntityHorse.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/model/geom/Model.h"
|
#include "Minecraft.Client/net/minecraft/client/model/geom/Model.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
ModelHorse::ModelHorse() {
|
ModelHorse::ModelHorse() {
|
||||||
texWidth = 128;
|
texWidth = 128;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#include "VillagerModel.h"
|
#include "VillagerModel.h"
|
||||||
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/entity/Entity.h"
|
#include "Minecraft.World/net/minecraft/world/entity/Entity.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
WitchModel::WitchModel(float g) : VillagerModel(g, 0, 64, 128) {
|
WitchModel::WitchModel(float g) : VillagerModel(g, 0, 64, 128) {
|
||||||
mole = (new ModelPart(this))->setTexSize(64, 128);
|
mole = (new ModelPart(this))->setTexSize(64, 128);
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@
|
||||||
#include "Minecraft.Client/Common/Source Files/Tutorial/TutorialMode.h"
|
#include "Minecraft.Client/Common/Source Files/Tutorial/TutorialMode.h"
|
||||||
#include "Minecraft.Client/Common/Source Files/Tutorial/FullTutorialMode.h"
|
#include "Minecraft.Client/Common/Source Files/Tutorial/FullTutorialMode.h"
|
||||||
#include "Minecraft.Client/Common/Source Files/DLC/DLCPack.h"
|
#include "Minecraft.Client/Common/Source Files/DLC/DLCPack.h"
|
||||||
|
#include "Minecraft.World/ConsoleHelpers/StringHelpers.h"
|
||||||
#include "4J_Input.h"
|
#include "4J_Input.h"
|
||||||
|
|
||||||
ClientConnection::ClientConnection(Minecraft* minecraft, const std::wstring& ip,
|
ClientConnection::ClientConnection(Minecraft* minecraft, const std::wstring& ip,
|
||||||
|
|
@ -2579,9 +2580,9 @@ void ClientConnection::handleContainerOpen(
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case ContainerOpenPacket::WORKBENCH: {
|
case ContainerOpenPacket::WORKBENCH: {
|
||||||
if (player->startCrafting(Mth::floor(player->x),
|
if (player->startCrafting(std::floor(player->x),
|
||||||
Mth::floor(player->y),
|
std::floor(player->y),
|
||||||
Mth::floor(player->z))) {
|
std::floor(player->z))) {
|
||||||
player->containerMenu->containerId = packet->containerId;
|
player->containerMenu->containerId = packet->containerId;
|
||||||
} else {
|
} else {
|
||||||
failed = true;
|
failed = true;
|
||||||
|
|
@ -2589,8 +2590,8 @@ void ClientConnection::handleContainerOpen(
|
||||||
} break;
|
} break;
|
||||||
case ContainerOpenPacket::ENCHANTMENT: {
|
case ContainerOpenPacket::ENCHANTMENT: {
|
||||||
if (player->startEnchanting(
|
if (player->startEnchanting(
|
||||||
Mth::floor(player->x), Mth::floor(player->y),
|
std::floor(player->x), std::floor(player->y),
|
||||||
Mth::floor(player->z),
|
std::floor(player->z),
|
||||||
packet->customName ? packet->title : L"")) {
|
packet->customName ? packet->title : L"")) {
|
||||||
player->containerMenu->containerId = packet->containerId;
|
player->containerMenu->containerId = packet->containerId;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -2621,9 +2622,9 @@ void ClientConnection::handleContainerOpen(
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case ContainerOpenPacket::REPAIR_TABLE: {
|
case ContainerOpenPacket::REPAIR_TABLE: {
|
||||||
if (player->startRepairing(Mth::floor(player->x),
|
if (player->startRepairing(std::floor(player->x),
|
||||||
Mth::floor(player->y),
|
std::floor(player->y),
|
||||||
Mth::floor(player->z))) {
|
std::floor(player->z))) {
|
||||||
player->containerMenu->containerId = packet->containerId;
|
player->containerMenu->containerId = packet->containerId;
|
||||||
} else {
|
} else {
|
||||||
failed = true;
|
failed = true;
|
||||||
|
|
@ -2655,9 +2656,9 @@ void ClientConnection::handleContainerOpen(
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case ContainerOpenPacket::FIREWORKS: {
|
case ContainerOpenPacket::FIREWORKS: {
|
||||||
if (player->openFireworks(Mth::floor(player->x),
|
if (player->openFireworks(std::floor(player->x),
|
||||||
Mth::floor(player->y),
|
std::floor(player->y),
|
||||||
Mth::floor(player->z))) {
|
std::floor(player->z))) {
|
||||||
player->containerMenu->containerId = packet->containerId;
|
player->containerMenu->containerId = packet->containerId;
|
||||||
} else {
|
} else {
|
||||||
failed = true;
|
failed = true;
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ void MultiplayerLocalPlayer::tick() {
|
||||||
);
|
);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if (!level->hasChunkAt(Mth::floor(x), 0, Mth::floor(z))) return;
|
if (!level->hasChunkAt(std::floor(x), 0, std::floor(z))) return;
|
||||||
|
|
||||||
double tempX = x, tempY = y, tempZ = z;
|
double tempX = x, tempY = y, tempZ = z;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ void BubbleParticle::tick() {
|
||||||
yd *= 0.85f;
|
yd *= 0.85f;
|
||||||
zd *= 0.85f;
|
zd *= 0.85f;
|
||||||
|
|
||||||
if (level->getMaterial(Mth::floor(x), Mth::floor(y), Mth::floor(z)) !=
|
if (level->getMaterial(std::floor(x), std::floor(y), std::floor(z)) !=
|
||||||
Material::water)
|
Material::water)
|
||||||
remove();
|
remove();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,11 +123,11 @@ void DripParticle::tick() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Material* m =
|
Material* m =
|
||||||
level->getMaterial(Mth::floor(x), Mth::floor(y), Mth::floor(z));
|
level->getMaterial(std::floor(x), std::floor(y), std::floor(z));
|
||||||
if (m->isLiquid() || m->isSolid()) {
|
if (m->isLiquid() || m->isSolid()) {
|
||||||
double y0 = Mth::floor(y) + 1 -
|
double y0 = std::floor(y) + 1 -
|
||||||
LiquidTile::getHeight(level->getData(
|
LiquidTile::getHeight(level->getData(
|
||||||
Mth::floor(x), Mth::floor(y), Mth::floor(z)));
|
std::floor(x), std::floor(y), std::floor(z)));
|
||||||
if (y < y0) {
|
if (y < y0) {
|
||||||
remove();
|
remove();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ void FootstepParticle::render(Tesselator* t, float a, float xa, float ya,
|
||||||
float zz = (float)(z - zOff);
|
float zz = (float)(z - zOff);
|
||||||
|
|
||||||
float br =
|
float br =
|
||||||
level->getBrightness(Mth::floor(x), Mth::floor(y), Mth::floor(z));
|
level->getBrightness(std::floor(x), std::floor(y), std::floor(z));
|
||||||
|
|
||||||
textures->bindTexture(&FOOTPRINT_LOCATION);
|
textures->bindTexture(&FOOTPRINT_LOCATION);
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ Particle::Particle(Level* level, double x, double y, double z, double xa,
|
||||||
zd = za + (float)(Math::random() * 2 - 1) * 0.4f;
|
zd = za + (float)(Math::random() * 2 - 1) * 0.4f;
|
||||||
float speed = (float)(Math::random() + Math::random() + 1) * 0.15f;
|
float speed = (float)(Math::random() + Math::random() + 1) * 0.15f;
|
||||||
|
|
||||||
float dd = (float)(Mth::sqrt(xd * xd + yd * yd + zd * zd));
|
float dd = (float)(std::sqrt(xd * xd + yd * yd + zd * zd));
|
||||||
xd = xd / dd * speed * 0.4f;
|
xd = xd / dd * speed * 0.4f;
|
||||||
yd = yd / dd * speed * 0.4f + 0.1f;
|
yd = yd / dd * speed * 0.4f + 0.1f;
|
||||||
zd = zd / dd * speed * 0.4f;
|
zd = zd / dd * speed * 0.4f;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ void SuspendedParticle::tick() {
|
||||||
|
|
||||||
move(xd, yd, zd);
|
move(xd, yd, zd);
|
||||||
|
|
||||||
if (level->getMaterial(Mth::floor(x), Mth::floor(y), Mth::floor(z)) !=
|
if (level->getMaterial(std::floor(x), std::floor(y), std::floor(z)) !=
|
||||||
Material::water)
|
Material::water)
|
||||||
remove();
|
remove();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,9 @@ void TakeAnimationParticle::render(Tesselator* t, float a, float xa, float ya,
|
||||||
double yy = yo + (yt - yo) * time;
|
double yy = yo + (yt - yo) * time;
|
||||||
double zz = zo + (zt - zo) * time;
|
double zz = zo + (zt - zo) * time;
|
||||||
|
|
||||||
int xTile = Mth::floor(xx);
|
int xTile = std::floor(xx);
|
||||||
int yTile = Mth::floor(yy + heightOffset / 2.0f);
|
int yTile = std::floor(yy + heightOffset / 2.0f);
|
||||||
int zTile = Mth::floor(zz);
|
int zTile = std::floor(zz);
|
||||||
|
|
||||||
// 4J - change brought forward from 1.8.2
|
// 4J - change brought forward from 1.8.2
|
||||||
if (SharedConstants::TEXTURE_LIGHTING) {
|
if (SharedConstants::TEXTURE_LIGHTING) {
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,11 @@ void WaterDropParticle::tick() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Material* m =
|
Material* m =
|
||||||
level->getMaterial(Mth::floor(x), Mth::floor(y), Mth::floor(z));
|
level->getMaterial(std::floor(x), std::floor(y), std::floor(z));
|
||||||
if (m->isLiquid() || m->isSolid()) {
|
if (m->isLiquid() || m->isSolid()) {
|
||||||
double y0 = Mth::floor(y) + 1 -
|
double y0 = std::floor(y) + 1 -
|
||||||
LiquidTile::getHeight(level->getData(
|
LiquidTile::getHeight(level->getData(
|
||||||
Mth::floor(x), Mth::floor(y), Mth::floor(z)));
|
std::floor(x), std::floor(y), std::floor(z)));
|
||||||
if (y < y0) {
|
if (y < y0) {
|
||||||
remove();
|
remove();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1097,9 +1097,9 @@ bool LocalPlayer::isSolidBlock(int x, int y, int z) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LocalPlayer::checkInTile(double x, double y, double z) {
|
bool LocalPlayer::checkInTile(double x, double y, double z) {
|
||||||
int xTile = Mth::floor(x);
|
int xTile = std::floor(x);
|
||||||
int yTile = Mth::floor(y);
|
int yTile = std::floor(y);
|
||||||
int zTile = Mth::floor(z);
|
int zTile = std::floor(z);
|
||||||
|
|
||||||
double xd = x - xTile;
|
double xd = x - xTile;
|
||||||
double zd = z - zTile;
|
double zd = z - zTile;
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ void RemotePlayer::tick() {
|
||||||
walkAnimSpeedO = walkAnimSpeed;
|
walkAnimSpeedO = walkAnimSpeed;
|
||||||
double xxd = x - xo;
|
double xxd = x - xo;
|
||||||
double zzd = z - zo;
|
double zzd = z - zo;
|
||||||
float wst = Mth::sqrt(xxd * xxd + zzd * zzd) * 4;
|
float wst = std::sqrt(xxd * xxd + zzd * zzd) * 4;
|
||||||
if (wst > 1) wst = 1;
|
if (wst > 1) wst = 1;
|
||||||
walkAnimSpeed += (wst - walkAnimSpeed) * 0.4f;
|
walkAnimSpeed += (wst - walkAnimSpeed) * 0.4f;
|
||||||
walkAnimPos += walkAnimSpeed;
|
walkAnimPos += walkAnimSpeed;
|
||||||
|
|
@ -106,7 +106,7 @@ void RemotePlayer::aiStep() {
|
||||||
}
|
}
|
||||||
oBob = bob;
|
oBob = bob;
|
||||||
|
|
||||||
float tBob = (float)Mth::sqrt(xd * xd + zd * zd);
|
float tBob = (float)std::sqrt(xd * xd + zd * zd);
|
||||||
float tTilt = (float)atan(-yd * 0.2f) * 15.0f;
|
float tTilt = (float)atan(-yd * 0.2f) * 15.0f;
|
||||||
if (tBob > 0.1f) tBob = 0.1f;
|
if (tBob > 0.1f) tBob = 0.1f;
|
||||||
if (!onGround || getHealth() <= 0) tBob = 0;
|
if (!onGround || getHealth() <= 0) tBob = 0;
|
||||||
|
|
|
||||||
|
|
@ -243,9 +243,9 @@ void GameRenderer::tick(bool first) // 4J - add bFirst
|
||||||
mc->cameraTargetPlayer = std::dynamic_pointer_cast<Mob>(mc->player);
|
mc->cameraTargetPlayer = std::dynamic_pointer_cast<Mob>(mc->player);
|
||||||
}
|
}
|
||||||
|
|
||||||
float brr = mc->level->getBrightness(Mth::floor(mc->cameraTargetPlayer->x),
|
float brr = mc->level->getBrightness(std::floor(mc->cameraTargetPlayer->x),
|
||||||
Mth::floor(mc->cameraTargetPlayer->y),
|
std::floor(mc->cameraTargetPlayer->y),
|
||||||
Mth::floor(mc->cameraTargetPlayer->z));
|
std::floor(mc->cameraTargetPlayer->z));
|
||||||
float whiteness = (3 - mc->options->viewDistance) / 3.0f;
|
float whiteness = (3 - mc->options->viewDistance) / 3.0f;
|
||||||
float fogBrT = brr * (1 - whiteness) + whiteness;
|
float fogBrT = brr * (1 - whiteness) + whiteness;
|
||||||
fogBr += (fogBrT - fogBr) * 0.1f;
|
fogBr += (fogBrT - fogBr) * 0.1f;
|
||||||
|
|
@ -479,12 +479,12 @@ void GameRenderer::moveCameraToPlayer(float a) {
|
||||||
glTranslatef(0.0f, 0.3f, 0);
|
glTranslatef(0.0f, 0.3f, 0);
|
||||||
if (!mc->options->fixedCamera) {
|
if (!mc->options->fixedCamera) {
|
||||||
int t =
|
int t =
|
||||||
mc->level->getTile(Mth::floor(player->x), Mth::floor(player->y),
|
mc->level->getTile(std::floor(player->x), std::floor(player->y),
|
||||||
Mth::floor(player->z));
|
std::floor(player->z));
|
||||||
if (t == Tile::bed_Id) {
|
if (t == Tile::bed_Id) {
|
||||||
int data = mc->level->getData(Mth::floor(player->x),
|
int data = mc->level->getData(std::floor(player->x),
|
||||||
Mth::floor(player->y),
|
std::floor(player->y),
|
||||||
Mth::floor(player->z));
|
std::floor(player->z));
|
||||||
|
|
||||||
int direction = data & 3;
|
int direction = data & 3;
|
||||||
glRotatef((float)direction * 90, 0.0f, 1.0f, 0.0f);
|
glRotatef((float)direction * 90, 0.0f, 1.0f, 0.0f);
|
||||||
|
|
@ -1545,9 +1545,9 @@ void GameRenderer::tickRain() {
|
||||||
std::shared_ptr<LivingEntity> player = mc->cameraTargetPlayer;
|
std::shared_ptr<LivingEntity> player = mc->cameraTargetPlayer;
|
||||||
Level* level = mc->level;
|
Level* level = mc->level;
|
||||||
|
|
||||||
int x0 = Mth::floor(player->x);
|
int x0 = std::floor(player->x);
|
||||||
int y0 = Mth::floor(player->y);
|
int y0 = std::floor(player->y);
|
||||||
int z0 = Mth::floor(player->z);
|
int z0 = std::floor(player->z);
|
||||||
|
|
||||||
int r = 10;
|
int r = 10;
|
||||||
|
|
||||||
|
|
@ -1597,9 +1597,9 @@ void GameRenderer::tickRain() {
|
||||||
if (rainPosSamples > 0 && random->nextInt(3) < rainSoundTime++) {
|
if (rainPosSamples > 0 && random->nextInt(3) < rainSoundTime++) {
|
||||||
rainSoundTime = 0;
|
rainSoundTime = 0;
|
||||||
if (rainPosY > player->y + 1 &&
|
if (rainPosY > player->y + 1 &&
|
||||||
level->getTopRainBlock(Mth::floor(player->x),
|
level->getTopRainBlock(std::floor(player->x),
|
||||||
Mth::floor(player->z)) >
|
std::floor(player->z)) >
|
||||||
Mth::floor(player->y)) {
|
std::floor(player->y)) {
|
||||||
mc->level->playLocalSound(rainPosX, rainPosY, rainPosZ,
|
mc->level->playLocalSound(rainPosX, rainPosY, rainPosZ,
|
||||||
eSoundType_AMBIENT_WEATHER_RAIN, 0.1f,
|
eSoundType_AMBIENT_WEATHER_RAIN, 0.1f,
|
||||||
0.5f);
|
0.5f);
|
||||||
|
|
@ -1629,7 +1629,7 @@ void GameRenderer::renderSnowAndRain(float a) {
|
||||||
for (int x = 0; x < 32; x++) {
|
for (int x = 0; x < 32; x++) {
|
||||||
float xa = x - 16;
|
float xa = x - 16;
|
||||||
float za = z - 16;
|
float za = z - 16;
|
||||||
float d = Mth::sqrt(xa * xa + za * za);
|
float d = std::sqrt(xa * xa + za * za);
|
||||||
rainXa[z << 5 | x] = -za / d;
|
rainXa[z << 5 | x] = -za / d;
|
||||||
rainZa[z << 5 | x] = xa / d;
|
rainZa[z << 5 | x] = xa / d;
|
||||||
}
|
}
|
||||||
|
|
@ -1639,9 +1639,9 @@ void GameRenderer::renderSnowAndRain(float a) {
|
||||||
std::shared_ptr<LivingEntity> player = mc->cameraTargetPlayer;
|
std::shared_ptr<LivingEntity> player = mc->cameraTargetPlayer;
|
||||||
Level* level = mc->level;
|
Level* level = mc->level;
|
||||||
|
|
||||||
int x0 = Mth::floor(player->x);
|
int x0 = std::floor(player->x);
|
||||||
int y0 = Mth::floor(player->y);
|
int y0 = std::floor(player->y);
|
||||||
int z0 = Mth::floor(player->z);
|
int z0 = std::floor(player->z);
|
||||||
|
|
||||||
Tesselator* t = Tesselator::getInstance();
|
Tesselator* t = Tesselator::getInstance();
|
||||||
glDisable(GL_CULL_FACE);
|
glDisable(GL_CULL_FACE);
|
||||||
|
|
@ -1657,7 +1657,7 @@ void GameRenderer::renderSnowAndRain(float a) {
|
||||||
double yo = player->yOld + (player->y - player->yOld) * a;
|
double yo = player->yOld + (player->y - player->yOld) * a;
|
||||||
double zo = player->zOld + (player->z - player->zOld) * a;
|
double zo = player->zOld + (player->z - player->zOld) * a;
|
||||||
|
|
||||||
int yMin = Mth::floor(yo);
|
int yMin = std::floor(yo);
|
||||||
|
|
||||||
int r = 5;
|
int r = 5;
|
||||||
// 4J - was if(mc.options.fancyGraphics) r = 10;
|
// 4J - was if(mc.options.fancyGraphics) r = 10;
|
||||||
|
|
@ -1722,7 +1722,7 @@ void GameRenderer::renderSnowAndRain(float a) {
|
||||||
|
|
||||||
double xd = (x + 0.5f) - player->x;
|
double xd = (x + 0.5f) - player->x;
|
||||||
double zd = (z + 0.5f) - player->z;
|
double zd = (z + 0.5f) - player->z;
|
||||||
float dd = (float)Mth::sqrt(xd * xd + zd * zd) / r;
|
float dd = (float)std::sqrt(xd * xd + zd * zd) / r;
|
||||||
|
|
||||||
float br = 1.0f;
|
float br = 1.0f;
|
||||||
float s = 1.0f;
|
float s = 1.0f;
|
||||||
|
|
|
||||||
|
|
@ -452,13 +452,13 @@ void ItemInHandRenderer::render(float a) {
|
||||||
std::shared_ptr<ItemInstance> item = selectedItem;
|
std::shared_ptr<ItemInstance> item = selectedItem;
|
||||||
|
|
||||||
float br = minecraft->level->getBrightness(
|
float br = minecraft->level->getBrightness(
|
||||||
Mth::floor(player->x), Mth::floor(player->y), Mth::floor(player->z));
|
std::floor(player->x), std::floor(player->y), std::floor(player->z));
|
||||||
// 4J - change brought forward from 1.8.2
|
// 4J - change brought forward from 1.8.2
|
||||||
if (SharedConstants::TEXTURE_LIGHTING) {
|
if (SharedConstants::TEXTURE_LIGHTING) {
|
||||||
br = 1;
|
br = 1;
|
||||||
int col = minecraft->level->getLightColor(Mth::floor(player->x),
|
int col = minecraft->level->getLightColor(std::floor(player->x),
|
||||||
Mth::floor(player->y),
|
std::floor(player->y),
|
||||||
Mth::floor(player->z), 0);
|
std::floor(player->z), 0);
|
||||||
int u = col % 65536;
|
int u = col % 65536;
|
||||||
int v = col / 65536;
|
int v = col / 65536;
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
|
|
@ -621,7 +621,7 @@ void ItemInHandRenderer::render(float a) {
|
||||||
is = is * is * is;
|
is = is * is * is;
|
||||||
float iss = 1 - is;
|
float iss = 1 - is;
|
||||||
glTranslatef(0,
|
glTranslatef(0,
|
||||||
Mth::abs(cosf(t / 4 * std::numbers::pi) * 0.1f) *
|
std::abs(cosf(t / 4 * std::numbers::pi) * 0.1f) *
|
||||||
(swing > 0.2 ? 1 : 0),
|
(swing > 0.2 ? 1 : 0),
|
||||||
0);
|
0);
|
||||||
glTranslatef(iss * 0.6f, -iss * 0.5f, 0);
|
glTranslatef(iss * 0.6f, -iss * 0.5f, 0);
|
||||||
|
|
@ -783,9 +783,9 @@ void ItemInHandRenderer::renderScreenEffect(float a) {
|
||||||
|
|
||||||
if (minecraft->player->isInWall()) // Inside a tile
|
if (minecraft->player->isInWall()) // Inside a tile
|
||||||
{
|
{
|
||||||
int x = Mth::floor(minecraft->player->x);
|
int x = std::floor(minecraft->player->x);
|
||||||
int y = Mth::floor(minecraft->player->y);
|
int y = std::floor(minecraft->player->y);
|
||||||
int z = Mth::floor(minecraft->player->z);
|
int z = std::floor(minecraft->player->z);
|
||||||
|
|
||||||
int tile = minecraft->level->getTile(x, y, z);
|
int tile = minecraft->level->getTile(x, y, z);
|
||||||
if (minecraft->level->isSolidBlockingTile(x, y, z)) {
|
if (minecraft->level->isSolidBlockingTile(x, y, z)) {
|
||||||
|
|
@ -798,9 +798,9 @@ void ItemInHandRenderer::renderScreenEffect(float a) {
|
||||||
((i >> 1) % 2 - 0.5f) * minecraft->player->bbHeight * 0.2f;
|
((i >> 1) % 2 - 0.5f) * minecraft->player->bbHeight * 0.2f;
|
||||||
float zo =
|
float zo =
|
||||||
((i >> 2) % 2 - 0.5f) * minecraft->player->bbWidth * 0.9f;
|
((i >> 2) % 2 - 0.5f) * minecraft->player->bbWidth * 0.9f;
|
||||||
int xt = Mth::floor(x + xo);
|
int xt = std::floor(x + xo);
|
||||||
int yt = Mth::floor(y + yo);
|
int yt = std::floor(y + yo);
|
||||||
int zt = Mth::floor(z + zo);
|
int zt = std::floor(z + zo);
|
||||||
if (minecraft->level->isSolidBlockingTile(xt, yt, zt)) {
|
if (minecraft->level->isSolidBlockingTile(xt, yt, zt)) {
|
||||||
tile = minecraft->level->getTile(xt, yt, zt);
|
tile = minecraft->level->getTile(xt, yt, zt);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@
|
||||||
#include "Minecraft.Client/net/minecraft/client/resources/ResourceLocation.h"
|
#include "Minecraft.Client/net/minecraft/client/resources/ResourceLocation.h"
|
||||||
#include "Minecraft.Client/Header Files/stubs.h"
|
#include "Minecraft.Client/Header Files/stubs.h"
|
||||||
#include "4J_Input.h"
|
#include "4J_Input.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
class Icon;
|
class Icon;
|
||||||
class ItemInstance;
|
class ItemInstance;
|
||||||
|
|
@ -540,8 +541,8 @@ void LevelRenderer::allChanged(int playerIndex) {
|
||||||
if (level[playerIndex] != nullptr) {
|
if (level[playerIndex] != nullptr) {
|
||||||
std::shared_ptr<Entity> player = mc->cameraTargetPlayer;
|
std::shared_ptr<Entity> player = mc->cameraTargetPlayer;
|
||||||
if (player != nullptr) {
|
if (player != nullptr) {
|
||||||
this->resortChunks(Mth::floor(player->x), Mth::floor(player->y),
|
this->resortChunks(std::floor(player->x), std::floor(player->y),
|
||||||
Mth::floor(player->z));
|
std::floor(player->z));
|
||||||
// sort(sortedChunks[playerIndex]->begin(),sortedChunks[playerIndex]->end(),
|
// sort(sortedChunks[playerIndex]->begin(),sortedChunks[playerIndex]->end(),
|
||||||
// DistanceChunkSorter(player)); // 4J - removed - not sorting
|
// DistanceChunkSorter(player)); // 4J - removed - not sorting
|
||||||
// our chunks anymore
|
// our chunks anymore
|
||||||
|
|
@ -638,8 +639,8 @@ void LevelRenderer::renderEntities(Vec3* cam, Culler* culler, float a) {
|
||||||
!mc->cameraTargetPlayer->isSleeping())
|
!mc->cameraTargetPlayer->isSleeping())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!level[playerIndex]->hasChunkAt(Mth::floor(entity->x), 0,
|
if (!level[playerIndex]->hasChunkAt(std::floor(entity->x), 0,
|
||||||
Mth::floor(entity->z))) {
|
std::floor(entity->z))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
renderedEntities++;
|
renderedEntities++;
|
||||||
|
|
@ -772,8 +773,8 @@ int LevelRenderer::render(std::shared_ptr<LivingEntity> player, int layer,
|
||||||
yOld[playerIndex] = player->y;
|
yOld[playerIndex] = player->y;
|
||||||
zOld[playerIndex] = player->z;
|
zOld[playerIndex] = player->z;
|
||||||
|
|
||||||
resortChunks(Mth::floor(player->x), Mth::floor(player->y),
|
resortChunks(std::floor(player->x), std::floor(player->y),
|
||||||
Mth::floor(player->z));
|
std::floor(player->z));
|
||||||
// sort(sortedChunks[playerIndex]->begin(),sortedChunks[playerIndex]->end(),
|
// sort(sortedChunks[playerIndex]->begin(),sortedChunks[playerIndex]->end(),
|
||||||
// DistanceChunkSorter(player)); // 4J - removed - not sorting
|
// DistanceChunkSorter(player)); // 4J - removed - not sorting
|
||||||
// our chunks anymore
|
// our chunks anymore
|
||||||
|
|
@ -1215,8 +1216,8 @@ void LevelRenderer::renderClouds(float alpha) {
|
||||||
double zo =
|
double zo =
|
||||||
mc->cameraTargetPlayer->zo +
|
mc->cameraTargetPlayer->zo +
|
||||||
(mc->cameraTargetPlayer->z - mc->cameraTargetPlayer->zo) * alpha;
|
(mc->cameraTargetPlayer->z - mc->cameraTargetPlayer->zo) * alpha;
|
||||||
int xOffs = Mth::floor(xo / 2048);
|
int xOffs = std::floor(xo / 2048);
|
||||||
int zOffs = Mth::floor(zo / 2048);
|
int zOffs = std::floor(zo / 2048);
|
||||||
xo -= xOffs * 2048;
|
xo -= xOffs * 2048;
|
||||||
zo -= zOffs * 2048;
|
zo -= zOffs * 2048;
|
||||||
|
|
||||||
|
|
@ -1458,8 +1459,8 @@ void LevelRenderer::renderAdvancedClouds(float alpha) {
|
||||||
0.33f;
|
0.33f;
|
||||||
float yy = (float)(level[playerIndex]->dimension->getCloudHeight() - yOffs +
|
float yy = (float)(level[playerIndex]->dimension->getCloudHeight() - yOffs +
|
||||||
0.33f);
|
0.33f);
|
||||||
int xOffs = Mth::floor(xo / 2048);
|
int xOffs = std::floor(xo / 2048);
|
||||||
int zOffs = Mth::floor(zo / 2048);
|
int zOffs = std::floor(zo / 2048);
|
||||||
xo -= xOffs * 2048;
|
xo -= xOffs * 2048;
|
||||||
zo -= zOffs * 2048;
|
zo -= zOffs * 2048;
|
||||||
|
|
||||||
|
|
@ -1505,16 +1506,16 @@ void LevelRenderer::renderAdvancedClouds(float alpha) {
|
||||||
|
|
||||||
float scale = 1 / 256.0f;
|
float scale = 1 / 256.0f;
|
||||||
|
|
||||||
uo = (float)(Mth::floor(xo)) * scale;
|
uo = (float)(std::floor(xo)) * scale;
|
||||||
vo = (float)(Mth::floor(zo)) * scale;
|
vo = (float)(std::floor(zo)) * scale;
|
||||||
// 4J - keep our UVs +ve - there's a small bug in the xbox GPU that
|
// 4J - keep our UVs +ve - there's a small bug in the xbox GPU that
|
||||||
// incorrectly rounds small -ve UVs (between -1/(64*size) and 0) up to 0,
|
// incorrectly rounds small -ve UVs (between -1/(64*size) and 0) up to 0,
|
||||||
// which leaves gaps in our clouds...
|
// which leaves gaps in our clouds...
|
||||||
while (uo < 1.0f) uo += 1.0f;
|
while (uo < 1.0f) uo += 1.0f;
|
||||||
while (vo < 1.0f) vo += 1.0f;
|
while (vo < 1.0f) vo += 1.0f;
|
||||||
|
|
||||||
float xoffs = (float)(xo - Mth::floor(xo));
|
float xoffs = (float)(xo - std::floor(xo));
|
||||||
float zoffs = (float)(zo - Mth::floor(zo));
|
float zoffs = (float)(zo - std::floor(zo));
|
||||||
|
|
||||||
int D = 8;
|
int D = 8;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -224,12 +224,12 @@ void EntityRenderDispatcher::prepare(
|
||||||
this->crosshairPickMob = crosshairPickMob;
|
this->crosshairPickMob = crosshairPickMob;
|
||||||
|
|
||||||
if (player->isSleeping()) {
|
if (player->isSleeping()) {
|
||||||
int t = level->getTile(Mth::floor(player->x), Mth::floor(player->y),
|
int t = level->getTile(std::floor(player->x), std::floor(player->y),
|
||||||
Mth::floor(player->z));
|
std::floor(player->z));
|
||||||
if (t == Tile::bed_Id) {
|
if (t == Tile::bed_Id) {
|
||||||
int data =
|
int data =
|
||||||
level->getData(Mth::floor(player->x), Mth::floor(player->y),
|
level->getData(std::floor(player->x), std::floor(player->y),
|
||||||
Mth::floor(player->z));
|
std::floor(player->z));
|
||||||
|
|
||||||
int direction = data & 3;
|
int direction = data & 3;
|
||||||
playerRotY = (float)(direction * 90 + 180);
|
playerRotY = (float)(direction * 90 + 180);
|
||||||
|
|
|
||||||
|
|
@ -178,12 +178,12 @@ void EntityRenderer::renderShadow(std::shared_ptr<Entity> e, double x, double y,
|
||||||
}
|
}
|
||||||
double ez = e->zOld + (e->z - e->zOld) * a;
|
double ez = e->zOld + (e->z - e->zOld) * a;
|
||||||
|
|
||||||
int x0 = Mth::floor(ex - r);
|
int x0 = std::floor(ex - r);
|
||||||
int x1 = Mth::floor(ex + r);
|
int x1 = std::floor(ex + r);
|
||||||
int y0 = Mth::floor(ey - r);
|
int y0 = std::floor(ey - r);
|
||||||
int y1 = Mth::floor(ey);
|
int y1 = std::floor(ey);
|
||||||
int z0 = Mth::floor(ez - r);
|
int z0 = std::floor(ez - r);
|
||||||
int z1 = Mth::floor(ez + r);
|
int z1 = std::floor(ez + r);
|
||||||
|
|
||||||
double xo = x - ex;
|
double xo = x - ex;
|
||||||
double yo = y - ey;
|
double yo = y - ey;
|
||||||
|
|
|
||||||
|
|
@ -47,28 +47,28 @@ void FallingTileRenderer::render(std::shared_ptr<Entity> _tile, double x,
|
||||||
tileRenderer->level = level;
|
tileRenderer->level = level;
|
||||||
Tesselator* t = Tesselator::getInstance();
|
Tesselator* t = Tesselator::getInstance();
|
||||||
t->begin();
|
t->begin();
|
||||||
t->offset(-Mth::floor(tile->x) - 0.5f, -Mth::floor(tile->y) - 0.5f,
|
t->offset(-std::floor(tile->x) - 0.5f, -std::floor(tile->y) - 0.5f,
|
||||||
-Mth::floor(tile->z) - 0.5f);
|
-std::floor(tile->z) - 0.5f);
|
||||||
tileRenderer->tesselateAnvilInWorld(
|
tileRenderer->tesselateAnvilInWorld(
|
||||||
(AnvilTile*)tt, Mth::floor(tile->x), Mth::floor(tile->y),
|
(AnvilTile*)tt, std::floor(tile->x), std::floor(tile->y),
|
||||||
Mth::floor(tile->z), tile->data);
|
std::floor(tile->z), tile->data);
|
||||||
t->offset(0, 0, 0);
|
t->offset(0, 0, 0);
|
||||||
t->end();
|
t->end();
|
||||||
} else if (tt == Tile::dragonEgg) {
|
} else if (tt == Tile::dragonEgg) {
|
||||||
tileRenderer->level = level;
|
tileRenderer->level = level;
|
||||||
Tesselator* t = Tesselator::getInstance();
|
Tesselator* t = Tesselator::getInstance();
|
||||||
t->begin();
|
t->begin();
|
||||||
t->offset(-Mth::floor(tile->x) - 0.5f, -Mth::floor(tile->y) - 0.5f,
|
t->offset(-std::floor(tile->x) - 0.5f, -std::floor(tile->y) - 0.5f,
|
||||||
-Mth::floor(tile->z) - 0.5f);
|
-std::floor(tile->z) - 0.5f);
|
||||||
tileRenderer->tesselateInWorld(tt, Mth::floor(tile->x),
|
tileRenderer->tesselateInWorld(tt, std::floor(tile->x),
|
||||||
Mth::floor(tile->y),
|
std::floor(tile->y),
|
||||||
Mth::floor(tile->z));
|
std::floor(tile->z));
|
||||||
t->offset(0, 0, 0);
|
t->offset(0, 0, 0);
|
||||||
t->end();
|
t->end();
|
||||||
} else if (tt != nullptr) {
|
} else if (tt != nullptr) {
|
||||||
tileRenderer->setShape(tt);
|
tileRenderer->setShape(tt);
|
||||||
tileRenderer->renderBlock(tt, level, Mth::floor(tile->x),
|
tileRenderer->renderBlock(tt, level, std::floor(tile->x),
|
||||||
Mth::floor(tile->y), Mth::floor(tile->z),
|
std::floor(tile->y), std::floor(tile->z),
|
||||||
tile->data);
|
tile->data);
|
||||||
}
|
}
|
||||||
glEnable(GL_LIGHTING);
|
glEnable(GL_LIGHTING);
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
#include "Minecraft.Client/net/minecraft/client/renderer/Tesselator.h"
|
#include "Minecraft.Client/net/minecraft/client/renderer/Tesselator.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/renderer/Textures.h"
|
#include "Minecraft.Client/net/minecraft/client/renderer/Textures.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/resources/ResourceLocation.h"
|
#include "Minecraft.Client/net/minecraft/client/resources/ResourceLocation.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
class MapItemSavedData;
|
class MapItemSavedData;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
#include "Minecraft.Client/net/minecraft/client/renderer/Tesselator.h"
|
#include "Minecraft.Client/net/minecraft/client/renderer/Tesselator.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/renderer/Textures.h"
|
#include "Minecraft.Client/net/minecraft/client/renderer/Textures.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderer.h"
|
#include "Minecraft.Client/net/minecraft/client/renderer/entity/EntityRenderer.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
class ResourceLocation;
|
class ResourceLocation;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#include "Minecraft.Client/net/minecraft/client/renderer/Tesselator.h"
|
#include "Minecraft.Client/net/minecraft/client/renderer/Tesselator.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/renderer/Textures.h"
|
#include "Minecraft.Client/net/minecraft/client/renderer/Textures.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/resources/ResourceLocation.h"
|
#include "Minecraft.Client/net/minecraft/client/resources/ResourceLocation.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
ResourceLocation LivingEntityRenderer::ENCHANT_GLINT_LOCATION =
|
ResourceLocation LivingEntityRenderer::ENCHANT_GLINT_LOCATION =
|
||||||
ResourceLocation(TN__BLUR__MISC_GLINT);
|
ResourceLocation(TN__BLUR__MISC_GLINT);
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
#include "java/Class.h"
|
#include "java/Class.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/Minecraft.h"
|
#include "Minecraft.Client/net/minecraft/client/Minecraft.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/renderer/Tesselator.h"
|
#include "Minecraft.Client/net/minecraft/client/renderer/Tesselator.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
class Model;
|
class Model;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,13 +124,13 @@ void PaintingRenderer::renderPainting(std::shared_ptr<Painting> painting, int w,
|
||||||
|
|
||||||
void PaintingRenderer::setBrightness(std::shared_ptr<Painting> painting,
|
void PaintingRenderer::setBrightness(std::shared_ptr<Painting> painting,
|
||||||
float ss, float ya) {
|
float ss, float ya) {
|
||||||
int x = Mth::floor(painting->x);
|
int x = std::floor(painting->x);
|
||||||
int y = Mth::floor(painting->y + ya / 16.0f);
|
int y = std::floor(painting->y + ya / 16.0f);
|
||||||
int z = Mth::floor(painting->z);
|
int z = std::floor(painting->z);
|
||||||
if (painting->dir == 0) x = Mth::floor(painting->x + ss / 16.0f);
|
if (painting->dir == 0) x = std::floor(painting->x + ss / 16.0f);
|
||||||
if (painting->dir == 1) z = Mth::floor(painting->z - ss / 16.0f);
|
if (painting->dir == 1) z = std::floor(painting->z - ss / 16.0f);
|
||||||
if (painting->dir == 2) x = Mth::floor(painting->x - ss / 16.0f);
|
if (painting->dir == 2) x = std::floor(painting->x - ss / 16.0f);
|
||||||
if (painting->dir == 3) z = Mth::floor(painting->z + ss / 16.0f);
|
if (painting->dir == 3) z = std::floor(painting->z + ss / 16.0f);
|
||||||
|
|
||||||
int col = this->entityRenderDispatcher->level->getLightColor(x, y, z, 0);
|
int col = this->entityRenderDispatcher->level->getLightColor(x, y, z, 0);
|
||||||
int u = col % 65536;
|
int u = col % 65536;
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h"
|
#include "Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/renderer/Textures.h"
|
#include "Minecraft.Client/net/minecraft/client/renderer/Textures.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/resources/ResourceLocation.h"
|
#include "Minecraft.Client/net/minecraft/client/resources/ResourceLocation.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
ResourceLocation EnchantTableRenderer::BOOK_LOCATION =
|
ResourceLocation EnchantTableRenderer::BOOK_LOCATION =
|
||||||
ResourceLocation(TN_ITEM_BOOK);
|
ResourceLocation(TN_ITEM_BOOK);
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h"
|
#include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/entity/Entity.h"
|
#include "Minecraft.World/net/minecraft/world/entity/Entity.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/Level.h"
|
#include "Minecraft.World/net/minecraft/world/level/Level.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/Colours/ColourTable.h"
|
||||||
|
|
||||||
ResourceLocation SignRenderer::SIGN_LOCATION = ResourceLocation(TN_ITEM_SIGN);
|
ResourceLocation SignRenderer::SIGN_LOCATION = ResourceLocation(TN_ITEM_SIGN);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -396,7 +396,7 @@ void TitleScreen::render(int xm, int ym, float a) {
|
||||||
glTranslatef((float)width / 2 + 90, 70, 0);
|
glTranslatef((float)width / 2 + 90, 70, 0);
|
||||||
|
|
||||||
glRotatef(-20, 0, 0, 1);
|
glRotatef(-20, 0, 0, 1);
|
||||||
float sss = 1.8f - Mth::abs(sinf(System::currentTimeMillis() % 1000 /
|
float sss = 1.8f - std::abs(sinf(System::currentTimeMillis() % 1000 /
|
||||||
1000.0f * std::numbers::pi * 2) *
|
1000.0f * std::numbers::pi * 2) *
|
||||||
0.1f);
|
0.1f);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,14 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.h"
|
#include "Minecraft.World/net/minecraft/world/level/chunk/SparseLightStorage.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.h"
|
#include "Minecraft.World/net/minecraft/world/level/chunk/SparseDataStorage.h"
|
||||||
#include "Minecraft.World/Header Files/compression.h"
|
#include "Minecraft.World/Header Files/compression.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/world/level/biome/BiomeSource.h"
|
||||||
#include "Minecraft.Client/Common/ShutdownManager.h"
|
#include "Minecraft.Client/Common/ShutdownManager.h"
|
||||||
#include "Minecraft.Client/Common/Source Files/UI/All Platforms/UIStructs.h"
|
#include "Minecraft.Client/Common/Source Files/UI/All Platforms/UIStructs.h"
|
||||||
#include "Minecraft.Client/net/minecraft/server/commands/ServerCommandDispatcher.h"
|
#include "Minecraft.Client/net/minecraft/server/commands/ServerCommandDispatcher.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/biome/BiomeSource.h"
|
|
||||||
#include "Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.h"
|
#include "Minecraft.Client/net/minecraft/server/level/PlayerChunkMap.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/GameRules/LevelGeneration/ConsoleSchematicFile.h"
|
||||||
#include "4J_Input.h"
|
#include "4J_Input.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/world/level/Level.h"
|
||||||
|
|
||||||
#define DEBUG_SERVER_DONT_SPAWN_MOBS 0
|
#define DEBUG_SERVER_DONT_SPAWN_MOBS 0
|
||||||
|
|
||||||
|
|
@ -208,7 +210,7 @@ bool MinecraftServer::initServer(int64_t seed, NetworkGameInitData* initData,
|
||||||
settings->getInt(L"max-build-height", Level::maxBuildHeight));
|
settings->getInt(L"max-build-height", Level::maxBuildHeight));
|
||||||
setMaxBuildHeight(((getMaxBuildHeight() + 8) / 16) * 16);
|
setMaxBuildHeight(((getMaxBuildHeight() + 8) / 16) * 16);
|
||||||
setMaxBuildHeight(
|
setMaxBuildHeight(
|
||||||
Mth::clamp(getMaxBuildHeight(), 64, Level::maxBuildHeight));
|
std::clamp(getMaxBuildHeight(), 64, Level::maxBuildHeight));
|
||||||
// settings->setProperty(L"max-build-height", maxBuildHeight);
|
// settings->setProperty(L"max-build-height", maxBuildHeight);
|
||||||
|
|
||||||
// logger.info("Preparing level \"" + levelName + "\"");
|
// logger.info("Preparing level \"" + levelName + "\"");
|
||||||
|
|
@ -1012,8 +1014,8 @@ bool MinecraftServer::isUnderSpawnProtection(Level* level, int x, int y, int z,
|
||||||
if (getSpawnProtectionRadius() <= 0) return false;
|
if (getSpawnProtectionRadius() <= 0) return false;
|
||||||
|
|
||||||
Pos* spawnPos = level->getSharedSpawnPos();
|
Pos* spawnPos = level->getSharedSpawnPos();
|
||||||
int xd = Mth::abs(x - spawnPos->x);
|
int xd = std::abs(x - spawnPos->x);
|
||||||
int zd = Mth::abs(z - spawnPos->z);
|
int zd = std::abs(z - spawnPos->z);
|
||||||
int dist = std::max(xd, zd);
|
int dist = std::max(xd, zd);
|
||||||
|
|
||||||
return dist <= getSpawnProtectionRadius();
|
return dist <= getSpawnProtectionRadius();
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
#include "java/JavaMath.h"
|
#include "java/JavaMath.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/entity/EntityIO.h"
|
#include "Minecraft.World/net/minecraft/world/entity/EntityIO.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerGameMode.h"
|
#include "Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerGameMode.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/GameRules/LevelRules/RuleDefinitions/LevelRuleset.h"
|
||||||
#include "Minecraft.Client/Common/Source Files/Tutorial/Tutorial.h"
|
#include "Minecraft.Client/Common/Source Files/Tutorial/Tutorial.h"
|
||||||
|
|
||||||
// 4J - this class is fairly substantially altered as there didn't seem any
|
// 4J - this class is fairly substantially altered as there didn't seem any
|
||||||
|
|
@ -374,17 +375,17 @@ void PlayerList::validatePlayerSpawnPosition(
|
||||||
|
|
||||||
double targetX = 0;
|
double targetX = 0;
|
||||||
if (player->x < 0)
|
if (player->x < 0)
|
||||||
targetX = Mth::ceil(player->x) - 0.5;
|
targetX = std::ceil(player->x) - 0.5;
|
||||||
else
|
else
|
||||||
targetX = Mth::floor(player->x) + 0.5;
|
targetX = std::floor(player->x) + 0.5;
|
||||||
|
|
||||||
double targetY = floor(player->y);
|
double targetY = floor(player->y);
|
||||||
|
|
||||||
double targetZ = 0;
|
double targetZ = 0;
|
||||||
if (player->z < 0)
|
if (player->z < 0)
|
||||||
targetZ = Mth::ceil(player->z) - 0.5;
|
targetZ = std::ceil(player->z) - 0.5;
|
||||||
else
|
else
|
||||||
targetZ = Mth::floor(player->z) + 0.5;
|
targetZ = std::floor(player->z) + 0.5;
|
||||||
|
|
||||||
player->setPos(targetX, targetY, targetZ);
|
player->setPos(targetX, targetY, targetZ);
|
||||||
|
|
||||||
|
|
@ -957,9 +958,9 @@ void PlayerList::repositionAcrossDimension(std::shared_ptr<Entity> entity,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastDimension != 1) {
|
if (lastDimension != 1) {
|
||||||
xt = (double)Mth::clamp((int)xt, -Level::MAX_LEVEL_SIZE + 128,
|
xt = (double)std::clamp((int)xt, -Level::MAX_LEVEL_SIZE + 128,
|
||||||
Level::MAX_LEVEL_SIZE - 128);
|
Level::MAX_LEVEL_SIZE - 128);
|
||||||
zt = (double)Mth::clamp((int)zt, -Level::MAX_LEVEL_SIZE + 128,
|
zt = (double)std::clamp((int)zt, -Level::MAX_LEVEL_SIZE + 128,
|
||||||
Level::MAX_LEVEL_SIZE - 128);
|
Level::MAX_LEVEL_SIZE - 128);
|
||||||
if (entity->isAlive()) {
|
if (entity->isAlive()) {
|
||||||
newLevel->addEntity(entity);
|
newLevel->addEntity(entity);
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ class TileEntity;
|
||||||
class ProgressListener;
|
class ProgressListener;
|
||||||
class GameType;
|
class GameType;
|
||||||
class LoginPacket;
|
class LoginPacket;
|
||||||
|
class Connection;
|
||||||
class ServerScoreboard;
|
class ServerScoreboard;
|
||||||
|
|
||||||
class PlayerList {
|
class PlayerList {
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@
|
||||||
#include "Minecraft.Client/net/minecraft/client/Minecraft.h"
|
#include "Minecraft.Client/net/minecraft/client/Minecraft.h"
|
||||||
#include "PlayerChunkMap.h"
|
#include "PlayerChunkMap.h"
|
||||||
#include "Minecraft.Client/Common/Source Files/DLC/DLCPack.h"
|
#include "Minecraft.Client/Common/Source Files/DLC/DLCPack.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/Console_Debug_enum.h"
|
||||||
#include "4J_Input.h"
|
#include "4J_Input.h"
|
||||||
|
|
||||||
std::vector<WeighedTreasure*> ServerLevel::RANDOM_BONUS_ITEMS;
|
std::vector<WeighedTreasure*> ServerLevel::RANDOM_BONUS_ITEMS;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,17 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <list>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h"
|
#include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h"
|
||||||
#include "java/JavaIntHash.h"
|
#include "java/JavaIntHash.h"
|
||||||
|
|
||||||
class ServerChunkCache;
|
class ServerChunkCache;
|
||||||
class MinecraftServer;
|
class MinecraftServer;
|
||||||
class Node;
|
class Node;
|
||||||
class EntityTracker;
|
class EntityTracker;
|
||||||
class PlayerChunkMap;
|
class PlayerChunkMap;
|
||||||
|
class WeighedTreasure;
|
||||||
|
|
||||||
class ServerLevel : public Level {
|
class ServerLevel : public Level {
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#include "Minecraft.Client/net/minecraft/server/Settings.h"
|
#include "Minecraft.Client/net/minecraft/server/Settings.h"
|
||||||
#include "Minecraft.Client/net/minecraft/server/PlayerList.h"
|
#include "Minecraft.Client/net/minecraft/server/PlayerList.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.h"
|
#include "Minecraft.Client/net/minecraft/client/multiplayer/MultiPlayerLevel.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/Console_Debug_enum.h"
|
||||||
|
|
||||||
#include "Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h"
|
#include "Minecraft.World/net/minecraft/network/packet/net.minecraft.network.packet.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/damageSource/net.minecraft.world.damagesource.h"
|
#include "Minecraft.World/net/minecraft/world/damageSource/net.minecraft.world.damagesource.h"
|
||||||
|
|
@ -1663,7 +1664,7 @@ int ServerPlayer::getViewDistance() { return viewDistance; }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Pos* ServerPlayer::getCommandSenderWorldPosition() {
|
Pos* ServerPlayer::getCommandSenderWorldPosition() {
|
||||||
return new Pos(Mth::floor(x), Mth::floor(y + .5), Mth::floor(z));
|
return new Pos(std::floor(x), std::floor(y + .5), std::floor(z));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerPlayer::resetLastActionTime() {
|
void ServerPlayer::resetLastActionTime() {
|
||||||
|
|
|
||||||
|
|
@ -78,13 +78,13 @@ TrackedEntity::TrackedEntity(std::shared_ptr<Entity> e, int range,
|
||||||
this->updateInterval = updateInterval;
|
this->updateInterval = updateInterval;
|
||||||
this->trackDelta = trackDelta;
|
this->trackDelta = trackDelta;
|
||||||
|
|
||||||
xp = Mth::floor(e->x * 32);
|
xp = std::floor(e->x * 32);
|
||||||
yp = Mth::floor(e->y * 32);
|
yp = std::floor(e->y * 32);
|
||||||
zp = Mth::floor(e->z * 32);
|
zp = std::floor(e->z * 32);
|
||||||
|
|
||||||
yRotp = Mth::floor(e->yRot * 256 / 360);
|
yRotp = std::floor(e->yRot * 256 / 360);
|
||||||
xRotp = Mth::floor(e->xRot * 256 / 360);
|
xRotp = std::floor(e->xRot * 256 / 360);
|
||||||
yHeadRotp = Mth::floor(e->getYHeadRot() * 256 / 360);
|
yHeadRotp = std::floor(e->getYHeadRot() * 256 / 360);
|
||||||
}
|
}
|
||||||
|
|
||||||
int c0a = 0, c0b = 0, c1a = 0, c1b = 0, c1c = 0, c2a = 0, c2b = 0;
|
int c0a = 0, c0b = 0, c1a = 0, c1b = 0, c1c = 0, c2a = 0, c2b = 0;
|
||||||
|
|
@ -141,8 +141,8 @@ void TrackedEntity::tick(EntityTracker* tracker,
|
||||||
} else if (tickCount % updateInterval == 0 || e->hasImpulse ||
|
} else if (tickCount % updateInterval == 0 || e->hasImpulse ||
|
||||||
e->getEntityData()->isDirty()) {
|
e->getEntityData()->isDirty()) {
|
||||||
// 4J: Moved this as it's shared
|
// 4J: Moved this as it's shared
|
||||||
int yRotn = Mth::floor(e->yRot * 256 / 360);
|
int yRotn = std::floor(e->yRot * 256 / 360);
|
||||||
int xRotn = Mth::floor(e->xRot * 256 / 360);
|
int xRotn = std::floor(e->xRot * 256 / 360);
|
||||||
|
|
||||||
// 4J: Changed rotation to be generally sent as a delta as well as
|
// 4J: Changed rotation to be generally sent as a delta as well as
|
||||||
// position
|
// position
|
||||||
|
|
@ -152,9 +152,9 @@ void TrackedEntity::tick(EntityTracker* tracker,
|
||||||
if (e->riding == nullptr) {
|
if (e->riding == nullptr) {
|
||||||
teleportDelay++;
|
teleportDelay++;
|
||||||
|
|
||||||
int xn = Mth::floor(e->x * 32.0);
|
int xn = std::floor(e->x * 32.0);
|
||||||
int yn = Mth::floor(e->y * 32.0);
|
int yn = std::floor(e->y * 32.0);
|
||||||
int zn = Mth::floor(e->z * 32.0);
|
int zn = std::floor(e->z * 32.0);
|
||||||
|
|
||||||
int xa = xn - xp;
|
int xa = xn - xp;
|
||||||
int ya = yn - yp;
|
int ya = yn - yp;
|
||||||
|
|
@ -349,16 +349,16 @@ void TrackedEntity::tick(EntityTracker* tracker,
|
||||||
xRotp = xRotn;
|
xRotp = xRotn;
|
||||||
}
|
}
|
||||||
|
|
||||||
xp = Mth::floor(e->x * 32.0);
|
xp = std::floor(e->x * 32.0);
|
||||||
yp = Mth::floor(e->y * 32.0);
|
yp = std::floor(e->y * 32.0);
|
||||||
zp = Mth::floor(e->z * 32.0);
|
zp = std::floor(e->z * 32.0);
|
||||||
|
|
||||||
sendDirtyEntityData();
|
sendDirtyEntityData();
|
||||||
|
|
||||||
wasRiding = true;
|
wasRiding = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int yHeadRot = Mth::floor(e->getYHeadRot() * 256 / 360);
|
int yHeadRot = std::floor(e->getYHeadRot() * 256 / 360);
|
||||||
if (abs(yHeadRot - yHeadRotp) >= TOLERANCE_LEVEL) {
|
if (abs(yHeadRot - yHeadRotp) >= TOLERANCE_LEVEL) {
|
||||||
broadcast(std::shared_ptr<RotateHeadPacket>(
|
broadcast(std::shared_ptr<RotateHeadPacket>(
|
||||||
new RotateHeadPacket(e->entityId, (uint8_t)yHeadRot)));
|
new RotateHeadPacket(e->entityId, (uint8_t)yHeadRot)));
|
||||||
|
|
@ -664,8 +664,8 @@ void TrackedEntity::updatePlayer(EntityTracker* tracker,
|
||||||
std::shared_ptr<EntityActionAtPositionPacket>(
|
std::shared_ptr<EntityActionAtPositionPacket>(
|
||||||
new EntityActionAtPositionPacket(
|
new EntityActionAtPositionPacket(
|
||||||
e, EntityActionAtPositionPacket::START_SLEEP,
|
e, EntityActionAtPositionPacket::START_SLEEP,
|
||||||
Mth::floor(e->x), Mth::floor(e->y),
|
std::floor(e->x), std::floor(e->y),
|
||||||
Mth::floor(e->z))));
|
std::floor(e->z))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -720,7 +720,7 @@ std::shared_ptr<Packet> TrackedEntity::getAddEntityPacket() {
|
||||||
|
|
||||||
// 4J-PB - replacing with a switch, rather than tons of ifs
|
// 4J-PB - replacing with a switch, rather than tons of ifs
|
||||||
if (std::dynamic_pointer_cast<Creature>(e) != nullptr) {
|
if (std::dynamic_pointer_cast<Creature>(e) != nullptr) {
|
||||||
yHeadRotp = Mth::floor(e->getYHeadRot() * 256 / 360);
|
yHeadRotp = std::floor(e->getYHeadRot() * 256 / 360);
|
||||||
return std::shared_ptr<AddMobPacket>(
|
return std::shared_ptr<AddMobPacket>(
|
||||||
new AddMobPacket(std::dynamic_pointer_cast<Mob>(e), yRotp, xRotp,
|
new AddMobPacket(std::dynamic_pointer_cast<Mob>(e), yRotp, xRotp,
|
||||||
xp, yp, zp, yHeadRotp));
|
xp, yp, zp, yHeadRotp));
|
||||||
|
|
@ -756,7 +756,7 @@ std::shared_ptr<Packet> TrackedEntity::getAddEntityPacket() {
|
||||||
return std::make_shared<AddEntityPacket>(
|
return std::make_shared<AddEntityPacket>(
|
||||||
e, AddEntityPacket::BOAT, yRotp, xRotp, xp, yp, zp);
|
e, AddEntityPacket::BOAT, yRotp, xRotp, xp, yp, zp);
|
||||||
} else if (e->instanceof(eTYPE_ENDERDRAGON)) {
|
} else if (e->instanceof(eTYPE_ENDERDRAGON)) {
|
||||||
yHeadRotp = Mth::floor(e->getYHeadRot() * 256 / 360);
|
yHeadRotp = std::floor(e->getYHeadRot() * 256 / 360);
|
||||||
return std::shared_ptr<AddMobPacket>(
|
return std::shared_ptr<AddMobPacket>(
|
||||||
new AddMobPacket(std::dynamic_pointer_cast<LivingEntity>(e), yRotp,
|
new AddMobPacket(std::dynamic_pointer_cast<LivingEntity>(e), yRotp,
|
||||||
xRotp, xp, yp, zp, yHeadRotp));
|
xRotp, xp, yp, zp, yHeadRotp));
|
||||||
|
|
@ -851,9 +851,9 @@ std::shared_ptr<Packet> TrackedEntity::getAddEntityPacket() {
|
||||||
std::shared_ptr<AddEntityPacket>(
|
std::shared_ptr<AddEntityPacket>(
|
||||||
new AddEntityPacket(e, AddEntityPacket::ITEM_FRAME, frame->dir,
|
new AddEntityPacket(e, AddEntityPacket::ITEM_FRAME, frame->dir,
|
||||||
yRotp, xRotp, xp, yp, zp));
|
yRotp, xRotp, xp, yp, zp));
|
||||||
packet->x = Mth::floor(frame->xTile * 32.0f);
|
packet->x = std::floor(frame->xTile * 32.0f);
|
||||||
packet->y = Mth::floor(frame->yTile * 32.0f);
|
packet->y = std::floor(frame->yTile * 32.0f);
|
||||||
packet->z = Mth::floor(frame->zTile * 32.0f);
|
packet->z = std::floor(frame->zTile * 32.0f);
|
||||||
return packet;
|
return packet;
|
||||||
} else if (e->instanceof(eTYPE_LEASHFENCEKNOT)) {
|
} else if (e->instanceof(eTYPE_LEASHFENCEKNOT)) {
|
||||||
std::shared_ptr<LeashFenceKnotEntity> knot =
|
std::shared_ptr<LeashFenceKnotEntity> knot =
|
||||||
|
|
@ -861,9 +861,9 @@ std::shared_ptr<Packet> TrackedEntity::getAddEntityPacket() {
|
||||||
std::shared_ptr<AddEntityPacket> packet =
|
std::shared_ptr<AddEntityPacket> packet =
|
||||||
std::make_shared<AddEntityPacket>(
|
std::make_shared<AddEntityPacket>(
|
||||||
e, AddEntityPacket::LEASH_KNOT, yRotp, xRotp, xp, yp, zp);
|
e, AddEntityPacket::LEASH_KNOT, yRotp, xRotp, xp, yp, zp);
|
||||||
packet->x = Mth::floor((float)knot->xTile * 32);
|
packet->x = std::floor((float)knot->xTile * 32);
|
||||||
packet->y = Mth::floor((float)knot->yTile * 32);
|
packet->y = std::floor((float)knot->yTile * 32);
|
||||||
packet->z = Mth::floor((float)knot->zTile * 32);
|
packet->z = std::floor((float)knot->zTile * 32);
|
||||||
return packet;
|
return packet;
|
||||||
} else if (e->instanceof(eTYPE_EXPERIENCEORB)) {
|
} else if (e->instanceof(eTYPE_EXPERIENCEORB)) {
|
||||||
return std::shared_ptr<AddExperienceOrbPacket>(
|
return std::shared_ptr<AddExperienceOrbPacket>(
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/network/packet/LoginPacket.h"
|
#include "Minecraft.World/net/minecraft/network/packet/LoginPacket.h"
|
||||||
#include "Minecraft.World/net/minecraft/network/packet/PreLoginPacket.h"
|
#include "Minecraft.World/net/minecraft/network/packet/PreLoginPacket.h"
|
||||||
#include "Minecraft.World/x64headers/extraX64.h"
|
#include "Minecraft.World/x64headers/extraX64.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/BuildVer/BuildVer.h"
|
||||||
#include "java/Random.h"
|
#include "java/Random.h"
|
||||||
|
|
||||||
class Packet;
|
class Packet;
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@ void PlayerConnection::handleMovePlayer(
|
||||||
// stance: " + yd);
|
// stance: " + yd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (abs(packet->x) > 32000000 || abs(packet->z) > 32000000) {
|
if (std::abs(packet->x) > 32000000 || std::abs(packet->z) > 32000000) {
|
||||||
disconnect(DisconnectPacket::eDisconnect_IllegalPosition);
|
disconnect(DisconnectPacket::eDisconnect_IllegalPosition);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
#include "java/System.h"
|
#include "java/System.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.h"
|
#include "Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.h"
|
||||||
#include "Minecraft.World/x64headers/extraX64.h"
|
#include "Minecraft.World/x64headers/extraX64.h"
|
||||||
|
#include "platform/PlatformServices.h"
|
||||||
|
|
||||||
#define RESERVE_ALLOCATION MEM_RESERVE
|
#define RESERVE_ALLOCATION MEM_RESERVE
|
||||||
#define COMMIT_ALLOCATION MEM_COMMIT
|
#define COMMIT_ALLOCATION MEM_COMMIT
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
#include "java/System.h"
|
#include "java/System.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.h"
|
#include "Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFile.h"
|
||||||
#include "Minecraft.World/x64headers/extraX64.h"
|
#include "Minecraft.World/x64headers/extraX64.h"
|
||||||
|
#include "platform/PlatformServices.h"
|
||||||
|
|
||||||
class ProgressListener;
|
class ProgressListener;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,8 +66,8 @@ private:
|
||||||
int32_t DecompressWithType(void* pDestination, unsigned int* pDestSize,
|
int32_t DecompressWithType(void* pDestination, unsigned int* pDestSize,
|
||||||
void* pSource, unsigned int SrcSize);
|
void* pSource, unsigned int SrcSize);
|
||||||
|
|
||||||
XMEMCOMPRESSION_CONTEXT compressionContext;
|
void* compressionContext;
|
||||||
XMEMDECOMPRESSION_CONTEXT decompressionContext;
|
void* decompressionContext;
|
||||||
std::mutex rleCompressLock;
|
std::mutex rleCompressLock;
|
||||||
std::mutex rleDecompressLock;
|
std::mutex rleDecompressLock;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,97 +4,10 @@
|
||||||
//
|
//
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef _WINDOWS64
|
|
||||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
|
||||||
#include <windows.h>
|
|
||||||
#include <malloc.h>
|
|
||||||
#include <tchar.h>
|
|
||||||
#include <d3d11.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <unordered_set>
|
|
||||||
#include <vector>
|
|
||||||
#include "Minecraft.Client/Linux/Stubs/LinuxStubs.h"
|
|
||||||
#else
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <unordered_set>
|
|
||||||
#include <sal.h>
|
|
||||||
#include <vector>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include "Minecraft.World/x64headers/extraX64.h"
|
|
||||||
|
|
||||||
#include <list>
|
|
||||||
#include <map>
|
|
||||||
#include <set>
|
|
||||||
#include <queue>
|
|
||||||
#include <deque>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <math.h>
|
|
||||||
#include <numbers>
|
|
||||||
#include <limits>
|
|
||||||
#include <string>
|
|
||||||
#include <sstream>
|
|
||||||
#include <iostream>
|
|
||||||
#include <exception>
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#include "Minecraft.World/ConsoleHelpers/Definitions.h"
|
|
||||||
#include "java/Class.h"
|
|
||||||
#include "java/Exceptions.h"
|
|
||||||
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
|
||||||
#include "Minecraft.World/ConsoleHelpers/StringHelpers.h"
|
|
||||||
#include "Minecraft.World/ConsoleHelpers/ArrayWithLength.h"
|
|
||||||
#include "java/Random.h"
|
|
||||||
#include "Minecraft.World/net/minecraft/world/level/TilePos.h"
|
|
||||||
#include "Minecraft.World/net/minecraft/world/level/ChunkPos.h"
|
|
||||||
#include "Minecraft.World/Header Files/compression.h"
|
|
||||||
#include "Minecraft.World/ConsoleHelpers/PerformanceTimer.h"
|
|
||||||
|
|
||||||
#ifdef _FINAL_BUILD
|
|
||||||
#define printf BREAKTHECOMPILE
|
|
||||||
#define wprintf BREAKTHECOMPILE
|
|
||||||
#undef OutputDebugString
|
|
||||||
#define OutputDebugString BREAKTHECOMPILE
|
|
||||||
#define OutputDebugStringA BREAKTHECOMPILE
|
|
||||||
#define OutputDebugStringW BREAKTHECOMPILE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#include "platform/PlatformServices.h"
|
|
||||||
|
|
||||||
#include "Minecraft.Client/Common/Source Files/Network/GameNetworkManager.h"
|
|
||||||
|
|
||||||
#include "Minecraft.Client/Common/Source Files/UI/All Platforms/UIEnums.h"
|
|
||||||
#include "Minecraft.Client/Common/App_Defines.h"
|
|
||||||
#include "Minecraft.Client/Common/App_enums.h"
|
|
||||||
#include "Minecraft.Client/Common/Source Files/Tutorial/TutorialEnum.h"
|
|
||||||
#include "Minecraft.Client/Common/App_structs.h"
|
|
||||||
|
|
||||||
#include "Minecraft.Client/Common/Consoles_App.h"
|
|
||||||
#include "Minecraft.Client/Common/Minecraft_Macros.h"
|
|
||||||
#include "Minecraft.Client/Common/Source Files/Colours/ColourTable.h"
|
|
||||||
|
|
||||||
#include "Minecraft.Client/Common/Source Files/BuildVer/BuildVer.h"
|
|
||||||
|
|
||||||
// This is generated at build time via scripts/pack_loc.py
|
|
||||||
#include "strings.h"
|
|
||||||
|
|
||||||
#ifdef _WINDOWS64
|
#ifdef _WINDOWS64
|
||||||
#include "Minecraft.Client/Windows64/Windows64_App.h"
|
#include "Minecraft.Client/Windows64/Windows64_App.h"
|
||||||
#else
|
#else
|
||||||
// Use the Linux runtime path with supported metadata/config headers only.
|
// Use the Linux runtime path with supported metadata/config headers only.
|
||||||
#include "Minecraft.Client/Linux/Linux_App.h"
|
#include "Minecraft.Client/Linux/Linux_App.h"
|
||||||
|
// #include "Minecraft.Client/Linux/Stubs/LinuxStubs.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "Minecraft.Client/Common/Source Files/DLC/DLCSkinFile.h"
|
|
||||||
#include "Minecraft.Client/Common/Source Files/Console_Awards_enum.h"
|
|
||||||
#include "Minecraft.Client/Common/Potion_Macros.h"
|
|
||||||
#include "Minecraft.Client/Common/Source Files/Console_Debug_enum.h"
|
|
||||||
#include "Minecraft.Client/Common/Source Files/GameRules/ConsoleGameRulesConstants.h"
|
|
||||||
#include "Minecraft.Client/Common/Source Files/GameRules/ConsoleGameRules.h"
|
|
||||||
|
|
@ -40,9 +40,7 @@ lib_world = static_library('Minecraft.World',
|
||||||
simdutf_dep,
|
simdutf_dep,
|
||||||
],
|
],
|
||||||
include_directories : include_directories('Header Files', '..'),
|
include_directories : include_directories('Header Files', '..'),
|
||||||
cpp_args : global_cpp_args + global_cpp_defs + [
|
cpp_args : global_cpp_args + global_cpp_defs,
|
||||||
'-include', 'Header Files/stdafx.h',
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
zlib_dep = dependency('zlib')
|
zlib_dep = dependency('zlib')
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "java/Class.h"
|
#include "java/Class.h"
|
||||||
|
|
||||||
class SharedConstants {
|
class SharedConstants {
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#include "Minecraft.Client/Linux/Stubs/winapi_stubs.h"
|
#include "Minecraft.Client/Linux/Stubs/winapi_stubs.h"
|
||||||
#include "java/InputOutputStream/DataInputStream.h"
|
#include "java/InputOutputStream/DataInputStream.h"
|
||||||
#include "java/InputOutputStream/DataOutputStream.h"
|
#include "java/InputOutputStream/DataOutputStream.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/BuildVer/BuildVer.h"
|
||||||
|
|
||||||
PreLoginPacket::PreLoginPacket() {
|
PreLoginPacket::PreLoginPacket() {
|
||||||
loginKey = L"";
|
loginKey = L"";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <format>
|
#include <format>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class Achievement;
|
class Achievement;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class Random;
|
class Random;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "java/Random.h"
|
#include "java/Random.h"
|
||||||
|
|
||||||
// 4J - this WeighedRandomItem class was a nested static class within
|
// 4J - this WeighedRandomItem class was a nested static class within
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
class ItemInstance;
|
class ItemInstance;
|
||||||
class Player;
|
class Player;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -366,7 +366,7 @@ std::wstring MobEffect::formatDuration(MobEffectInstance* instance) {
|
||||||
seconds %= 60;
|
seconds %= 60;
|
||||||
|
|
||||||
wchar_t temp[8];
|
wchar_t temp[8];
|
||||||
ZeroMemory(&temp, 8 * (sizeof(wchar_t)));
|
memset(&temp, 0, 8 * (sizeof(wchar_t)));
|
||||||
|
|
||||||
if (seconds < 10) {
|
if (seconds < 10) {
|
||||||
swprintf(temp, 8, L"%d:0%d", minutes, seconds);
|
swprintf(temp, 8, L"%d:0%d", minutes, seconds);
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,13 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/entity/ai/attributes/AttributeModifier.h"
|
#include "Minecraft.World/net/minecraft/world/entity/ai/attributes/AttributeModifier.h"
|
||||||
#include "Minecraft.Client/Common/App_enums.h"
|
#include "Minecraft.Client/Common/App_enums.h"
|
||||||
|
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
class Mob;
|
class Mob;
|
||||||
class MobEffectInstance;
|
class MobEffectInstance;
|
||||||
class Attribute;
|
class Attribute;
|
||||||
|
class LivingEntity;
|
||||||
|
class BaseAttributeMap;
|
||||||
|
|
||||||
class MobEffect {
|
class MobEffect {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
class AttributeModifier;
|
class AttributeModifier;
|
||||||
|
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
// 4J: This ID is serialised into save data so new attributes must always be
|
// 4J: This ID is serialised into save data so new attributes must always be
|
||||||
// added after existing ones
|
// added after existing ones
|
||||||
enum eATTRIBUTE_ID {
|
enum eATTRIBUTE_ID {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "AttributeModifier.h"
|
#include "AttributeModifier.h"
|
||||||
|
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
class AttributeInstance {
|
class AttributeInstance {
|
||||||
public:
|
public:
|
||||||
virtual ~AttributeInstance() {}
|
virtual ~AttributeInstance() {}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ void BodyControl::clientTick() {
|
||||||
|
|
||||||
// Body will align to head after looking long enough in a direction
|
// Body will align to head after looking long enough in a direction
|
||||||
float clampAngle = maxClampAngle;
|
float clampAngle = maxClampAngle;
|
||||||
if (abs(mob->yHeadRot - lastHeadY) > 15) {
|
if (std::abs(mob->yHeadRot - lastHeadY) > 15) {
|
||||||
timeStill = 0;
|
timeStill = 0;
|
||||||
lastHeadY = mob->yHeadRot;
|
lastHeadY = mob->yHeadRot;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,8 @@ bool TemptGoal::canContinueToUse() {
|
||||||
if (mob->distanceToSqr(player.lock()) < 6 * 6) {
|
if (mob->distanceToSqr(player.lock()) < 6 * 6) {
|
||||||
if (player.lock()->distanceToSqr(px, py, pz) > 0.1 * 0.1)
|
if (player.lock()->distanceToSqr(px, py, pz) > 0.1 * 0.1)
|
||||||
return false;
|
return false;
|
||||||
if (abs(player.lock()->xRot - pRotX) > 5 ||
|
if (std::abs(player.lock()->xRot - pRotX) > 5 ||
|
||||||
abs(player.lock()->yRot - pRotY) > 5)
|
std::abs(player.lock()->yRot - pRotY) > 5)
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
px = player.lock()->x;
|
px = player.lock()->x;
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/level/Level.h"
|
#include "Minecraft.World/net/minecraft/world/level/Level.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/tile/Tile.h"
|
#include "Minecraft.World/net/minecraft/world/level/tile/Tile.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/phys/AABB.h"
|
#include "Minecraft.World/net/minecraft/world/phys/AABB.h"
|
||||||
|
#include "platform/PlatformServices.h"
|
||||||
|
|
||||||
const double Ocelot::SNEAK_SPEED_MOD = 0.6;
|
const double Ocelot::SNEAK_SPEED_MOD = 0.6;
|
||||||
const double Ocelot::WALK_SPEED_MOD = 0.8;
|
const double Ocelot::WALK_SPEED_MOD = 0.8;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
class Level;
|
||||||
class MultiEntityMobPart;
|
class MultiEntityMobPart;
|
||||||
|
class DamageSource;
|
||||||
|
|
||||||
class MultiEntityMob {
|
class MultiEntityMob {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h"
|
#include "Minecraft.World/net/minecraft/world/item/trading/net.minecraft.world.item.trading.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h"
|
#include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h"
|
#include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/renderer/Textures.h"
|
#include "Minecraft.Client/net/minecraft/client/renderer/Textures.h"
|
||||||
#include "Villager.h"
|
#include "Villager.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h"
|
#include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h"
|
#include "Minecraft.World/net/minecraft/world/item/net.minecraft.world.item.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h"
|
#include "Minecraft.World/net/minecraft/world/item/enchantment/net.minecraft.world.item.enchantment.h"
|
||||||
|
#include "Minecraft.World/ConsoleHelpers/StringHelpers.h"
|
||||||
#include "AnvilMenu.h"
|
#include "AnvilMenu.h"
|
||||||
|
|
||||||
AnvilMenu::AnvilMenu(std::shared_ptr<Inventory> inventory, Level* level, int xt,
|
AnvilMenu::AnvilMenu(std::shared_ptr<Inventory> inventory, Level* level, int xt,
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h"
|
#include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h"
|
#include "Minecraft.World/net/minecraft/world/level/tile/net.minecraft.world.level.tile.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h"
|
#include "Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
#include "ItemInstance.h"
|
#include "ItemInstance.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/phys/Vec3.h"
|
#include "Minecraft.World/net/minecraft/world/phys/Vec3.h"
|
||||||
#include "BoatItem.h"
|
#include "BoatItem.h"
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/net.minecraft.world.h"
|
#include "Minecraft.World/net/minecraft/world/net.minecraft.world.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/material/Material.h"
|
#include "Minecraft.World/net/minecraft/world/level/material/Material.h"
|
||||||
#include "DyePowderItem.h"
|
#include "DyePowderItem.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
DyePowderItem::DyePowderItem(int id) : Item(id) {
|
DyePowderItem::DyePowderItem(int id) : Item(id) {
|
||||||
setStackedByData(true);
|
setStackedByData(true);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include "net.minecraft.world.item.h"
|
#include "net.minecraft.world.item.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h"
|
#include "Minecraft.World/net/minecraft/world/level/net.minecraft.world.level.h"
|
||||||
#include "FireworksItem.h"
|
#include "FireworksItem.h"
|
||||||
|
#include "Minecraft.World/ConsoleHelpers/StringHelpers.h"
|
||||||
|
|
||||||
const std::wstring FireworksItem::TAG_FIREWORKS = L"Fireworks";
|
const std::wstring FireworksItem::TAG_FIREWORKS = L"Fireworks";
|
||||||
const std::wstring FireworksItem::TAG_EXPLOSION = L"Explosion";
|
const std::wstring FireworksItem::TAG_EXPLOSION = L"Explosion";
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ void HangingEntityItem::appendHoverText(
|
||||||
int motive = itemInstance->getAuxValue() - 1;
|
int motive = itemInstance->getAuxValue() - 1;
|
||||||
|
|
||||||
wchar_t formatted[256];
|
wchar_t formatted[256];
|
||||||
ZeroMemory(formatted, 256 * sizeof(wchar_t));
|
memset(formatted, 0, 256 * sizeof(wchar_t));
|
||||||
swprintf(formatted, 256, L"** %ls %dx%d",
|
swprintf(formatted, 256, L"** %ls %dx%d",
|
||||||
Painting::Motive::values[motive]->name.c_str(),
|
Painting::Motive::values[motive]->name.c_str(),
|
||||||
Painting::Motive::values[motive]->w / 16,
|
Painting::Motive::values[motive]->w / 16,
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
#include "HangingEntityItem.h"
|
#include "HangingEntityItem.h"
|
||||||
#include "Minecraft.World/net/minecraft/util/HtmlString.h"
|
#include "Minecraft.World/net/minecraft/util/HtmlString.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/phys/Vec3.h"
|
#include "Minecraft.World/net/minecraft/world/phys/Vec3.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
typedef Item::Tier _Tier;
|
typedef Item::Tier _Tier;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ class EnchantedBookItem;
|
||||||
class EmptyMapItem;
|
class EmptyMapItem;
|
||||||
class LivingEntity;
|
class LivingEntity;
|
||||||
class HtmlString;
|
class HtmlString;
|
||||||
|
class Tile;
|
||||||
|
class Entity;
|
||||||
|
|
||||||
#define ITEM_ICON_COLUMNS 16
|
#define ITEM_ICON_COLUMNS 16
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/SharedConstants.h"
|
#include "Minecraft.World/net/minecraft/SharedConstants.h"
|
||||||
#include "PotionItem.h"
|
#include "PotionItem.h"
|
||||||
#include "Minecraft.World/Header Files/SoundTypes.h"
|
#include "Minecraft.World/Header Files/SoundTypes.h"
|
||||||
|
#include "Minecraft.Client/Common/Potion_Macros.h"
|
||||||
|
|
||||||
const std::wstring PotionItem::DEFAULT_ICON = L"potion";
|
const std::wstring PotionItem::DEFAULT_ICON = L"potion";
|
||||||
const std::wstring PotionItem::THROWABLE_ICON = L"potion_splash";
|
const std::wstring PotionItem::THROWABLE_ICON = L"potion_splash";
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/net.minecraft.h"
|
#include "Minecraft.World/net/minecraft/net.minecraft.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/net.minecraft.world.h"
|
#include "Minecraft.World/net/minecraft/world/net.minecraft.world.h"
|
||||||
#include "SkullItem.h"
|
#include "SkullItem.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
const unsigned int SkullItem::NAMES[SKULL_COUNT] = {
|
const unsigned int SkullItem::NAMES[SKULL_COUNT] = {
|
||||||
IDS_ITEM_SKULL_SKELETON, IDS_ITEM_SKULL_WITHER, IDS_ITEM_SKULL_ZOMBIE,
|
IDS_ITEM_SKULL_SKELETON, IDS_ITEM_SKULL_WITHER, IDS_ITEM_SKULL_ZOMBIE,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/phys/HitResult.h"
|
#include "Minecraft.World/net/minecraft/world/phys/HitResult.h"
|
||||||
#include "SpawnEggItem.h"
|
#include "SpawnEggItem.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/Difficulty.h"
|
#include "Minecraft.World/net/minecraft/world/Difficulty.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/Colours/ColourTable.h"
|
||||||
|
|
||||||
SpawnEggItem::SpawnEggItem(int id) : Item(id) {
|
SpawnEggItem::SpawnEggItem(int id) : Item(id) {
|
||||||
setMaxStackSize(16); // 4J-PB brought forward. It is 64 on PC, but we'll
|
setMaxStackSize(16); // 4J-PB brought forward. It is 64 on PC, but we'll
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
#include "java/JavaMath.h"
|
#include "java/JavaMath.h"
|
||||||
#include "Minecraft.World/net/minecraft/SharedConstants.h"
|
#include "Minecraft.World/net/minecraft/SharedConstants.h"
|
||||||
#include "PotionBrewing.h"
|
#include "PotionBrewing.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/Colours/ColourTable.h"
|
||||||
|
|
||||||
const int PotionBrewing::DEFAULT_APPEARANCES[] = {
|
const int PotionBrewing::DEFAULT_APPEARANCES[] = {
|
||||||
IDS_POTION_PREFIX_MUNDANE, IDS_POTION_PREFIX_UNINTERESTING,
|
IDS_POTION_PREFIX_MUNDANE, IDS_POTION_PREFIX_UNINTERESTING,
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Minecraft.World/net/minecraft/world/inventory/CraftingContainer.h"
|
#include "Minecraft.World/net/minecraft/world/inventory/CraftingContainer.h"
|
||||||
|
#include "4J.Common/4J_Compat.h"
|
||||||
|
|
||||||
#define RECIPE_TYPE_2x2 0
|
#define RECIPE_TYPE_2x2 0
|
||||||
#define RECIPE_TYPE_3x3 1
|
#define RECIPE_TYPE_3x3 1
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ void Enchantment::_init(int id) {
|
||||||
if (enchantments[id] != nullptr) {
|
if (enchantments[id] != nullptr) {
|
||||||
app.DebugPrintf("Duplicate enchantment id!");
|
app.DebugPrintf("Duplicate enchantment id!");
|
||||||
#ifndef _CONTENT_PACKAGE
|
#ifndef _CONTENT_PACKAGE
|
||||||
__debugbreak();
|
assert(0);
|
||||||
#endif
|
#endif
|
||||||
// throw new IllegalArgumentException("Duplicate enchantment id!");
|
// throw new IllegalArgumentException("Duplicate enchantment id!");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,14 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "EnchantmentCategory.h"
|
#include "EnchantmentCategory.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/HtmlString.h"
|
||||||
|
|
||||||
class DamageSource;
|
class DamageSource;
|
||||||
|
class LivingEntity;
|
||||||
|
class ItemInstance;
|
||||||
class Mob;
|
class Mob;
|
||||||
|
|
||||||
class Enchantment // implements Descriptive<Enchantment> {
|
class Enchantment // implements Descriptive<Enchantment> {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/damageSource/net.minecraft.world.damagesource.h"
|
#include "Minecraft.World/net/minecraft/world/damageSource/net.minecraft.world.damagesource.h"
|
||||||
#include "net.minecraft.world.item.enchantment.h"
|
#include "net.minecraft.world.item.enchantment.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h"
|
#include "Minecraft.World/net/minecraft/world/entity/net.minecraft.world.entity.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
#include "ProtectionEnchantment.h"
|
#include "ProtectionEnchantment.h"
|
||||||
|
|
||||||
const int ProtectionEnchantment::names[] = {
|
const int ProtectionEnchantment::names[] = {
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,7 @@
|
||||||
#include "net/minecraft/world/phys/Vec3.h"
|
#include "net/minecraft/world/phys/Vec3.h"
|
||||||
#include "net/minecraft/world/scores/Scoreboard.h"
|
#include "net/minecraft/world/scores/Scoreboard.h"
|
||||||
#include "Minecraft.World/x64headers/extraX64.h"
|
#include "Minecraft.World/x64headers/extraX64.h"
|
||||||
|
#include "platform/PlatformServices.h"
|
||||||
|
|
||||||
class CompoundTag;
|
class CompoundTag;
|
||||||
class ItemInstance;
|
class ItemInstance;
|
||||||
|
|
|
||||||
|
|
@ -74,33 +74,33 @@ public:
|
||||||
using lightCache_t = unsigned int;
|
using lightCache_t = unsigned int;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const int MAX_TICK_TILES_PER_TICK = 1000;
|
static constexpr int MAX_TICK_TILES_PER_TICK = 1000;
|
||||||
|
|
||||||
// 4J Added
|
// 4J Added
|
||||||
static const int MAX_GRASS_TICKS = 100;
|
static constexpr int MAX_GRASS_TICKS = 100;
|
||||||
static const int MAX_LAVA_TICKS = 100;
|
static constexpr int MAX_LAVA_TICKS = 100;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const int MAX_XBOX_BOATS = 40; // Max number of boats
|
static constexpr int MAX_XBOX_BOATS = 40; // Max number of boats
|
||||||
static const int MAX_CONSOLE_MINECARTS = 40;
|
static constexpr int MAX_CONSOLE_MINECARTS = 40;
|
||||||
static const int MAX_DISPENSABLE_FIREBALLS = 200;
|
static constexpr int MAX_DISPENSABLE_FIREBALLS = 200;
|
||||||
static const int MAX_DISPENSABLE_PROJECTILES = 300;
|
static constexpr int MAX_DISPENSABLE_PROJECTILES = 300;
|
||||||
|
|
||||||
static const int MAX_LEVEL_SIZE = 30000000;
|
static constexpr int MAX_LEVEL_SIZE = 30000000;
|
||||||
static const int maxMovementHeight = 512; // 4J added
|
static constexpr int maxMovementHeight = 512; // 4J added
|
||||||
|
|
||||||
static const int minBuildHeight = 0; // 4J - brought forward from 1.2.3
|
static constexpr int minBuildHeight = 0; // 4J - brought forward from 1.2.3
|
||||||
static const int maxBuildHeight = 256; // 4J - brought forward from 1.2.3
|
static constexpr int maxBuildHeight = 256; // 4J - brought forward from 1.2.3
|
||||||
static const int genDepthBits = 7;
|
static constexpr int genDepthBits = 7;
|
||||||
static const int genDepthBitsPlusFour = genDepthBits + 4;
|
static constexpr int genDepthBitsPlusFour = genDepthBits + 4;
|
||||||
static const int genDepth = 1 << genDepthBits;
|
static constexpr int genDepth = 1 << genDepthBits;
|
||||||
static const int genDepthMinusOne = genDepth - 1;
|
static constexpr int genDepthMinusOne = genDepth - 1;
|
||||||
static const int constSeaLevel = genDepth / 2 - 1;
|
static constexpr int constSeaLevel = genDepth / 2 - 1;
|
||||||
|
|
||||||
static const int CHUNK_TILE_COUNT = maxBuildHeight * 16 * 16;
|
static constexpr int CHUNK_TILE_COUNT = maxBuildHeight * 16 * 16;
|
||||||
static const int HALF_CHUNK_TILE_COUNT = CHUNK_TILE_COUNT / 2;
|
static constexpr int HALF_CHUNK_TILE_COUNT = CHUNK_TILE_COUNT / 2;
|
||||||
static const int COMPRESSED_CHUNK_SECTION_HEIGHT = 128;
|
static constexpr int COMPRESSED_CHUNK_SECTION_HEIGHT = 128;
|
||||||
static const int COMPRESSED_CHUNK_SECTION_TILES =
|
static constexpr int COMPRESSED_CHUNK_SECTION_TILES =
|
||||||
COMPRESSED_CHUNK_SECTION_HEIGHT * 16 * 16; // 4J Stu - Fixed size
|
COMPRESSED_CHUNK_SECTION_HEIGHT * 16 * 16; // 4J Stu - Fixed size
|
||||||
|
|
||||||
int seaLevel;
|
int seaLevel;
|
||||||
|
|
@ -116,8 +116,8 @@ public:
|
||||||
static void setInstaTick(bool enable);
|
static void setInstaTick(bool enable);
|
||||||
// bool instaTick; // 4J - removed
|
// bool instaTick; // 4J - removed
|
||||||
|
|
||||||
static const int MAX_BRIGHTNESS = 15;
|
static constexpr int MAX_BRIGHTNESS = 15;
|
||||||
static const int TICKS_PER_DAY = 20 * 60 * 20; // ORG:20*60*20
|
static constexpr int TICKS_PER_DAY = 20 * 60 * 20; // ORG:20*60*20
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::recursive_mutex m_entitiesCS; // 4J added
|
std::recursive_mutex m_entitiesCS; // 4J added
|
||||||
|
|
@ -307,21 +307,21 @@ public:
|
||||||
LightLayer::variety layer);
|
LightLayer::variety layer);
|
||||||
|
|
||||||
bool cachewritten;
|
bool cachewritten;
|
||||||
static const int LIGHTING_SHIFT = 24;
|
static constexpr int LIGHTING_SHIFT = 24;
|
||||||
static const int BLOCKING_SHIFT = 20;
|
static constexpr int BLOCKING_SHIFT = 20;
|
||||||
static const int EMISSION_SHIFT = 16;
|
static constexpr int EMISSION_SHIFT = 16;
|
||||||
#if defined(_LARGE_WORLDS)
|
#if defined(_LARGE_WORLDS)
|
||||||
static const int64_t LIGHTING_WRITEBACK = 0x80000000LL;
|
static constexpr int64_t LIGHTING_WRITEBACK = 0x80000000LL;
|
||||||
static const int64_t EMISSION_VALID = 0x40000000LL;
|
static constexpr int64_t EMISSION_VALID = 0x40000000LL;
|
||||||
static const int64_t BLOCKING_VALID = 0x20000000LL;
|
static constexpr int64_t BLOCKING_VALID = 0x20000000LL;
|
||||||
static const int64_t LIGHTING_VALID = 0x10000000LL;
|
static constexpr int64_t LIGHTING_VALID = 0x10000000LL;
|
||||||
static const lightCache_t POSITION_MASK = 0xffffffff0000ffffLL;
|
static constexpr lightCache_t POSITION_MASK = 0xffffffff0000ffffLL;
|
||||||
#else
|
#else
|
||||||
static const int LIGHTING_WRITEBACK = 0x80000000;
|
static constexpr int LIGHTING_WRITEBACK = 0x80000000;
|
||||||
static const int EMISSION_VALID = 0x40000000;
|
static constexpr int EMISSION_VALID = 0x40000000;
|
||||||
static const int BLOCKING_VALID = 0x20000000;
|
static constexpr int BLOCKING_VALID = 0x20000000;
|
||||||
static const int LIGHTING_VALID = 0x10000000;
|
static constexpr int LIGHTING_VALID = 0x10000000;
|
||||||
static const lightCache_t POSITION_MASK = 0x0000ffff;
|
static constexpr lightCache_t POSITION_MASK = 0x0000ffff;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int cacheminx, cachemaxx, cacheminy, cachemaxy, cacheminz, cachemaxz;
|
int cacheminx, cachemaxx, cacheminy, cachemaxy, cacheminz, cachemaxz;
|
||||||
|
|
@ -472,9 +472,9 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int delayUntilNextMoodSound;
|
int delayUntilNextMoodSound;
|
||||||
static const int CHUNK_POLL_RANGE = 9;
|
static constexpr int CHUNK_POLL_RANGE = 9;
|
||||||
static const int CHUNK_TILE_TICK_COUNT = 80;
|
static constexpr int CHUNK_TILE_TICK_COUNT = 80;
|
||||||
static const int CHUNK_SECTION_TILE_TICK_COUNT =
|
static constexpr int CHUNK_SECTION_TILE_TICK_COUNT =
|
||||||
(CHUNK_TILE_TICK_COUNT / 8) + 1;
|
(CHUNK_TILE_TICK_COUNT / 8) + 1;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
class BiomeSource;
|
class BiomeSource;
|
||||||
class Material;
|
class Material;
|
||||||
class TileEntity;
|
class TileEntity;
|
||||||
|
class Biome;
|
||||||
|
|
||||||
#include "LightLayer.h"
|
#include "LightLayer.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
#include "BiomeSource.h"
|
#include "BiomeSource.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/Minecraft.h"
|
#include "Minecraft.Client/net/minecraft/client/Minecraft.h"
|
||||||
#include "Minecraft.Client/net/minecraft/client/ProgressRenderer.h"
|
#include "Minecraft.Client/net/minecraft/client/ProgressRenderer.h"
|
||||||
|
#include "Minecraft.Client/Common/Source Files/Console_Debug_enum.h"
|
||||||
|
#include "platform/PlatformServices.h"
|
||||||
|
|
||||||
// 4J - removal of separate temperature & downfall layers brought forward
|
// 4J - removal of separate temperature & downfall layers brought forward
|
||||||
// from 1.2.3
|
// from 1.2.3
|
||||||
|
|
@ -151,7 +153,7 @@ void BiomeSource::getRawBiomeBlock(std::vector<Biome*>& biomes, int x, int z, in
|
||||||
#if !defined(_CONTENT_PACKAGE)
|
#if !defined(_CONTENT_PACKAGE)
|
||||||
if (biomes[i] == nullptr) {
|
if (biomes[i] == nullptr) {
|
||||||
app.DebugPrintf("Tried to assign null biome %d\n", result[i]);
|
app.DebugPrintf("Tried to assign null biome %d\n", result[i]);
|
||||||
__debugbreak();
|
assert(0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h"
|
#include "Minecraft.World/net/minecraft/world/level/chunk/storage/OldChunkStorage.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.h"
|
#include "Minecraft.World/net/minecraft/world/level/chunk/storage/RegionFileCache.h"
|
||||||
#include "Minecraft.World/x64headers/extraX64.h"
|
#include "Minecraft.World/x64headers/extraX64.h"
|
||||||
|
#include "platform/PlatformServices.h"
|
||||||
|
|
||||||
class DataInput;
|
class DataInput;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/level/storage/LevelData.h"
|
#include "Minecraft.World/net/minecraft/world/level/storage/LevelData.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h"
|
#include "Minecraft.World/net/minecraft/world/level/tile/entity/TileEntity.h"
|
||||||
#include "Minecraft.World/x64headers/extraX64.h"
|
#include "Minecraft.World/x64headers/extraX64.h"
|
||||||
|
#include "platform/PlatformServices.h"
|
||||||
|
|
||||||
thread_local OldChunkStorage::ThreadStorage* OldChunkStorage::m_tlsStorage =
|
thread_local OldChunkStorage::ThreadStorage* OldChunkStorage::m_tlsStorage =
|
||||||
nullptr;
|
nullptr;
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/level/levelgen/flat/FlatGeneratorInfo.h"
|
#include "Minecraft.World/net/minecraft/world/level/levelgen/flat/FlatGeneratorInfo.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/storage/LevelData.h"
|
#include "Minecraft.World/net/minecraft/world/level/storage/LevelData.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/tile/Tile.h"
|
#include "Minecraft.World/net/minecraft/world/level/tile/Tile.h"
|
||||||
|
#include "platform/PlatformServices.h"
|
||||||
|
|
||||||
class Pos;
|
class Pos;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.h"
|
#include "Minecraft.World/net/minecraft/world/level/levelgen/HellRandomLevelSource.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/storage/LevelData.h"
|
#include "Minecraft.World/net/minecraft/world/level/storage/LevelData.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/phys/Vec3.h"
|
#include "Minecraft.World/net/minecraft/world/phys/Vec3.h"
|
||||||
|
#include "platform/PlatformServices.h"
|
||||||
|
|
||||||
void HellDimension::init() {
|
void HellDimension::init() {
|
||||||
biomeSource = new FixedBiomeSource(Biome::hell, 1, 0);
|
biomeSource = new FixedBiomeSource(Biome::hell, 1, 0);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Minecraft.World/ConsoleHelpers/ArrayWithLength.h"
|
#include "Minecraft.World/ConsoleHelpers/ArrayWithLength.h"
|
||||||
|
#include "nbt/IntArrayTag.h"
|
||||||
|
|
||||||
class BoundingBox {
|
class BoundingBox {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
#include "StructurePiece.h"
|
#include "StructurePiece.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureIO.h"
|
#include "Minecraft.World/net/minecraft/world/level/levelgen/structure/StructureFeatureIO.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.h"
|
#include "Minecraft.World/net/minecraft/world/level/levelgen/structure/StructurePiece.h"
|
||||||
|
#include "nbt/CompoundTag.h"
|
||||||
|
|
||||||
class BoundingBox;
|
class BoundingBox;
|
||||||
class Random;
|
class Random;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include "nbt/CompoundTag.h"
|
||||||
|
|
||||||
class StructurePiece;
|
class StructurePiece;
|
||||||
class StructureStart;
|
class StructureStart;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/util/WeighedRandom.h"
|
#include "Minecraft.World/net/minecraft/util/WeighedRandom.h"
|
||||||
#include "BoundingBox.h"
|
#include "BoundingBox.h"
|
||||||
#include "StructureFeatureIO.h"
|
#include "StructureFeatureIO.h"
|
||||||
|
#include "nbt/CompoundTag.h"
|
||||||
|
|
||||||
class Level;
|
class Level;
|
||||||
class Random;
|
class Random;
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/level/newbiome/layer/SwampRiversLayer.h"
|
#include "Minecraft.World/net/minecraft/world/level/newbiome/layer/SwampRiversLayer.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/newbiome/layer/VoronoiZoom.h"
|
#include "Minecraft.World/net/minecraft/world/level/newbiome/layer/VoronoiZoom.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/newbiome/layer/ZoomLayer.h"
|
#include "Minecraft.World/net/minecraft/world/level/newbiome/layer/ZoomLayer.h"
|
||||||
|
#include "platform/PlatformServices.h"
|
||||||
|
|
||||||
std::vector<std::shared_ptr<Layer>> Layer::getDefaultLayers(int64_t seed, LevelType* levelType) {
|
std::vector<std::shared_ptr<Layer>> Layer::getDefaultLayers(int64_t seed, LevelType* levelType) {
|
||||||
// 4J - Some changes moved here from 1.2.3. Temperature & downfall layers
|
// 4J - Some changes moved here from 1.2.3. Temperature & downfall layers
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/level/storage/LevelStorage.h"
|
#include "Minecraft.World/net/minecraft/world/level/storage/LevelStorage.h"
|
||||||
#include "Minecraft.World/net/minecraft/world/level/storage/PlayerIO.h"
|
#include "Minecraft.World/net/minecraft/world/level/storage/PlayerIO.h"
|
||||||
#include "Minecraft.World/x64headers/extraX64.h"
|
#include "Minecraft.World/x64headers/extraX64.h"
|
||||||
|
#include "platform/PlatformServices.h"
|
||||||
|
|
||||||
const std::wstring DirectoryLevelStorage::sc_szPlayerDir(L"players/");
|
const std::wstring DirectoryLevelStorage::sc_szPlayerDir(L"players/");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/net.minecraft.world.h"
|
#include "Minecraft.World/net/minecraft/world/net.minecraft.world.h"
|
||||||
#include "Minecraft.World/net/minecraft/net.minecraft.h"
|
#include "Minecraft.World/net/minecraft/net.minecraft.h"
|
||||||
#include "AnvilTile.h"
|
#include "AnvilTile.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
const unsigned int AnvilTile::ANVIL_NAMES[ANVIL_NAMES_LENGTH] = {
|
const unsigned int AnvilTile::ANVIL_NAMES[ANVIL_NAMES_LENGTH] = {
|
||||||
IDS_TILE_ANVIL_INTACT,
|
IDS_TILE_ANVIL_INTACT,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
#include "Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h"
|
#include "Minecraft.World/net/minecraft/world/phys/net.minecraft.world.phys.h"
|
||||||
#include "ChestTile.h"
|
#include "ChestTile.h"
|
||||||
#include "Minecraft.World/net/minecraft/Facing.h"
|
#include "Minecraft.World/net/minecraft/Facing.h"
|
||||||
|
#include "Minecraft.World/net/minecraft/util/Mth.h"
|
||||||
|
|
||||||
ChestTile::ChestTile(int id, int type)
|
ChestTile::ChestTile(int id, int type)
|
||||||
: BaseEntityTile(id, Material::wood, false) {
|
: BaseEntityTile(id, Material::wood, false) {
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue