block cleanup #7

This commit is contained in:
Sen 2025-06-21 18:58:35 +02:00
parent 7b25e6181e
commit 9de6017751
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
41 changed files with 514 additions and 977 deletions

View file

@ -277,7 +277,7 @@ public class EntityFirework
if (aint.length == 0) if (aint.length == 0)
{ {
aint = new int[] {ItemDye.dyeColors[0]}; aint = new int[] {ItemDye.FIREWORK_COLORS[0]};
} }
if (l == 1) if (l == 1)

View file

@ -1,21 +1,14 @@
package common.block.artificial; package common.block.artificial;
import java.util.List;
import common.block.Block; import common.block.Block;
import common.block.Material; import common.block.Material;
import common.entity.types.EntityLiving; import common.entity.types.EntityLiving;
import common.init.Blocks;
import common.init.ItemRegistry;
import common.item.CheatTab; import common.item.CheatTab;
import common.item.Item;
import common.item.ItemStack;
import common.model.Model; import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
import common.model.ModelRotation; import common.model.ModelRotation;
import common.properties.Property; import common.properties.Property;
import common.properties.PropertyEnum; import common.properties.PropertyEnum;
import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.util.Identifyable; import common.util.Identifyable;
@ -24,16 +17,30 @@ import common.world.World;
public class BlockQuartz extends Block public class BlockQuartz extends Block
{ {
public static final PropertyEnum<Facing.Axis> AXIS = PropertyEnum.create("axis", Facing.Axis.class);
public static final BlockQuartz[] QUARTZ = new BlockQuartz[EnumType.values().length * 2];
private final EnumType type; private final EnumType type;
private final String prefix; private final boolean dark;
public BlockQuartz(String prefix, EnumType type) public static BlockQuartz getByType(boolean dark, EnumType type) {
return QUARTZ[(dark ? EnumType.values().length : 0) + type.ordinal()];
}
public BlockQuartz(boolean dark, EnumType type)
{ {
super(Material.SOLID); super(Material.SOLID);
this.type = type; this.type = type;
if(type == EnumType.PILLAR)
this.setDefaultState(this.getBaseState().withProperty(AXIS, Facing.Axis.Y));
this.setTab(CheatTab.BLOCKS); this.setTab(CheatTab.BLOCKS);
this.prefix = prefix; this.dark = dark;
QUARTZ[(dark ? EnumType.values().length : 0) + type.ordinal()] = this;
}
public boolean isDark() {
return this.dark;
} }
public EnumType getType() { public EnumType getType() {
@ -42,77 +49,87 @@ public class BlockQuartz extends Block
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, int meta, EntityLiving placer) public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, int meta, EntityLiving placer)
{ {
if (this.type == EnumType.LINES_Y) return this.type != EnumType.PILLAR ? super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer) : this.getState().withProperty(AXIS, facing.getAxis());
{ }
switch (facing.getAxis())
{
case Z:
return Blocks.quartz_block_z.getState();
case X: public State getStateFromMeta(int meta)
return Blocks.quartz_block_x.getState(); {
if(this.type != EnumType.PILLAR)
case Y: return super.getStateFromMeta(meta);
State state = this.getState();
switch (meta & 3)
{
default: default:
return this.getState(); state = state.withProperty(AXIS, Facing.Axis.Y);
} break;
} case 1:
else state = state.withProperty(AXIS, Facing.Axis.X);
{ break;
return this.getState(); case 2:
state = state.withProperty(AXIS, Facing.Axis.Z);
break;
} }
return state;
} }
public Item getItemDropped(State state, Random rand, int fortune) { public int getMetaFromState(State state)
return this.type != BlockQuartz.EnumType.LINES_X && this.type != BlockQuartz.EnumType.LINES_Z ? super.getItemDropped(state, rand, fortune) : ItemRegistry.getItemFromBlock(Blocks.quartz_block_y); {
if(this.type != EnumType.PILLAR)
return super.getMetaFromState(state);
int meta = 0;
switch (state.getValue(AXIS))
{
case X:
meta = 1;
break;
case Z:
meta = 2;
break;
}
return meta;
} }
public ItemStack createStackedBlock(State state) protected Property[] getProperties()
{ {
return this.type != BlockQuartz.EnumType.LINES_X && this.type != BlockQuartz.EnumType.LINES_Z ? super.createStackedBlock(state) : new ItemStack(Blocks.quartz_block_y); return this.type != EnumType.PILLAR ? super.getProperties() : new Property[] {AXIS};
} }
public Model getModel(ModelProvider provider, String name, State state) { public Model getModel(ModelProvider provider, String name, State state) {
String prefix = this.dark ? "black_" : "";
switch(this.type) { switch(this.type) {
case DEFAULT: case DEFAULT:
default: default:
return provider.getModel(this.prefix + "quartz_block_side").add().nswe().d(this.prefix + "quartz_block_bottom").u(this.prefix + "quartz_top"); return provider.getModel(prefix + "quartz_block_side").add().nswe().d(prefix + "quartz_block_bottom").u(prefix + "quartz_top");
case CHISELED: case CHISELED:
return provider.getModel(this.prefix + "quartz_block_chiseled").add().nswe().du(this.prefix + "quartz_block_chiseled_top"); return provider.getModel(prefix + "quartz_block_chiseled").add().nswe().du(prefix + "quartz_block_chiseled_top");
case LINES_X: case PILLAR:
return provider.getModel(this.prefix + "quartz_block_lines").add().nswe().du(this.prefix + "quartz_block_lines_top").rotate(ModelRotation.X90_Y90); switch(state.getValue(AXIS)) {
case LINES_Y: case X:
return provider.getModel(this.prefix + "quartz_block_lines").add().nswe().du(this.prefix + "quartz_block_lines_top"); return provider.getModel(prefix + "quartz_block_lines").add().nswe().du(prefix + "quartz_block_lines_top").rotate(ModelRotation.X90_Y90);
case LINES_Z: case Y:
return provider.getModel(this.prefix + "quartz_block_lines").add().nswe().du(this.prefix + "quartz_block_lines_top").rotate(ModelRotation.X90_Y0); default:
return provider.getModel(prefix + "quartz_block_lines").add().nswe().du(prefix + "quartz_block_lines_top");
case Z:
return provider.getModel(prefix + "quartz_block_lines").add().nswe().du(prefix + "quartz_block_lines_top").rotate(ModelRotation.X90_Y0);
}
} }
} }
public static enum EnumType implements Identifyable public static enum EnumType implements Identifyable
{ {
DEFAULT(0, "default", "default", null), DEFAULT("quartz_block", "Quarzblock", "Schwarzer Quarzblock"),
CHISELED(1, "chiseled", "chiseled", null), CHISELED("quartz_ornaments", "Gemeißelter Quarzblock", "Schwarzer gemeißelter Quarzblock"),
LINES_Y(2, "lines_y", "lines", Facing.Axis.Y), PILLAR("quartz_pillar", "Quarzsäule", "Schwarze Quarzsäule");
LINES_X(3, "lines_x", "lines", Facing.Axis.X),
LINES_Z(4, "lines_z", "lines", Facing.Axis.Z);
private static final BlockQuartz.EnumType[] META_LOOKUP = new BlockQuartz.EnumType[values().length];
private final int meta;
private final String name; private final String name;
private final String unlocalizedName; private final String displayLight;
private final Facing.Axis axis; private final String displayDark;
private EnumType(int meta, String name, String unlocalizedName, Facing.Axis axis) private EnumType(String name, String light, String dark)
{ {
this.meta = meta;
this.name = name; this.name = name;
this.unlocalizedName = unlocalizedName; this.displayLight = light;
this.axis = axis; this.displayDark = dark;
}
public int getMetadata()
{
return this.meta;
} }
public String toString() public String toString()
@ -120,31 +137,17 @@ public class BlockQuartz extends Block
return this.name; return this.name;
} }
public static BlockQuartz.EnumType byMetadata(int meta)
{
if (meta < 0 || meta >= META_LOOKUP.length)
{
meta = 0;
}
return META_LOOKUP[meta];
}
public String getName() public String getName()
{ {
return this.name; return this.name;
} }
public Facing.Axis getAxis() public String getDisplayLight() {
{ return this.displayLight;
return this.axis;
} }
static { public String getDisplayDark() {
for (BlockQuartz.EnumType blockquartz$enumtype : values()) return this.displayDark;
{
META_LOOKUP[blockquartz$enumtype.getMetadata()] = blockquartz$enumtype;
}
} }
} }
} }

View file

@ -1,93 +0,0 @@
package common.block.artificial;
import common.block.Block;
import common.block.Material;
import common.item.CheatTab;
import common.model.Model;
import common.model.ModelProvider;
import common.util.Identifyable;
import common.world.State;
public class BlockStoneBrick extends Block
{
private final EnumType type;
public BlockStoneBrick(EnumType type)
{
super(Material.SOLID);
this.type = type;
this.setTab(CheatTab.BLOCKS);
}
public EnumType getType() {
return this.type;
}
public Model getModel(ModelProvider provider, String name, State state) {
return provider.getModel("stonebrick_" + this.type.getTexture()).add().all();
}
public static enum EnumType implements Identifyable
{
DEFAULT("default", 0, "stonebrick", "Steinziegel"),
MOSSY("mossy", 1, "mossy_stonebrick", "Bemooste Steinziegel"),
CRACKED("cracked", 2, "cracked_stonebrick", "Rissige Steinziegel"),
CHISELED("chiseled", 3, "chiseled_stonebrick", "Gemeißelte Steinziegel");
private static final BlockStoneBrick.EnumType[] META_LOOKUP = new BlockStoneBrick.EnumType[values().length];
private final int meta;
private final String texture;
private final String name;
private final String display;
private EnumType(String texture, int meta, String name, String display)
{
this.texture = texture;
this.meta = meta;
this.name = name;
this.display = display;
}
public int getMetadata()
{
return this.meta;
}
public String toString()
{
return this.name;
}
public static BlockStoneBrick.EnumType byMetadata(int meta)
{
if (meta < 0 || meta >= META_LOOKUP.length)
{
meta = 0;
}
return META_LOOKUP[meta];
}
public String getName()
{
return this.name;
}
public String getTexture()
{
return this.texture;
}
public String getDisplay()
{
return this.display;
}
static {
for (BlockStoneBrick.EnumType blockstonebrick$enumtype : values())
{
META_LOOKUP[blockstonebrick$enumtype.getMetadata()] = blockstonebrick$enumtype;
}
}
}
}

View file

@ -1,7 +1,10 @@
package common.block.artificial; package common.block.artificial;
import java.util.List;
import common.block.Block; import common.block.Block;
import common.block.Material; import common.block.Material;
import common.collect.Lists;
import common.init.Blocks; import common.init.Blocks;
import common.item.CheatTab; import common.item.CheatTab;
import common.model.Model; import common.model.Model;
@ -12,7 +15,6 @@ import common.properties.PropertyBool;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.BoundingBox; import common.util.BoundingBox;
import common.util.Facing; import common.util.Facing;
import common.util.Identifyable;
import common.world.IBlockAccess; import common.world.IBlockAccess;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
@ -25,22 +27,24 @@ public class BlockWall extends Block
public static final PropertyBool EAST = PropertyBool.create("east"); public static final PropertyBool EAST = PropertyBool.create("east");
public static final PropertyBool SOUTH = PropertyBool.create("south"); public static final PropertyBool SOUTH = PropertyBool.create("south");
public static final PropertyBool WEST = PropertyBool.create("west"); public static final PropertyBool WEST = PropertyBool.create("west");
public static final List<BlockWall> WALLS = Lists.newArrayList();
private final EnumType type; private final String texture;
public BlockWall(Block modelBlock, EnumType type) public BlockWall(Block modelBlock, String texture)
{ {
super(modelBlock.getMaterial()); super(modelBlock.getMaterial());
this.type = type; this.texture = texture;
this.setDefaultState(this.getBaseState().withProperty(UP, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false))); this.setDefaultState(this.getBaseState().withProperty(UP, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)));
this.setHardness(modelBlock.getRawHardness()); this.setHardness(modelBlock.getRawHardness());
this.setResistance(modelBlock.getRawResistance() / 3.0F); this.setResistance(modelBlock.getRawResistance() / 3.0F);
this.setStepSound(modelBlock.sound); this.setStepSound(modelBlock.sound);
this.setTab(CheatTab.BLOCKS); this.setTab(CheatTab.BLOCKS);
WALLS.add(this);
} }
public EnumType getType() { public String getTexture() {
return this.type; return this.texture;
} }
public boolean isFullCube() public boolean isFullCube()
@ -142,7 +146,7 @@ public class BlockWall extends Block
} }
public Model getModel(ModelProvider provider, String name, State state) { public Model getModel(ModelProvider provider, String name, State state) {
String wall = this.type.getName(); String wall = this.texture;
boolean n = state.getValue(NORTH); boolean n = state.getValue(NORTH);
boolean s = state.getValue(SOUTH); boolean s = state.getValue(SOUTH);
boolean w = state.getValue(WEST); boolean w = state.getValue(WEST);
@ -285,59 +289,4 @@ public class BlockWall extends Block
.e().uv(5, 3, 11, 16) .e().uv(5, 3, 11, 16)
.rotate(!w ? ModelRotation.X0_Y0 : (!e ? ModelRotation.X0_Y180 : (!s ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90))); .rotate(!w ? ModelRotation.X0_Y0 : (!e ? ModelRotation.X0_Y180 : (!s ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
} }
public static enum EnumType implements Identifyable
{
NORMAL(0, "cobblestone", "Bruchsteinmauer"),
MOSSY(1, "mossy_cobblestone", "Bemooste Bruchsteinmauer");
private static final BlockWall.EnumType[] META_LOOKUP = new BlockWall.EnumType[values().length];
private final int meta;
private final String name;
private String display;
private EnumType(int meta, String name, String display)
{
this.meta = meta;
this.name = name;
this.display = display;
}
public int getMetadata()
{
return this.meta;
}
public String toString()
{
return this.name;
}
public static BlockWall.EnumType byMetadata(int meta)
{
if (meta < 0 || meta >= META_LOOKUP.length)
{
meta = 0;
}
return META_LOOKUP[meta];
}
public String getName()
{
return this.name;
}
public String getDisplay()
{
return this.display;
}
static {
for (BlockWall.EnumType blockwall$enumtype : values())
{
META_LOOKUP[blockwall$enumtype.getMetadata()] = blockwall$enumtype;
}
}
}
} }

View file

@ -40,6 +40,10 @@ public class BlockDoublePlant extends BlockBush implements Rotatable, IGrowable
private final EnumPlantType type; private final EnumPlantType type;
public static BlockDoublePlant getByType(EnumPlantType type) {
return PLANTS[type.ordinal()];
}
public BlockDoublePlant(EnumPlantType type) public BlockDoublePlant(EnumPlantType type)
{ {
super(Material.BUSH); super(Material.BUSH);
@ -319,9 +323,9 @@ public class BlockDoublePlant extends BlockBush implements Rotatable, IGrowable
{ {
SUNFLOWER(0, "sunflower", "Sonnenblume"), SUNFLOWER(0, "sunflower", "Sonnenblume"),
SYRINGA(1, "syringa", "Flieder"), SYRINGA(1, "syringa", "Flieder"),
GRASS(2, "double_grass", "Hohes Gras"), GRASS(2, "large_tallgrass", "Hohes Gras"),
FERN(3, "double_fern", "Großer Farn"), FERN(3, "large_fern", "Großer Farn"),
ROSE(4, "double_rose", "Rosenstrauch"), ROSE(4, "rose_bush", "Rosenstrauch"),
PAEONIA(5, "paeonia", "Pfingstrose"); PAEONIA(5, "paeonia", "Pfingstrose");
private static final BlockDoublePlant.EnumPlantType[] META_LOOKUP = new BlockDoublePlant.EnumPlantType[values().length]; private static final BlockDoublePlant.EnumPlantType[] META_LOOKUP = new BlockDoublePlant.EnumPlantType[values().length];

View file

@ -21,7 +21,7 @@ import common.vars.Vars;
import common.world.State; import common.world.State;
import common.world.AWorldServer; import common.world.AWorldServer;
public abstract class BlockFlower extends BlockBush public class BlockFlower extends BlockBush
{ {
public static final BlockFlower[] FLOWERS = new BlockFlower[EnumFlowerType.values().length]; public static final BlockFlower[] FLOWERS = new BlockFlower[EnumFlowerType.values().length];
@ -68,7 +68,7 @@ public abstract class BlockFlower extends BlockBush
ORANGE_TULIP("orange_tulip", "Orange Tulpe"), ORANGE_TULIP("orange_tulip", "Orange Tulpe"),
WHITE_TULIP("white_tulip", "Weiße Tulpe"), WHITE_TULIP("white_tulip", "Weiße Tulpe"),
PINK_TULIP("pink_tulip", "Rosa Tulpe"), PINK_TULIP("pink_tulip", "Rosa Tulpe"),
OXEYE_DAISY("oxeye_daisy", "Margerite"), OXEYE_DAISY("daisy", "Margerite"),
BLACK_LOTUS("black_lotus", "Schwarzer Lotus"); BLACK_LOTUS("black_lotus", "Schwarzer Lotus");
private final String name; private final String name;

View file

@ -82,19 +82,19 @@ public class BlockLog extends BlockRotatedPillar
switch (meta & 3) switch (meta & 3)
{ {
case 0: default:
iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y); iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y);
break; break;
case 4: case 1:
iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.X); iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.X);
break; break;
case 8: case 2:
iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z); iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z);
break; break;
default: case 3:
iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE); iblockstate = iblockstate.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE);
} }
@ -109,7 +109,6 @@ public class BlockLog extends BlockRotatedPillar
public int getMetaFromState(State state) public int getMetaFromState(State state)
{ {
int i = 0; int i = 0;
// i = i | ((BlockPlanks.EnumType)state.getValue(VARIANT)).getMetadata();
switch ((BlockLog.EnumAxis)state.getValue(LOG_AXIS)) switch ((BlockLog.EnumAxis)state.getValue(LOG_AXIS))
{ {

View file

@ -32,6 +32,10 @@ public class BlockTallGrass extends BlockBush implements IGrowable
private final EnumType type; private final EnumType type;
public static BlockTallGrass getByType(EnumType type) {
return BUSHES[type.ordinal()];
}
public BlockTallGrass(EnumType type) public BlockTallGrass(EnumType type)
{ {
super(Material.BUSH); super(Material.BUSH);
@ -151,18 +155,20 @@ public class BlockTallGrass extends BlockBush implements IGrowable
public static enum EnumType implements Identifyable public static enum EnumType implements Identifyable
{ {
DEAD_BUSH(0, "dead_bush"), DEAD_BUSH(0, "dead_bush", "Busch"),
GRASS(1, "tall_grass"), GRASS(1, "tallgrass", "Gras"),
FERN(2, "fern"); FERN(2, "fern", "Farn");
private static final BlockTallGrass.EnumType[] META_LOOKUP = new BlockTallGrass.EnumType[values().length]; private static final BlockTallGrass.EnumType[] META_LOOKUP = new BlockTallGrass.EnumType[values().length];
private final int meta; private final int meta;
private final String name; private final String name;
private final String display;
private EnumType(int meta, String name) private EnumType(int meta, String name, String display)
{ {
this.meta = meta; this.meta = meta;
this.name = name; this.name = name;
this.display = display;
} }
public int getMeta() public int getMeta()
@ -190,6 +196,11 @@ public class BlockTallGrass extends BlockBush implements IGrowable
return this.name; return this.name;
} }
public String getDisplay()
{
return this.display;
}
static { static {
for (BlockTallGrass.EnumType blocktallgrass$enumtype : values()) for (BlockTallGrass.EnumType blocktallgrass$enumtype : values())
{ {

View file

@ -1,100 +0,0 @@
package common.block.natural;
import common.block.Block;
import common.block.Material;
import common.init.Blocks;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.model.Model;
import common.model.ModelProvider;
import common.properties.Property;
import common.properties.PropertyBool;
import common.rng.Random;
import common.util.BlockPos;
import common.util.Identifyable;
import common.world.IWorldAccess;
import common.world.State;
public class BlockDirt extends Block
{
public static final PropertyBool SNOWY = PropertyBool.create("snowy");
private final DirtType type;
public BlockDirt(DirtType type)
{
super(Material.LOOSE);
this.type = type;
this.setDefaultState(this.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)));
this.setTab(CheatTab.NATURE);
}
public DirtType getType() {
return this.type;
}
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
{
if (this.type == DirtType.PODZOL)
{
Block block = worldIn.getState(pos.up()).getBlock();
state = state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer));
}
return state;
}
protected Property[] getProperties()
{
return new Property[] {SNOWY};
}
public Item getItemDropped(State state, Random rand, int fortune) {
return this.type == DirtType.PODZOL ? Items.dirt : super.getItemDropped(state, rand, fortune);
}
public Model getModel(ModelProvider provider, String name, State state) {
switch(this.type) {
case DIRT:
default:
return provider.getModel("dirt").add().all();
case COARSE_DIRT:
return provider.getModel("coarse_dirt").add().all();
case PODZOL:
return state.getValue(SNOWY) ? provider.getModel("grass_side_snowed").add().nswe().d("dirt").u("grass_top") :
provider.getModel("dirt_podzol_side").add().nswe().d("dirt").u("dirt_podzol_top");
}
}
public static enum DirtType implements Identifyable
{
DIRT("dirt", "Erde"),
COARSE_DIRT("coarse_dirt", "Grobe Erde"),
PODZOL("podzol", "Podsol");
private final String name;
private final String display;
private DirtType(String name, String display)
{
this.name = name;
this.display = display;
}
public String getDisplay()
{
return this.display;
}
public String toString()
{
return this.name;
}
public String getName()
{
return this.name;
}
}
}

View file

@ -0,0 +1,44 @@
package common.block.natural;
import common.block.Block;
import common.block.Material;
import common.init.Blocks;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.model.Model;
import common.model.ModelProvider;
import common.properties.Property;
import common.properties.PropertyBool;
import common.rng.Random;
import common.util.BlockPos;
import common.world.IWorldAccess;
import common.world.State;
public class BlockPodzol extends Block {
public static final PropertyBool SNOWY = PropertyBool.create("snowy");
public BlockPodzol() {
super(Material.LOOSE);
this.setDefaultState(this.getBaseState().withProperty(SNOWY, Boolean.valueOf(false)));
this.setTab(CheatTab.NATURE);
}
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos) {
Block block = worldIn.getState(pos.up()).getBlock();
return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer));
}
protected Property[] getProperties() {
return new Property[] {SNOWY};
}
public Item getItemDropped(State state, Random rand, int fortune) {
return Items.dirt;
}
public Model getModel(ModelProvider provider, String name, State state) {
return state.getValue(SNOWY) ? provider.getModel("grass_side_snowed").add().nswe().d("dirt").u("grass_top")
: provider.getModel("dirt_podzol_side").add().nswe().d("dirt").u("dirt_podzol_top");
}
}

View file

@ -1,22 +0,0 @@
package common.block.natural;
import common.block.Block;
import common.block.Material;
import common.item.CheatTab;
import common.model.Model;
import common.model.ModelProvider;
import common.world.State;
public class BlockRock extends Block {
private final boolean smooth;
public BlockRock(boolean smooth) {
super(Material.SOLID);
this.smooth = smooth;
this.setTab(CheatTab.NATURE);
}
public Model getModel(ModelProvider provider, String name, State state) {
return provider.getModel(this.smooth ? "smooth_rock" : "rock").add().all();
}
}

View file

@ -1,84 +0,0 @@
package common.block.natural;
import common.block.BlockFalling;
import common.block.Material;
import common.item.CheatTab;
import common.model.Model;
import common.model.ModelProvider;
import common.util.Identifyable;
import common.world.State;
public class BlockSand extends BlockFalling
{
private final EnumType type;
public BlockSand(EnumType type)
{
super(Material.LOOSE);
this.type = type;
this.setTab(CheatTab.NATURE);
}
public EnumType getType() {
return this.type;
}
public Model getModel(ModelProvider provider, String name, State state) {
return provider.getModel(this.type.getName()).add().all();
}
public static enum EnumType implements Identifyable
{
SAND(0, "sand", "Sand"),
RED_SAND(1, "red_sand", "Roter Sand");
private static final BlockSand.EnumType[] META_LOOKUP = new BlockSand.EnumType[values().length];
private final int meta;
private final String name;
private final String display;
private EnumType(int meta, String name, String display)
{
this.meta = meta;
this.name = name;
this.display = display;
}
public int getMetadata()
{
return this.meta;
}
public String toString()
{
return this.name;
}
public static BlockSand.EnumType byMetadata(int meta)
{
if (meta < 0 || meta >= META_LOOKUP.length)
{
meta = 0;
}
return META_LOOKUP[meta];
}
public String getName()
{
return this.name;
}
public String getDisplay()
{
return this.display;
}
static {
for (BlockSand.EnumType blocksand$enumtype : values())
{
META_LOOKUP[blocksand$enumtype.getMetadata()] = blocksand$enumtype;
}
}
}
}

View file

@ -5,89 +5,18 @@ import common.block.Material;
import common.item.CheatTab; import common.item.CheatTab;
import common.model.Model; import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
import common.util.Identifyable;
import common.world.State; import common.world.State;
public class BlockSandStone extends Block public class BlockSandStone extends Block {
{ private final String texture;
private final EnumType type;
public BlockSandStone(EnumType type) public BlockSandStone(String texture) {
{
super(Material.SOLID); super(Material.SOLID);
this.type = type; this.texture = texture;
this.setTab(CheatTab.NATURE); this.setTab(CheatTab.NATURE);
} }
public EnumType getType() {
return this.type;
}
public Model getModel(ModelProvider provider, String name, State state) { public Model getModel(ModelProvider provider, String name, State state) {
switch(this.type) { return provider.getModel("sandstone_" + this.texture).add().nswe().d("sandstone_bottom").u("sandstone_all");
case DEFAULT:
default:
return provider.getModel("sandstone_normal").add().nswe().d("sandstone_bottom").u("sandstone_all");
case CHISELED:
return provider.getModel("sandstone_carved").add().nswe().d("sandstone_bottom").u("sandstone_all");
case SMOOTH:
return provider.getModel("sandstone_smooth").add().nswe().d("sandstone_bottom").u("sandstone_all");
}
}
public static enum EnumType implements Identifyable
{
DEFAULT(0, "sandstone", "Sandstein"),
CHISELED(1, "chiseled_sandstone", "Gemeißelter Sandstein"),
SMOOTH(2, "smooth_sandstone", "Glatter Sandstein");
private static final BlockSandStone.EnumType[] META_LOOKUP = new BlockSandStone.EnumType[values().length];
private final int metadata;
private final String name;
private final String display;
private EnumType(int meta, String name, String display)
{
this.metadata = meta;
this.name = name;
this.display = display;
}
public int getMetadata()
{
return this.metadata;
}
public String toString()
{
return this.name;
}
public static BlockSandStone.EnumType byMetadata(int meta)
{
if (meta < 0 || meta >= META_LOOKUP.length)
{
meta = 0;
}
return META_LOOKUP[meta];
}
public String getName()
{
return this.name;
}
public String getDisplay()
{
return this.display;
}
static {
for (BlockSandStone.EnumType blocksandstone$enumtype : values())
{
META_LOOKUP[blocksandstone$enumtype.getMetadata()] = blocksandstone$enumtype;
}
}
} }
} }

View file

@ -17,6 +17,7 @@ import common.model.Transforms;
import common.properties.Property; import common.properties.Property;
import common.tileentity.IInteractionObject; import common.tileentity.IInteractionObject;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.ExtMath;
import common.util.Facing; import common.util.Facing;
import common.world.IWorldAccess; import common.world.IWorldAccess;
import common.world.State; import common.world.State;
@ -24,8 +25,14 @@ import common.world.World;
public class BlockAnvil extends BlockFalling implements Rotatable public class BlockAnvil extends BlockFalling implements Rotatable
{ {
public static final BlockAnvil[] ANVILS = new BlockAnvil[3];
private final int damage; private final int damage;
public static BlockAnvil getByDamage(int damage) {
return ANVILS[ExtMath.clampi(damage, 0, ANVILS.length - 1)];
}
public BlockAnvil(int damage) public BlockAnvil(int damage)
{ {
super(Material.HEAVY); super(Material.HEAVY);
@ -33,6 +40,7 @@ public class BlockAnvil extends BlockFalling implements Rotatable
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH)); this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH));
this.setLightOpacity(0); this.setLightOpacity(0);
this.setTab(CheatTab.TECHNOLOGY); this.setTab(CheatTab.TECHNOLOGY);
ANVILS[damage] = this;
} }
public int getAnvilDamage() { public int getAnvilDamage() {
@ -52,6 +60,10 @@ public class BlockAnvil extends BlockFalling implements Rotatable
return false; return false;
} }
public boolean isMagnetic() {
return true;
}
/** /**
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the * Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
* IBlockstate * IBlockstate

View file

@ -16,6 +16,7 @@ import common.model.ModelProvider;
import common.properties.Property; import common.properties.Property;
import common.properties.PropertyBool; import common.properties.PropertyBool;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.ExtMath;
import common.util.Facing; import common.util.Facing;
import common.world.Explosion; import common.world.Explosion;
import common.world.State; import common.world.State;
@ -29,6 +30,10 @@ public class BlockTNT extends Block
private final int power; private final int power;
public static BlockTNT getByPower(int power) {
return TNTS[ExtMath.clampi(power, 0, TNTS.length - 1)];
}
public BlockTNT(int power) public BlockTNT(int power)
{ {
super(Material.EXPLOSIVE); super(Material.EXPLOSIVE);

View file

@ -7,22 +7,22 @@ import common.util.Identifyable;
public enum DyeColor implements Identifyable public enum DyeColor implements Identifyable
{ {
WHITE(0, 15, "white", "Weiß", "Weißes", "Weißer", "Weiße", "Knochenmehl", 16777215, TextColor.WHITE), WHITE(0, 15, "white", "Weiß", "Weißes", "Weißer", "Weiße", "bonemeal", "Knochenmehl", 16777215, TextColor.WHITE),
ORANGE(1, 14, "orange", "Orange", "Oranges", "Oranger", "Orange", "Oranger Farbstoff", 14188339, TextColor.ORANGE), ORANGE(1, 14, "orange", "Orange", "Oranges", "Oranger", "Orange", null, "Oranger Farbstoff", 14188339, TextColor.ORANGE),
MAGENTA(2, 13, "magenta", "Magenta", "Magenta", "Magenta", "Magenta", "Magenta Farbstoff", 11685080, TextColor.NEON), MAGENTA(2, 13, "magenta", "Magenta", "Magenta", "Magenta", "Magenta", null, "Magenta Farbstoff", 11685080, TextColor.NEON),
LIGHT_BLUE(3, 12, "light_blue", "Hellblau", "Hellblaues", "Hellblauer", "Hellblaue", "Hellblauer Farbstoff", 6724056, TextColor.BLUE), LIGHT_BLUE(3, 12, "light_blue", "Hellblau", "Hellblaues", "Hellblauer", "Hellblaue", null, "Hellblauer Farbstoff", 6724056, TextColor.BLUE),
YELLOW(4, 11, "yellow", "Gelb", "Gelbes", "Gelber", "Gelbe", "Gelber Farbstoff", 15066419, TextColor.YELLOW), YELLOW(4, 11, "yellow", "Gelb", "Gelbes", "Gelber", "Gelbe", null, "Gelber Farbstoff", 15066419, TextColor.YELLOW),
LIME(5, 10, "lime", "Hellgrün", "Hellgrünes", "Hellgrüner", "Hellgrüne", "Hellgrüner Farbstoff", 8375321, TextColor.GREEN), LIME(5, 10, "lime", "Hellgrün", "Hellgrünes", "Hellgrüner", "Hellgrüne", null, "Hellgrüner Farbstoff", 8375321, TextColor.GREEN),
PINK(6, 9, "pink", "Rosa", "Rosa", "Rosa", "Rosa", "Rosa Farbstoff", 15892389, TextColor.MAGENTA), PINK(6, 9, "pink", "Rosa", "Rosa", "Rosa", "Rosa", null, "Rosa Farbstoff", 15892389, TextColor.MAGENTA),
GRAY(7, 8, "gray", "Grau", "Graues", "Grauer", "Graue", "Grauer Farbstoff", 5000268, TextColor.GRAY), GRAY(7, 8, "gray", "Grau", "Graues", "Grauer", "Graue", null, "Grauer Farbstoff", 5000268, TextColor.GRAY),
SILVER(8, 7, "silver", "Hellgrau", "Hellgraues", "Hellgrauer", "Hellgraue", "Hellgrauer Farbstoff", 10066329, TextColor.LGRAY), SILVER(8, 7, "silver", "Hellgrau", "Hellgraues", "Hellgrauer", "Hellgraue", null, "Hellgrauer Farbstoff", 10066329, TextColor.LGRAY),
CYAN(9, 6, "cyan", "Türkis", "Türkises", "Türkiser", "Türkise", "Türkiser Farbstoff", 5013401, TextColor.CYAN), CYAN(9, 6, "cyan", "Türkis", "Türkises", "Türkiser", "Türkise", null, "Türkiser Farbstoff", 5013401, TextColor.CYAN),
PURPLE(10, 5, "purple", "Violett", "Violettes", "Violetter", "Violette", "Violetter Farbstoff", 8339378, TextColor.DMAGENTA), PURPLE(10, 5, "purple", "Violett", "Violettes", "Violetter", "Violette", null, "Violetter Farbstoff", 8339378, TextColor.DMAGENTA),
BLUE(11, 4, "blue", "Blau", "Blaues", "Blauer", "Blaue", "Lapislazuli", 3361970, TextColor.MIDNIGHT), BLUE(11, 4, "blue", "Blau", "Blaues", "Blauer", "Blaue", "lapis_lazuli", "Lapislazuli", 3361970, TextColor.MIDNIGHT),
BROWN(12, 3, "brown", "Braun", "Braunes", "Brauner", "Braune", "Kakaobohnen", 6704179, TextColor.ORANGE), BROWN(12, 3, "brown", "Braun", "Braunes", "Brauner", "Braune", "cocoa", "Kakaobohnen", 6704179, TextColor.ORANGE),
GREEN(13, 2, "green", "Grün", "Grünes", "Grüner", "Grüne", "Kaktusgrün", 6717235, TextColor.DGREEN), GREEN(13, 2, "green", "Grün", "Grünes", "Grüner", "Grüne", "cactus_green", "Kaktusgrün", 6717235, TextColor.DGREEN),
RED(14, 1, "red", "Rot", "Rotes", "Roter", "Rote", "Roter Farbstoff", 10040115, TextColor.DRED), RED(14, 1, "red", "Rot", "Rotes", "Roter", "Rote", null, "Roter Farbstoff", 10040115, TextColor.DRED),
BLACK(15, 0, "black", "Schwarz", "Schwarzes", "Schwarzer", "Schwarze", "Tintenbeutel", 1644825, TextColor.BLACK); BLACK(15, 0, "black", "Schwarz", "Schwarzes", "Schwarzer", "Schwarze", "ink_sack", "Tintenbeutel", 1644825, TextColor.BLACK);
private static final Map<String, DyeColor> LOOKUP = Maps.newHashMap(); private static final Map<String, DyeColor> LOOKUP = Maps.newHashMap();
private static final DyeColor[] META_LOOKUP = new DyeColor[values().length]; private static final DyeColor[] META_LOOKUP = new DyeColor[values().length];
@ -36,11 +36,12 @@ public enum DyeColor implements Identifyable
private final String msubject; private final String msubject;
private final String fsubject; private final String fsubject;
private final String dye; private final String dye;
private final String dyeName;
private final int color; private final int color;
private final TextColor chatColor; private final TextColor chatColor;
private DyeColor(int meta, int dyeDamage, String name, String display, String subject, String msubject, private DyeColor(int meta, int dyeDamage, String name, String display, String subject, String msubject,
String fsubject, String dye, int colorIn, TextColor chatColor) String fsubject, String dye, String dyeName, int colorIn, TextColor chatColor)
{ {
this.meta = meta; this.meta = meta;
this.dyeDamage = dyeDamage; this.dyeDamage = dyeDamage;
@ -50,6 +51,7 @@ public enum DyeColor implements Identifyable
this.msubject = msubject; this.msubject = msubject;
this.fsubject = fsubject; this.fsubject = fsubject;
this.dye = dye; this.dye = dye;
this.dyeName = dyeName == null ? name + "_dye" : dyeName;
this.color = colorIn; this.color = colorIn;
this.chatColor = chatColor; this.chatColor = chatColor;
} }
@ -135,6 +137,11 @@ public enum DyeColor implements Identifyable
return this.dye; return this.dye;
} }
public String getDyeName()
{
return this.dye;
}
static { static {
for (DyeColor color : values()) for (DyeColor color : values())
{ {

View file

@ -185,13 +185,13 @@ public class EntityFalling extends Entity implements IObjectData
int j = anvil.getAnvilDamage(); int j = anvil.getAnvilDamage();
++j; ++j;
if (j > 2) if (j >= BlockAnvil.ANVILS.length)
{ {
this.canSetAsBlock = true; this.canSetAsBlock = true;
} }
else else
{ {
this.fallTile = BlockRegistry.getRegisteredBlock("anvil_damaged_" + j).getState().withProperty(BlockAnvil.FACING, this.fallTile.getValue(BlockAnvil.FACING)); this.fallTile = BlockAnvil.getByDamage(j).getState().withProperty(BlockAnvil.FACING, this.fallTile.getValue(BlockAnvil.FACING));
} }
} }
} }

View file

@ -117,25 +117,8 @@ public class EntityDie extends EntityThrowable implements IObjectData
return this.getValue() != 0; return this.getValue() != 0;
} }
public int getStackMeta() {
int meta = 1;
for(int z = 0; z < ItemDie.DIE_SIDES.length; z++) {
if(this.sides == ItemDie.DIE_SIDES[z])
meta = z;
}
return meta;
}
public boolean hasStackMeta() {
for(int z = 0; z < ItemDie.DIE_SIDES.length; z++) {
if(this.sides == ItemDie.DIE_SIDES[z])
return true;
}
return false;
}
public ItemStack getStack() { public ItemStack getStack() {
return new ItemStack(this.hasStackMeta() ? ItemRegistry.getRegisteredItem("die_" + this.sides) : Items.die_6); return new ItemStack(ItemDie.getBySides(this.sides));
} }
public boolean interactFirst(EntityNPC player) public boolean interactFirst(EntityNPC player)
@ -169,6 +152,6 @@ public class EntityDie extends EntityThrowable implements IObjectData
{ {
if(this.getValue() == 0) if(this.getValue() == 0)
return null; return null;
return ItemDie.DIE_COLORS[this.getStackMeta()] + "" + this.getValue(); return ItemDie.getBySides(this.sides).getDieColor() + "" + this.getValue();
} }
} }

View file

@ -24,7 +24,6 @@ import common.block.artificial.BlockSlab;
import common.block.artificial.BlockStainedGlass; import common.block.artificial.BlockStainedGlass;
import common.block.artificial.BlockStainedGlassPane; import common.block.artificial.BlockStainedGlassPane;
import common.block.artificial.BlockStairs; import common.block.artificial.BlockStairs;
import common.block.artificial.BlockStoneBrick;
import common.block.artificial.BlockTrapDoor; import common.block.artificial.BlockTrapDoor;
import common.block.artificial.BlockWall; import common.block.artificial.BlockWall;
import common.block.artificial.BlockWool; import common.block.artificial.BlockWool;
@ -38,6 +37,7 @@ import common.block.foliage.BlockDeadBush;
import common.block.foliage.BlockDoublePlant; import common.block.foliage.BlockDoublePlant;
import common.block.foliage.BlockDryLeaves; import common.block.foliage.BlockDryLeaves;
import common.block.foliage.BlockFarmland; import common.block.foliage.BlockFarmland;
import common.block.foliage.BlockFlower;
import common.block.foliage.BlockGrass; import common.block.foliage.BlockGrass;
import common.block.foliage.BlockHugeMushroom; import common.block.foliage.BlockHugeMushroom;
import common.block.foliage.BlockLeaves; import common.block.foliage.BlockLeaves;
@ -55,6 +55,7 @@ import common.block.foliage.BlockTallGrass;
import common.block.foliage.BlockTianSoil; import common.block.foliage.BlockTianSoil;
import common.block.foliage.BlockVine; import common.block.foliage.BlockVine;
import common.block.foliage.BlockWart; import common.block.foliage.BlockWart;
import common.block.foliage.LeavesType;
import common.block.liquid.BlockDynamicLiquid; import common.block.liquid.BlockDynamicLiquid;
import common.block.liquid.BlockStaticLiquid; import common.block.liquid.BlockStaticLiquid;
import common.block.natural.BlockBedrock; import common.block.natural.BlockBedrock;
@ -62,7 +63,6 @@ import common.block.natural.BlockBlackenedDirt;
import common.block.natural.BlockBlackenedStone; import common.block.natural.BlockBlackenedStone;
import common.block.natural.BlockClay; import common.block.natural.BlockClay;
import common.block.natural.BlockColoredClay; import common.block.natural.BlockColoredClay;
import common.block.natural.BlockDirt;
import common.block.natural.BlockFire; import common.block.natural.BlockFire;
import common.block.natural.BlockGlowstone; import common.block.natural.BlockGlowstone;
import common.block.natural.BlockGravel; import common.block.natural.BlockGravel;
@ -72,9 +72,8 @@ import common.block.natural.BlockIce;
import common.block.natural.BlockObsidian; import common.block.natural.BlockObsidian;
import common.block.natural.BlockOre; import common.block.natural.BlockOre;
import common.block.natural.BlockPackedIce; import common.block.natural.BlockPackedIce;
import common.block.natural.BlockPodzol;
import common.block.natural.BlockRedstoneOre; import common.block.natural.BlockRedstoneOre;
import common.block.natural.BlockRock;
import common.block.natural.BlockSand;
import common.block.natural.BlockSandStone; import common.block.natural.BlockSandStone;
import common.block.natural.BlockSlime; import common.block.natural.BlockSlime;
import common.block.natural.BlockSnow; import common.block.natural.BlockSnow;
@ -131,6 +130,7 @@ import common.init.FluidRegistry.LiquidType;
import common.item.CheatTab; import common.item.CheatTab;
import common.util.ObjectIntIdentityMap; import common.util.ObjectIntIdentityMap;
import common.util.RegistryNamespacedDefaultedByKey; import common.util.RegistryNamespacedDefaultedByKey;
import common.util.Util;
import common.world.State; import common.world.State;
public abstract class BlockRegistry { public abstract class BlockRegistry {
@ -236,7 +236,8 @@ public abstract class BlockRegistry {
registerBlock("stone", stone); registerBlock("stone", stone);
registerBlock("bedrock", (new BlockBedrock()).setHardness(1000.0F).setResistance(100000.0F).setStepSound(SoundType.STONE) registerBlock("bedrock", (new BlockBedrock()).setHardness(1000.0F).setResistance(100000.0F).setStepSound(SoundType.STONE)
.setDisplay("Grundgestein").setTab(CheatTab.NATURE).setMiningLevel(6)); .setDisplay("Grundgestein").setTab(CheatTab.NATURE).setMiningLevel(6));
registerBlock("rock", (new BlockRock()).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE).setDisplay("Felsen")); registerBlock("rock", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE).setDisplay("Felsen").setTab(CheatTab.NATURE));
registerBlock("smooth_rock", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE).setDisplay("Glatter Felsen").setTab(CheatTab.NATURE));
registerBlock("hellrock", (new BlockHellRock()).setHardness(0.4F).setStepSound(SoundType.STONE).setDisplay("Höllenstein")); registerBlock("hellrock", (new BlockHellRock()).setHardness(0.4F).setStepSound(SoundType.STONE).setDisplay("Höllenstein"));
registerBlock("cell_rock", (new Block(Material.LOOSE)).setHardness(1.0F).setResistance(3.0F) registerBlock("cell_rock", (new Block(Material.LOOSE)).setHardness(1.0F).setResistance(3.0F)
.setStepSound(SoundType.SLIME).setDisplay("Zellstein").setTab(CheatTab.NATURE)); .setStepSound(SoundType.SLIME).setDisplay("Zellstein").setTab(CheatTab.NATURE));
@ -245,19 +246,25 @@ public abstract class BlockRegistry {
Block cobblestone = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE) Block cobblestone = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Bruchstein").setTab(CheatTab.NATURE); .setDisplay("Bruchstein").setTab(CheatTab.NATURE);
registerBlock("cobblestone", cobblestone); registerBlock("cobblestone", cobblestone);
registerBlock("mossy_cobblestone", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE) Block mossyCobblestone = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Bemooster Bruchstein").setTab(CheatTab.NATURE)); .setDisplay("Bemooster Bruchstein").setTab(CheatTab.NATURE);
Block sandstone = (new BlockSandStone()).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Sandstein"); registerBlock("mossy_cobblestone", mossyCobblestone);
Block sandstone = (new BlockSandStone("normal")).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Sandstein");
registerBlock("sandstone", sandstone); registerBlock("sandstone", sandstone);
registerBlock("smooth_sandstone", (new BlockSandStone("smooth")).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Glatter Sandstein"));
registerBlock("carved_sandstone", (new BlockSandStone("carved")).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Gemeißelter Sandstein"));
registerBlock("obsidian", (new BlockObsidian()).setHardness(50.0F).setResistance(2000.0F).setStepSound(SoundType.STONE) registerBlock("obsidian", (new BlockObsidian()).setHardness(50.0F).setResistance(2000.0F).setStepSound(SoundType.STONE)
.setDisplay("Obsidian").setMiningLevel(3)); .setDisplay("Obsidian").setMiningLevel(3));
registerBlock("clay", (new BlockClay()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Ton").setShovelHarvestable()); registerBlock("clay", (new BlockClay()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Ton").setShovelHarvestable());
registerBlock("hardened_clay", (new BlockHardenedClay()).setHardness(1.25F).setResistance(7.0F).setStepSound(SoundType.STONE).setDisplay("Gebrannter Ton")); registerBlock("hardened_clay", (new BlockHardenedClay()).setHardness(1.25F).setResistance(7.0F).setStepSound(SoundType.STONE).setDisplay("Gebrannter Ton"));
registerBlock("stained_hardened_clay", (new BlockColoredClay()).setHardness(1.25F).setResistance(7.0F) for(DyeColor color : DyeColor.values()) {
.setStepSound(SoundType.STONE).setDisplay("gefärbter Ton")); registerBlock(color.getName() + "_clay", (new BlockColoredClay(color)).setHardness(1.25F).setResistance(7.0F)
.setStepSound(SoundType.STONE).setDisplay(color.getSubject(null) + " gefärbter Ton"));
}
registerBlock("coal_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F) registerBlock("coal_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay("Kohleblock").setTab(CheatTab.NATURE)); .setStepSound(SoundType.STONE).setDisplay("Kohleblock").setTab(CheatTab.NATURE));
registerBlock("sand", (new BlockSand()).setHardness(0.5F).setStepSound(SoundType.SAND).setDisplay("Sand").setShovelHarvestable()); registerBlock("sand", (new BlockFalling(Material.LOOSE)).setHardness(0.5F).setStepSound(SoundType.SAND).setDisplay("Sand").setShovelHarvestable().setTab(CheatTab.NATURE));
registerBlock("red_sand", (new BlockFalling(Material.LOOSE)).setHardness(0.5F).setStepSound(SoundType.SAND).setDisplay("Roter Sand").setShovelHarvestable().setTab(CheatTab.NATURE));
registerBlock("gravel", (new BlockGravel()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Kies").setShovelHarvestable()); registerBlock("gravel", (new BlockGravel()).setHardness(0.6F).setStepSound(SoundType.GRAVEL).setDisplay("Kies").setShovelHarvestable());
registerBlock("ash", (new Block(Material.LOOSE)).setHardness(0.2F).setStepSound(SoundType.SAND).setDisplay("Asche") registerBlock("ash", (new Block(Material.LOOSE)).setHardness(0.2F).setStepSound(SoundType.SAND).setDisplay("Asche")
.setTab(CheatTab.NATURE).setShovelHarvestable()); .setTab(CheatTab.NATURE).setShovelHarvestable());
@ -316,8 +323,10 @@ public abstract class BlockRegistry {
registerBlock("dirt", (new BlockDirt()).setHardness(0.5F).setStepSound(SoundType.GRAVEL).setDisplay("Erde").setShovelHarvestable()); registerBlock("dirt", (new Block(Material.LOOSE)).setHardness(0.5F).setStepSound(SoundType.GRAVEL).setDisplay("Erde").setShovelHarvestable().setTab(CheatTab.NATURE));
registerBlock("grass", (new BlockGrass()).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Gras").setShovelHarvestable()); registerBlock("grass", (new BlockGrass()).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Gras").setShovelHarvestable());
registerBlock("coarse_dirt", (new Block(Material.LOOSE)).setHardness(0.5F).setStepSound(SoundType.GRAVEL).setDisplay("Grobe Erde").setShovelHarvestable().setTab(CheatTab.NATURE));
registerBlock("podzol", (new BlockPodzol()).setHardness(0.5F).setStepSound(SoundType.GRAVEL).setDisplay("Podsol").setShovelHarvestable());
registerBlock("mycelium", (new BlockMycelium()).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Myzel").setShovelHarvestable()); registerBlock("mycelium", (new BlockMycelium()).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Myzel").setShovelHarvestable());
registerBlock("tian", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE) registerBlock("tian", (new Block(Material.SOLID)).setHardness(2.0F).setResistance(15.0F).setStepSound(SoundType.STONE)
.setDisplay("Tian").setTab(CheatTab.NATURE)); .setDisplay("Tian").setTab(CheatTab.NATURE));
@ -332,11 +341,18 @@ public abstract class BlockRegistry {
registerBlock("tallgrass", (new BlockTallGrass()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Gras").setShearsEfficiency(0)); for(BlockTallGrass.EnumType type : BlockTallGrass.EnumType.values()) {
registerBlock(type.getName(), (new BlockTallGrass(type)).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay(type.getDisplay()).setShearsEfficiency(0));
}
registerBlock("deadbush", (new BlockDeadBush()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Toter Busch")); registerBlock("deadbush", (new BlockDeadBush()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Toter Busch"));
registerBlock("flower", (new BlockBaseFlower()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Blume")); for(BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values()) {
registerBlock("double_plant", new BlockDoublePlant().setDisplay("Pflanze")); registerBlock(type.getName(), (new BlockFlower(type)).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay(type.getDisplay()));
registerBlock("cactus", (new BlockCactus()).setHardness(0.4F).setStepSound(SoundType.CLOTH).setDisplay("Kaktus")); }
for(BlockDoublePlant.EnumPlantType type : BlockDoublePlant.EnumPlantType.values()) {
registerBlock(type.getName(), new BlockDoublePlant(type).setDisplay(type.getDisplay()));
}
Block cactus = (new BlockCactus()).setHardness(0.4F).setStepSound(SoundType.CLOTH).setDisplay("Kaktus");
registerBlock("cactus", cactus);
registerBlock("reeds", (new BlockReed()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Zuckerrohr")); registerBlock("reeds", (new BlockReed()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Zuckerrohr"));
registerBlock("vine", (new BlockVine()).setHardness(0.2F).setStepSound(SoundType.GRASS).setDisplay("Ranken").setShearsEfficiency(0)); registerBlock("vine", (new BlockVine()).setHardness(0.2F).setStepSound(SoundType.GRASS).setDisplay("Ranken").setShearsEfficiency(0));
registerBlock("waterlily", (new BlockLilyPad()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Seerosenblatt")); registerBlock("waterlily", (new BlockLilyPad()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("Seerosenblatt"));
@ -367,7 +383,9 @@ public abstract class BlockRegistry {
registerBlock("dry_leaves", (new BlockDryLeaves()).setDisplay("Vertrocknetes Laub")); registerBlock("dry_leaves", (new BlockDryLeaves()).setDisplay("Vertrocknetes Laub"));
for(WoodType wood : WoodType.values()) { for(WoodType wood : WoodType.values()) {
registerBlock(wood.getName() + "_log", (new BlockLog()).setDisplay(wood.getDisplay() + "holz")); registerBlock(wood.getName() + "_log", (new BlockLog()).setDisplay(wood.getDisplay() + "holz"));
registerBlock(wood.getName() + "_leaves", (new BlockLeaves(wood)).setDisplay(wood.getDisplay() + "laub")); for(LeavesType type : LeavesType.values()) {
registerBlock(wood.getName() + "_leaves_" + type.getName(), (new BlockLeaves(wood, type)).setDisplay(wood.getDisplay() + "laub (" + type.getDisplayName() + ")"));
}
registerBlock(wood.getName() + "_sapling", (new BlockSapling(wood)).setHardness(0.0F).setStepSound(SoundType.GRASS) registerBlock(wood.getName() + "_sapling", (new BlockSapling(wood)).setHardness(0.0F).setStepSound(SoundType.GRASS)
.setDisplay(wood.getDisplay() + "setzling")); .setDisplay(wood.getDisplay() + "setzling"));
} }
@ -387,15 +405,22 @@ public abstract class BlockRegistry {
.setStepSound(SoundType.STONE).setDisplay("Redstone-Block").setTab(CheatTab.TECHNOLOGY)); .setStepSound(SoundType.STONE).setDisplay("Redstone-Block").setTab(CheatTab.TECHNOLOGY));
registerBlock("glass", (new BlockGlass()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Glas")); registerBlock("glass", (new BlockGlass()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Glas"));
registerBlock("stained_glass", (new BlockStainedGlass()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("gefärbtes Glas")); for(DyeColor color : DyeColor.values()) {
registerBlock(color.getName() + "_glass", (new BlockStainedGlass(color)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay(color.getSubject(null) + " gefärbtes Glas"));
}
registerBlock("glass_pane", (new BlockPane(Material.TRANSLUCENT, false)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Glasscheibe")); registerBlock("glass_pane", (new BlockPane(Material.TRANSLUCENT, false)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Glasscheibe"));
registerBlock("stained_glass_pane", (new BlockStainedGlassPane()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("gefärbte Glasscheibe")); for(DyeColor color : DyeColor.values()) {
registerBlock(color.getName() + "_glass_pane", (new BlockStainedGlassPane(color)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay(color.getSubject(null) + " gefärbte Glasscheibe"));
}
for(DyeColor color : DyeColor.values()) {
registerBlock("wool", (new BlockWool()).setHardness(0.8F).setStepSound(SoundType.CLOTH).setDisplay("Wolle") registerBlock("wool", (new BlockWool(color)).setHardness(0.8F).setStepSound(SoundType.CLOTH).setDisplay(color.getSubject(-1) + " Wolle")
.setShearsEfficiency(1)); .setShearsEfficiency(1));
registerBlock("carpet", (new BlockCarpet()).setHardness(0.1F).setStepSound(SoundType.CLOTH).setDisplay("Teppich").setLightOpacity(0)); }
for(DyeColor color : DyeColor.values()) {
registerBlock("carpet", (new BlockCarpet(color)).setHardness(0.1F).setStepSound(SoundType.CLOTH).setDisplay(color.getSubject(1) + " Teppich").setLightOpacity(0));
}
for(DyeColor color : BlockBed.COLORS) { for(DyeColor color : BlockBed.COLORS) {
registerBlock(color.getName() + "_bed", (new BlockBed(color)).setStepSound(SoundType.WOOD).setHardness(0.2F).setDisplay(color.getSubject(0) + " Bett")); registerBlock(color.getName() + "_bed", (new BlockBed(color)).setStepSound(SoundType.WOOD).setHardness(0.2F).setDisplay(color.getSubject(0) + " Bett"));
} }
@ -408,7 +433,11 @@ public abstract class BlockRegistry {
registerBlock("cake", (new BlockCake()).setHardness(0.5F).setStepSound(SoundType.CLOTH).setDisplay("Kuchen")); registerBlock("cake", (new BlockCake()).setHardness(0.5F).setStepSound(SoundType.CLOTH).setDisplay("Kuchen"));
registerBlock("dragon_egg", (new BlockDragonEgg()).setHardness(3.0F).setResistance(15.0F).setStepSound(SoundType.STONE) registerBlock("dragon_egg", (new BlockDragonEgg()).setHardness(3.0F).setResistance(15.0F).setStepSound(SoundType.STONE)
.setLightLevel(0.125F).setDisplay("Drachenei").setTab(CheatTab.DECORATION)); .setLightLevel(0.125F).setDisplay("Drachenei").setTab(CheatTab.DECORATION));
registerBlock("flower_pot", (new BlockFlowerPot()).setHardness(0.0F).setStepSound(SoundType.STONE).setDisplay("Blumentopf")); registerBlock("flowerpot", (new BlockFlowerPot(null)).setHardness(0.0F).setStepSound(SoundType.STONE).setDisplay("Blumentopf"));
registerBlock("flowerpot_cactus", (new BlockFlowerPot(cactus)).setHardness(0.0F).setStepSound(SoundType.STONE).setDisplay("Blumentopf mit " + cactus.getDisplay()));
for(BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values()) {
registerBlock("flowerpot_" + type.getName(), (new BlockFlowerPot(BlockFlower.getByType(type))).setHardness(0.0F).setStepSound(SoundType.STONE).setDisplay("Blumentopf mit " + type.getDisplay()));
}
registerBlock("sponge", (new Block(Material.LOOSE)).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Schwamm") registerBlock("sponge", (new Block(Material.LOOSE)).setHardness(0.6F).setStepSound(SoundType.GRASS).setDisplay("Schwamm")
.setTab(CheatTab.DECORATION)); .setTab(CheatTab.DECORATION));
registerBlock("skull", (new BlockSkull()).setHardness(1.0F).setStepSound(SoundType.STONE).setDisplay("Schädel").setTab(CheatTab.DECORATION)); registerBlock("skull", (new BlockSkull()).setHardness(1.0F).setStepSound(SoundType.STONE).setDisplay("Schädel").setTab(CheatTab.DECORATION));
@ -460,19 +489,25 @@ public abstract class BlockRegistry {
registerBlock("cobblestone_slab", (new BlockSlab(Material.SOLID, "cobblestone")) registerBlock("cobblestone_slab", (new BlockSlab(Material.SOLID, "cobblestone"))
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Bruchsteinstufe")); .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Bruchsteinstufe"));
registerBlock("cobblestone_stairs", (new BlockStairs(cobblestone.getState())).setDisplay("Bruchsteintreppe")); registerBlock("cobblestone_stairs", (new BlockStairs(cobblestone.getState())).setDisplay("Bruchsteintreppe"));
registerBlock("cobblestone_wall", (new BlockWall(cobblestone)).setDisplay("Bruchsteinmauer")); registerBlock("cobblestone_wall", (new BlockWall(cobblestone, "cobblestone")).setDisplay("Bruchsteinmauer"));
registerBlock("mossy_cobblestone_wall", (new BlockWall(mossyCobblestone, "mossy_cobblestone")).setDisplay("Bemooste Bruchsteinmauer"));
registerBlock("sandstone_slab", (new BlockSlab(Material.SOLID, "sandstone_normal", "sandstone_bottom", "sandstone_all")) registerBlock("sandstone_slab", (new BlockSlab(Material.SOLID, "sandstone_normal", "sandstone_bottom", "sandstone_all"))
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Sandsteinstufe")); .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Sandsteinstufe"));
registerBlock("sandstone_stairs", (new BlockStairs(sandstone.getState().withProperty(BlockSandStone.TYPE, BlockSandStone.EnumType.DEFAULT), registerBlock("sandstone_stairs", (new BlockStairs(sandstone.getState(),
"sandstone_bottom", "sandstone_all")) // fix type "sandstone_bottom", "sandstone_all")) // fix type
.setDisplay("Sandsteintreppe")); .setDisplay("Sandsteintreppe"));
Block quartz = (new BlockQuartz("")).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Quarzblock"); Block quartz = null;
registerBlock("quartz_block", quartz); for(BlockQuartz.EnumType type : BlockQuartz.EnumType.values()) {
Block block = (new BlockQuartz(false, type)).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay(type.getDisplayLight());
if(type == BlockQuartz.EnumType.DEFAULT)
quartz = block;
registerBlock(type.getName(), block);
}
registerBlock("quartz_slab", (new BlockSlab(Material.SOLID, "quartz_block_side", "quartz_block_bottom", "quartz_top")) registerBlock("quartz_slab", (new BlockSlab(Material.SOLID, "quartz_block_side", "quartz_block_bottom", "quartz_top"))
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Quarzstufe")); .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Quarzstufe"));
registerBlock("quartz_stairs", (new BlockStairs(quartz.getState().withProperty(BlockQuartz.VARIANT, BlockQuartz.EnumType.DEFAULT), registerBlock("quartz_stairs", (new BlockStairs(quartz.getState(),
"quartz_block_bottom", "quartz_top")) "quartz_block_bottom", "quartz_top"))
.setDisplay("Quarztreppe")); .setDisplay("Quarztreppe"));
@ -488,12 +523,18 @@ public abstract class BlockRegistry {
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Ziegelstufe")); .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Ziegelstufe"));
registerBlock("brick_stairs", (new BlockStairs(brick.getState())).setDisplay("Ziegeltreppe")); registerBlock("brick_stairs", (new BlockStairs(brick.getState())).setDisplay("Ziegeltreppe"));
Block stonebrick = (new BlockStoneBrick()).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE) Block stonebrick = (new Block(Material.SOLID)).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Steinziegel"); .setDisplay("Steinziegel").setTab(CheatTab.BLOCKS);
registerBlock("stonebrick", stonebrick); registerBlock("stonebrick", stonebrick);
registerBlock("stonebrick_slab", (new BlockSlab(Material.SOLID, "stonebrick_default")) registerBlock("mossy_stonebrick", (new Block(Material.SOLID)).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Bemooste Steinziegel").setTab(CheatTab.BLOCKS));
registerBlock("cracked_stonebrick", (new Block(Material.SOLID)).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Rissige Steinziegel").setTab(CheatTab.BLOCKS));
registerBlock("carved_stonebrick", (new Block(Material.SOLID)).setHardness(1.5F).setResistance(10.0F).setStepSound(SoundType.STONE)
.setDisplay("Gemeißelte Steinziegel").setTab(CheatTab.BLOCKS));
registerBlock("stonebrick_slab", (new BlockSlab(Material.SOLID, "stonebrick"))
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Steinziegelstufe")); .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Steinziegelstufe"));
registerBlock("stonebrick_stairs", (new BlockStairs(stonebrick.getState().withProperty(BlockStoneBrick.VARIANT, BlockStoneBrick.EnumType.DEFAULT))) registerBlock("stonebrick_stairs", (new BlockStairs(stonebrick.getState()))
.setDisplay("Steinziegeltreppe")); .setDisplay("Steinziegeltreppe"));
@ -516,11 +557,16 @@ public abstract class BlockRegistry {
registerBlock("black_brick_fence", (new BlockFence(Material.SOLID, "black_brick")).setHardness(2.0F).setResistance(10.0F) registerBlock("black_brick_fence", (new BlockFence(Material.SOLID, "black_brick")).setHardness(2.0F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay("Schwarzer Ziegelzaun")); .setStepSound(SoundType.STONE).setDisplay("Schwarzer Ziegelzaun"));
Block bquartz = (new BlockQuartz("black_")).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay("Schwarzer Quarzblock"); Block bquartz = null;
registerBlock("black_quartz_block", bquartz); for(BlockQuartz.EnumType type : BlockQuartz.EnumType.values()) {
Block block = (new BlockQuartz(true, type)).setStepSound(SoundType.STONE).setHardness(0.8F).setDisplay(type.getDisplayDark());
if(type == BlockQuartz.EnumType.DEFAULT)
bquartz = block;
registerBlock("black_" + type.getName(), block);
}
registerBlock("black_quartz_slab", (new BlockSlab(Material.SOLID, "black_quartz_block_side", "black_quartz_block_bottom", "black_quartz_top")) registerBlock("black_quartz_slab", (new BlockSlab(Material.SOLID, "black_quartz_block_side", "black_quartz_block_bottom", "black_quartz_top"))
.setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Schwarze Quarzstufe")); .setHardness(2.0F).setResistance(10.0F).setStepSound(SoundType.STONE).setDisplay("Schwarze Quarzstufe"));
registerBlock("black_quartz_stairs", (new BlockStairs(bquartz.getState().withProperty(BlockQuartz.VARIANT, BlockQuartz.EnumType.DEFAULT), registerBlock("black_quartz_stairs", (new BlockStairs(bquartz.getState(),
"black_quartz_block_bottom", "black_quartz_top")) "black_quartz_block_bottom", "black_quartz_top"))
.setDisplay("Schwarze Quarztreppe")); .setDisplay("Schwarze Quarztreppe"));
@ -558,7 +604,9 @@ public abstract class BlockRegistry {
.setTab(CheatTab.TECHNOLOGY)); .setTab(CheatTab.TECHNOLOGY));
registerBlock("lit_furnace", (new BlockFurnace(true)).setHardness(3.5F).setStepSound(SoundType.STONE).setLightLevel(0.875F) registerBlock("lit_furnace", (new BlockFurnace(true)).setHardness(3.5F).setStepSound(SoundType.STONE).setLightLevel(0.875F)
.setDisplay("Ofen (Gefeuert)").setTab(CheatTab.TECHNOLOGY)); .setDisplay("Ofen (Gefeuert)").setTab(CheatTab.TECHNOLOGY));
registerBlock("anvil", (new BlockAnvil()).setHardness(5.0F).setStepSound(SoundType.ANVIL).setResistance(2000.0F).setDisplay("Amboss")); for(int z = 0; z < BlockAnvil.ANVILS.length; z++) {
registerBlock("anvil" + (z == 0 ? "" : "_damaged_" + z), (new BlockAnvil(z)).setHardness(5.0F).setStepSound(SoundType.ANVIL).setResistance(2000.0F).setDisplay((z == 0 ? "" : (z == 1 ? "Leicht beschädigter " : "Stark beschädigter ")) + "Amboss"));
}
registerBlock("enchanting_table", (new BlockEnchantmentTable()).setHardness(5.0F).setResistance(2000.0F).setDisplay("Zaubertisch")); registerBlock("enchanting_table", (new BlockEnchantmentTable()).setHardness(5.0F).setResistance(2000.0F).setDisplay("Zaubertisch"));
registerBlock("brewing_stand", (new BlockBrewingStand()).setHardness(0.5F).setLightLevel(0.125F).setDisplay("Braustand")); registerBlock("brewing_stand", (new BlockBrewingStand()).setHardness(0.5F).setLightLevel(0.125F).setDisplay("Braustand"));
registerBlock("cauldron", (new BlockCauldron()).setHardness(2.0F).setDisplay("Kessel")); registerBlock("cauldron", (new BlockCauldron()).setHardness(2.0F).setDisplay("Kessel"));
@ -573,7 +621,9 @@ public abstract class BlockRegistry {
registerBlock("warp_chest", (new BlockWarpChest()).setHardness(22.5F).setResistance(1000.0F).setStepSound(SoundType.STONE) registerBlock("warp_chest", (new BlockWarpChest()).setHardness(22.5F).setResistance(1000.0F).setStepSound(SoundType.STONE)
.setDisplay("Warptruhe").setLightLevel(0.5F)); .setDisplay("Warptruhe").setLightLevel(0.5F));
registerBlock("tnt", (new BlockTNT()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("TNT")); for(int z = 0; z < BlockTNT.TNTS.length; z++) {
registerBlock("tnt" + (z == 0 ? "" : "_" + z), (new BlockTNT(z)).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("TNT" + Util.getTierSuffix(z)));
}
registerBlock("nuke", (new BlockNuke()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("T-17")); registerBlock("nuke", (new BlockNuke()).setHardness(0.0F).setStepSound(SoundType.GRASS).setDisplay("T-17"));
registerBlock("piston", (new BlockPistonBase(false)).setDisplay("Kolben")); registerBlock("piston", (new BlockPistonBase(false)).setDisplay("Kolben"));

View file

@ -147,7 +147,7 @@ public abstract class Blocks {
public static final BlockRailDetector detector_rail = get("detector_rail"); public static final BlockRailDetector detector_rail = get("detector_rail");
public static final Block diamond_block = get("diamond_block"); public static final Block diamond_block = get("diamond_block");
public static final BlockOre diamond_ore = get("diamond_ore"); public static final BlockOre diamond_ore = get("diamond_ore");
public static final BlockDirt dirt = get("dirt"); public static final Block dirt = get("dirt");
public static final BlockDispenser dispenser = get("dispenser"); public static final BlockDispenser dispenser = get("dispenser");
public static final BlockDoublePlant double_plant = get("double_plant"); public static final BlockDoublePlant double_plant = get("double_plant");
public static final BlockDragonEgg dragon_egg = get("dragon_egg"); public static final BlockDragonEgg dragon_egg = get("dragon_egg");
@ -311,10 +311,10 @@ public abstract class Blocks {
public static final BlockRedstoneTorch redstone_torch = get("redstone_torch"); public static final BlockRedstoneTorch redstone_torch = get("redstone_torch");
public static final BlockReed reeds = get("reeds"); public static final BlockReed reeds = get("reeds");
public static final BlockRedstoneRepeater repeater = get("repeater"); public static final BlockRedstoneRepeater repeater = get("repeater");
public static final BlockRock rock = get("rock"); public static final Block rock = get("rock");
public static final Block ruby_block = get("ruby_block"); public static final Block ruby_block = get("ruby_block");
public static final BlockOre ruby_ore = get("ruby_ore"); public static final BlockOre ruby_ore = get("ruby_ore");
public static final BlockSand sand = get("sand"); public static final BlockFalling sand = get("sand");
public static final BlockSandStone sandstone = get("sandstone"); public static final BlockSandStone sandstone = get("sandstone");
public static final BlockSlab sandstone_slab = get("sandstone_slab"); public static final BlockSlab sandstone_slab = get("sandstone_slab");
public static final BlockStairs sandstone_stairs = get("sandstone_stairs"); public static final BlockStairs sandstone_stairs = get("sandstone_stairs");
@ -354,7 +354,7 @@ public abstract class Blocks {
public static final BlockPressurePlate stone_pressure_plate = get("stone_pressure_plate"); public static final BlockPressurePlate stone_pressure_plate = get("stone_pressure_plate");
public static final BlockSlab stone_slab = get("stone_slab"); public static final BlockSlab stone_slab = get("stone_slab");
public static final BlockStairs stone_stairs = get("stone_stairs"); public static final BlockStairs stone_stairs = get("stone_stairs");
public static final BlockStoneBrick stonebrick = get("stonebrick"); public static final Block stonebrick = get("stonebrick");
public static final BlockSlab stonebrick_slab = get("stonebrick_slab"); public static final BlockSlab stonebrick_slab = get("stonebrick_slab");
public static final BlockStairs stonebrick_stairs = get("stonebrick_stairs"); public static final BlockStairs stonebrick_stairs = get("stonebrick_stairs");
public static final BlockTripWire string = get("string"); public static final BlockTripWire string = get("string");

View file

@ -12,14 +12,11 @@ import common.block.artificial.BlockCarpet;
import common.block.artificial.BlockQuartz; import common.block.artificial.BlockQuartz;
import common.block.artificial.BlockStainedGlass; import common.block.artificial.BlockStainedGlass;
import common.block.artificial.BlockStainedGlassPane; import common.block.artificial.BlockStainedGlassPane;
import common.block.artificial.BlockStoneBrick;
import common.block.artificial.BlockWall; import common.block.artificial.BlockWall;
import common.block.artificial.BlockWool; import common.block.artificial.BlockWool;
import common.block.foliage.BlockDoublePlant; import common.block.foliage.BlockDoublePlant;
import common.block.foliage.BlockFlower; import common.block.foliage.BlockFlower;
import common.block.natural.BlockColoredClay; import common.block.natural.BlockColoredClay;
import common.block.natural.BlockDirt;
import common.block.natural.BlockSand;
import common.block.natural.BlockSandStone; import common.block.natural.BlockSandStone;
import common.collect.Lists; import common.collect.Lists;
import common.collect.Maps; import common.collect.Maps;
@ -1014,7 +1011,7 @@ public abstract class CraftingRegistry
{ {
if (itemstack2.getItem() instanceof ItemDye dye) if (itemstack2.getItem() instanceof ItemDye dye)
{ {
list.add(ItemDye.dyeColors[dye.getColor().getDyeDamage()]); list.add(ItemDye.FIREWORK_COLORS[dye.getColor().getDyeDamage()]);
} }
else if (itemstack2.getItem() == Items.glowstone_dust) else if (itemstack2.getItem() == Items.glowstone_dust)
{ {
@ -1068,7 +1065,7 @@ public abstract class CraftingRegistry
{ {
if (itemstack1.getItem() instanceof ItemDye dye) if (itemstack1.getItem() instanceof ItemDye dye)
{ {
list1.add(ItemDye.dyeColors[dye.getColor().getDyeDamage()]); list1.add(ItemDye.FIREWORK_COLORS[dye.getColor().getDyeDamage()]);
} }
else if (itemstack1.getItem() == Items.firework_charge) else if (itemstack1.getItem() == Items.firework_charge)
{ {

View file

@ -61,12 +61,12 @@ public abstract class DispenserRegistry {
return new EntityEgg(worldIn, position.getX(), position.getY(), position.getZ()); return new EntityEgg(worldIn, position.getX(), position.getY(), position.getZ());
} }
}); });
for(final int sides : ItemDie.DIE_SIDES) { for(final ItemDie die : ItemDie.getDieItems()) {
REGISTRY.putObject(ItemRegistry.getRegisteredItem("die_" + sides), new BehaviorProjectileDispense() REGISTRY.putObject(die, new BehaviorProjectileDispense()
{ {
protected IProjectile getProjectileEntity(World worldIn, IPosition position, ItemStack item) protected IProjectile getProjectileEntity(World worldIn, IPosition position, ItemStack item)
{ {
return new EntityDie(worldIn, position.getX(), position.getY(), position.getZ(), sides); return new EntityDie(worldIn, position.getX(), position.getY(), position.getZ(), die.getSides());
} }
protected float getInaccuracy() protected float getInaccuracy()
{ {

View file

@ -2,25 +2,22 @@ package common.init;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.function.Function;
import common.attributes.UsageSlot; import common.attributes.UsageSlot;
import common.block.Block; import common.block.Block;
import common.block.artificial.BlockBed; import common.block.artificial.BlockBed;
import common.block.artificial.BlockDoor; import common.block.artificial.BlockDoor;
import common.block.artificial.BlockFence; import common.block.artificial.BlockFence;
import common.block.artificial.BlockSlab; import common.block.artificial.BlockSlab;
import common.block.artificial.BlockStoneBrick; import common.block.artificial.BlockStainedGlassPane;
import common.block.artificial.BlockWall; import common.block.artificial.BlockWall;
import common.block.foliage.BlockDoublePlant; import common.block.foliage.BlockDoublePlant;
import common.block.foliage.BlockFlower; import common.block.foliage.BlockFlower;
import common.block.foliage.BlockLeaves; import common.block.foliage.BlockLeaves;
import common.block.foliage.BlockSapling; import common.block.foliage.BlockSapling;
import common.block.natural.BlockDirt; import common.block.foliage.BlockTallGrass;
import common.block.natural.BlockOre; import common.block.natural.BlockOre;
import common.block.natural.BlockSand;
import common.block.natural.BlockSandStone;
import common.block.tech.BlockButton; import common.block.tech.BlockButton;
import common.block.tech.BlockTNT;
import common.collect.Maps; import common.collect.Maps;
import common.collect.Sets; import common.collect.Sets;
import common.color.DyeColor; import common.color.DyeColor;
@ -31,7 +28,6 @@ import common.entity.npc.SpeciesInfo;
import common.item.CheatTab; import common.item.CheatTab;
import common.item.Item; import common.item.Item;
import common.item.ItemAmmo; import common.item.ItemAmmo;
import common.item.ItemAnvilBlock;
import common.item.ItemAppleGold; import common.item.ItemAppleGold;
import common.item.ItemArmor; import common.item.ItemArmor;
import common.item.ItemAxe; import common.item.ItemAxe;
@ -50,7 +46,6 @@ import common.item.ItemCamera;
import common.item.ItemCarrotOnAStick; import common.item.ItemCarrotOnAStick;
import common.item.ItemChargedOrb; import common.item.ItemChargedOrb;
import common.item.ItemChest; import common.item.ItemChest;
import common.item.ItemCloth;
import common.item.ItemColored; import common.item.ItemColored;
import common.item.ItemDie; import common.item.ItemDie;
import common.item.ItemDispenser; import common.item.ItemDispenser;
@ -80,7 +75,6 @@ import common.item.ItemHugeMushroom;
import common.item.ItemInfoWand; import common.item.ItemInfoWand;
import common.item.ItemKey; import common.item.ItemKey;
import common.item.ItemLead; import common.item.ItemLead;
import common.item.ItemLeaves;
import common.item.ItemLightning; import common.item.ItemLightning;
import common.item.ItemLilyPad; import common.item.ItemLilyPad;
import common.item.ItemMagnet; import common.item.ItemMagnet;
@ -89,7 +83,6 @@ import common.item.ItemMetal;
import common.item.ItemMetalBlock; import common.item.ItemMetalBlock;
import common.item.ItemMinecart; import common.item.ItemMinecart;
import common.item.ItemMonsterPlacer; import common.item.ItemMonsterPlacer;
import common.item.ItemMultiTexture;
import common.item.ItemNameTag; import common.item.ItemNameTag;
import common.item.ItemNpcSpawner; import common.item.ItemNpcSpawner;
import common.item.ItemNugget; import common.item.ItemNugget;
@ -116,13 +109,14 @@ import common.item.ItemShovel;
import common.item.ItemStack; import common.item.ItemStack;
import common.item.ItemStick; import common.item.ItemStick;
import common.item.ItemSword; import common.item.ItemSword;
import common.item.ItemTNT;
import common.item.ItemTiny; import common.item.ItemTiny;
import common.item.ItemWall; import common.item.ItemWall;
import common.item.ItemWeatherToken; import common.item.ItemWeatherToken;
import common.potion.Potion; import common.potion.Potion;
import common.potion.PotionHelper; import common.potion.PotionHelper;
import common.util.Pair;
import common.util.RegistryNamespaced; import common.util.RegistryNamespaced;
import common.util.Util;
import common.world.Weather; import common.world.Weather;
public abstract class ItemRegistry { public abstract class ItemRegistry {
@ -198,7 +192,6 @@ public abstract class ItemRegistry {
} }
private static void registerTools(ToolMaterial material, String name, String prefix) { private static void registerTools(ToolMaterial material, String name, String prefix) {
// String loc = name.substring(0, 1).toUpperCase() + name.substring(1);
if(material.hasTools()) { if(material.hasTools()) {
registerItem(name + "_shovel", (new ItemShovel(material)).setDisplay(prefix + "schaufel")); registerItem(name + "_shovel", (new ItemShovel(material)).setDisplay(prefix + "schaufel"));
registerItem(name + "_pickaxe", (new ItemPickaxe(material)).setDisplay(prefix + "spitzhacke")); registerItem(name + "_pickaxe", (new ItemPickaxe(material)).setDisplay(prefix + "spitzhacke"));
@ -221,131 +214,36 @@ public abstract class ItemRegistry {
} }
static void register() { static void register() {
registerBlock(Blocks.grass, new ItemColored(Blocks.grass, false)); registerBlock(Blocks.grass, new ItemColored(Blocks.grass));
registerBlock(Blocks.dirt, (new ItemMultiTexture(Blocks.dirt, Blocks.dirt, new Function<ItemStack, String>() {
public String apply(ItemStack p_apply_1_) {
return BlockDirt.DirtType.byMetadata(p_apply_1_.getMetadata()).getDisplay();
}
})).setDisplay("Erde"));
// registerBlock(Blocks.planks, (new ItemMultiTexture(Blocks.planks, Blocks.planks, new Function<ItemStack, String>() {
// public String apply(ItemStack p_apply_1_) {
// return BlockPlanks.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
// }
// })).setUnlocalizedName("wood"));
// registerBlock(Blocks.sapling, (new ItemMultiTexture(Blocks.sapling, Blocks.sapling, true, new Function<ItemStack, String>() {
// public String apply(ItemStack p_apply_1_) {
// return BlockPlanks.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
// }
// })).setUnlocalizedName("sapling"));
registerBlock(Blocks.sand, (new ItemMultiTexture(Blocks.sand, Blocks.sand, new Function<ItemStack, String>() {
public String apply(ItemStack p_apply_1_) {
return BlockSand.EnumType.byMetadata(p_apply_1_.getMetadata()).getDisplay();
}
})).setDisplay("Sand"));
// registerBlock(Blocks.log, (new ItemMultiTexture(Blocks.log, Blocks.log, new Function<ItemStack, String>() {
// public String apply(ItemStack p_apply_1_) {
// return BlockPlanks.EnumType.byMetadata(p_apply_1_.getMetadata()).getUnlocalizedName();
// }
// })).setUnlocalizedName("log"));
// registerBlock(Blocks.log2, (new ItemMultiTexture(Blocks.log2, Blocks.log2, new Function<ItemStack, String>() {
// public String apply(ItemStack p_apply_1_) {
// return BlockPlanks.EnumType.byMetadata(p_apply_1_.getMetadata() + 4).getUnlocalizedName();
// }
// })).setUnlocalizedName("log"));
registerBlock(Blocks.dispenser, new ItemDispenser(Blocks.dispenser)); registerBlock(Blocks.dispenser, new ItemDispenser(Blocks.dispenser));
registerBlock(Blocks.sandstone, (new ItemMultiTexture(Blocks.sandstone, Blocks.sandstone, new Function<ItemStack, String>() { registerBlock(Blocks.dropper, new ItemDispenser(Blocks.dropper));
public String apply(ItemStack p_apply_1_) {
return BlockSandStone.EnumType.byMetadata(p_apply_1_.getMetadata()).getDisplay();
}
})).setDisplay("Sandstein"));
registerFlat(Blocks.golden_rail);
registerFlat(Blocks.detector_rail);
registerBlock(Blocks.sticky_piston, new ItemPiston(Blocks.sticky_piston)); registerBlock(Blocks.sticky_piston, new ItemPiston(Blocks.sticky_piston));
registerFlat(Blocks.web);
registerBlock(Blocks.tallgrass, (new ItemColored(Blocks.tallgrass, true, "")).setSubtypeNames(new String[] {"Busch", "Gras", "Farn"}));
registerFlat(Blocks.deadbush);
registerBlock(Blocks.piston, new ItemPiston(Blocks.piston)); registerBlock(Blocks.piston, new ItemPiston(Blocks.piston));
registerBlock(Blocks.wool, (new ItemCloth(Blocks.wool, -1)).setDisplay("Wolle"));
registerBlock(Blocks.flower, (new ItemMultiTexture(Blocks.flower, Blocks.flower, true, new Function<ItemStack, String>() {
public String apply(ItemStack stack) {
return BlockFlower.EnumFlowerType.getType(BlockFlower.EnumFlowerColor.BASE, stack.getMetadata()).getDisplay();
}
})).setDisplay("Blume"));
registerFlat(Blocks.brown_mushroom);
registerFlat(Blocks.red_mushroom);
registerBlock(Blocks.tnt, new ItemTNT(Blocks.tnt));
registerBlock(Blocks.nuke, new ItemBlock(Blocks.nuke).setColor(TextColor.RED)); registerBlock(Blocks.nuke, new ItemBlock(Blocks.nuke).setColor(TextColor.RED));
registerFlat(Blocks.torch);
registerBlock(Blocks.chest, new ItemChest(Blocks.chest)); registerBlock(Blocks.chest, new ItemChest(Blocks.chest));
registerFlat(Blocks.ladder);
registerFlat(Blocks.rail);
registerFlat(Blocks.lever, "lever");
registerBlock(Blocks.stone_pressure_plate, new ItemPressurePlate(Blocks.stone_pressure_plate)); registerBlock(Blocks.stone_pressure_plate, new ItemPressurePlate(Blocks.stone_pressure_plate));
registerBlock(Blocks.wooden_pressure_plate, new ItemPressurePlate(Blocks.wooden_pressure_plate)); registerBlock(Blocks.wooden_pressure_plate, new ItemPressurePlate(Blocks.wooden_pressure_plate));
registerFlat(Blocks.redstone_torch);
// registerBlock(Blocks.stone_button, new ItemButton(Blocks.stone_button));
registerBlock(Blocks.snow_layer, new ItemSnow(Blocks.snow_layer)); registerBlock(Blocks.snow_layer, new ItemSnow(Blocks.snow_layer));
// registerBlock(Blocks.oak_fence, new ItemFence(Blocks.oak_fence));
// registerBlock(Blocks.spruce_fence, new ItemFence(Blocks.spruce_fence));
// registerBlock(Blocks.birch_fence, new ItemFence(Blocks.birch_fence));
// registerBlock(Blocks.jungle_fence, new ItemFence(Blocks.jungle_fence));
// registerBlock(Blocks.dark_oak_fence, new ItemFence(Blocks.dark_oak_fence));
// registerBlock(Blocks.acacia_fence, new ItemFence(Blocks.acacia_fence));
registerBlock(Blocks.stonebrick, (new ItemMultiTexture(Blocks.stonebrick, Blocks.stonebrick, new Function<ItemStack, String>() {
public String apply(ItemStack p_apply_1_) {
return BlockStoneBrick.EnumType.byMetadata(p_apply_1_.getMetadata()).getDisplay();
}
})).setDisplay("Steinziegel"));
registerBlock(Blocks.brown_mushroom_block, new ItemHugeMushroom(Blocks.brown_mushroom_block)); registerBlock(Blocks.brown_mushroom_block, new ItemHugeMushroom(Blocks.brown_mushroom_block));
registerBlock(Blocks.red_mushroom_block, new ItemHugeMushroom(Blocks.red_mushroom_block)); registerBlock(Blocks.red_mushroom_block, new ItemHugeMushroom(Blocks.red_mushroom_block));
registerFlat(Blocks.iron_bars); registerBlock(Blocks.vine, new ItemColored(Blocks.vine, ""));
registerFlat(Blocks.glass_pane, "glass");
registerBlock(Blocks.vine, new ItemColored(Blocks.vine, false, ""));
registerBlock(Blocks.waterlily, new ItemLilyPad(Blocks.waterlily)); registerBlock(Blocks.waterlily, new ItemLilyPad(Blocks.waterlily));
// registerBlock(Blocks.blood_brick_fence, new ItemFence(Blocks.blood_brick_fence));
// registerBlock(Blocks.black_brick_fence, new ItemFence(Blocks.black_brick_fence));
registerFlat(Blocks.tripwire_hook, "tripwire_hook");
registerBlock(Blocks.cobblestone_wall,
(new ItemWall(Blocks.cobblestone_wall, Blocks.cobblestone_wall, new Function<ItemStack, String>() {
public String apply(ItemStack p_apply_1_) {
return BlockWall.EnumType.byMetadata(p_apply_1_.getMetadata()).getDisplay();
}
})).setDisplay("Bruchsteinmauer"));
// registerBlock(Blocks.wooden_button, new ItemButton(Blocks.wooden_button));
registerBlock(Blocks.anvil, (new ItemAnvilBlock(Blocks.anvil)).setDisplay("Amboss")); // ; , new String[] {"Amboss", "Leicht beschädigter Amboss", "Stark beschädigter Amboss"});
registerBlock(Blocks.trapped_chest, new ItemChest(Blocks.trapped_chest)); registerBlock(Blocks.trapped_chest, new ItemChest(Blocks.trapped_chest));
registerBlock(Blocks.light_weighted_pressure_plate, new ItemPressurePlate(Blocks.light_weighted_pressure_plate)); registerBlock(Blocks.light_weighted_pressure_plate, new ItemPressurePlate(Blocks.light_weighted_pressure_plate));
registerBlock(Blocks.heavy_weighted_pressure_plate, new ItemPressurePlate(Blocks.heavy_weighted_pressure_plate)); registerBlock(Blocks.heavy_weighted_pressure_plate, new ItemPressurePlate(Blocks.heavy_weighted_pressure_plate));
registerFlat(Blocks.hopper, "items/hopper");
registerBlock(Blocks.quartz_block,
(new ItemMultiTexture(Blocks.quartz_block, Blocks.quartz_block, new String[] {"Quarzblock", "Gemeißelter Quarzblock", "Quarzsäule"}))
.setDisplay("Quarzblock"));
registerBlock(Blocks.black_quartz_block,
(new ItemMultiTexture(Blocks.black_quartz_block, Blocks.black_quartz_block, new String[] {"Schwarzer Quarzblock", "Schwarzer gemeißelter Quarzblock", "Schwarze Quarzsäule"}))
.setDisplay("Schwarzer Quarzblock"));
registerFlat(Blocks.activator_rail);
registerBlock(Blocks.dropper, new ItemDispenser(Blocks.dropper));
registerBlock(Blocks.stained_hardened_clay, (new ItemCloth(Blocks.stained_hardened_clay, null)).setDisplay("gefärbter Ton"));
registerBlock(Blocks.carpet, (new ItemCloth(Blocks.carpet, 1)).setDisplay("Teppich"));
registerBlock(Blocks.double_plant, (new ItemDoublePlant(Blocks.double_plant, Blocks.double_plant, new Function<ItemStack, String>() {
public String apply(ItemStack p_apply_1_) {
return BlockDoublePlant.EnumPlantType.byMetadata(p_apply_1_.getMetadata()).getDisplay();
}
})).setDisplay("Pflanze"));
registerBlock(Blocks.stained_glass, (new ItemCloth(Blocks.stained_glass, null)).setDisplay("Glas"));
registerBlock(Blocks.stained_glass_pane, (new ItemCloth(Blocks.stained_glass_pane, null, "glass")).setDisplay("Glasscheibe"));
// registerBlock(Blocks.cherry_fence, new ItemFence(Blocks.cherry_fence));
// registerBlock(Blocks.maple_fence, new ItemFence(Blocks.maple_fence));
registerFlat(Blocks.blue_mushroom);
// registerBlock(Blocks.red_button, new ItemButton(Blocks.red_button));
registerBlock(Blocks.rock, (new ItemMultiTexture(Blocks.rock, Blocks.rock, new Function<ItemStack, String>() {
public String apply(ItemStack stack) {
return stack.getMetadata() == 1 ? "Glatter Felsen" : "Felsen";
}
})).setDisplay("Felsen"));
for(BlockTallGrass.EnumType type : BlockTallGrass.EnumType.values()) {
registerBlock(BlockTallGrass.getByType(type), (new ItemColored(Blocks.tallgrass, "")));
}
for(BlockDoublePlant.EnumPlantType type : BlockDoublePlant.EnumPlantType.values()) {
registerBlock(BlockDoublePlant.getByType(type), new ItemDoublePlant(BlockDoublePlant.getByType(type), type));
}
for(BlockWall wall : BlockWall.WALLS) {
registerBlock(wall, new ItemWall(wall));
}
for(BlockLeaves leaves : BlockLeaves.LEAVES) { for(BlockLeaves leaves : BlockLeaves.LEAVES) {
registerBlock(leaves, new ItemLeaves(leaves)); // .setDisplay(BlockRegistry.getNameFromBlock(leaves))); registerBlock(leaves, new ItemColored(leaves, 8));
} }
for(BlockSlab slab : BlockSlab.SLABS) { for(BlockSlab slab : BlockSlab.SLABS) {
registerBlock(slab, new ItemSlab(slab)); registerBlock(slab, new ItemSlab(slab));
@ -356,9 +254,36 @@ public abstract class ItemRegistry {
for(BlockButton button : BlockButton.BUTTONS) { for(BlockButton button : BlockButton.BUTTONS) {
registerBlock(button, new ItemButton(button)); registerBlock(button, new ItemButton(button));
} }
for(int z = 0; z < BlockTNT.TNTS.length; z++) {
registerBlock(BlockTNT.getByPower(z), new ItemBlock(BlockTNT.getByPower(z)).setColor(TextColor.RED));
}
for(BlockFlower.EnumFlowerType type : BlockFlower.EnumFlowerType.values()) {
registerFlat(BlockFlower.getByType(type));
}
for(BlockStainedGlassPane pane : BlockStainedGlassPane.PANES) {
registerFlat(pane);
}
for(BlockSapling sapling : BlockSapling.SAPLINGS) { for(BlockSapling sapling : BlockSapling.SAPLINGS) {
registerFlat(sapling); registerFlat(sapling);
} }
registerFlat(Blocks.golden_rail);
registerFlat(Blocks.detector_rail);
registerFlat(Blocks.web);
registerFlat(Blocks.deadbush);
registerFlat(Blocks.brown_mushroom);
registerFlat(Blocks.red_mushroom);
registerFlat(Blocks.torch);
registerFlat(Blocks.ladder);
registerFlat(Blocks.rail);
registerFlat(Blocks.redstone_torch);
registerFlat(Blocks.iron_bars);
registerFlat(Blocks.activator_rail);
registerFlat(Blocks.blue_mushroom);
registerFlat(Blocks.lever, "lever");
registerFlat(Blocks.glass_pane, "glass");
registerFlat(Blocks.tripwire_hook, "tripwire_hook");
registerFlat(Blocks.hopper, "items/hopper");
Item bucket = (new ItemBucket(null, false)).setDisplay("Eimer"); Item bucket = (new ItemBucket(null, false)).setDisplay("Eimer");
@ -375,8 +300,6 @@ public abstract class ItemRegistry {
} }
registerItem("milk_bucket", (new ItemBucketMilk()).setDisplay("Milch").setContainerItem(bucket)); registerItem("milk_bucket", (new ItemBucketMilk()).setDisplay("Milch").setContainerItem(bucket));
// registerItem("painting", (new ItemHangingEntity(EntityPainting.class)).setDisplay("Gemälde"));
// registerItem("item_frame", (new ItemHangingEntity(EntityFrame.class)).setDisplay("Rahmen"));
registerItem("boat", (new ItemBoat()).setDisplay("Boot")); registerItem("boat", (new ItemBoat()).setDisplay("Boot"));
registerItem("minecart", (new ItemMinecart(EntityCart.EnumMinecartType.RIDEABLE)).setDisplay("Lore")); registerItem("minecart", (new ItemMinecart(EntityCart.EnumMinecartType.RIDEABLE)).setDisplay("Lore"));
registerItem("chest_minecart", (new ItemMinecart(EntityCart.EnumMinecartType.CHEST)).setDisplay("Güterlore")); registerItem("chest_minecart", (new ItemMinecart(EntityCart.EnumMinecartType.CHEST)).setDisplay("Güterlore"));
@ -400,7 +323,9 @@ public abstract class ItemRegistry {
registerItem("lightning_wand", (new ItemLightning()).setDisplay("Geladenes Zepter")); registerItem("lightning_wand", (new ItemLightning()).setDisplay("Geladenes Zepter"));
registerItem("banhammer", (new ItemBanHammer()).setDisplay("Hammer der Verbannung").setTab(CheatTab.TOOLS)); registerItem("banhammer", (new ItemBanHammer()).setDisplay("Hammer der Verbannung").setTab(CheatTab.TOOLS));
registerItem("key", (new ItemKey()).setDisplay("Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(128)); registerItem("key", (new ItemKey()).setDisplay("Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(128));
registerItem("die", (new ItemDie()).setDisplay("Würfel").setMaxAmount(128)); for(Pair<Integer, TextColor> sides : ItemDie.DIE_SIDES) {
registerItem("die_" + sides.first(), (new ItemDie(sides.first(), sides.second())).setDisplay("Würfel").setMaxAmount(128));
}
registerItem("chick_magnet", (new ItemMagnet(true)).setDisplay("Kükenmagnet")); registerItem("chick_magnet", (new ItemMagnet(true)).setDisplay("Kükenmagnet"));
registerItem("magnet", (new ItemMagnet(false)).setDisplay("Magnet")); registerItem("magnet", (new ItemMagnet(false)).setDisplay("Magnet"));
registerItem("camera", (new ItemCamera()).setDisplay("Kamera").setTab(CheatTab.TOOLS)); registerItem("camera", (new ItemCamera()).setDisplay("Kamera").setTab(CheatTab.TOOLS));
@ -435,11 +360,7 @@ public abstract class ItemRegistry {
registerItem("golden_apple", (new ItemAppleGold(4, false)).setPotionEffect(Potion.REGENERATION, 5, 1, 1.0F) registerItem("golden_apple", (new ItemAppleGold(4, false)).setPotionEffect(Potion.REGENERATION, 5, 1, 1.0F)
.setDisplay("Goldener Apfel")); .setDisplay("Goldener Apfel"));
registerItem((new ItemSign()).setDisplay("Schild")); registerItem((new ItemSign()).setDisplay("Schild"));
// registerItem("oak_door", (new ItemDoor(Blocks.oak_door)).setUnlocalizedName("doorOak"));
// registerItem("water_bucket", (new ItemBucket(Blocks.flowing_water)).setUnlocalizedName("bucketWater").setContainerItem(bucket));
// registerItem("lava_bucket", (new ItemBucket(Blocks.flowing_lava)).setUnlocalizedName("bucketLava").setContainerItem(bucket));
registerItem("saddle", (new ItemSaddle()).setDisplay("Sattel")); registerItem("saddle", (new ItemSaddle()).setDisplay("Sattel"));
// registerItem("iron_door", (new ItemDoor(Blocks.iron_door)).setUnlocalizedName("doorIron"));
registerItem((new ItemRedstone()).setDisplay("Redstone").setPotionEffect(PotionHelper.redstoneEffect).setMaxAmount(256)); registerItem((new ItemRedstone()).setDisplay("Redstone").setPotionEffect(PotionHelper.redstoneEffect).setMaxAmount(256));
registerItem("snowball", (new ItemSnowball()).setDisplay("Schneeball").setMaxAmount(128)); registerItem("snowball", (new ItemSnowball()).setDisplay("Schneeball").setMaxAmount(128));
registerItem("leather", (new Item()).setDisplay("Leder").setTab(CheatTab.MATERIALS)); registerItem("leather", (new Item()).setDisplay("Leder").setTab(CheatTab.MATERIALS));
@ -455,10 +376,18 @@ public abstract class ItemRegistry {
registerItem("fishing_rod", (new ItemFishingRod()).setDisplay("Angel")); registerItem("fishing_rod", (new ItemFishingRod()).setDisplay("Angel"));
registerItem("glowstone_dust", (new Item()).setDisplay("Glowstonestaub").setPotionEffect(PotionHelper.glowstoneEffect) registerItem("glowstone_dust", (new Item()).setDisplay("Glowstonestaub").setPotionEffect(PotionHelper.glowstoneEffect)
.setTab(CheatTab.MATERIALS).setMaxAmount(256)); .setTab(CheatTab.MATERIALS).setMaxAmount(256));
registerItem("fish", (new ItemFishFood(false)).setDisplay("Fisch")); for(ItemFishFood.FishType type : ItemFishFood.FishType.values()) {
registerItem("cooked_fish", (new ItemFishFood(true)).setDisplay("Fisch")); registerItem(type.getName(), (new ItemFishFood(false, type)).setDisplay("Fisch"));
Item dye = (new ItemDye()).setDisplay("Farbstoff").setMaxAmount(512); if(type.canCook())
registerItem("dye", dye); registerItem("cooked_" + type.getName(), (new ItemFishFood(true, type)).setDisplay("Fisch"));
}
Item lapis = null;
for(DyeColor color : DyeColor.values()) {
Item dye = (new ItemDye(color)).setDisplay(color.getDyeName()).setMaxAmount(512);
if(color == DyeColor.BLUE)
lapis = dye;
registerItem(color.getDye(), dye);
}
registerItem("bone", (new ItemStick()).setDisplay("Knochen").setTab(CheatTab.MATERIALS).setMaxAmount(128)); registerItem("bone", (new ItemStick()).setDisplay("Knochen").setTab(CheatTab.MATERIALS).setMaxAmount(128));
registerItem("sugar", (new Item()).setDisplay("Zucker").setPotionEffect(PotionHelper.sugarEffect).setTab(CheatTab.MATERIALS).setMaxAmount(512)); registerItem("sugar", (new Item()).setDisplay("Zucker").setPotionEffect(PotionHelper.sugarEffect).setTab(CheatTab.MATERIALS).setMaxAmount(512));
registerItem((new ItemSmallBlock(Blocks.cake)).setMaxAmount(1).setDisplay("Kuchen").setTab(CheatTab.DECORATION)); registerItem((new ItemSmallBlock(Blocks.cake)).setMaxAmount(1).setDisplay("Kuchen").setTab(CheatTab.DECORATION));
@ -477,7 +406,10 @@ public abstract class ItemRegistry {
registerItem("ghast_tear", (new ItemTiny()).setDisplay("Ghastträne").setPotionEffect(PotionHelper.ghastTearEffect).setTab(CheatTab.MATERIALS).setMaxAmount(256)); registerItem("ghast_tear", (new ItemTiny()).setDisplay("Ghastträne").setPotionEffect(PotionHelper.ghastTearEffect).setTab(CheatTab.MATERIALS).setMaxAmount(256));
registerItem("gold_nugget", (new ItemNugget()).setDisplay("Goldnugget").setTab(CheatTab.METALS).setMaxAmount(256)); registerItem("gold_nugget", (new ItemNugget()).setDisplay("Goldnugget").setTab(CheatTab.METALS).setMaxAmount(256));
registerItem((new ItemSeeds(Blocks.soul_wart, Blocks.soul_sand)).setDisplay("Seelenwarze").setPotionEffect("+4").setMaxAmount(128)); registerItem((new ItemSeeds(Blocks.soul_wart, Blocks.soul_sand)).setDisplay("Seelenwarze").setPotionEffect("+4").setMaxAmount(128));
registerItem("potion", (new ItemPotion()).setDisplay("Trank")); for(int data : ItemPotion.getValidDataValues()) {
ItemPotion potion = new ItemPotion(data);
registerItem(ItemPotion.getPotionName(potion), potion.setDisplay("Trank"));
}
registerItem("glass_bottle", (new ItemGlassBottle()).setDisplay("Glasflasche")); registerItem("glass_bottle", (new ItemGlassBottle()).setDisplay("Glasflasche"));
registerItem("spider_eye", (new ItemFood(2, false)).setPotionEffect(Potion.POISON, 5, 0, 1.0F).setDisplay("Spinnenauge") registerItem("spider_eye", (new ItemFood(2, false)).setPotionEffect(Potion.POISON, 5, 0, 1.0F).setDisplay("Spinnenauge")
.setPotionEffect(PotionHelper.spiderEyeEffect).setMaxAmount(128)); .setPotionEffect(PotionHelper.spiderEyeEffect).setMaxAmount(128));
@ -521,37 +453,19 @@ public abstract class ItemRegistry {
registerItem("lead", (new ItemLead()).setDisplay("Leine").setMaxAmount(128)); registerItem("lead", (new ItemLead()).setDisplay("Leine").setMaxAmount(128));
registerItem("name_tag", (new ItemNameTag()).setDisplay("Namensschild")); registerItem("name_tag", (new ItemNameTag()).setDisplay("Namensschild"));
registerItem((new ItemBanner()).setDisplay("Banner")); registerItem((new ItemBanner()).setDisplay("Banner"));
// registerItem("spruce_door", (new ItemDoor(Blocks.spruce_door)).setUnlocalizedName("doorSpruce")); for(int z = 0; z < ItemDynamite.DYNAMITE.length; z++) {
// registerItem("birch_door", (new ItemDoor(Blocks.birch_door)).setUnlocalizedName("doorBirch")); registerItem("dynamite" + (z == 0 ? "" : ("_" + z)), (new ItemDynamite(z)).setDisplay("Dynamit" + Util.getTierSuffix(z)).setColor(TextColor.RED));
// registerItem("jungle_door", (new ItemDoor(Blocks.jungle_door)).setUnlocalizedName("doorJungle"));
// registerItem("acacia_door", (new ItemDoor(Blocks.acacia_door)).setUnlocalizedName("doorAcacia"));
// registerItem("dark_oak_door", (new ItemDoor(Blocks.dark_oak_door)).setUnlocalizedName("doorDarkOak"));
for(int z = 0; z < 8; z++) {
registerItem("dynamite", (new ItemDynamite(z)).setDisplay("Dynamit").setColor(TextColor.RED));
} }
// registerItem("cherry_door", (new ItemDoor(Blocks.cherry_door)).setUnlocalizedName("doorCherry"));
// registerItem("maple_door", (new ItemDoor(Blocks.maple_door)).setUnlocalizedName("doorMaple"));
registerItem("chain", (new ItemMagnetic()).setDisplay("Kette").setTab(CheatTab.MATERIALS)); registerItem("chain", (new ItemMagnetic()).setDisplay("Kette").setTab(CheatTab.MATERIALS));
for(OreType ore : OreType.values()) { for(OreType ore : OreType.values()) {
// String loc = ore.name.substring(0, 1).toUpperCase() + ore.name.substring(1);
// registerItemBlock(BlockRegistry.getRegisteredBlock(ore.name + "_ore"));
// registerItemBlock(BlockRegistry.getRegisteredBlock(ore.name + "_block"));
// if(ore.gem != null) {
Item itm = (new Item()).setDisplay(ore.itemDisplay).setTab(CheatTab.METALS); Item itm = (new Item()).setDisplay(ore.itemDisplay).setTab(CheatTab.METALS);
registerItem(ore.item, itm); registerItem(ore.item, itm);
((BlockOre)BlockRegistry.getRegisteredBlock(ore.name + "_ore")).setDropItem(new ItemStack(itm, ore.dropQuantity), ((BlockOre)BlockRegistry.getRegisteredBlock(ore.name + "_ore")).setDropItem(new ItemStack(itm, ore.dropQuantity),
ore.bonusChance, ore.experience); ore.bonusChance, ore.experience);
// }
// else {
// Item itm = (new Item()).setUnlocalizedName("ingot" + loc).setCreativeTab(CreativeTab.tabMaterialsFood);
// registerItem(ore.name + "_ingot", itm);
// ((BlockOre)BlockRegistry.getRegisteredBlock(ore.name + "_ore")).setSmeltItem(new ItemStack(itm));
// }
registerTools(ore.material, ore.name, ore.display); registerTools(ore.material, ore.name, ore.display);
} }
for(MetalType metal : MetalType.values()) { for(MetalType metal : MetalType.values()) {
// String loc = metal.name.substring(0, 1).toUpperCase() + metal.name.substring(1);
Block oreBlock = BlockRegistry.getRegisteredBlock(metal.name + "_ore"); Block oreBlock = BlockRegistry.getRegisteredBlock(metal.name + "_ore");
ItemBlock ore = new ItemMetalBlock(oreBlock, metal, true); ItemBlock ore = new ItemMetalBlock(oreBlock, metal, true);
registerBlock(oreBlock, ore); registerBlock(oreBlock, ore);
@ -575,7 +489,7 @@ public abstract class ItemRegistry {
registerTools(tool.material, tool.name, tool.display); registerTools(tool.material, tool.name, tool.display);
} }
for(BlockDoor door : BlockDoor.DOORS) { for(BlockDoor door : BlockDoor.DOORS) {
registerItem(new ItemDoor(door)); // .setDisplay(door.getDisplay())); registerItem(new ItemDoor(door));
} }
for(DyeColor color : BlockBed.COLORS) { for(DyeColor color : BlockBed.COLORS) {
registerItem(new ItemBed((BlockBed)BlockRegistry.getRegisteredBlock(color.getName() + "_bed")).setMaxAmount(1).setDisplay(color.getSubject(0) + " Bett")); registerItem(new ItemBed((BlockBed)BlockRegistry.getRegisteredBlock(color.getName() + "_bed")).setMaxAmount(1).setDisplay(color.getSubject(0) + " Bett"));
@ -607,54 +521,21 @@ public abstract class ItemRegistry {
registerSpecial(FluidRegistry.getFluidBlock(z)); registerSpecial(FluidRegistry.getFluidBlock(z));
registerSpecial(FluidRegistry.getStaticBlock(z)); registerSpecial(FluidRegistry.getStaticBlock(z));
} }
// for(EnumDyeColor color : BlockBed.COLORS) {
// registerSpecial(BlockRegistry.getRegisteredBlock(color.getName() + "_bed"));
// }
// for(BlockDoor door : BlockDoor.DOORS) {
// registerSpecial(door);
// }
registerSpecial(Blocks.air); registerSpecial(Blocks.air);
// registerSpecial(Blocks.flowing_water);
// registerSpecial(Blocks.water);
// registerSpecial(Blocks.flowing_lava);
// registerSpecial(Blocks.lava);
// registerSpecial(Blocks.wheat);
// registerSpecial(Blocks.carrots);
// registerSpecial(Blocks.potatoes);
// registerSpecial(Blocks.soul_wart);
// registerSpecial(Blocks.pumpkin_stem);
// registerSpecial(Blocks.melon_stem);
registerSpecial(Blocks.cocoa); registerSpecial(Blocks.cocoa);
// registerSpecial(Blocks.reeds);
registerSpecial(Blocks.fire); registerSpecial(Blocks.fire);
registerSpecial(Blocks.soul_fire); registerSpecial(Blocks.soul_fire);
registerSpecial(Blocks.black_fire); registerSpecial(Blocks.black_fire);
registerSpecial(Blocks.portal); registerSpecial(Blocks.portal);
registerSpecial(Blocks.floor_portal); registerSpecial(Blocks.floor_portal);
// registerSpecial(Blocks.standing_sign);
registerSpecial(Blocks.wall_sign); registerSpecial(Blocks.wall_sign);
// registerSpecial(Blocks.standing_banner);
registerSpecial(Blocks.wall_banner); registerSpecial(Blocks.wall_banner);
// registerSpecial(Blocks.cake);
// registerSpecial(Blocks.brewing_stand);
// registerSpecial(Blocks.cauldron);
// registerSpecial(Blocks.flower_pot);
// registerSpecial(Blocks.skull);
// registerSpecial(Blocks.tripwire);
registerSpecial(Blocks.piston_head); registerSpecial(Blocks.piston_head);
registerSpecial(Blocks.piston_extension); registerSpecial(Blocks.piston_extension);
registerSpecial(Blocks.lit_redstone_ore); registerSpecial(Blocks.lit_redstone_ore);
registerSpecial(Blocks.lit_redstone_lamp); registerSpecial(Blocks.lit_redstone_lamp);
// registerSpecial(Blocks.redstone_wire);
registerSpecial(Blocks.unlit_redstone_torch); registerSpecial(Blocks.unlit_redstone_torch);
// registerSpecial(Blocks.unpowered_repeater);
registerSpecial(Blocks.powered_repeater); registerSpecial(Blocks.powered_repeater);
// registerSpecial(Blocks.unpowered_comparator);
registerSpecial(Blocks.powered_comparator); registerSpecial(Blocks.powered_comparator);
registerSpecial(Blocks.daylight_detector_inverted); registerSpecial(Blocks.daylight_detector_inverted);

View file

@ -18,7 +18,7 @@ public abstract class Items {
public static final ItemDoor acacia_door = get("acacia_door"); public static final ItemDoor acacia_door = get("acacia_door");
public static final ItemFence acacia_fence = get("acacia_fence"); public static final ItemFence acacia_fence = get("acacia_fence");
public static final ItemBlock acacia_fence_gate = get("acacia_fence_gate"); public static final ItemBlock acacia_fence_gate = get("acacia_fence_gate");
public static final ItemLeaves acacia_leaves = get("acacia_leaves"); public static final ItemColored acacia_leaves = get("acacia_leaves");
public static final ItemBlock acacia_log = get("acacia_log"); public static final ItemBlock acacia_log = get("acacia_log");
public static final ItemBlock acacia_planks = get("acacia_planks"); public static final ItemBlock acacia_planks = get("acacia_planks");
public static final ItemBlock acacia_sapling = get("acacia_sapling"); public static final ItemBlock acacia_sapling = get("acacia_sapling");
@ -33,7 +33,7 @@ public abstract class Items {
public static final ItemMetalBlock antimony_block = get("antimony_block"); public static final ItemMetalBlock antimony_block = get("antimony_block");
public static final ItemMetalBlock antimony_ore = get("antimony_ore"); public static final ItemMetalBlock antimony_ore = get("antimony_ore");
public static final ItemMetal antimony_powder = get("antimony_powder"); public static final ItemMetal antimony_powder = get("antimony_powder");
public static final ItemAnvilBlock anvil = get("anvil"); public static final ItemBlock anvil = get("anvil");
public static final ItemFood apple = get("apple"); public static final ItemFood apple = get("apple");
public static final ItemBlock ardite_block = get("ardite_block"); public static final ItemBlock ardite_block = get("ardite_block");
public static final ItemArmor ardite_boots = get("ardite_boots"); public static final ItemArmor ardite_boots = get("ardite_boots");
@ -57,7 +57,7 @@ public abstract class Items {
public static final ItemDoor birch_door = get("birch_door"); public static final ItemDoor birch_door = get("birch_door");
public static final ItemFence birch_fence = get("birch_fence"); public static final ItemFence birch_fence = get("birch_fence");
public static final ItemBlock birch_fence_gate = get("birch_fence_gate"); public static final ItemBlock birch_fence_gate = get("birch_fence_gate");
public static final ItemLeaves birch_leaves = get("birch_leaves"); public static final ItemColored birch_leaves = get("birch_leaves");
public static final ItemBlock birch_log = get("birch_log"); public static final ItemBlock birch_log = get("birch_log");
public static final ItemBlock birch_planks = get("birch_planks"); public static final ItemBlock birch_planks = get("birch_planks");
public static final ItemBlock birch_sapling = get("birch_sapling"); public static final ItemBlock birch_sapling = get("birch_sapling");
@ -87,7 +87,7 @@ public abstract class Items {
public static final ItemDoor blackwood_door = get("blackwood_door"); public static final ItemDoor blackwood_door = get("blackwood_door");
public static final ItemFence blackwood_fence = get("blackwood_fence"); public static final ItemFence blackwood_fence = get("blackwood_fence");
public static final ItemBlock blackwood_fence_gate = get("blackwood_fence_gate"); public static final ItemBlock blackwood_fence_gate = get("blackwood_fence_gate");
public static final ItemLeaves blackwood_leaves = get("blackwood_leaves"); public static final ItemColored blackwood_leaves = get("blackwood_leaves");
public static final ItemBlock blackwood_log = get("blackwood_log"); public static final ItemBlock blackwood_log = get("blackwood_log");
public static final ItemBlock blackwood_planks = get("blackwood_planks"); public static final ItemBlock blackwood_planks = get("blackwood_planks");
public static final ItemBlock blackwood_sapling = get("blackwood_sapling"); public static final ItemBlock blackwood_sapling = get("blackwood_sapling");
@ -141,7 +141,7 @@ public abstract class Items {
public static final ItemDoor cherry_door = get("cherry_door"); public static final ItemDoor cherry_door = get("cherry_door");
public static final ItemFence cherry_fence = get("cherry_fence"); public static final ItemFence cherry_fence = get("cherry_fence");
public static final ItemBlock cherry_fence_gate = get("cherry_fence_gate"); public static final ItemBlock cherry_fence_gate = get("cherry_fence_gate");
public static final ItemLeaves cherry_leaves = get("cherry_leaves"); public static final ItemColored cherry_leaves = get("cherry_leaves");
public static final ItemBlock cherry_log = get("cherry_log"); public static final ItemBlock cherry_log = get("cherry_log");
public static final ItemBlock cherry_planks = get("cherry_planks"); public static final ItemBlock cherry_planks = get("cherry_planks");
public static final ItemBlock cherry_sapling = get("cherry_sapling"); public static final ItemBlock cherry_sapling = get("cherry_sapling");
@ -188,7 +188,7 @@ public abstract class Items {
public static final ItemDoor dark_oak_door = get("dark_oak_door"); public static final ItemDoor dark_oak_door = get("dark_oak_door");
public static final ItemFence dark_oak_fence = get("dark_oak_fence"); public static final ItemFence dark_oak_fence = get("dark_oak_fence");
public static final ItemBlock dark_oak_fence_gate = get("dark_oak_fence_gate"); public static final ItemBlock dark_oak_fence_gate = get("dark_oak_fence_gate");
public static final ItemLeaves dark_oak_leaves = get("dark_oak_leaves"); public static final ItemColored dark_oak_leaves = get("dark_oak_leaves");
public static final ItemBlock dark_oak_log = get("dark_oak_log"); public static final ItemBlock dark_oak_log = get("dark_oak_log");
public static final ItemBlock dark_oak_planks = get("dark_oak_planks"); public static final ItemBlock dark_oak_planks = get("dark_oak_planks");
public static final ItemBlock dark_oak_sapling = get("dark_oak_sapling"); public static final ItemBlock dark_oak_sapling = get("dark_oak_sapling");
@ -312,7 +312,7 @@ public abstract class Items {
public static final ItemDoor jungle_door = get("jungle_door"); public static final ItemDoor jungle_door = get("jungle_door");
public static final ItemFence jungle_fence = get("jungle_fence"); public static final ItemFence jungle_fence = get("jungle_fence");
public static final ItemBlock jungle_fence_gate = get("jungle_fence_gate"); public static final ItemBlock jungle_fence_gate = get("jungle_fence_gate");
public static final ItemLeaves jungle_leaves = get("jungle_leaves"); public static final ItemColored jungle_leaves = get("jungle_leaves");
public static final ItemBlock jungle_log = get("jungle_log"); public static final ItemBlock jungle_log = get("jungle_log");
public static final ItemBlock jungle_planks = get("jungle_planks"); public static final ItemBlock jungle_planks = get("jungle_planks");
public static final ItemBlock jungle_sapling = get("jungle_sapling"); public static final ItemBlock jungle_sapling = get("jungle_sapling");
@ -353,7 +353,7 @@ public abstract class Items {
public static final ItemDoor maple_door = get("maple_door"); public static final ItemDoor maple_door = get("maple_door");
public static final ItemFence maple_fence = get("maple_fence"); public static final ItemFence maple_fence = get("maple_fence");
public static final ItemBlock maple_fence_gate = get("maple_fence_gate"); public static final ItemBlock maple_fence_gate = get("maple_fence_gate");
public static final ItemLeaves maple_leaves = get("maple_leaves"); public static final ItemColored maple_leaves = get("maple_leaves");
public static final ItemBlock maple_log = get("maple_log"); public static final ItemBlock maple_log = get("maple_log");
public static final ItemBlock maple_planks = get("maple_planks"); public static final ItemBlock maple_planks = get("maple_planks");
public static final ItemBlock maple_sapling = get("maple_sapling"); public static final ItemBlock maple_sapling = get("maple_sapling");
@ -400,7 +400,7 @@ public abstract class Items {
public static final ItemDoor oak_door = get("oak_door"); public static final ItemDoor oak_door = get("oak_door");
public static final ItemFence oak_fence = get("oak_fence"); public static final ItemFence oak_fence = get("oak_fence");
public static final ItemBlock oak_fence_gate = get("oak_fence_gate"); public static final ItemBlock oak_fence_gate = get("oak_fence_gate");
public static final ItemLeaves oak_leaves = get("oak_leaves"); public static final ItemColored oak_leaves = get("oak_leaves");
public static final ItemBlock oak_log = get("oak_log"); public static final ItemBlock oak_log = get("oak_log");
public static final ItemBlock oak_planks = get("oak_planks"); public static final ItemBlock oak_planks = get("oak_planks");
public static final ItemBlock oak_sapling = get("oak_sapling"); public static final ItemBlock oak_sapling = get("oak_sapling");
@ -522,7 +522,7 @@ public abstract class Items {
public static final ItemDoor spruce_door = get("spruce_door"); public static final ItemDoor spruce_door = get("spruce_door");
public static final ItemFence spruce_fence = get("spruce_fence"); public static final ItemFence spruce_fence = get("spruce_fence");
public static final ItemBlock spruce_fence_gate = get("spruce_fence_gate"); public static final ItemBlock spruce_fence_gate = get("spruce_fence_gate");
public static final ItemLeaves spruce_leaves = get("spruce_leaves"); public static final ItemColored spruce_leaves = get("spruce_leaves");
public static final ItemBlock spruce_log = get("spruce_log"); public static final ItemBlock spruce_log = get("spruce_log");
public static final ItemBlock spruce_planks = get("spruce_planks"); public static final ItemBlock spruce_planks = get("spruce_planks");
public static final ItemBlock spruce_sapling = get("spruce_sapling"); public static final ItemBlock spruce_sapling = get("spruce_sapling");
@ -568,7 +568,7 @@ public abstract class Items {
public static final ItemDoor tian_door = get("tian_door"); public static final ItemDoor tian_door = get("tian_door");
public static final ItemFence tian_fence = get("tian_fence"); public static final ItemFence tian_fence = get("tian_fence");
public static final ItemBlock tian_fence_gate = get("tian_fence_gate"); public static final ItemBlock tian_fence_gate = get("tian_fence_gate");
public static final ItemLeaves tian_leaves = get("tian_leaves"); public static final ItemColored tian_leaves = get("tian_leaves");
public static final ItemBlock tian_log = get("tian_log"); public static final ItemBlock tian_log = get("tian_log");
public static final ItemBlock tian_planks = get("tian_planks"); public static final ItemBlock tian_planks = get("tian_planks");
public static final ItemBlock tian_reactor = get("tian_reactor"); public static final ItemBlock tian_reactor = get("tian_reactor");
@ -582,7 +582,7 @@ public abstract class Items {
public static final ItemMetalBlock titanium_block = get("titanium_block"); public static final ItemMetalBlock titanium_block = get("titanium_block");
public static final ItemMetal titanium_ingot = get("titanium_ingot"); public static final ItemMetal titanium_ingot = get("titanium_ingot");
public static final ItemMetalBlock titanium_ore = get("titanium_ore"); public static final ItemMetalBlock titanium_ore = get("titanium_ore");
public static final ItemTNT tnt = get("tnt"); public static final ItemBlock tnt = get("tnt");
public static final ItemMinecart tnt_minecart = get("tnt_minecart"); public static final ItemMinecart tnt_minecart = get("tnt_minecart");
public static final ItemBlock torch = get("torch"); public static final ItemBlock torch = get("torch");
public static final ItemBlock trapdoor = get("trapdoor"); public static final ItemBlock trapdoor = get("trapdoor");

View file

@ -106,14 +106,14 @@ public class ContainerRepair extends Container
int l = anvil.getAnvilDamage(); int l = anvil.getAnvilDamage();
++l; ++l;
if (l > 2) if (l >= BlockAnvil.ANVILS.length)
{ {
worldIn.setBlockToAir(blockPosIn); worldIn.setBlockToAir(blockPosIn);
worldIn.playAuxSFX(1020, blockPosIn, 0); worldIn.playAuxSFX(1020, blockPosIn, 0);
} }
else else
{ {
worldIn.setState(blockPosIn, BlockRegistry.getRegisteredBlock("anvil_damaged_" + l).getState().withProperty(BlockAnvil.FACING, iblockstate.getValue(BlockAnvil.FACING)), 2); worldIn.setState(blockPosIn, BlockAnvil.getByDamage(l).getState().withProperty(BlockAnvil.FACING, iblockstate.getValue(BlockAnvil.FACING)), 2);
worldIn.playAuxSFX(1021, blockPosIn, 0); worldIn.playAuxSFX(1021, blockPosIn, 0);
} }
} }

View file

@ -1,15 +0,0 @@
package common.item;
import common.block.Block;
public class ItemAnvilBlock extends ItemBlock
{
public ItemAnvilBlock(Block block)
{
super(block);
}
public boolean isMagnetic() {
return true;
}
}

View file

@ -1,7 +1,5 @@
package common.item; package common.item;
import java.util.List;
import common.block.Block; import common.block.Block;
import common.color.TextColor; import common.color.TextColor;
import common.entity.Entity; import common.entity.Entity;
@ -22,16 +20,28 @@ public class ItemBlock extends Item
{ {
protected final Block block; protected final Block block;
protected final String flatTexture; protected final String flatTexture;
protected final int fixedMeta;
public ItemBlock(Block block, String flatTexture) public ItemBlock(Block block, String flatTexture, int fixedMeta)
{ {
this.block = block; this.block = block;
this.flatTexture = flatTexture; this.flatTexture = flatTexture;
this.fixedMeta = fixedMeta;
}
public ItemBlock(Block block, int fixedMeta)
{
this(block, null, fixedMeta);
}
public ItemBlock(Block block, String flatTexture)
{
this(block, flatTexture, 0);
} }
public ItemBlock(Block block) public ItemBlock(Block block)
{ {
this(block, null); this(block, null, 0);
} }
public ItemBlock setDisplay(String unlocalizedName) public ItemBlock setDisplay(String unlocalizedName)
@ -183,6 +193,11 @@ public class ItemBlock extends Item
return this.block; return this.block;
} }
public int getMetadata()
{
return this.fixedMeta;
}
// public Set<String> getValidTags() { // public Set<String> getValidTags() {
// return Sets.newHashSet("BlockEntityTag"); // return Sets.newHashSet("BlockEntityTag");
// } // }

View file

@ -7,24 +7,17 @@ import common.model.ModelProvider;
public class ItemCloth extends ItemBlock public class ItemCloth extends ItemBlock
{ {
private final Integer display;
private final DyeColor color; private final DyeColor color;
public ItemCloth(Block block, Integer display, String flatTexture, DyeColor color) public ItemCloth(Block block, String flatTexture, DyeColor color)
{ {
super(block, flatTexture); super(block, flatTexture);
this.color = color; this.color = color;
this.display = display;
} }
public ItemCloth(Block block, Integer display, DyeColor color) public ItemCloth(Block block, DyeColor color)
{ {
this(block, display, null, color); this(block, null, color);
}
public String getDisplay(ItemStack stack)
{
return this.color.getSubject(this.display) + " " + super.getDisplay(stack);
} }
public Model getModel(ModelProvider provider, String name) { public Model getModel(ModelProvider provider, String name) {

View file

@ -4,21 +4,23 @@ import common.block.Block;
public class ItemColored extends ItemBlock public class ItemColored extends ItemBlock
{ {
private final Block coloredBlock;
public ItemColored(Block block, String flatTexture) public ItemColored(Block block, String flatTexture)
{ {
super(block, flatTexture); super(block, flatTexture);
this.coloredBlock = block; }
public ItemColored(Block block, int fixedMeta)
{
super(block, fixedMeta);
} }
public ItemColored(Block block) public ItemColored(Block block)
{ {
this(block, null); super(block);
} }
public int getColorFromItemStack(ItemStack stack, int renderPass) public int getColorFromItemStack(ItemStack stack, int renderPass)
{ {
return this.coloredBlock.getRenderColor(this.coloredBlock.getState()); return this.block.getRenderColor(this.block.getState());
} }
} }

View file

@ -1,5 +1,9 @@
package common.item; package common.item;
import java.util.Collection;
import java.util.Map;
import common.collect.Maps;
import common.color.TextColor; import common.color.TextColor;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.entity.projectile.EntityDie; import common.entity.projectile.EntityDie;
@ -7,20 +11,47 @@ import common.init.SoundEvent;
import common.model.Model; import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
import common.model.Transforms; import common.model.Transforms;
import common.util.Pair;
import common.world.World; import common.world.World;
public class ItemDie extends Item public class ItemDie extends Item
{ {
public static final int[] DIE_SIDES = new int[] {4, 6, 8, 10, 12, 20}; public static final Pair<Integer, TextColor>[] DIE_SIDES = new Pair[] {
public static final TextColor[] DIE_COLORS = new TextColor[] {TextColor.DGREEN, TextColor.NEON, TextColor.DMAGENTA, new Pair(4, TextColor.DGREEN),
TextColor.MAGENTA, TextColor.DRED, TextColor.ORANGE}; new Pair(6, TextColor.NEON),
new Pair(8, TextColor.DMAGENTA),
new Pair(10, TextColor.MAGENTA),
new Pair(12, TextColor.DRED),
new Pair(20, TextColor.ORANGE)
};
public static final Map<Integer, ItemDie> DICE = Maps.newTreeMap();
private final int sides; private final int sides;
private final TextColor color;
public ItemDie(int sides) public static final ItemDie getBySides(int sides) {
ItemDie die = DICE.get(sides);
return die == null ? DICE.get(6) : die;
}
public static Collection<ItemDie> getDieItems() {
return DICE.values();
}
public ItemDie(int sides, TextColor color)
{ {
this.sides = sides; this.sides = sides;
this.color = color;
this.setTab(CheatTab.TOOLS); this.setTab(CheatTab.TOOLS);
DICE.put(sides, this);
}
public int getSides() {
return this.sides;
}
public TextColor getDieColor() {
return this.color;
} }
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn) public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn)

View file

@ -22,7 +22,7 @@ import common.world.AWorldServer;
public class ItemDye extends Item public class ItemDye extends Item
{ {
public static final int[] dyeColors = new int[] {1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320}; public static final int[] FIREWORK_COLORS = new int[] {1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320};
private static final ItemDye[] DIES = new ItemDye[DyeColor.values().length]; private static final ItemDye[] DIES = new ItemDye[DyeColor.values().length];
private final DyeColor color; private final DyeColor color;
@ -42,11 +42,6 @@ public class ItemDye extends Item
return this.color; return this.color;
} }
public String getDisplay(ItemStack stack)
{
return this.color.getDye();
}
/** /**
* Called when a Block is right-clicked with this Item * Called when a Block is right-clicked with this Item
*/ */

View file

@ -1,54 +1,36 @@
package common.item; package common.item;
import java.util.List;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.entity.projectile.EntityDynamite; import common.entity.projectile.EntityDynamite;
import common.init.SoundEvent; import common.init.SoundEvent;
import common.model.Model; import common.util.ExtMath;
import common.model.ModelProvider;
import common.world.World; import common.world.World;
public class ItemDynamite extends Item public class ItemDynamite extends Item {
{ public static final ItemDynamite[] DYNAMITE = new ItemDynamite[8];
private static final String[] TIERS = new String[] {"II", "III", "IV", "V", "VI", "VII", "VIII"};
private final int power; private final int power;
public ItemDynamite(int power) public static ItemDynamite getByPower(int power) {
{ return DYNAMITE[ExtMath.clampi(power, 0, DYNAMITE.length - 1)];
}
public ItemDynamite(int power) {
this.power = power; this.power = power;
this.setMaxAmount(32); this.setMaxAmount(32);
this.setTab(CheatTab.TOOLS); this.setTab(CheatTab.TOOLS);
DYNAMITE[power] = this;
} }
/** public int getExplosionPower() {
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer return this.power;
*/
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityNPC playerIn)
{
// if (!playerIn.creative)
// {
--itemStackIn.size;
// }
worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F);
if (!worldIn.client)
{
worldIn.spawnEntityInWorld(new EntityDynamite(worldIn, playerIn, this.power));
} }
// playerIn.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]); public ItemStack onItemRightClick(ItemStack stack, World world, EntityNPC player) {
return itemStackIn; --stack.size;
} world.playSoundAtEntity(player, SoundEvent.THROW, 0.5F);
if(!world.client)
public String getDisplay(ItemStack stack) world.spawnEntityInWorld(new EntityDynamite(world, player, this.power));
{ return stack;
return super.getDisplay(stack) + (this.power == 0 ? "" : " " + TIERS[this.power-1]);
}
public Model getModel(ModelProvider provider, String name) {
return provider.getModel(this.getTransform(), "dynamite" + (this.power == 0 ? "" : ("_" + this.power)));
} }
} }

View file

@ -104,9 +104,9 @@ public class ItemFireworkCharge extends Item
flag = false; flag = false;
boolean flag1 = false; boolean flag1 = false;
for (int j = 0; j < ItemDye.dyeColors.length; ++j) for (int j = 0; j < ItemDye.FIREWORK_COLORS.length; ++j)
{ {
if (i == ItemDye.dyeColors[j]) if (i == ItemDye.FIREWORK_COLORS[j])
{ {
flag1 = true; flag1 = true;
s = s + DyeColor.byDyeDamage(j).getDisplay(); s = s + DyeColor.byDyeDamage(j).getDisplay();
@ -142,7 +142,7 @@ public class ItemFireworkCharge extends Item
for (int k = 0; k < 16; ++k) for (int k = 0; k < 16; ++k)
{ {
if (l == ItemDye.dyeColors[k]) if (l == ItemDye.FIREWORK_COLORS[k])
{ {
flag5 = true; flag5 = true;
s1 = s1 + DyeColor.byDyeDamage(k).getDisplay(); s1 = s1 + DyeColor.byDyeDamage(k).getDisplay();

View file

@ -1,7 +1,6 @@
package common.item; package common.item;
import common.block.Block; import common.block.Block;
import common.block.natural.BlockDirt;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.init.Blocks; import common.init.Blocks;
import common.init.ToolMaterial; import common.init.ToolMaterial;

View file

@ -1,29 +0,0 @@
package common.item;
import common.block.foliage.BlockLeaves;
public class ItemLeaves extends ItemBlock
{
protected final BlockLeaves leaves;
public ItemLeaves(BlockLeaves block)
{
super(block);
this.leaves = block;
}
public int getMetadata()
{
return 8;
}
public int getColorFromItemStack(ItemStack stack, int renderPass)
{
return this.leaves.getRenderColor(this.leaves.getState());
}
public String getDisplay(ItemStack stack)
{
return this.block.getDisplay() + " (" + this.leaves.getType().getDisplayName() + ")";
}
}

View file

@ -271,6 +271,16 @@ public class ItemPotion extends Item
return list != null && !list.isEmpty(); return list != null && !list.isEmpty();
} }
public static String getPotionName(ItemPotion potion) { //TODO: fix potion names
if((potion.getPotionData() & 16383) == 0)
return potion.isSplashPotion() ? "splash_potion" : "potion";
List<PotionEffect> list = potion.getEffects();
if(list == null || list.isEmpty())
return (potion.isSplashPotion() ? "splash_potion_" : "potion_") + PotionHelper.getPotionPrefixIndex(potion.getPotionData());
PotionEffect effect = list.get(0);
return (potion.isSplashPotion() ? "splash_potion_" : "potion_") + effect.getPotion().getName() + (effect.getAmplifier() == 0 ? "" : "_" + (effect.getAmplifier() + 1)) + (effect.getPotion().isInstant() ? "" : "_" + effect.getDuration());
}
public static List<Integer> getValidDataValues() public static List<Integer> getValidDataValues()
{ {
List<Integer> data = Lists.newArrayList(); List<Integer> data = Lists.newArrayList();

View file

@ -1,23 +0,0 @@
package common.item;
import common.block.tech.BlockTNT;
import common.color.TextColor;
public class ItemTNT extends ItemBlock
{
private static final String[] TIERS = new String[] {"II", "III", "IV", "V", "VI", "VII", "VIII"};
private final int power;
public ItemTNT(BlockTNT block)
{
super(block);
this.power = block.getExplosionPower();
this.setColor(TextColor.RED);
}
public String getDisplay(ItemStack stack)
{
return super.getDisplay(stack) + (this.power == 0 ? "" : " " + TIERS[this.power-1]);
}
}

View file

@ -1,21 +1,20 @@
package common.item; package common.item;
import common.block.Block;
import common.block.artificial.BlockWall; import common.block.artificial.BlockWall;
import common.model.Model; import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
public class ItemWall extends ItemBlock { public class ItemWall extends ItemBlock {
private final BlockWall.EnumType type; private final BlockWall wallBlock;
public ItemWall(Block block, BlockWall.EnumType type) { public ItemWall(BlockWall block) {
super(block); super(block);
this.type = type; this.wallBlock = block;
} }
public Model getModel(ModelProvider provider, String name) { public Model getModel(ModelProvider provider, String name) {
return provider.getModel( return provider.getModel(
provider.getModel(this.type.getName()) provider.getModel(this.wallBlock.getTexture())
.add(4, 0, 4, 12, 16, 12) .add(4, 0, 4, 12, 16, 12)
.d().uv(4, 4, 12, 12) .d().uv(4, 4, 12, 12)
.u().uv(4, 4, 12, 12).noCull() .u().uv(4, 4, 12, 12).noCull()

View file

@ -33,6 +33,8 @@ public abstract class Util {
public static final int PROTOCOL = Version.MAJOR << 16 | Version.MINOR << 8 | Version.PATCH; public static final int PROTOCOL = Version.MAJOR << 16 | Version.MINOR << 8 | Version.PATCH;
public static final String VERSION = "v" + Version.MAJOR + "." + Version.MINOR + "." + Version.PATCH + Version.RELEASE; public static final String VERSION = "v" + Version.MAJOR + "." + Version.MINOR + "." + Version.PATCH + Version.RELEASE;
private static final String[] TIERS = new String[] {"II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"};
private static boolean crashed; private static boolean crashed;
public static String strip(String str, int offset, int len, char newl, char tab, char unk) { public static String strip(String str, int offset, int len, char newl, char tab, char unk) {
@ -532,4 +534,8 @@ public abstract class Util {
public static void throwUnchecked(Throwable t) { public static void throwUnchecked(Throwable t) {
throw t instanceof RuntimeException ? (RuntimeException)t : new RuntimeException(t); throw t instanceof RuntimeException ? (RuntimeException)t : new RuntimeException(t);
} }
public static String getTierSuffix(int tier) {
return tier <= 0 ? "" : " " + (tier > TIERS.length ? (tier + 1) : TIERS[tier - 1]);
}
} }

View file

@ -9,6 +9,7 @@ import common.block.Block;
import common.block.BlockRotatedPillar; import common.block.BlockRotatedPillar;
import common.block.artificial.BlockDoor; import common.block.artificial.BlockDoor;
import common.block.artificial.BlockPortal; import common.block.artificial.BlockPortal;
import common.block.artificial.BlockQuartz;
import common.block.foliage.BlockLog; import common.block.foliage.BlockLog;
import common.block.tech.BlockLever; import common.block.tech.BlockLever;
import common.block.tech.BlockRail; import common.block.tech.BlockRail;
@ -74,9 +75,9 @@ public abstract class RotationRegistry {
else if(prop == BlockLog.LOG_AXIS) { else if(prop == BlockLog.LOG_AXIS) {
axis = ((BlockLog.EnumAxis)v).getAxis(); axis = ((BlockLog.EnumAxis)v).getAxis();
} }
// else if(prop == BlockQuartz.VARIANT) { // TODO: fix quartz else if(prop == BlockQuartz.AXIS) {
// axis = ((BlockQuartz.EnumType)v).getAxis(); axis = ((Facing.Axis)v);
// } }
else if(prop == BlockLever.FACING) { else if(prop == BlockLever.FACING) {
dv = ((BlockLever.EnumOrientation)v).getFacing().getDirectionVec(); dv = ((BlockLever.EnumOrientation)v).getFacing().getDirectionVec();
} }

View file

@ -25,7 +25,6 @@ import common.block.artificial.BlockQuartz;
import common.block.artificial.BlockSlab; import common.block.artificial.BlockSlab;
import common.block.artificial.BlockStainedGlass; import common.block.artificial.BlockStainedGlass;
import common.block.artificial.BlockStainedGlassPane; import common.block.artificial.BlockStainedGlassPane;
import common.block.artificial.BlockStoneBrick;
import common.block.artificial.BlockWall; import common.block.artificial.BlockWall;
import common.block.artificial.BlockWool; import common.block.artificial.BlockWool;
import common.block.foliage.BlockCactus; import common.block.foliage.BlockCactus;
@ -35,10 +34,7 @@ import common.block.foliage.BlockLog;
import common.block.foliage.BlockTallGrass; import common.block.foliage.BlockTallGrass;
import common.block.foliage.LeavesType; import common.block.foliage.LeavesType;
import common.block.liquid.BlockLiquid; import common.block.liquid.BlockLiquid;
import common.block.natural.BlockDirt;
import common.block.natural.BlockFire; import common.block.natural.BlockFire;
import common.block.natural.BlockRock;
import common.block.natural.BlockSand;
import common.block.natural.BlockSandStone; import common.block.natural.BlockSandStone;
import common.block.tech.BlockPistonBase; import common.block.tech.BlockPistonBase;
import common.block.tech.BlockPistonHead; import common.block.tech.BlockPistonHead;