mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-18 03:15:28 +00:00
CleanUp
This commit is contained in:
1 parent
cf23644f45
commit
c5fc804bfa
26 files changed
+178
-206
No files matched your search
@@ -82,6 +82,7 @@ import forestry.apiculture.genetics.alleles.AlleleEffect;
|
||||
import forestry.apiculture.items.EnumHoneyComb;
|
||||
import forestry.apiculture.items.EnumPollenCluster;
|
||||
import forestry.apiculture.items.EnumPropolis;
|
||||
import forestry.apiculture.items.ItemHabitatLocator;
|
||||
import forestry.apiculture.items.ItemRegistryApiculture;
|
||||
import forestry.apiculture.multiblock.TileAlvearyFan;
|
||||
import forestry.apiculture.multiblock.TileAlvearyHeater;
|
||||
@@ -937,5 +938,6 @@ public class PluginApiculture extends BlankForestryPlugin {
|
||||
for (int i = 0; i < EntityFXSnow.sprites.length; i++) {
|
||||
EntityFXSnow.sprites[i] = event.map.registerSprite(new ResourceLocation("forestry:items/particles/snow." + (i + 1)));
|
||||
}
|
||||
ItemHabitatLocator.registerSprite();
|
||||
}
|
||||
}
|
||||
@@ -40,14 +40,15 @@ import forestry.api.core.Tabs;
|
||||
import forestry.apiculture.MaterialBeehive;
|
||||
import forestry.apiculture.PluginApiculture;
|
||||
import forestry.apiculture.tiles.TileSwarm;
|
||||
import forestry.core.blocks.IBlockWithMeta;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.utils.InventoryUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
|
||||
public class BlockBeehives extends BlockContainer implements IItemModelRegister {
|
||||
private static final PropertyEnum HIVE_TYPES = PropertyEnum.create("hive", HiveType.class);
|
||||
public class BlockBeeHives extends BlockContainer implements IItemModelRegister, IBlockWithMeta {
|
||||
private static final PropertyEnum<HiveType> HIVE_TYPES = PropertyEnum.create("hive", HiveType.class);
|
||||
|
||||
public BlockBeehives() {
|
||||
public BlockBeeHives() {
|
||||
super(new MaterialBeehive(true));
|
||||
setLightLevel(0.8f);
|
||||
setHardness(1.0f);
|
||||
@@ -63,12 +64,12 @@ public class BlockBeehives extends BlockContainer implements IItemModelRegister
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((HiveType) state.getValue(HIVE_TYPES)).ordinal() + 1;
|
||||
return state.getValue(HIVE_TYPES).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(HIVE_TYPES, HiveType.values()[meta - 1]);
|
||||
return getDefaultState().withProperty(HIVE_TYPES, HiveType.VALUES[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -168,54 +169,39 @@ public class BlockBeehives extends BlockContainer implements IItemModelRegister
|
||||
}
|
||||
|
||||
private static String getHiveNameForMeta(int meta) {
|
||||
switch (meta) {
|
||||
case 1:
|
||||
return HiveType.FOREST.getHiveName();
|
||||
case 2:
|
||||
return HiveType.MEADOWS.getHiveName();
|
||||
case 3:
|
||||
return HiveType.DESERT.getHiveName();
|
||||
case 4:
|
||||
return HiveType.JUNGLE.getHiveName();
|
||||
case 5:
|
||||
return HiveType.END.getHiveName();
|
||||
case 6:
|
||||
return HiveType.SNOW.getHiveName();
|
||||
case 7:
|
||||
return HiveType.SWAMP.getHiveName();
|
||||
}
|
||||
return null;
|
||||
return HiveType.VALUES[meta].getHiveName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
itemList.add(new ItemStack(this, 1, 0));
|
||||
itemList.add(new ItemStack(this, 1, 1));
|
||||
itemList.add(new ItemStack(this, 1, 2));
|
||||
itemList.add(new ItemStack(this, 1, 3));
|
||||
itemList.add(new ItemStack(this, 1, 4));
|
||||
if (Config.isDebug) {
|
||||
itemList.add(new ItemStack(this, 1, 5));
|
||||
itemList.add(new ItemStack(this, 1, 4));
|
||||
}
|
||||
itemList.add(new ItemStack(this, 1, 5));
|
||||
itemList.add(new ItemStack(this, 1, 6));
|
||||
itemList.add(new ItemStack(this, 1, 7));
|
||||
// Swarm hive not added
|
||||
}
|
||||
|
||||
/* ITEM MODELS */
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerItemModel(item, 1, "beehives/" + HiveType.FOREST.getName());
|
||||
manager.registerItemModel(item, 2, "beehives/" + HiveType.MEADOWS.getName());
|
||||
manager.registerItemModel(item, 3, "beehives/" + HiveType.DESERT.getName());
|
||||
manager.registerItemModel(item, 4, "beehives/" + HiveType.JUNGLE.getName());
|
||||
manager.registerItemModel(item, 5, "beehives/" + HiveType.END.getName());
|
||||
manager.registerItemModel(item, 6, "beehives/" + HiveType.SNOW.getName());
|
||||
manager.registerItemModel(item, 7, "beehives/" + HiveType.SWAMP.getName());
|
||||
for(int i = 0;i < HiveType.VALUES.length;i++){
|
||||
manager.registerItemModel(item, i, "beehives/" + HiveType.VALUES[i].getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNameFromMeta(int meta) {
|
||||
return HiveType.VALUES[meta].getName();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,7 +54,7 @@ import forestry.core.utils.ItemStackUtil;
|
||||
public class BlockCandle extends BlockTorch implements IItemModelRegister {
|
||||
|
||||
private static final ImmutableMap<String, Integer> colours;
|
||||
private static final Set<Item> lightingItems;
|
||||
public static final Set<Item> lightingItems;
|
||||
public static final String colourTagName = "colour";
|
||||
|
||||
private static final PropertyEnum STATE = PropertyEnum.create("state", State.class);
|
||||
|
||||
@@ -23,7 +23,7 @@ import forestry.core.items.ItemBlockForestry;
|
||||
public class BlockRegistryApiculture extends BlockRegistry {
|
||||
public final BlockApiculture apiculture;
|
||||
public final BlockBase<BlockTypeApicultureTesr> apicultureChest;
|
||||
public final BlockBeehives beehives;
|
||||
public final BlockBeeHives beehives;
|
||||
public final BlockCandle candle;
|
||||
public final BlockStump stump;
|
||||
private final Map<BlockAlvearyType, BlockAlveary> alvearyBlockMap;
|
||||
@@ -35,7 +35,7 @@ public class BlockRegistryApiculture extends BlockRegistry {
|
||||
apicultureChest.setCreativeTab(Tabs.tabApiculture);
|
||||
apicultureChest.setHarvestLevel("axe", 0);
|
||||
|
||||
beehives = registerBlock(new BlockBeehives(), ItemBlockForestry.class, "beehives");
|
||||
beehives = registerBlock(new BlockBeeHives(), ItemBlockForestry.class, "beehives");
|
||||
|
||||
candle = registerBlock(new BlockCandle(), ItemBlockCandle.class, "candle");
|
||||
stump = registerBlock(new BlockStump(), ItemBlockForestry.class, "stump");
|
||||
|
||||
@@ -17,8 +17,6 @@ import net.minecraft.block.BlockTorch;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
@@ -35,7 +33,6 @@ import forestry.apiculture.PluginApiculture;
|
||||
import forestry.apiculture.tiles.TileCandle;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.utils.BlockUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
|
||||
public class BlockStump extends BlockTorch implements IItemModelRegister {
|
||||
|
||||
@@ -61,10 +58,7 @@ public class BlockStump extends BlockTorch implements IItemModelRegister {
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
ItemStack held = player.getCurrentEquippedItem();
|
||||
if (held != null &&
|
||||
(held.getItem() == Items.flint_and_steel ||
|
||||
held.getItem() == Items.flint ||
|
||||
ItemStackUtil.equals(Blocks.torch, held))) {
|
||||
if (held != null && BlockCandle.lightingItems.contains(held.getItem())) {
|
||||
world.setBlockState(pos, PluginApiculture.blocks.candle.getStateFromMeta(BlockUtil.getBlockMetadata(world, pos) | 0x08), Constants.FLAG_BLOCK_SYNCH);
|
||||
TileCandle tc = new TileCandle();
|
||||
tc.setColour(0); // default to white
|
||||
@@ -82,6 +76,6 @@ public class BlockStump extends BlockTorch implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
|
||||
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand) {
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,8 @@ import forestry.api.core.Tabs;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.items.ItemForestry;
|
||||
|
||||
public class ItemHoneycomb extends ItemForestry {
|
||||
public ItemHoneycomb() {
|
||||
public class ItemHoneyComb extends ItemForestry {
|
||||
public ItemHoneyComb() {
|
||||
super();
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
|
||||
@@ -15,7 +15,6 @@ import java.util.List;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.block.BlockRailBase;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
|
||||
import net.minecraft.dispenser.IBehaviorDispenseItem;
|
||||
import net.minecraft.dispenser.IBlockSource;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -37,12 +36,10 @@ import forestry.apiculture.entities.EntityMinecartBeehouse;
|
||||
|
||||
public class ItemMinecartBeehouse extends ItemMinecart implements IItemModelRegister {
|
||||
private final String[] definition = new String[]{"cart.beehouse", "cart.apiary"};
|
||||
|
||||
private static final IBehaviorDispenseItem dispenserMinecartBehavior = new BehaviorDefaultDispenseItem() {
|
||||
private final BehaviorDefaultDispenseItem behaviourDefaultDispenseItem = new BehaviorDefaultDispenseItem();
|
||||
|
||||
|
||||
private static final IBehaviorDispenseItem dispenserMinecartBehavior = new IBehaviorDispenseItem() {
|
||||
@Override
|
||||
public ItemStack dispenseStack(IBlockSource source, ItemStack stack) {
|
||||
public ItemStack dispense(IBlockSource source, ItemStack stack) {
|
||||
return stack;
|
||||
}
|
||||
};
|
||||
@@ -51,7 +48,7 @@ public class ItemMinecartBeehouse extends ItemMinecart implements IItemModelRegi
|
||||
super(null);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(this, new BehaviorDefaultDispenseItem());
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenserMinecartBehavior);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ItemRegistryApiculture extends ItemRegistry {
|
||||
public final ItemForestry honeydew;
|
||||
public final ItemForestry royalJelly;
|
||||
public final ItemForestry waxCast;
|
||||
public final ItemHoneycomb beeComb;
|
||||
public final ItemHoneyComb beeComb;
|
||||
|
||||
public final ItemArmorApiarist apiaristHat;
|
||||
public final ItemArmorApiarist apiaristChest;
|
||||
@@ -86,7 +86,7 @@ public class ItemRegistryApiculture extends ItemRegistry {
|
||||
waxCast = registerItem(new ItemWaxCast(), "waxCast");
|
||||
|
||||
// / BEE COMBS
|
||||
beeComb = registerItem(new ItemHoneycomb(), "beeCombs");
|
||||
beeComb = registerItem(new ItemHoneyComb(), "beeCombs");
|
||||
OreDictionary.registerOre("beeComb", beeComb.getWildcard());
|
||||
|
||||
// / APIARIST'S CLOTHES
|
||||
|
||||
@@ -32,17 +32,17 @@ import forestry.apiculture.genetics.BeeDefinition;
|
||||
|
||||
public enum HiveDescription implements IHiveDescription {
|
||||
|
||||
FOREST(1, 3.0f, BeeDefinition.FOREST, HiveManager.genHelper.tree()),
|
||||
MEADOWS(2, 1.0f, BeeDefinition.MEADOWS, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass)),
|
||||
DESERT(3, 1.0f, BeeDefinition.MODEST, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass, Blocks.sand, Blocks.sandstone)),
|
||||
JUNGLE(4, 4.0f, BeeDefinition.TROPICAL, HiveManager.genHelper.tree()),
|
||||
END(5, 4.0f, BeeDefinition.ENDED, HiveManager.genHelper.ground(Blocks.end_stone)) {
|
||||
FOREST(0, 3.0f, BeeDefinition.FOREST, HiveManager.genHelper.tree()),
|
||||
MEADOWS(1, 1.0f, BeeDefinition.MEADOWS, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass)),
|
||||
DESERT(2, 1.0f, BeeDefinition.MODEST, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass, Blocks.sand, Blocks.sandstone)),
|
||||
JUNGLE(3, 4.0f, BeeDefinition.TROPICAL, HiveManager.genHelper.tree()),
|
||||
END(4, 4.0f, BeeDefinition.ENDED, HiveManager.genHelper.ground(Blocks.end_stone)) {
|
||||
@Override
|
||||
public boolean isGoodBiome(BiomeGenBase biome) {
|
||||
return BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.END);
|
||||
}
|
||||
},
|
||||
SNOW(6, 2.0f, BeeDefinition.WINTRY, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass, Blocks.snow)) {
|
||||
SNOW(5, 2.0f, BeeDefinition.WINTRY, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass, Blocks.snow)) {
|
||||
@Override
|
||||
public void postGen(World world, BlockPos pos) {
|
||||
if (world.isAirBlock(pos.add(0, 1, 0))) {
|
||||
@@ -50,7 +50,7 @@ public enum HiveDescription implements IHiveDescription {
|
||||
}
|
||||
}
|
||||
},
|
||||
SWAMP(7, 2.0f, BeeDefinition.MARSHY, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass)),;
|
||||
SWAMP(6, 2.0f, BeeDefinition.MARSHY, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass)),;
|
||||
|
||||
private final int meta;
|
||||
private final float genChance;
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -35,10 +35,9 @@ import forestry.api.multiblock.MultiblockManager;
|
||||
import forestry.api.storage.ICrateRegistry;
|
||||
import forestry.api.storage.StorageManager;
|
||||
import forestry.core.blocks.BlockRegistryCore;
|
||||
import forestry.core.blocks.BlockResourceOre;
|
||||
import forestry.core.blocks.BlockResourceStorage;
|
||||
import forestry.core.blocks.BlockSoil;
|
||||
import forestry.core.blocks.BlockTypeCoreTesr;
|
||||
import forestry.core.blocks.EnumResourceType;
|
||||
import forestry.core.circuits.CircuitRegistry;
|
||||
import forestry.core.circuits.SolderManager;
|
||||
import forestry.core.commands.CommandPlugins;
|
||||
@@ -46,6 +45,7 @@ import forestry.core.commands.RootCommand;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.genetics.CapabilityIndividual;
|
||||
import forestry.core.genetics.alleles.AlleleFactory;
|
||||
import forestry.core.genetics.alleles.AlleleHelper;
|
||||
import forestry.core.genetics.alleles.AlleleRegistry;
|
||||
@@ -95,6 +95,8 @@ public class PluginCore extends BlankForestryPlugin {
|
||||
|
||||
MultiblockManager.logicFactory = new MultiblockLogicFactory();
|
||||
ForestryAPI.climateManager = new ClimateManager();
|
||||
|
||||
CapabilityIndividual.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -205,9 +207,9 @@ public class PluginCore extends BlankForestryPlugin {
|
||||
public void registerRecipes() {
|
||||
|
||||
/* SMELTING RECIPES */
|
||||
RecipeUtil.addSmelting(blocks.resources.get(BlockResourceOre.ResourceType.APATITE, 1), items.apatite, 0.5f);
|
||||
RecipeUtil.addSmelting(blocks.resources.get(BlockResourceOre.ResourceType.COPPER, 1), items.ingotCopper, 0.5f);
|
||||
RecipeUtil.addSmelting(blocks.resources.get(BlockResourceOre.ResourceType.TIN, 1), items.ingotTin, 0.5f);
|
||||
RecipeUtil.addSmelting(blocks.resources.get(EnumResourceType.APATITE, 1), items.apatite, 0.5f);
|
||||
RecipeUtil.addSmelting(blocks.resources.get(EnumResourceType.COPPER, 1), items.ingotCopper, 0.5f);
|
||||
RecipeUtil.addSmelting(blocks.resources.get(EnumResourceType.TIN, 1), items.ingotTin, 0.5f);
|
||||
RecipeUtil.addSmelting(new ItemStack(items.peat), items.ash, 0.0f);
|
||||
|
||||
/* BRONZE INGOTS */
|
||||
@@ -310,16 +312,16 @@ public class PluginCore extends BlankForestryPlugin {
|
||||
RecipeUtil.addRecipe(items.pipette, " #", " X ", "X ", 'X', "paneGlass", '#', new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
// Storage Blocks
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(BlockResourceStorage.ResourceType.APATITE), "###", "###", "###", '#', "gemApatite");
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(EnumResourceType.APATITE), "###", "###", "###", '#', "gemApatite");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.apatite, 9), "blockApatite");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(BlockResourceStorage.ResourceType.COPPER), "###", "###", "###", '#', "ingotCopper");
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(EnumResourceType.COPPER), "###", "###", "###", '#', "ingotCopper");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotCopper, 9), "blockCopper");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(BlockResourceStorage.ResourceType.TIN), "###", "###", "###", '#', "ingotTin");
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(EnumResourceType.TIN), "###", "###", "###", '#', "ingotTin");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotTin, 9), "blockTin");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(BlockResourceStorage.ResourceType.BRONZE), "###", "###", "###", '#', "ingotBronze");
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(EnumResourceType.BRONZE), "###", "###", "###", '#', "ingotBronze");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotBronze, 9), "blockBronze");
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ import forestry.core.utils.PlayerUtil;
|
||||
|
||||
import jline.internal.Log;
|
||||
|
||||
public class BlockBase<P extends Enum<P> & IBlockType & IStringSerializable> extends BlockForestry implements IItemModelRegister, IStateMapperRegister {
|
||||
public class BlockBase<P extends Enum<P> & IBlockType & IStringSerializable> extends BlockForestry implements IItemModelRegister, IStateMapperRegister, IBlockWithMeta {
|
||||
private final Map<P, IMachineProperties> properties = new HashMap<>();
|
||||
private final boolean hasTESR;
|
||||
private final boolean hasCustom;
|
||||
@@ -68,7 +68,7 @@ public class BlockBase<P extends Enum<P> & IBlockType & IStringSerializable> ext
|
||||
|
||||
protected final BlockState blockState;
|
||||
|
||||
private boolean isReady = false;
|
||||
private boolean canCreateProps = false;
|
||||
|
||||
public BlockBase(Class<P> machinePropertiesClass) {
|
||||
super(Material.iron);
|
||||
@@ -78,7 +78,7 @@ public class BlockBase<P extends Enum<P> & IBlockType & IStringSerializable> ext
|
||||
this.lightOpacity = this.isOpaqueCube() ? 255 : 0;
|
||||
this.machinePropertiesClass = machinePropertiesClass;
|
||||
|
||||
isReady = true;
|
||||
canCreateProps = true;
|
||||
|
||||
TYPE = PropertyEnum.create("type", machinePropertiesClass);
|
||||
FACE = PropertyEnum.create("face", EnumFacing.class);
|
||||
@@ -162,20 +162,14 @@ public class BlockBase<P extends Enum<P> & IBlockType & IStringSerializable> ext
|
||||
|
||||
/* TILE ENTITY CREATION */
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, IBlockState state) {
|
||||
IMachineProperties definition = state.getValue(TYPE).getMachineProperties();
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
IMachineProperties definition = getStateFromMeta(meta).getValue(TYPE).getMachineProperties();
|
||||
if (definition == null) {
|
||||
return null;
|
||||
}
|
||||
return definition.createTileEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
IBlockState state = getStateFromMeta(meta);
|
||||
return createTileEntity(world, state); // TODO: refactor to just use Block, not BlockContainer
|
||||
}
|
||||
|
||||
/* INTERACTION */
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
@@ -278,7 +272,7 @@ public class BlockBase<P extends Enum<P> & IBlockType & IStringSerializable> ext
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
if (!isReady) {
|
||||
if (!canCreateProps) {
|
||||
return super.createBlockState();
|
||||
}
|
||||
return new BlockState(this, TYPE, FACE);
|
||||
@@ -303,6 +297,7 @@ public class BlockBase<P extends Enum<P> & IBlockType & IStringSerializable> ext
|
||||
return getDefaultState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNameFromMeta(int meta) {
|
||||
IBlockState state = getStateFromMeta(meta);
|
||||
IBlockType blockType = (IBlockType) state.getProperties().get(TYPE);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
package forestry.core.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -30,7 +30,7 @@ import forestry.core.access.IRestrictedAccess;
|
||||
import forestry.core.tiles.TileForestry;
|
||||
import forestry.core.utils.Log;
|
||||
|
||||
public abstract class BlockForestry extends BlockContainer implements IItemModelRegister {
|
||||
public abstract class BlockForestry extends Block implements IItemModelRegister, ITileEntityProvider {
|
||||
|
||||
protected BlockForestry(Material material) {
|
||||
super(material);
|
||||
|
||||
@@ -32,16 +32,16 @@ public class BlockRegistryCore extends BlockRegistry {
|
||||
|
||||
resources = registerBlock(new BlockResourceOre(), ItemBlockForestry.class, "resources");
|
||||
resources.setHarvestLevel("pickaxe", 1);
|
||||
OreDictionary.registerOre("oreApatite", resources.get(BlockResourceOre.ResourceType.APATITE, 1));
|
||||
OreDictionary.registerOre("oreCopper", resources.get(BlockResourceOre.ResourceType.COPPER, 1));
|
||||
OreDictionary.registerOre("oreTin", resources.get(BlockResourceOre.ResourceType.TIN, 1));
|
||||
OreDictionary.registerOre("oreApatite", resources.get(EnumResourceType.APATITE, 1));
|
||||
OreDictionary.registerOre("oreCopper", resources.get(EnumResourceType.COPPER, 1));
|
||||
OreDictionary.registerOre("oreTin", resources.get(EnumResourceType.TIN, 1));
|
||||
|
||||
resourceStorage = registerBlock(new BlockResourceStorage(), ItemBlockForestry.class, "resourceStorage");
|
||||
resourceStorage.setHarvestLevel("pickaxe", 0);
|
||||
OreDictionary.registerOre("blockApatite", resourceStorage.get(BlockResourceStorage.ResourceType.APATITE));
|
||||
OreDictionary.registerOre("blockCopper", resourceStorage.get(BlockResourceStorage.ResourceType.COPPER));
|
||||
OreDictionary.registerOre("blockTin", resourceStorage.get(BlockResourceStorage.ResourceType.TIN));
|
||||
OreDictionary.registerOre("blockBronze", resourceStorage.get(BlockResourceStorage.ResourceType.BRONZE));
|
||||
OreDictionary.registerOre("blockApatite", resourceStorage.get(EnumResourceType.APATITE));
|
||||
OreDictionary.registerOre("blockCopper", resourceStorage.get(EnumResourceType.COPPER));
|
||||
OreDictionary.registerOre("blockTin", resourceStorage.get(EnumResourceType.TIN));
|
||||
OreDictionary.registerOre("blockBronze", resourceStorage.get(EnumResourceType.BRONZE));
|
||||
|
||||
// register some common oreDict names for our recipes
|
||||
OreDictionary.registerOre("chestWood", Blocks.chest);
|
||||
|
||||
@@ -12,7 +12,7 @@ package forestry.core.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -23,7 +23,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -37,71 +36,51 @@ import forestry.core.CreativeTabForestry;
|
||||
import forestry.core.PluginCore;
|
||||
|
||||
public class BlockResourceOre extends Block implements IItemModelRegister {
|
||||
private static final PropertyEnum<ResourceType> RESOURCE = PropertyEnum.create("resource", ResourceType.class);
|
||||
|
||||
public enum ResourceType implements IStringSerializable {
|
||||
APATITE(0),
|
||||
COPPER(1),
|
||||
TIN(2);
|
||||
|
||||
public static final ResourceType[] VALUES = values();
|
||||
|
||||
private final int meta;
|
||||
|
||||
ResourceType(int meta) {
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
public int getMeta() {
|
||||
return meta;
|
||||
}
|
||||
|
||||
public static final PropertyEnum<EnumResourceType> ORE_RESOURCES = PropertyEnum.create("resource", EnumResourceType.class, new Predicate<EnumResourceType>(){
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ENGLISH);
|
||||
public boolean apply(EnumResourceType input) {
|
||||
return input.hasOre();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
public BlockResourceOre() {
|
||||
super(Material.rock);
|
||||
setHardness(3F);
|
||||
setResistance(5F);
|
||||
setCreativeTab(CreativeTabForestry.tabForestry);
|
||||
setDefaultState(this.blockState.getBaseState().withProperty(RESOURCE, ResourceType.APATITE));
|
||||
setDefaultState(this.blockState.getBaseState().withProperty(ORE_RESOURCES, EnumResourceType.APATITE));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, RESOURCE);
|
||||
return new BlockState(this, ORE_RESOURCES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(RESOURCE).getMeta();
|
||||
return state.getValue(ORE_RESOURCES).getMeta();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(RESOURCE, ResourceType.values()[meta]);
|
||||
return getDefaultState().withProperty(ORE_RESOURCES, EnumResourceType.VALUES[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World world, BlockPos pos, IBlockState state, float chance, int fortune) {
|
||||
super.dropBlockAsItemWithChance(world, pos, state, chance, fortune);
|
||||
|
||||
|
||||
if (state.getValue(RESOURCE) == ResourceType.APATITE) {
|
||||
if (state.getValue(ORE_RESOURCES) == EnumResourceType.APATITE) {
|
||||
this.dropXpOnBlockBreak(world, pos, MathHelper.getRandomIntegerInRange(world.rand, 1, 4));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
ArrayList<ItemStack> drops = new ArrayList<>();
|
||||
|
||||
ResourceType metadata = state.getValue(RESOURCE);
|
||||
ArrayList<ItemStack> drops = new ArrayList();
|
||||
EnumResourceType metadata = state.getValue(ORE_RESOURCES);
|
||||
|
||||
if (metadata == ResourceType.APATITE) {
|
||||
if (metadata == EnumResourceType.APATITE) {
|
||||
int fortuneModifier = RANDOM.nextInt(fortune + 2) - 1;
|
||||
if (fortuneModifier < 0) {
|
||||
fortuneModifier = 0;
|
||||
@@ -112,7 +91,7 @@ public class BlockResourceOre extends Block implements IItemModelRegister {
|
||||
drops.add(PluginCore.items.apatite.getItemStack(amount));
|
||||
}
|
||||
} else {
|
||||
drops.add(new ItemStack(this, 1, metadata.ordinal()));
|
||||
drops.add(new ItemStack(this, 1, metadata.getMeta()));
|
||||
}
|
||||
|
||||
return drops;
|
||||
@@ -130,9 +109,8 @@ public class BlockResourceOre extends Block implements IItemModelRegister {
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
for (ResourceType resourceType : ResourceType.values()) {
|
||||
ItemStack stack = get(resourceType, 1);
|
||||
itemList.add(stack);
|
||||
for (EnumResourceType resourceType : ORE_RESOURCES.getAllowedValues()) {
|
||||
itemList.add(get(resourceType, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +123,7 @@ public class BlockResourceOre extends Block implements IItemModelRegister {
|
||||
manager.registerItemModel(item, 2, "ores/tin");
|
||||
}
|
||||
|
||||
public ItemStack get(ResourceType type, int amount) {
|
||||
return new ItemStack(this, amount, type.ordinal());
|
||||
public ItemStack get(EnumResourceType type, int amount) {
|
||||
return new ItemStack(this, amount, type.getMeta());
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
package forestry.core.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
@@ -11,8 +9,6 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -21,50 +17,35 @@ import forestry.api.core.IModelManager;
|
||||
import forestry.core.CreativeTabForestry;
|
||||
|
||||
public class BlockResourceStorage extends Block implements IItemModelRegister {
|
||||
public static final PropertyEnum RESOURCE = PropertyEnum.create("resource", ResourceType.class);
|
||||
|
||||
public enum ResourceType implements IStringSerializable {
|
||||
APATITE,
|
||||
COPPER,
|
||||
TIN,
|
||||
BRONZE;
|
||||
|
||||
public static final ResourceType[] VALUES = values();
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
}
|
||||
public static final PropertyEnum<EnumResourceType> STORAGE_RESOURCES = PropertyEnum.create("resource", EnumResourceType.class);
|
||||
|
||||
public BlockResourceStorage() {
|
||||
super(Material.iron);
|
||||
setHardness(3F);
|
||||
setResistance(5F);
|
||||
setCreativeTab(CreativeTabForestry.tabForestry);
|
||||
setDefaultState(this.blockState.getBaseState().withProperty(RESOURCE, ResourceType.APATITE));
|
||||
setDefaultState(this.blockState.getBaseState().withProperty(STORAGE_RESOURCES, EnumResourceType.APATITE));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, RESOURCE);
|
||||
return new BlockState(this, STORAGE_RESOURCES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((ResourceType) state.getValue(RESOURCE)).ordinal();
|
||||
return state.getValue(STORAGE_RESOURCES).getMeta();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(RESOURCE, ResourceType.values()[meta]);
|
||||
return getDefaultState().withProperty(STORAGE_RESOURCES, EnumResourceType.VALUES[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List<ItemStack> itemList) {
|
||||
for (ResourceType resourceType : ResourceType.values()) {
|
||||
ItemStack stack = get(resourceType);
|
||||
itemList.add(stack);
|
||||
for (EnumResourceType resourceType : EnumResourceType.VALUES) {
|
||||
itemList.add(get(resourceType));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,13 +57,12 @@ public class BlockResourceStorage extends Block implements IItemModelRegister {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerItemModel(item, 0, "storage/apatite");
|
||||
manager.registerItemModel(item, 1, "storage/copper");
|
||||
manager.registerItemModel(item, 2, "storage/tin");
|
||||
manager.registerItemModel(item, 3, "storage/bronze");
|
||||
for(EnumResourceType resourceType : EnumResourceType.VALUES){
|
||||
manager.registerItemModel(item, resourceType.getMeta(), "storage/" + resourceType.getName());
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack get(ResourceType type) {
|
||||
return new ItemStack(this, 1, type.ordinal());
|
||||
public ItemStack get(EnumResourceType type) {
|
||||
return new ItemStack(this, 1, type.getMeta());
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,6 @@ public abstract class BlockStructure extends BlockForestry {
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state) {
|
||||
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
@@ -132,10 +131,5 @@ public abstract class BlockStructure extends BlockForestry {
|
||||
}
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.core.blocks;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
|
||||
public enum EnumResourceType implements IStringSerializable {
|
||||
APATITE(0, true),
|
||||
COPPER(1, true),
|
||||
TIN(2, true),
|
||||
BRONZE(3, false);
|
||||
|
||||
public static final EnumResourceType[] VALUES = values();
|
||||
|
||||
private final int meta;
|
||||
private final boolean hasOre;
|
||||
|
||||
EnumResourceType(int meta, boolean hasOre) {
|
||||
this.meta = meta;
|
||||
this.hasOre = hasOre;
|
||||
}
|
||||
|
||||
public int getMeta() {
|
||||
return meta;
|
||||
}
|
||||
|
||||
public boolean hasOre() {
|
||||
return hasOre;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.core.blocks;
|
||||
|
||||
public interface IBlockWithMeta {
|
||||
|
||||
String getNameFromMeta(int meta);
|
||||
|
||||
}
|
||||
@@ -18,9 +18,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.apiculture.hives.IHiveRegistry.HiveType;
|
||||
import forestry.apiculture.blocks.BlockBeehives;
|
||||
import forestry.core.blocks.BlockBase;
|
||||
import forestry.core.blocks.IBlockWithMeta;
|
||||
import forestry.core.tiles.TileForestry;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
|
||||
@@ -46,14 +44,10 @@ public class ItemBlockForestry<B extends Block> extends ItemBlock {
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
Block block = getBlock();
|
||||
if (block instanceof BlockBase) {
|
||||
BlockBase<?> blockBase = (BlockBase) block;
|
||||
if(block instanceof IBlockWithMeta){
|
||||
IBlockWithMeta blockMeta = (IBlockWithMeta) block;
|
||||
int meta = itemstack.getMetadata();
|
||||
return block.getUnlocalizedName() + "." + blockBase.getNameFromMeta(meta);
|
||||
}else if(block instanceof BlockBeehives){
|
||||
BlockBeehives blockHives = (BlockBeehives) block;
|
||||
int meta = itemstack.getMetadata();
|
||||
return block.getUnlocalizedName() + "." + HiveType.VALUES[meta - 1].getName();
|
||||
return block.getUnlocalizedName() + "." + blockMeta.getNameFromMeta(meta);
|
||||
}
|
||||
return block.getUnlocalizedName();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import net.minecraftforge.fml.common.IWorldGenerator;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import forestry.core.PluginCore;
|
||||
import forestry.core.blocks.BlockResourceOre;
|
||||
import forestry.core.blocks.EnumResourceType;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.plugins.PluginManager;
|
||||
|
||||
@@ -56,9 +56,9 @@ public class WorldGenerator implements IWorldGenerator {
|
||||
private void generateWorld(Random random, int chunkX, int chunkZ, World world) {
|
||||
|
||||
if (apatiteGenerator == null) {
|
||||
apatiteGenerator = new WorldGenMinableMeta(PluginCore.blocks.resources, BlockResourceOre.ResourceType.APATITE.getMeta(), 36);
|
||||
copperGenerator = new WorldGenMinableMeta(PluginCore.blocks.resources, BlockResourceOre.ResourceType.COPPER.getMeta(), 6);
|
||||
tinGenerator = new WorldGenMinableMeta(PluginCore.blocks.resources, BlockResourceOre.ResourceType.TIN.getMeta(), 6);
|
||||
apatiteGenerator = new WorldGenMinableMeta(PluginCore.blocks.resources, EnumResourceType.APATITE.getMeta(), 36);
|
||||
copperGenerator = new WorldGenMinableMeta(PluginCore.blocks.resources, EnumResourceType.COPPER.getMeta(), 6);
|
||||
tinGenerator = new WorldGenMinableMeta(PluginCore.blocks.resources, EnumResourceType.TIN.getMeta(), 6);
|
||||
}
|
||||
|
||||
// shift to world coordinates
|
||||
|
||||
@@ -57,7 +57,7 @@ import forestry.farming.tiles.TileFarmValve;
|
||||
|
||||
public class BlockFarm extends BlockStructure {
|
||||
|
||||
public static final PropertyEnum META = PropertyEnum.create("meta", EnumFarmBlockType.class);
|
||||
public static final PropertyEnum<EnumFarmBlockType> META = PropertyEnum.create("meta", EnumFarmBlockType.class);
|
||||
|
||||
public BlockFarm() {
|
||||
super(Material.rock);
|
||||
@@ -70,12 +70,12 @@ public class BlockFarm extends BlockStructure {
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(META, EnumFarmBlockType.values()[meta]);
|
||||
return getDefaultState().withProperty(META, EnumFarmBlockType.VALUES[meta]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return ((EnumFarmBlockType) state.getValue(META)).ordinal();
|
||||
return state.getValue(META).ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -196,6 +196,9 @@ public class BlockFarm extends BlockStructure {
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
for(int i = 0;i < 6;i++){
|
||||
if(i == 1){
|
||||
continue;
|
||||
}
|
||||
ModelLoader.setCustomModelResourceLocation(item, i, new ModelResourceLocation("forestry:ffarm", "inventory"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,8 +164,8 @@ public class BlockMushroom extends BlockBush implements IItemTyped, IItemModelRe
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerItemModel(item, 0, "minecraft", "red_mushroom");
|
||||
manager.registerItemModel(item, 0, "minecraft", "brown_mushroom");
|
||||
manager.registerItemModel(item, 1, "minecraft", "red_mushroom");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -382,7 +382,7 @@ public class BlockGreenhouseDoor extends BlockGreenhouse implements IStateMappe
|
||||
@Override
|
||||
protected BlockState createBlockState()
|
||||
{
|
||||
return new BlockState(this, new IProperty[] {HALF, FACING, OPEN, HINGE, POWERED});
|
||||
return new BlockState(this, HALF, FACING, OPEN, HINGE, POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,7 +15,6 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.render.EmptyStateMapper;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
@@ -24,8 +23,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
@@ -40,7 +37,7 @@ public class BlockCocoon extends Block implements ITileEntityProvider, IStateMap
|
||||
super(Material.cloth);
|
||||
setTickRandomly(true);
|
||||
setStepSound(soundTypeGrass);
|
||||
setCreativeTab(Tabs.tabLepidopterology);
|
||||
setCreativeTab(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -80,10 +77,6 @@ public class BlockCocoon extends Block implements ITileEntityProvider, IStateMap
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
|
||||
@@ -13,7 +13,6 @@ package forestry.lepidopterology.blocks;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.render.EmptyStateMapper;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
@@ -22,9 +21,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
@@ -41,7 +38,7 @@ public class BlockSolidCocoon extends Block implements ITileEntityProvider, ISta
|
||||
setHardness(0.5F);
|
||||
setTickRandomly(true);
|
||||
setStepSound(soundTypeGrass);
|
||||
setCreativeTab(Tabs.tabLepidopterology);
|
||||
setCreativeTab(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -85,10 +82,6 @@ public class BlockSolidCocoon extends Block implements ITileEntityProvider, ISta
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
|
||||
Reference in new issue
Block a user