blob: e91497d855f63c803994276f68bed019b3186507 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
package org.bukkit.craftbukkit.block;
import com.google.common.base.Preconditions;
import net.minecraft.server.EnumColor;
import net.minecraft.server.TileEntityBed;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.block.Bed;
import org.bukkit.block.Block;
public class CraftBed extends CraftBlockEntityState<TileEntityBed> implements Bed {
public CraftBed(Block block) {
super(block, TileEntityBed.class);
}
public CraftBed(Material material, TileEntityBed te) {
super(material, te);
}
@Override
public DyeColor getColor() {
switch (getType()) {
case BLACK_BED:
return DyeColor.BLACK;
case BLUE_BED:
return DyeColor.BLUE;
case BROWN_BED:
return DyeColor.BROWN;
case CYAN_BED:
return DyeColor.CYAN;
case GRAY_BED:
return DyeColor.GRAY;
case GREEN_BED:
return DyeColor.GREEN;
case LIGHT_BLUE_BED:
return DyeColor.LIGHT_BLUE;
case LIGHT_GRAY_BED:
return DyeColor.SILVER;
case LIME_BED:
return DyeColor.LIME;
case MAGENTA_BED:
return DyeColor.MAGENTA;
case ORANGE_BED:
return DyeColor.ORANGE;
case PINK_BED:
return DyeColor.PINK;
case PURPLE_BED:
return DyeColor.PURPLE;
case RED_BED:
return DyeColor.RED;
case WHITE_BED:
return DyeColor.WHITE;
case YELLOW_BED:
return DyeColor.YELLOW;
default:
throw new IllegalArgumentException("Unknown DyeColor for " + getType());
}
}
@Override
public void setColor(DyeColor color) {
throw new UnsupportedOperationException("Must set block type to appropriate bed colour");
}
}
|