Skip to content

Commit

Permalink
Fix bed drop color (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
aki-ks authored and mastercoms committed Jul 2, 2018
1 parent f7cc3f9 commit 53ea412
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/net/glowstone/block/blocktype/BlockBed.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.glowstone.block.blocktype;

import java.util.Collection;
import java.util.Collections;
import net.glowstone.GlowWorld;
import net.glowstone.block.GlowBlock;
import net.glowstone.block.GlowBlockState;
Expand All @@ -26,10 +28,6 @@

public class BlockBed extends BlockType {

public BlockBed() {
setDrops(new ItemStack(Material.BED));
}

/**
* Helper method for set whether the specified bed blocks are occupied.
*
Expand Down Expand Up @@ -92,6 +90,12 @@ public static GlowBlock getFoot(GlowBlock block) {
}
}

@Override
public Collection<ItemStack> getDrops(GlowBlock block, ItemStack tool) {
return Collections.singletonList(new ItemStack(Material.BED, 1,
(((GlowBed) block.getState()).getColor().getWoolData())));
}

@Override
public void onNearBlockChanged(GlowBlock block, BlockFace face, GlowBlock changedBlock,
Material oldType, byte oldData, Material newType, byte newData) {
Expand Down

0 comments on commit 53ea412

Please sign in to comment.