Made the WorldRenderer class a bit smaller by removing redundant methods

This commit is contained in:
2020-04-09 10:55:46 -06:00
parent fed335b2f6
commit 7ec0d5eb5c
3 changed files with 7 additions and 14 deletions

View File

@@ -27,7 +27,7 @@ public class Chunks {
}
public double noise1(double nx, double ny) {
OpenSimplexNoise gen1 = new OpenSimplexNoise(seed);
OpenSimplexNoise gen1 = new OpenSimplexNoise(seed+1);
return gen1.eval(nx, ny)/2 + 0.5;
}

View File

@@ -20,26 +20,20 @@ public class WorldRenderer implements Restrictions {
public void drawWorld(Batch batch) {
for (Pair<Integer, Integer> chunkpair : Chunks.blocks.keySet()) {
String name = Chunks.blocks.get(chunkpair).getName();
int drawingLocationX = chunkpair.getFirst() << TILE_SHIFT;
int drawingLocationY = chunkpair.getSecond() << TILE_SHIFT;
batch.draw(BlockMaterials.getTexture(name), drawingLocationX, drawingLocationY);
batch.draw(
BlockMaterials.getTexture(name),
chunkpair.getFirst() << TILE_SHIFT,
chunkpair.getSecond() << TILE_SHIFT
);
}
}
public void render(SpriteBatch batch) {
try {
drawWorld(batch);
}catch (Exception ignored){}
inputController.handleInput();
batch.setProjectionMatrix(cam.combined);
cam.update();
mouse.render(batch);
}
public void dispose() {
}
}

View File

@@ -68,7 +68,6 @@ public class Main extends ApplicationAdapter {
@Override
public void dispose () {
worldRenderer.dispose();
gui.dispose();
batch.dispose();
Player.textureAtlas.dispose();