Close #1028 add Fireproof versions of Vanilla wood items

This commit is contained in:
mezz committed 2016-05-25 01:31:49 -07:00
1 parent cdb85cb042
commit 23ffa00ca5
810 files changed
+4041 -3577

No files matched your search

@@ -9,9 +9,7 @@ import javax.annotation.Nonnull;
import java.util.Locale;
import java.util.Random;
import net.minecraft.util.IStringSerializable;
public enum EnumWoodType implements IStringSerializable {
public enum EnumForestryWoodType implements IWoodType {
LARCH, TEAK, ACACIA, LIME,
CHESTNUT, WENGE, BAOBAB, SEQUOIA(4.0f),
@@ -25,23 +23,24 @@ public enum EnumWoodType implements IStringSerializable {
ZEBRAWOOD;
public static final float DEFAULT_HARDNESS = 2.0f;
public static final EnumWoodType[] VALUES = values();
public static final EnumForestryWoodType[] VALUES = values();
private final float hardness;
EnumWoodType() {
this.hardness = DEFAULT_HARDNESS;
EnumForestryWoodType() {
this(DEFAULT_HARDNESS);
}
EnumWoodType(float hardness) {
EnumForestryWoodType(float hardness) {
this.hardness = hardness;
}
@Override
public float getHardness() {
return hardness;
}
public static EnumWoodType getRandom(Random random) {
public static EnumForestryWoodType getRandom(Random random) {
return VALUES[random.nextInt(VALUES.length)];
}
@@ -55,12 +54,13 @@ public enum EnumWoodType implements IStringSerializable {
return toString();
}
@Override
public int getMetadata() {
return ordinal();
}
@Nonnull
public static EnumWoodType byMetadata(int meta) {
public static EnumForestryWoodType byMetadata(int meta) {
if (meta < 0 || meta >= VALUES.length) {
meta = 0;
}
@@ -0,0 +1,60 @@
package forestry.api.arboriculture;
import javax.annotation.Nonnull;
import java.util.Locale;
import java.util.Random;
import net.minecraft.block.BlockPlanks;
public enum EnumVanillaWoodType implements IWoodType {
OAK(BlockPlanks.EnumType.OAK),
BIRCH(BlockPlanks.EnumType.BIRCH),
SPRUCE(BlockPlanks.EnumType.SPRUCE),
JUNGLE(BlockPlanks.EnumType.JUNGLE),
ACACIA(BlockPlanks.EnumType.ACACIA),
DARK_OAK(BlockPlanks.EnumType.DARK_OAK);
public static final EnumVanillaWoodType[] VALUES = values();
public static EnumVanillaWoodType getRandom(Random random) {
return VALUES[random.nextInt(VALUES.length)];
}
private final BlockPlanks.EnumType vanillaType;
EnumVanillaWoodType(BlockPlanks.EnumType vanillaType) {
this.vanillaType = vanillaType;
}
public BlockPlanks.EnumType getVanillaType() {
return vanillaType;
}
@Override
public String toString() {
return super.toString().toLowerCase(Locale.ENGLISH);
}
@Override
public String getName() {
return toString();
}
@Override
public int getMetadata() {
return ordinal();
}
@Nonnull
public static EnumVanillaWoodType byMetadata(int meta) {
if (meta < 0 || meta >= VALUES.length) {
meta = 0;
}
return VALUES[meta];
}
@Override
public float getHardness() {
return 2.0F;
}
}
@@ -10,6 +10,7 @@ import java.util.Collection;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -43,12 +44,6 @@ public interface IAlleleTreeSpecies extends IAlleleSpecies, IAlleleProperty<IAll
@Nonnull
ITreeGenerator getGenerator();
/**
* @return The name of the model from the tree.
*/
@Nonnull
String getModelName();
/**
* @return The modid from the mod of the species.
*/
@@ -5,9 +5,8 @@
******************************************************************************/
package forestry.api.arboriculture;
import java.awt.Color;
import javax.annotation.Nonnull;
import java.awt.Color;
import forestry.api.genetics.IClassification;
@@ -25,14 +24,13 @@ public interface ITreeFactory {
* @param branch Classification of this species
* @param binomial Binomial name of the species sans genus. "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null.
* @param modID The modID from the mod of the species
* @param modelName The model name for this species
* @param leafSpriteProvider The leaf sprite provider for this species
* @param germlingModelProvider The germling model provider for this species
* @param woodProvider The wood texture provider. It is used to get wood textures for the charcoal pile.
* @param generator The tree generator
* @return a new tree species allele.
*/
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, String modelName, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, @Nonnull IWoodProvider woodProvider, ITreeGenerator generator);
IAlleleTreeSpeciesBuilder createSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, String modID, ILeafSpriteProvider leafSpriteProvider, IGermlingModelProvider germlingModelProvider, @Nonnull IWoodProvider woodProvider, ITreeGenerator generator);
/** Get one of the built-in Forestry leaf types. Default type is deciduous. */
ILeafSpriteProvider getLeafIconProvider(EnumLeafType enumLeafType, Color color, Color colorPollinated);
@@ -5,69 +5,22 @@
******************************************************************************/
package forestry.api.arboriculture;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.BlockFence;
import net.minecraft.block.BlockFenceGate;
import net.minecraft.block.BlockLog;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.BlockStairs;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
/**
* Provides easy access to Forestry and Vanilla wood items.
* Forestry wood blocks have the same block state properties as vanilla ones.
* Note that all doors are fireproof (even vanilla).
*
* @see WoodBlockKind
* @see EnumForestryWoodType
* @see EnumVanillaWoodType
*/
public interface IWoodAccess {
// ITEMS
ItemStack getLog(EnumWoodType woodType, boolean fireproof);
ItemStack getStack(IWoodType woodType, WoodBlockKind kind, boolean fireproof);
ItemStack getPlanks(EnumWoodType woodType, boolean fireproof);
IBlockState getBlock(IWoodType woodType, WoodBlockKind kind, boolean fireproof);
ItemStack getSlab(EnumWoodType woodType, boolean fireproof);
ItemStack getFence(EnumWoodType woodType, boolean fireproof);
ItemStack getFenceGate(EnumWoodType woodType, boolean fireproof);
ItemStack getStairs(EnumWoodType woodType, boolean fireproof);
/**
* All doors in Minecraft are fireproof.
*/
ItemStack getDoor(EnumWoodType woodType);
// BLOCKS
/**
* Forestry logs have their own properties for woodType and use {@link BlockLog.EnumAxis} for orientation.
*/
IBlockState getLogBlock(EnumWoodType woodType, boolean fireproof);
/**
* Forestry slabs have no properties except their wood type.
*/
IBlockState getPlanksBlock(EnumWoodType woodType, boolean fireProof);
/**
* Forestry slabs have the same properties as {@link BlockSlab}
*/
IBlockState getSlabBlock(EnumWoodType woodType, boolean fireproof);
/**
* Forestry fences have the same properties as {@link BlockFence}
*/
IBlockState getFenceBlock(EnumWoodType woodType, boolean fireproof);
/**
* Forestry fence gates have the same properties as {@link BlockFenceGate}
*/
IBlockState getFenceGateBlock(EnumWoodType woodType, boolean fireproof);
/**
* Forestry stairs have the same properties as {@link BlockStairs}
*/
IBlockState getStairsBlock(EnumWoodType woodType, boolean fireproof);
/**
* Forestry doors have the same properties as {@link BlockDoor}
*/
IBlockState getDoorBlock(EnumWoodType woodType);
}
@@ -0,0 +1,13 @@
package forestry.api.arboriculture;
import net.minecraft.util.IStringSerializable;
/**
* @see EnumForestryWoodType
* @see EnumVanillaWoodType
*/
public interface IWoodType extends IStringSerializable {
int getMetadata();
float getHardness();
}
@@ -0,0 +1,12 @@
package forestry.api.arboriculture;
import java.util.Locale;
public enum WoodBlockKind {
LOG, PLANKS, SLAB, FENCE, FENCE_GATE, STAIRS, DOOR;
@Override
public String toString() {
return super.toString().toLowerCase(Locale.ENGLISH);
}
}