Better /Stuff

-Uses Coordinates a little in TestWorldGenerator. Ill do more eventually I think
-Better sprite getting for FallingBlocks
This commit is contained in:
opfromthestart 2021-08-03 15:05:05 -04:00
parent c2a2cc074a
commit dccfcc9419
2 changed files with 5 additions and 8 deletions

View File

@ -3,14 +3,11 @@ package ru.windcorp.progressia.test;
import ru.windcorp.progressia.client.graphics.model.Renderable;
import ru.windcorp.progressia.client.graphics.model.ShapeRenderHelper;
import ru.windcorp.progressia.client.graphics.model.Shapes;
import ru.windcorp.progressia.client.graphics.texture.Atlases;
import ru.windcorp.progressia.client.graphics.texture.SimpleTexture;
import ru.windcorp.progressia.client.graphics.texture.Texture;
import ru.windcorp.progressia.client.graphics.texture.Atlases.AtlasGroup;
import ru.windcorp.progressia.client.graphics.world.WorldRenderProgram;
import ru.windcorp.progressia.client.world.block.BlockRenderRegistry;
import ru.windcorp.progressia.client.world.entity.EntityRender;
import ru.windcorp.progressia.client.world.entity.EntityRenderable;
import ru.windcorp.progressia.common.resource.ResourceManager;
import ru.windcorp.progressia.common.world.entity.EntityData;
/**
@ -24,8 +21,7 @@ public class TestEntityRenderFallingBlock extends EntityRender {
public TestEntityRenderFallingBlock(String id) {
super(id);
cube = new Shapes.PppBuilder(WorldRenderProgram.getDefault(), new SimpleTexture(Atlases
.getSprite(ResourceManager.getTextureResource("blocks/Sand"), new AtlasGroup("Blocks", 1 << 12))))
cube = new Shapes.PppBuilder(WorldRenderProgram.getDefault(), BlockRenderRegistry.getBlockTexture(id) )
.create();
}

View File

@ -62,7 +62,8 @@ public class TestWorldGenerator extends AbstractWorldGenerator<Boolean> {
@Override
public void onChunkBlockChanged(ChunkData chunk, Vec3i blockInChunk, BlockData previous,
BlockData current) {
Vec3i chunkWorldPos = chunk.getPosition().mul_(16).add_(blockInChunk);
Vec3i chunkWorldPos = new Vec3i(0,0,0);
Coordinates.getInWorld(chunk.getPosition(), blockInChunk, chunkWorldPos); //chunk.getPosition().mul_(16).add_(blockInChunk);
if (TestEntityLogicFallingBlock.FallingBlocks
.contains(chunk.getWorld().getBlock(chunkWorldPos.add_(0, 0, 1)).getId())) {