Added 3 unicode pages for font, fixed UI, added Block.breakable

Added 1, 2, 3 and 4 unicode pages from Minecraft.
Font now uses std::wstring instead of std::string
Added Block.breakable field (the only unbreakable block is bedrock)
Bedrock is now selectable
This commit is contained in:
MihailRis 2022-07-14 19:23:31 +03:00 • committed by GitHub
parent b2872650d6
commit bdd3fbf7d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 94 additions and 47 deletions

View file

@ -6,6 +6,7 @@
#include "physics/Hitbox.h"
#include "lighting/Lighting.h"
#include "world/Level.h"
#include "voxels/Block.h"
#include "voxels/voxel.h"
#include "voxels/Chunks.h"
#include "window/Camera.h"
@ -175,7 +176,7 @@ void update_interaction(Level* level, LineBatch* lineBatch){
if (vox != nullptr){
lineBatch->box(iend.x+0.5f, iend.y+0.5f, iend.z+0.5f, 1.005f,1.005f,1.005f, 0,0,0,0.5f);
if (Events::jclicked(GLFW_MOUSE_BUTTON_1)){
if (Events::jclicked(GLFW_MOUSE_BUTTON_1) && Block::blocks[vox->id]->breakable){
int x = (int)iend.x;
int y = (int)iend.y;
int z = (int)iend.z;