hotfix: Oops!
This commit is contained in:
@@ -14,4 +14,6 @@ dependencies {
|
||||
/* Components */
|
||||
compile (group: 'commons-io', name: 'commons-io', version: '2.6')
|
||||
compile (group: 'com.google.guava', name: 'guava', version: '24.1-jre')
|
||||
/* Named Binary Tags */
|
||||
compile (group: 'com.flowpowered', name: 'flow-nbt', version: '1.0.0')
|
||||
}
|
||||
|
||||
@@ -35,6 +35,12 @@ public class Location implements Serializable{
|
||||
set(compactValue);
|
||||
}
|
||||
|
||||
public void set(double x, double y, double z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public void set(Location location) {
|
||||
this.x = location.x;
|
||||
this.y = location.y;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package mc.core.serialization;
|
||||
|
||||
import mc.core.world.Chunk;
|
||||
import mc.core.world.chunk.Chunk;
|
||||
import mc.core.world.Region;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -2,6 +2,7 @@ package mc.core.world;
|
||||
|
||||
import mc.core.serialization.IRegionReaderWriter;
|
||||
import mc.core.serialization.Serializer;
|
||||
import mc.core.world.chunk.Chunk;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
*/
|
||||
package mc.core.world;
|
||||
|
||||
import mc.core.Location;
|
||||
import mc.core.WarpPosition;
|
||||
import mc.core.nbt.Taggable;
|
||||
import mc.core.world.chunk.Chunk;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -16,6 +16,9 @@ public abstract class AbstractBlock implements Block {
|
||||
@Getter
|
||||
private int meta;
|
||||
@Getter
|
||||
@Setter
|
||||
private int light = 0; //TODO need to know range of values
|
||||
@Getter
|
||||
private final BlockType blockType;
|
||||
private final Map<String, Tag<?>> nbtTagsMap = new HashMap<>();
|
||||
|
||||
|
||||
@@ -38,6 +38,9 @@ public interface Block extends Taggable, Serializable{
|
||||
*/
|
||||
int getMeta();
|
||||
|
||||
int getLight();
|
||||
void setLight(int light);
|
||||
|
||||
/**
|
||||
* Getting block type
|
||||
*/
|
||||
|
||||
@@ -4,21 +4,25 @@ import mc.core.Location;
|
||||
|
||||
public class BlockFactory {
|
||||
|
||||
public Block create(BlockType blockType, int meta, int x, int y, int z) {
|
||||
return new EmbeddedBlock(blockType, meta, x, y, z);
|
||||
}
|
||||
|
||||
public Block create(BlockType blockType, int meta) {
|
||||
return new EmbeddedBlock(blockType, meta);
|
||||
return new EmbeddedBlock(blockType, meta, 0, 0, 0);
|
||||
}
|
||||
|
||||
public Block create(BlockType blockType) {
|
||||
return create(blockType, 0);
|
||||
return create(blockType, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* For first-time generation
|
||||
*/
|
||||
private class EmbeddedBlock extends AbstractBlock {
|
||||
EmbeddedBlock(BlockType type, int meta) {
|
||||
EmbeddedBlock(BlockType type, int meta, int x, int y, int z) {
|
||||
super(type, meta);
|
||||
super.setLocation(new Location(0,0,0));
|
||||
super.setLocation(new Location(x,y,z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package mc.core.block;
|
||||
package mc.core.world.block;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public enum BlockType {
|
||||
AIR(0, "Air"),
|
||||
STONE(1, "Stone"),
|
||||
GRASS(2, "Grass"),
|
||||
DIRT(3, "Dirt"),
|
||||
BEDROCK(7, "Bedrock"),
|
||||
WATER(8, "Water"),
|
||||
SAND(12, "Sand"),
|
||||
SNOW(32, "Snow"),
|
||||
AIR(0, "Air");
|
||||
SNOW(32, "Snow");
|
||||
|
||||
@Getter
|
||||
private final int id;
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
* DmitriyMX <dimon550@gmail.com>
|
||||
* 2018-04-15
|
||||
*/
|
||||
package mc.core.world;
|
||||
package mc.core.world.chunk;
|
||||
|
||||
import mc.core.Location;
|
||||
import mc.core.world.Biome;
|
||||
import mc.core.world.block.Block;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package mc.core.world;
|
||||
package mc.core.world.chunk;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user