mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-06-05 07:13:06 +00:00
format it all
Some checks are pending
Some checks are pending
This commit is contained in:
parent
2fc0095b86
commit
64a44b5385
|
|
@ -6,8 +6,8 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "platform/PlatformTypes.h"
|
||||
#include "minecraft/IGameServices.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
#include "platform/fs/fs.h"
|
||||
#include "platform/renderer/renderer.h"
|
||||
#include "util/StringHelpers.h"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
#include "minecraft/world/item/Item.h"
|
||||
#include "minecraft/world/level/tile/Tile.h"
|
||||
// 4J Stu - Added for tutorial callbacks
|
||||
#include "platform/PlatformTypes.h"
|
||||
#include "Pos.h"
|
||||
#include "app/common/Audio/ConsoleSoundEngine.h"
|
||||
#include "app/common/Audio/SoundTypes.h"
|
||||
|
|
@ -79,6 +78,7 @@
|
|||
#include "minecraft/world/phys/HitResult.h"
|
||||
#include "minecraft/world/phys/Vec3.h"
|
||||
#include "minecraft/world/tutorial/ITutorial.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
#include "platform/input/input.h"
|
||||
#include "platform/profile/ProfileConstants.h"
|
||||
#include "platform/profile/profile.h"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#include "minecraft/locale/StringTable.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <ranges>
|
||||
#include <utility>
|
||||
#include <cassert>
|
||||
|
||||
#include "java/InputOutputStream/ByteArrayInputStream.h"
|
||||
#include "java/InputOutputStream/DataInputStream.h"
|
||||
|
|
|
|||
|
|
@ -685,13 +685,12 @@ void Entity::move(double xa, double ya, double za,
|
|||
onGround && isSneaking() && instanceof(eTYPE_PLAYER);
|
||||
|
||||
auto shared = shared_from_this();
|
||||
|
||||
|
||||
if (isPlayerSneaking) {
|
||||
double d = 0.05;
|
||||
|
||||
AABB translated_bb = bb.move(xa, -1.0, 0.0);
|
||||
while (xa != 0 &&
|
||||
level->getCubes(shared, &translated_bb)->empty()) {
|
||||
while (xa != 0 && level->getCubes(shared, &translated_bb)->empty()) {
|
||||
if (xa < d && xa >= -d)
|
||||
xa = 0;
|
||||
else if (xa > 0)
|
||||
|
|
@ -702,8 +701,7 @@ void Entity::move(double xa, double ya, double za,
|
|||
}
|
||||
|
||||
translated_bb = bb.move(0, -1.0, za);
|
||||
while (za != 0 &&
|
||||
level->getCubes(shared, &translated_bb)->empty()) {
|
||||
while (za != 0 && level->getCubes(shared, &translated_bb)->empty()) {
|
||||
if (za < d && za >= -d)
|
||||
za = 0;
|
||||
else if (za > 0)
|
||||
|
|
|
|||
|
|
@ -1244,7 +1244,7 @@ void LivingEntity::jumpFromGround() {
|
|||
}
|
||||
|
||||
void LivingEntity::travel(float xa, float ya) {
|
||||
// AP - dynamic_pointer_cast is a non-trivial call, use raw pointer instead
|
||||
// AP - dynamic_pointer_cast is a non-trivial call, use raw pointer instead
|
||||
Player* thisPlayer = nullptr;
|
||||
if (this->instanceof(eTYPE_PLAYER)) {
|
||||
thisPlayer = (Player*)this;
|
||||
|
|
@ -1280,10 +1280,11 @@ void LivingEntity::travel(float xa, float ya) {
|
|||
int frictionTile = 0;
|
||||
if (onGround) {
|
||||
friction = 0.6f * 0.91f;
|
||||
frictionTile = level->getTile(Mth::floor(x), Mth::floor(bb.y0) - 1, Mth::floor(z));
|
||||
if (frictionTile > 0) {
|
||||
friction = Tile::tiles[frictionTile]->friction * 0.91f;
|
||||
}
|
||||
frictionTile = level->getTile(Mth::floor(x), Mth::floor(bb.y0) - 1,
|
||||
Mth::floor(z));
|
||||
if (frictionTile > 0) {
|
||||
friction = Tile::tiles[frictionTile]->friction * 0.91f;
|
||||
}
|
||||
}
|
||||
|
||||
float friction2 = (0.6f * 0.6f * 0.91f * 0.91f * 0.6f * 0.91f) /
|
||||
|
|
@ -1301,9 +1302,9 @@ void LivingEntity::travel(float xa, float ya) {
|
|||
friction = 0.91f;
|
||||
if (onGround) {
|
||||
friction = 0.6f * 0.91f;
|
||||
if (frictionTile > 0) {
|
||||
friction = Tile::tiles[frictionTile]->friction * 0.91f;
|
||||
}
|
||||
if (frictionTile > 0) {
|
||||
friction = Tile::tiles[frictionTile]->friction * 0.91f;
|
||||
}
|
||||
}
|
||||
if (onLadder()) {
|
||||
float max = 0.15f;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
#include <wchar.h>
|
||||
|
||||
#include "platform/PlatformTypes.h"
|
||||
#include "minecraft/client/Minecraft.h"
|
||||
#include "minecraft/network/packet/SignUpdatePacket.h"
|
||||
#include "minecraft/server/level/ServerLevel.h"
|
||||
#include "minecraft/world/level/Level.h"
|
||||
#include "minecraft/world/level/tile/entity/TileEntity.h"
|
||||
#include "nbt/CompoundTag.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
|
||||
class Player;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
#include "SDL2Input.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
#include "../../PlatformTypes.h"
|
||||
#include "../InputConstants.h"
|
||||
#include "SDL2/SDL.h"
|
||||
#include "SDL2/SDL_events.h"
|
||||
#include "SDL2/SDL_gamecontroller.h"
|
||||
|
|
@ -10,15 +19,6 @@
|
|||
#include "SDL2/SDL_stdinc.h"
|
||||
#include "SDL2/SDL_video.h"
|
||||
#include "SDL2/begin_code.h"
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
#include "../../PlatformTypes.h"
|
||||
#include "../InputConstants.h"
|
||||
|
||||
namespace platform_internal {
|
||||
IPlatformInput& PlatformInput_get() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#include "GLRenderer.h"
|
||||
|
||||
#include "platform/PlatformTypes.h"
|
||||
#include "SDL.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_events.h"
|
||||
|
|
@ -9,6 +8,7 @@
|
|||
#include "java/ByteBuffer.h"
|
||||
#include "java/FloatBuffer.h"
|
||||
#include "java/IntBuffer.h"
|
||||
#include "platform/PlatformTypes.h"
|
||||
#include "platform/renderer/renderer.h"
|
||||
|
||||
// undefine macros from header to avoid argument mismatch
|
||||
|
|
@ -41,12 +41,9 @@
|
|||
#include "stb_image.h"
|
||||
|
||||
#define GLM_FORCE_RADIANS
|
||||
#include "glm/glm.hpp"
|
||||
#include "glm/gtc/matrix_transform.hpp"
|
||||
#include "glm/gtc/type_ptr.hpp"
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
|
@ -54,6 +51,10 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "glm/glm.hpp"
|
||||
#include "glm/gtc/matrix_transform.hpp"
|
||||
#include "glm/gtc/type_ptr.hpp"
|
||||
|
||||
namespace platform_internal {
|
||||
IPlatformRenderer& PlatformRenderer_get() {
|
||||
static GLRenderer instance;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "java/File.h"
|
||||
|
|
|
|||
Loading…
Reference in a new issue