Made the WorldRenderer class a bit smaller by removing redundant methods
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ public class Main extends ApplicationAdapter {
|
||||
|
||||
@Override
|
||||
public void dispose () {
|
||||
worldRenderer.dispose();
|
||||
gui.dispose();
|
||||
batch.dispose();
|
||||
Player.textureAtlas.dispose();
|
||||
|
||||
Reference in New Issue
Block a user