mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-27 15:22:57 +00:00
This commit is contained in:
1 parent
72380251f3
commit
d567138365
12 files changed
+82
-124
No files matched your search
@@ -10,53 +10,51 @@ import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
public enum EnumForestryWoodType implements IWoodType {
|
||||
LARCH(4, 20),
|
||||
TEAK(4, 20),
|
||||
ACACIA(4, 20),
|
||||
LIME(4, 19),
|
||||
CHESTNUT(4, 21),
|
||||
WENGE(4, 20),
|
||||
BAOBAB(4, 20),
|
||||
SEQUOIA(3, 18, 4.0f),
|
||||
LARCH(4),
|
||||
TEAK(4),
|
||||
ACACIA(4),
|
||||
LIME(4),
|
||||
CHESTNUT(4),
|
||||
WENGE(4),
|
||||
BAOBAB(4),
|
||||
SEQUOIA(3, 4.0f),
|
||||
|
||||
KAPOK(4, 20),
|
||||
EBONY(4, 20),
|
||||
MAHOGANY(4, 20),
|
||||
BALSA(4, 20, 1.0f),
|
||||
WILLOW(4, 20),
|
||||
WALNUT(4, 21),
|
||||
GREENHEART(4, 20, 7.5f),
|
||||
CHERRY(4, 20),
|
||||
KAPOK(4),
|
||||
EBONY(4),
|
||||
MAHOGANY(4),
|
||||
BALSA(4, 1.0f),
|
||||
WILLOW(4),
|
||||
WALNUT(4),
|
||||
GREENHEART(4, 7.5f),
|
||||
CHERRY(4),
|
||||
|
||||
MAHOE(4, 20),
|
||||
POPLAR(4, 20),
|
||||
PALM(4, 20),
|
||||
PAPAYA(4, 20),
|
||||
PINE(4, 20, 3.0f),
|
||||
PLUM(4, 20),
|
||||
MAPLE(4, 20),
|
||||
CITRUS(4, 20),
|
||||
MAHOE(4),
|
||||
POPLAR(4),
|
||||
PALM(4),
|
||||
PAPAYA(4),
|
||||
PINE(4, 3.0f),
|
||||
PLUM(4),
|
||||
MAPLE(4),
|
||||
CITRUS(4),
|
||||
|
||||
GIGANTEUM(3, 18, 4.0f),
|
||||
IPE(4, 20),
|
||||
PADAUK(4, 20),
|
||||
COCOBOLO(4, 20),
|
||||
ZEBRAWOOD(4, 20);
|
||||
GIGANTEUM(3, 4.0f),
|
||||
IPE(4),
|
||||
PADAUK(4),
|
||||
COCOBOLO(4),
|
||||
ZEBRAWOOD(4);
|
||||
|
||||
public static final float DEFAULT_HARDNESS = 2.0f;
|
||||
public static final EnumForestryWoodType[] VALUES = values();
|
||||
|
||||
private final int carbonization;
|
||||
private final int combustability;
|
||||
private final float hardness;
|
||||
|
||||
EnumForestryWoodType(int carbonization, int combustability) {
|
||||
this(carbonization, combustability, DEFAULT_HARDNESS);
|
||||
EnumForestryWoodType(int carbonization) {
|
||||
this(carbonization, DEFAULT_HARDNESS);
|
||||
}
|
||||
|
||||
EnumForestryWoodType(int carbonization, int combustability, float hardness) {
|
||||
EnumForestryWoodType(int carbonization, float hardness) {
|
||||
this.carbonization = carbonization;
|
||||
this.combustability = combustability;
|
||||
this.hardness = hardness;
|
||||
}
|
||||
|
||||
@@ -96,10 +94,17 @@ public enum EnumForestryWoodType implements IWoodType {
|
||||
public int getCarbonization() {
|
||||
return carbonization;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getCombustability() {
|
||||
return combustability;
|
||||
public float getCharcoalChance(int numberOfCharcoal) {
|
||||
if(numberOfCharcoal == 3){
|
||||
return 0.75F;
|
||||
}else if(numberOfCharcoal == 4){
|
||||
return 0.5F;
|
||||
}else if(numberOfCharcoal == 5){
|
||||
return 0.25F;
|
||||
}
|
||||
return 0.15F;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,12 +7,12 @@ import java.util.Random;
|
||||
import net.minecraft.block.BlockPlanks;
|
||||
|
||||
public enum EnumVanillaWoodType implements IWoodType {
|
||||
OAK(BlockPlanks.EnumType.OAK, 5, 20),
|
||||
SPRUCE(BlockPlanks.EnumType.SPRUCE, 4, 19),
|
||||
BIRCH(BlockPlanks.EnumType.BIRCH, 4, 19),
|
||||
JUNGLE(BlockPlanks.EnumType.JUNGLE, 5, 20),
|
||||
ACACIA(BlockPlanks.EnumType.ACACIA, 4, 20),
|
||||
DARK_OAK(BlockPlanks.EnumType.DARK_OAK, 5, 20);
|
||||
OAK(BlockPlanks.EnumType.OAK, 5),
|
||||
SPRUCE(BlockPlanks.EnumType.SPRUCE, 4),
|
||||
BIRCH(BlockPlanks.EnumType.BIRCH, 4),
|
||||
JUNGLE(BlockPlanks.EnumType.JUNGLE, 5),
|
||||
ACACIA(BlockPlanks.EnumType.ACACIA, 4),
|
||||
DARK_OAK(BlockPlanks.EnumType.DARK_OAK, 5);
|
||||
|
||||
public static final EnumVanillaWoodType[] VALUES = values();
|
||||
|
||||
@@ -22,12 +22,10 @@ public enum EnumVanillaWoodType implements IWoodType {
|
||||
|
||||
private final BlockPlanks.EnumType vanillaType;
|
||||
private final int carbonization;
|
||||
private final int combustability;
|
||||
|
||||
EnumVanillaWoodType(BlockPlanks.EnumType vanillaType, int carbonization, int combustability) {
|
||||
EnumVanillaWoodType(BlockPlanks.EnumType vanillaType, int carbonization) {
|
||||
this.vanillaType = vanillaType;
|
||||
this.carbonization = carbonization;
|
||||
this.combustability = combustability;
|
||||
}
|
||||
|
||||
public BlockPlanks.EnumType getVanillaType() {
|
||||
@@ -66,10 +64,17 @@ public enum EnumVanillaWoodType implements IWoodType {
|
||||
public int getCarbonization() {
|
||||
return carbonization;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getCombustability() {
|
||||
return combustability;
|
||||
public float getCharcoalChance(int numberOfCharcoal) {
|
||||
if(numberOfCharcoal == 3){
|
||||
return 0.75F;
|
||||
}else if(numberOfCharcoal == 4){
|
||||
return 0.5F;
|
||||
}else if(numberOfCharcoal == 5){
|
||||
return 0.25F;
|
||||
}
|
||||
return 0.15F;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,13 +31,13 @@ public interface IWoodProvider {
|
||||
*/
|
||||
ItemStack getWoodStack();
|
||||
|
||||
/**
|
||||
* @return how long this wood's charcoal burns / 1000
|
||||
*/
|
||||
int getCombustibility();
|
||||
|
||||
/**
|
||||
* The amount of charcoal dropped from a charcoal pile of this wood.
|
||||
*/
|
||||
int getCarbonization();
|
||||
|
||||
/**
|
||||
* The chance that a pile has to drop a extra charcoal
|
||||
*/
|
||||
float getCharcoalChance(int numberOfCharcoal);
|
||||
}
|
||||
@@ -12,8 +12,8 @@ public interface IWoodType extends IStringSerializable {
|
||||
float getHardness();
|
||||
|
||||
int getCarbonization();
|
||||
|
||||
int getCombustability();
|
||||
|
||||
float getCharcoalChance(int numberOfCharcoal);
|
||||
|
||||
String getPlankTexture();
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ import forestry.arboriculture.genetics.TreekeepingMode;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleFruit;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleGrowth;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleLeafEffect;
|
||||
import forestry.arboriculture.items.ItemCharcoal;
|
||||
import forestry.arboriculture.items.ItemGrafter;
|
||||
import forestry.arboriculture.items.ItemRegistryArboriculture;
|
||||
import forestry.arboriculture.models.TextureLeaves;
|
||||
@@ -540,10 +539,6 @@ public class PluginArboriculture extends BlankForestryPlugin {
|
||||
return 100;
|
||||
}
|
||||
|
||||
if(items.charcoal == item){
|
||||
return ItemCharcoal.getBurnTime(fuel);
|
||||
}
|
||||
|
||||
Block block = Block.getBlockFromItem(item);
|
||||
|
||||
if (block instanceof IWoodTyped) {
|
||||
|
||||
@@ -37,6 +37,7 @@ import forestry.core.multiblock.MultiblockLogic;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.render.ParticleHelper;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
import forestry.factory.tiles.TileSqueezer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.SoundType;
|
||||
@@ -52,6 +53,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Enchantments;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -414,9 +416,13 @@ public abstract class BlockPile extends BlockStructure implements ITileEntityPro
|
||||
if (getPileType() == EnumPileType.ASH) {
|
||||
if (pile.getTreeSpecies() != null) {
|
||||
IWoodProvider woodProvider = pile.getTreeSpecies().getWoodProvider();
|
||||
ItemStack charcoal = new ItemStack(PluginArboriculture.items.charcoal, woodProvider.getCarbonization(), woodProvider.getCombustibility());
|
||||
int charcoalAmount = woodProvider.getCarbonization();
|
||||
ItemStack charcoal = new ItemStack(Items.COAL, charcoalAmount, 1);
|
||||
while(RANDOM.nextFloat() < woodProvider.getCharcoalChance(charcoalAmount)){
|
||||
charcoal.stackSize++;
|
||||
}
|
||||
list.add(charcoal);
|
||||
list.add(new ItemStack(PluginCore.items.ash, 3));
|
||||
list.add(new ItemStack(PluginCore.items.ash, (int)(charcoalAmount / 1.5)));
|
||||
} else {
|
||||
list.add(new ItemStack(Blocks.DIRT, 2));
|
||||
list.add(new ItemStack(PluginCore.items.ash, 2));
|
||||
|
||||
@@ -273,12 +273,11 @@ public class Tree extends Individual implements ITree, IPlantable {
|
||||
String girth = TextFormatting.AQUA + "G: " + String.format("%sx%s", genome.getGirth(), genome.getGirth());
|
||||
String saplings = TextFormatting.YELLOW + "S: " + genome.getActiveAllele(EnumTreeChromosome.FERTILITY).getName();
|
||||
String yield = TextFormatting.WHITE + "Y: " + genome.getActiveAllele(EnumTreeChromosome.YIELD).getName();
|
||||
String combustibility = TextFormatting.DARK_GRAY + "CO: " + primary.getWoodProvider().getCombustibility();
|
||||
String carbonization = TextFormatting.GRAY + "CA: " + secondary.getWoodProvider().getCarbonization();
|
||||
list.add(String.format("%s, %s", saplings, maturation));
|
||||
list.add(String.format("%s, %s", height, girth));
|
||||
list.add(String.format("%s, %s", yield, sappiness));
|
||||
list.add(String.format("%s, %s", combustibility, carbonization));
|
||||
list.add(String.format("%s", carbonization));
|
||||
|
||||
IAlleleBoolean primaryFireproof = (IAlleleBoolean) genome.getActiveAllele(EnumTreeChromosome.FIREPROOF);
|
||||
if (primaryFireproof.getValue()) {
|
||||
|
||||
@@ -138,14 +138,6 @@ public class TreeAlyzerPlugin implements IAlyzerPlugin {
|
||||
IAlleleTreeSpecies activeSpecies = (IAlleleTreeSpecies) tree.getGenome().getActiveAllele(EnumTreeChromosome.SPECIES);
|
||||
IAlleleTreeSpecies inActiveSpecies = (IAlleleTreeSpecies) tree.getGenome().getInactiveAllele(EnumTreeChromosome.SPECIES);
|
||||
|
||||
int activeCombustibility = activeSpecies.getWoodProvider().getCombustibility();
|
||||
int inactiveCombustibility = inActiveSpecies.getWoodProvider().getCombustibility();
|
||||
textLayout.drawLine(Translator.translateToLocal("for.gui.combustibility"), GuiAlyzer.COLUMN_0);
|
||||
guiAlyzer.drawLine(Integer.toString(activeCombustibility), GuiAlyzer.COLUMN_1, tree, EnumTreeChromosome.SPECIES, false);
|
||||
guiAlyzer.drawLine(Integer.toString(inactiveCombustibility), GuiAlyzer.COLUMN_2, tree, EnumTreeChromosome.SPECIES, true);
|
||||
|
||||
textLayout.newLineCompressed();
|
||||
|
||||
int activeCarbonization = activeSpecies.getWoodProvider().getCarbonization();
|
||||
int inactiveCarbonization = inActiveSpecies.getWoodProvider().getCarbonization();
|
||||
textLayout.drawLine(Translator.translateToLocal("for.gui.carbonization"), GuiAlyzer.COLUMN_0);
|
||||
|
||||
@@ -60,14 +60,13 @@ public class WoodProvider implements IWoodProvider {
|
||||
return TreeManager.woodAccess.getStack(woodType, WoodBlockKind.LOG, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCombustibility() {
|
||||
return woodType.getCombustability();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCarbonization() {
|
||||
return woodType.getCarbonization();
|
||||
}
|
||||
|
||||
public float getCharcoalChance(int numberOfCharcoal){
|
||||
return woodType.getCharcoalChance(numberOfCharcoal);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,10 +79,9 @@ public class WoodProviderVanilla implements IWoodProvider {
|
||||
public ItemStack getWoodStack() {
|
||||
return TreeManager.woodAccess.getStack(woodType, WoodBlockKind.LOG, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCombustibility() {
|
||||
return woodType.getCombustability();
|
||||
|
||||
public float getCharcoalChance(int numberOfCharcoal){
|
||||
return woodType.getCharcoalChance(numberOfCharcoal);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
package forestry.arboriculture.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.items.ItemForestry;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemCharcoal extends ItemForestry {
|
||||
|
||||
public ItemCharcoal() {
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> subItems) {
|
||||
for(int i = 1;i < 25;i++){
|
||||
subItems.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
for(int i = 1;i < 25;i++){
|
||||
manager.registerItemModel(item, i);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getBurnTime(ItemStack fuel) {
|
||||
return fuel.getMetadata() * 100;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,6 @@ import forestry.core.utils.OreDictUtil;
|
||||
public class ItemRegistryArboriculture extends ItemRegistry {
|
||||
public final ItemGermlingGE sapling;
|
||||
public final ItemGermlingGE pollenFertile;
|
||||
public final ItemCharcoal charcoal;
|
||||
public final ItemGrafter grafter;
|
||||
public final ItemGrafter grafterProven;
|
||||
|
||||
@@ -31,10 +30,6 @@ public class ItemRegistryArboriculture extends ItemRegistry {
|
||||
|
||||
pollenFertile = registerItem(new ItemGermlingGE(EnumGermlingType.POLLEN), "pollenFertile");
|
||||
|
||||
charcoal = registerItem(new ItemCharcoal(), "charcoal");
|
||||
registerOreDict(OreDictUtil.CHARCOAL, new ItemStack(charcoal, 1, OreDictionary.WILDCARD_VALUE));
|
||||
registerOreDict(OreDictUtil.CHARCOAL, new ItemStack(Items.COAL, 1, 1));
|
||||
|
||||
grafter = registerItem(new ItemGrafter(9), "grafter");
|
||||
grafterProven = registerItem(new ItemGrafter(149), "grafterProven");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user