mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-21 04:32:23 +00:00
Move block registration out of constructors
This commit is contained in:
17 files changed
+127
-96
No files matched your search
@@ -49,7 +49,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public abstract class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconable {
|
||||
public abstract class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconable, IRegisterCallback {
|
||||
private static final int COUNT = 8;
|
||||
|
||||
private final boolean second;
|
||||
@@ -59,8 +59,8 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
this.setHardness(0.0F);
|
||||
this.setSoundType(SoundType.PLANT);
|
||||
String name = LibBlockNames.DOUBLE_FLOWER + (second ? 2 : 1);
|
||||
GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
ModBlocks.ALL_BLOCKS.add(this);
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
setUnlocalizedName(name);
|
||||
setHardness(0F);
|
||||
setTickRandomly(false);
|
||||
@@ -218,4 +218,10 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I
|
||||
return new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getValue(prop).ordinal() - (second ? 8 : 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void register() {
|
||||
GameRegistry.register(this);
|
||||
GameRegistry.register(new ItemBlockWithMetadataAndName(this), getRegistryName());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user