Skip to content

Commit

Permalink
NukkitX standard generator (#1303)
Browse files Browse the repository at this point in the history
* delete packages `cn.nukkit.level.generator` and `cn.nukkit.level.biome`

* add some base generator interfaces

temp commit because i have to go and will need to access from home when i get there

* allow generators to define a custom selection of chunks for population

* add a basic superflat generator

customization will come later

* make the server be able to build and start again

generation actually works now, as does the demo superflat generator!

also added a void generator for empty worlds.

* add tasks for generation and population, theoretically population should partially work now

* redo `NukkitRandom` to make it be not bad, and eliminate dozens of unneeded `NukkitRandom` allocations by using `ThreadLocalRandom`

* begin to implement a `ChunkManager` for population

* attempt to use population chunk manager, it's broken though...

this is probably the same bug that's been causing cut off trees in nukkit and pmmp for years

* debug temp commit

* totally remove NukkitRandom and remove all usages of BedrockRandom

also add a dependency on porklib:random

* since we now can save all chunks, we can make this a lot cleaner

* crash when an invalid generator is configured

* make chunks completely unobtainable unless they and all of their neighbors have been populated

* avoid useless array allocation

* implement superflat presets

* initial commit for standard generator

* population chunks are always 3x3

* initial block replacer interface

* load block replacers from registry

* begin working on a noise generator registry as well

* add a biome implementation

* we can now generate a world with surfaces

* interpolate density values

* be able to use `BiomeMap` to actually select biomes

* add populator registry as well

this should nearly mark the end of the api stuff

* add "decorators" (basically populators, except at generation time)

* add simple tree populator

* make a system for matching an arbitrary number of block types with one option

* make biome dictionary only contain IDs, everything else should be separate

* add simple surface decorator

* minor refactor (BlockMatcher to BlockFilter, add separate BlockMatcher interface)

* add block layers (i'll probably have to remove this again shortly)

* begin migrating to jackson for loading generator config

hopefully this will be cleaner...

* okay this is a hell of a lot cleaner! begin porting everything to jackson

* everything except noise generation has now been ported to jackson

* noise generation loads with jackson now as well

* allow overriding the local seed generation to ensure consistency

* theoretically be able to define biome-specific generation passes

now i need to figure out how to these should be configured

* actually implement biome-specific generation passes

* prepare to implement vanilla noise

* actually implement vanilla noise

* fix up biome generation heights

* break some stuff

* theoretically make biome surface now be done using a block replacer instead of a decorator

however, gradients appear to be quite broken

* remove block replacers, because they add a lot of extra load for very little benefit (can be implemented better as decorator)

* make surfaces be generated using a decorator again, but this time do it correctly

* implement basic tall grass populator and a block selection mechanism

* fix build

* set name in LevelConverter

* implement vanilla-style flower generation

* make trees look nicer and add double plants

* begin working on implementing a decent biome selector

* temp commit

* implement biome selection zoom filter

* work on implementing more biome selection filters

* stop trying to skid from vanilla and actually implement this myself, and it looks way better

* try and fail to make rivers

* something is very broken...

strange artifacting along axes, doesn't seem to make any sense

* fix biome selection artifacts when sampling at low resolutions

* try to fix biome generation heights part 1

* try to fix biome generation heights part 2

* revert previous changes

* okay now i think i'm on the right track to fixing biome elevations

* ores

* allow biomes to inherit from each other

* partially clean up trees

* re-implement population around

protocol-lib changed levelchunkmanager stuff

* fix build

* spruce trees

* partially make extreme hills ground cover correct

* rename filtered to complex

* make biome selection a lot like vanilla (part 1)

* make biome selection a lot like vanilla (part 2)

* make biome selection a lot like vanilla (part 3)

this next commit will be fun... or something.

* make biome selection a lot like vanilla (part 4)

it wasn't as bad as expected, i guess

* make biome selection a lot like vanilla (part 5)

* make biome selection a lot like vanilla (part 6)

this is just about done! the only thing that remains to be finalized is adding all the biome mutations, which will require me to implement them first.

* fully implement mushroom island and mushroom island shore

* fully implement (frozen) river, (frozen) ocean, deep ocean

although they still lack newer features such as seaweed

* fully implement beach, stone beach, cold beach, fix generation of extreme hills and variants

* fully implement ice plains, ice plains spikes, ice mountains, fix generation of plains and sunflower plains

also make decorators all be populators as well

* fully implement (cold) taiga, (cold) taiga hills, (cold) taiga m

* fully implement mega taiga (hills), redwood taiga (hills)

also optimize tree generation quite a bit and make noise selection decorators/populators have a range with separate options for above and below

* convert biome height variation from vanilla correctly

* fully implement swampland (hills)

* fully implement (flower) forest (hills), (tall) birch forest (hills)

* fully implement roofed forest (hills)

* fully implement (mutated) jungle (hills)

* fully implement (mutated) desert (hills)

* fully implement (mutated) savanna (plateau)

also fix noise to make it use simplex instead of perlin

* fully implement (mutated) mesa (plateau)

also revert back to using perlin noise

* add all biomes to overworld biome selector and finalize overworld preset

* add fallen trees

* make populators be per-block rather than per-chunk (part 1)

* make populators be per-block rather than per-chunk (part 2)

* some minor things

- all icy biomes should generate frozen river, not just ice plains
- icy biomes should also freeze water in them
- add a description of how the overworld density scale values are calculated

* try to implement end noise generation

* something something end terrain doesn't like me

* this kind of almost works...

* finalize end density generation

* add basic nether density source

* finalize nether terrain

* mostly finalize end terrain

* add water/lava lakes

* fix generation frequency of shrubs

* partially fix empty chunks

* fix empty chunks for good

* clean up+optimize chunk heightmap stuff somewhat and optimize chunk locking

now the heightmap not actually updated anywhere, which is arguably bad, but it wasn't actually used correctly anyway

* make the default preset be correct

* make generation+population a lot faster by caching biomes one chunk at a time rather than each block

* make density sources generate entire swaths at a time

this will make it possible to vectorize the entire thing later once https://openjdk.java.net/jeps/338 is released

* make biomes actually have their own registry and eliminate "biome dictionaries"

* implement "finish" pass for standard generator

* fix ice/snow generation by actually using finishers correctly

* stop randomly switching between the seed in config and the seed in level.dat

seriously, level loading is totally broken

* add an amplified preset

* add optimized swath implementations for overworld and end density sources

* make ice/snow generation altitude-based

* fix up most of the TODOs

* bake generation pass arrays once at the beginning, and use int keys in the map

also fix vine generation in jungles

* fix worlds config in default nukkit.yml

* make property naming more consistent

* reformat

* don't generate surface blocks one block below sea level
  • Loading branch information
DaMatrix authored Apr 19, 2020
1 parent 8fe42e3 commit 7747a0e
Show file tree
Hide file tree
Showing 402 changed files with 13,011 additions and 9,970 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,4 @@ resource_packs
resource_packs/*
creativeitems.json
recipes.json
/run/
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.daporkchop.lib</groupId>
<artifactId>noise</artifactId>
<version>0.5.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.sf.jopt-simple</groupId>
<artifactId>jopt-simple</artifactId>
Expand Down
12 changes: 9 additions & 3 deletions src/main/java/cn/nukkit/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import cn.nukkit.item.Item;
import cn.nukkit.item.enchantment.Enchantment;
import cn.nukkit.level.*;
import cn.nukkit.level.biome.EnumBiome;
import cn.nukkit.level.storage.StorageIds;
import cn.nukkit.locale.LocaleManager;
import cn.nukkit.locale.TextContainer;
Expand Down Expand Up @@ -81,6 +80,7 @@
import java.nio.file.Paths;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -197,6 +197,7 @@ public class Server {
private final BlockEntityRegistry blockEntityRegistry = BlockEntityRegistry.get();
private final ItemRegistry itemRegistry = ItemRegistry.get();
private final EntityRegistry entityRegistry = EntityRegistry.get();
private final BiomeRegistry biomeRegistry = BiomeRegistry.get();

private final Map<InetSocketAddress, Player> players = new HashMap<>();

Expand Down Expand Up @@ -520,6 +521,7 @@ public void boot() throws IOException {
this.blockRegistry.close();
this.itemRegistry.close();
this.entityRegistry.close();
this.biomeRegistry.close();
this.gameRuleRegistry.close();
this.generatorRegistry.close();
this.storageRegistry.close();
Expand Down Expand Up @@ -1893,7 +1895,6 @@ private void loadPacks() {

private void registerVanillaComponents() {
Enchantment.init();
EnumBiome.values(); //load class, this also registers biomes
Item.initCreativeItems();
Effect.init();
Potion.init();
Expand Down Expand Up @@ -1929,7 +1930,8 @@ private void loadLevels() {
Identifier generator = Identifier.fromString(this.getConfig("worlds." + name + ".generator"));
String options = this.getConfig("worlds." + name + ".options", "");

levelFutures.add(this.loadLevel().id(name).seed(seed)
levelFutures.add(this.loadLevel().id(name)
.seed(seed)
.generator(generator == null ? this.generatorRegistry.getFallback() : generator)
.generatorOptions(options)
.load());
Expand Down Expand Up @@ -1994,6 +1996,10 @@ public ItemRegistry getItemRegistry() {
return itemRegistry;
}

public GeneratorRegistry getGeneratorRegistry() {
return this.generatorRegistry;
}

public int getBaseTickRate() {
return baseTickRate;
}
Expand Down
78 changes: 39 additions & 39 deletions src/main/java/cn/nukkit/block/BlockCocoa.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,49 @@

import java.util.concurrent.ThreadLocalRandom;

import static cn.nukkit.block.BlockIds.LOG;
import static cn.nukkit.item.ItemIds.DYE;
import static cn.nukkit.block.BlockIds.*;
import static cn.nukkit.item.ItemIds.*;

/**
* Created by CreeperFace on 27. 10. 2016.
*/
public class BlockCocoa extends BlockTransparent implements Faceable {

protected static final AxisAlignedBB[] EAST = new SimpleAxisAlignedBB[]{new SimpleAxisAlignedBB(0.6875f, 0.4375f, 0.375f, 0.9375f, 0.75f, 0.625f), new SimpleAxisAlignedBB(0.5625f, 0.3125f, 0.3125f, 0.9375f, 0.75f, 0.6875f), new SimpleAxisAlignedBB(0.5625f, 0.3125f, 0.3125f, 0.9375f, 0.75f, 0.6875f)};
protected static final AxisAlignedBB[] WEST = new SimpleAxisAlignedBB[]{new SimpleAxisAlignedBB(0.0625f, 0.4375f, 0.375f, 0.3125f, 0.75f, 0.625f), new SimpleAxisAlignedBB(0.0625f, 0.3125f, 0.3125f, 0.4375f, 0.75f, 0.6875f), new SimpleAxisAlignedBB(0.0625f, 0.3125f, 0.3125f, 0.4375f, 0.75f, 0.6875f)};
protected static final AxisAlignedBB[] NORTH = new SimpleAxisAlignedBB[]{new SimpleAxisAlignedBB(0.375f, 0.4375f, 0.0625f, 0.625f, 0.75f, 0.3125f), new SimpleAxisAlignedBB(0.3125f, 0.3125f, 0.0625f, 0.6875f, 0.75f, 0.4375f), new SimpleAxisAlignedBB(0.3125f, 0.3125f, 0.0625f, 0.6875f, 0.75f, 0.4375f)};
protected static final AxisAlignedBB[] SOUTH = new SimpleAxisAlignedBB[]{new SimpleAxisAlignedBB(0.375f, 0.4375f, 0.6875f, 0.625f, 0.75f, 0.9375f), new SimpleAxisAlignedBB(0.3125f, 0.3125f, 0.5625f, 0.6875f, 0.75f, 0.9375f), new SimpleAxisAlignedBB(0.3125f, 0.3125f, 0.5625f, 0.6875f, 0.75f, 0.9375f)};
protected static final AxisAlignedBB[] ALL = new AxisAlignedBB[12];
protected static final AxisAlignedBB[] BB_NORTH = {
new SimpleAxisAlignedBB(0.375f, 0.4375f, 0.0625f, 0.625f, 0.75f, 0.3125f),
new SimpleAxisAlignedBB(0.3125f, 0.3125f, 0.0625f, 0.6875f, 0.75f, 0.4375f),
new SimpleAxisAlignedBB(0.3125f, 0.3125f, 0.0625f, 0.6875f, 0.75f, 0.4375f)
};
protected static final AxisAlignedBB[] BB_EAST = {
new SimpleAxisAlignedBB(0.6875f, 0.4375f, 0.375f, 0.9375f, 0.75f, 0.625f),
new SimpleAxisAlignedBB(0.5625f, 0.3125f, 0.3125f, 0.9375f, 0.75f, 0.6875f),
new SimpleAxisAlignedBB(0.5625f, 0.3125f, 0.3125f, 0.9375f, 0.75f, 0.6875f)
};
protected static final AxisAlignedBB[] BB_SOUTH = {
new SimpleAxisAlignedBB(0.375f, 0.4375f, 0.6875f, 0.625f, 0.75f, 0.9375f),
new SimpleAxisAlignedBB(0.3125f, 0.3125f, 0.5625f, 0.6875f, 0.75f, 0.9375f),
new SimpleAxisAlignedBB(0.3125f, 0.3125f, 0.5625f, 0.6875f, 0.75f, 0.9375f)
};
protected static final AxisAlignedBB[] BB_WEST = {
new SimpleAxisAlignedBB(0.0625f, 0.4375f, 0.375f, 0.3125f, 0.75f, 0.625f),
new SimpleAxisAlignedBB(0.0625f, 0.3125f, 0.3125f, 0.4375f, 0.75f, 0.6875f),
new SimpleAxisAlignedBB(0.0625f, 0.3125f, 0.3125f, 0.4375f, 0.75f, 0.6875f)
};
protected static final AxisAlignedBB[] BB_ALL = {
BB_NORTH[0], BB_EAST[0], BB_SOUTH[0], BB_WEST[0],
BB_NORTH[1], BB_EAST[1], BB_SOUTH[1], BB_WEST[1],
BB_NORTH[2], BB_EAST[2], BB_SOUTH[2], BB_WEST[2],
};

public static final int NORTH = 0;
public static final int EAST = 1;
public static final int SOUTH = 2;
public static final int WEST = 3;
public static final int DIR_MASK = 3;

public static final int STAGE_1 = 0;
public static final int STAGE_2 = 1;
public static final int STAGE_3 = 2;
public static final int STAGE_MASK = 12;

public BlockCocoa(Identifier id) {
super(id);
Expand Down Expand Up @@ -77,38 +107,8 @@ private AxisAlignedBB getRelativeBoundingBox() {
if (meta > 11) {
this.setMeta(meta = 11);
}
AxisAlignedBB boundingBox = ALL[meta];
if (boundingBox != null) return boundingBox;

AxisAlignedBB[] bbs;

switch (getMeta()) {
case 0:
case 4:
case 8:
bbs = NORTH;
break;
case 1:
case 5:
case 9:
bbs = EAST;
break;
case 2:
case 6:
case 10:
bbs = SOUTH;
break;
case 3:
case 7:
case 11:
bbs = WEST;
break;
default:
bbs = NORTH;
break;
}

return ALL[meta] = bbs[this.getMeta() >> 2];
return BB_ALL[meta];
}

@Override
Expand Down
32 changes: 24 additions & 8 deletions src/main/java/cn/nukkit/block/BlockGrass.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
import cn.nukkit.event.block.BlockSpreadEvent;
import cn.nukkit.item.Item;
import cn.nukkit.level.Level;
import cn.nukkit.level.generator.object.ObjectTallGrass;
import cn.nukkit.level.particle.BoneMealParticle;
import cn.nukkit.math.BedrockRandom;
import cn.nukkit.math.NukkitRandom;
import cn.nukkit.player.Player;
import cn.nukkit.utils.BlockColor;
import cn.nukkit.utils.Identifier;
import com.nukkitx.math.vector.Vector3i;
import net.daporkchop.lib.random.PRandom;
import net.daporkchop.lib.random.impl.FastPRandom;

import java.util.concurrent.ThreadLocalRandom;

import static cn.nukkit.block.BlockIds.*;
import static cn.nukkit.item.ItemIds.DYE;
Expand Down Expand Up @@ -43,7 +44,23 @@ public boolean onActivate(Item item, Player player) {
item.decrementCount();
}
this.level.addParticle(new BoneMealParticle(this.getPosition()));
ObjectTallGrass.growGrass(this.getLevel(), this.getPosition(), new BedrockRandom());

PRandom random = new FastPRandom();

for (int i = 0; i < 64; i++) {
int blockY = this.getY() + random.nextInt(4) - random.nextInt(4);
if (blockY < 0 || blockY >= 255) {
continue;
}
int blockX = this.getX() + random.nextInt(8) - random.nextInt(8);
int blockZ = this.getZ() + random.nextInt(8) - random.nextInt(8);

Block tallGrass = Block.get(BlockIds.TALL_GRASS, 0, blockX, blockY + 1, blockZ, this.level);
Block toReplace = this.level.getBlock(blockX, blockY + 1, blockZ);
if (toReplace.getId() == BlockIds.AIR) {
tallGrass.place(null, toReplace, null, null, null, null);
}
}
return true;
} else if (item.isHoe()) {
item.useOn(this);
Expand All @@ -61,11 +78,10 @@ public boolean onActivate(Item item, Player player) {
@Override
public int onUpdate(int type) {
if (type == Level.BLOCK_UPDATE_RANDOM) {
NukkitRandom random = new NukkitRandom();
Vector3i pos = this.getPosition();
int x = random.nextRange(pos.getX() - 1, pos.getX() + 1);
int y = random.nextRange(pos.getY() - 2, pos.getY() + 2);
int z = random.nextRange(pos.getZ() - 1, pos.getZ() + 1);
int x = ThreadLocalRandom.current().nextInt(pos.getX() - 1, pos.getX() + 1);
int y = ThreadLocalRandom.current().nextInt(pos.getY() - 2, pos.getY() + 2);
int z = ThreadLocalRandom.current().nextInt(pos.getZ() - 1, pos.getZ() + 1);
Block block = this.getLevel().getBlock(x, y, z);
if (block.getId() == DIRT && block.getMeta() == 0) {
if (block.up() instanceof BlockAir) {
Expand Down
18 changes: 16 additions & 2 deletions src/main/java/cn/nukkit/block/BlockHugeMushroomBrown.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,30 @@

import cn.nukkit.item.Item;
import cn.nukkit.item.ItemTool;
import cn.nukkit.math.NukkitRandom;
import cn.nukkit.utils.BlockColor;
import cn.nukkit.utils.Identifier;

import java.util.concurrent.ThreadLocalRandom;

import static cn.nukkit.block.BlockIds.BROWN_MUSHROOM;

/**
* Created by Pub4Game on 28.01.2016.
*/
public class BlockHugeMushroomBrown extends BlockSolid {
public static final int NONE = 0;
public static final int TOP_NW = 1;
public static final int TOP_N = 2;
public static final int TOP_NE = 3;
public static final int TOP_W = 4;
public static final int TOP = 5;
public static final int TOP_E = 6;
public static final int TOP_SW = 7;
public static final int TOP_S = 8;
public static final int TOP_SE = 9;
public static final int STEM = 10;
public static final int ALL = 14;
public static final int STEM_ALL = 15;

public BlockHugeMushroomBrown(Identifier id) {
super(id);
Expand All @@ -34,7 +48,7 @@ public float getResistance() {

@Override
public Item[] getDrops(Item item) {
if (new NukkitRandom().nextRange(1, 20) == 0) {
if (ThreadLocalRandom.current().nextInt(0, 20) == 0) {
return new Item[]{
Item.get(BROWN_MUSHROOM)
};
Expand Down
18 changes: 16 additions & 2 deletions src/main/java/cn/nukkit/block/BlockHugeMushroomRed.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,30 @@

import cn.nukkit.item.Item;
import cn.nukkit.item.ItemTool;
import cn.nukkit.math.NukkitRandom;
import cn.nukkit.utils.BlockColor;
import cn.nukkit.utils.Identifier;

import java.util.concurrent.ThreadLocalRandom;

import static cn.nukkit.block.BlockIds.RED_MUSHROOM;

/**
* Created by Pub4Game on 28.01.2016.
*/
public class BlockHugeMushroomRed extends BlockSolid {
public static final int NONE = 0;
public static final int TOP_NW = 1;
public static final int TOP_N = 2;
public static final int TOP_NE = 3;
public static final int TOP_W = 4;
public static final int TOP = 5;
public static final int TOP_E = 6;
public static final int TOP_SW = 7;
public static final int TOP_S = 8;
public static final int TOP_SE = 9;
public static final int STEM = 10;
public static final int ALL = 14;
public static final int STEM_ALL = 15;

public BlockHugeMushroomRed(Identifier id) {
super(id);
Expand All @@ -34,7 +48,7 @@ public float getResistance() {

@Override
public Item[] getDrops(Item item) {
if (new NukkitRandom().nextRange(1, 20) == 0) {
if (ThreadLocalRandom.current().nextInt(0, 20) == 0) {
return new Item[]{
Item.get(RED_MUSHROOM)
};
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/cn/nukkit/block/BlockIds.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import lombok.experimental.UtilityClass;

@UtilityClass
public final class BlockIds {

public class BlockIds {
public static final Identifier AIR = Identifier.fromString("air");
public static final Identifier STONE = Identifier.fromString("stone");
public static final Identifier GRASS = Identifier.fromString("grass");
Expand Down Expand Up @@ -42,7 +41,6 @@ public final class BlockIds {
public static final Identifier PISTON = Identifier.fromString("piston");
public static final Identifier PISTON_ARM_COLLISION = Identifier.fromString("pistonArmCollision");
public static final Identifier WOOL = Identifier.fromString("wool");
// public static final Identifier ELEMENT_0 = Identifier.fromString("element_0");
public static final Identifier YELLOW_FLOWER = Identifier.fromString("yellow_flower");
public static final Identifier RED_FLOWER = Identifier.fromString("red_flower");
public static final Identifier BROWN_MUSHROOM = Identifier.fromString("brown_mushroom");
Expand Down Expand Up @@ -267,7 +265,8 @@ public final class BlockIds {
public static final Identifier STRIPPED_DARK_OAK_LOG = Identifier.fromString("stripped_dark_oak_log");
public static final Identifier STRIPPED_OAK_LOG = Identifier.fromString("stripped_oak_log");
public static final Identifier BLUE_ICE = Identifier.fromString("blue_ice");
// public static final Identifier ELEMENT_1 = Identifier.fromString("element_1");
// public static final Identifier ELEMENT_0 = Identifier.fromString("element_0");
// public static final Identifier ELEMENT_1 = Identifier.fromString("element_1");
// public static final Identifier ELEMENT_2 = Identifier.fromString("element_2");
// public static final Identifier ELEMENT_3 = Identifier.fromString("element_3");
// public static final Identifier ELEMENT_4 = Identifier.fromString("element_4");
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/cn/nukkit/block/BlockLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@
* Nukkit Project
*/
public class BlockLog extends BlockSolid {
public static final int OAK = 0;
public static final int OAK = 0;
public static final int SPRUCE = 1;
public static final int BIRCH = 2;
public static final int BIRCH = 2;
public static final int JUNGLE = 3;

public static final int UP_DOWN = 0 << 2;
public static final int EAST_WEST = 1 << 2;
public static final int NORTH_SOUTH = 2 << 2;
public static final int ALL = 3 << 2;

protected static final Identifier[] STRIPPED_IDS = new Identifier[]{
BlockIds.STRIPPED_OAK_LOG,
BlockIds.STRIPPED_SPRUCE_LOG,
Expand Down Expand Up @@ -107,7 +112,7 @@ public int getToolType() {

@Override
public BlockColor getColor() {
switch (getMeta() & 0x07) {
switch (getMeta() & 0x03) {
default:
case OAK:
return BlockColor.WOOD_BLOCK_COLOR;
Expand Down
Loading

0 comments on commit 7747a0e

Please sign in to comment.