mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-26 23:03:18 +00:00
Fix #1241 Analysed charcoal uses
This commit is contained in:
1 parent
555304d987
commit
8f836ef0d2
10 files changed
+47
-30
No files matched your search
@@ -8,7 +8,7 @@ package forestry.api.arboriculture;
|
||||
import forestry.api.genetics.ISpeciesType;
|
||||
|
||||
public enum EnumGermlingType implements ISpeciesType {
|
||||
SAPLING("sapling"), POLLEN("pollen"), CHARCOAL("charcoal");
|
||||
SAPLING("sapling"), POLLEN("pollen");
|
||||
|
||||
public static final EnumGermlingType[] VALUES = values();
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ 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.ItemGermlingGE;
|
||||
import forestry.arboriculture.items.ItemRegistryArboriculture;
|
||||
import forestry.arboriculture.models.TextureLeaves;
|
||||
@@ -518,7 +519,7 @@ public class PluginArboriculture extends BlankForestryPlugin {
|
||||
}
|
||||
|
||||
if(items.charcoal == item){
|
||||
return ItemGermlingGE.getBurnTime(fuel);
|
||||
return ItemCharcoal.getBurnTime(fuel);
|
||||
}
|
||||
|
||||
Block block = Block.getBlockFromItem(item);
|
||||
|
||||
@@ -392,8 +392,7 @@ public abstract class BlockPile extends BlockStructure implements ITileEntityPro
|
||||
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
|
||||
if (getPileType() == EnumPileType.ASH) {
|
||||
if(pile.getTree() != null){
|
||||
ItemStack charcoal = TreeManager.treeRoot.getMemberStack(pile.getTree(), EnumGermlingType.CHARCOAL);
|
||||
charcoal.stackSize = pile.getTree().getGenome().getCarbonization();
|
||||
ItemStack charcoal = new ItemStack(PluginArboriculture.items.charcoal, pile.getTree().getGenome().getCarbonization(), pile.getTree().getGenome().getCombustibility());
|
||||
list.add(charcoal);
|
||||
list.add(new ItemStack(PluginCore.items.ash, 3));
|
||||
}else{
|
||||
|
||||
@@ -133,8 +133,6 @@ public class TreeRoot extends SpeciesRoot implements ITreeRoot {
|
||||
return EnumGermlingType.SAPLING;
|
||||
} else if (PluginArboriculture.items.pollenFertile == item) {
|
||||
return EnumGermlingType.POLLEN;
|
||||
} else if (PluginArboriculture.items.charcoal == item) {
|
||||
return EnumGermlingType.CHARCOAL;
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -195,9 +193,6 @@ public class TreeRoot extends SpeciesRoot implements ITreeRoot {
|
||||
case POLLEN:
|
||||
germlingItem = PluginArboriculture.items.pollenFertile;
|
||||
break;
|
||||
case CHARCOAL:
|
||||
germlingItem = PluginArboriculture.items.charcoal;
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("Cannot instantiate a tree of type " + type);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package forestry.arboriculture.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.genetics.alleles.AlleleHelper;
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -162,14 +162,6 @@ public class ItemGermlingGE extends ItemGE implements IVariableFermentable, ICol
|
||||
}
|
||||
return new ActionResult<>(EnumActionResult.PASS, itemStackIn);
|
||||
}
|
||||
|
||||
public static int getBurnTime(ItemStack fuel) {
|
||||
if(TreeManager.treeRoot.isMember(fuel)){
|
||||
ITree tree = TreeManager.treeRoot.getMember(fuel);
|
||||
return tree.getGenome().getCombustibility() * 100;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
private static ActionResult<ItemStack> onItemRightClickPollen(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, BlockPos pos, ITree tree) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import forestry.core.utils.OreDictUtil;
|
||||
public class ItemRegistryArboriculture extends ItemRegistry {
|
||||
public final ItemGermlingGE sapling;
|
||||
public final ItemGermlingGE pollenFertile;
|
||||
public final ItemGermlingGE charcoal;
|
||||
public final ItemCharcoal charcoal;
|
||||
public final ItemGrafter grafter;
|
||||
public final ItemGrafter grafterProven;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ItemRegistryArboriculture extends ItemRegistry {
|
||||
OreDictionary.registerOre(OreDictUtil.TREE_SAPLING, sapling.getWildcard());
|
||||
|
||||
pollenFertile = registerItem(new ItemGermlingGE(EnumGermlingType.POLLEN), "pollenFertile");
|
||||
charcoal = registerItem(new ItemGermlingGE(EnumGermlingType.CHARCOAL), "charcoal");
|
||||
charcoal = registerItem(new ItemCharcoal(), "charcoal");
|
||||
grafter = registerItem(new ItemGrafter(4), "grafter");
|
||||
grafterProven = registerItem(new ItemGrafter(149), "grafterProven");
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ public class ModelProviderGermling implements IGermlingModelProvider {
|
||||
|
||||
private ModelResourceLocation germlingModel;
|
||||
private ModelResourceLocation pollenModel;
|
||||
private ModelResourceLocation charcoalModel;
|
||||
|
||||
public ModelProviderGermling(String modelUid) {
|
||||
this.name = modelUid.substring("forestry.".length());
|
||||
@@ -40,9 +39,6 @@ public class ModelProviderGermling implements IGermlingModelProvider {
|
||||
}else if(type == EnumGermlingType.POLLEN){
|
||||
pollenModel = manager.getModelLocation("pollen");
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:pollen"));
|
||||
}else if(type == EnumGermlingType.CHARCOAL){
|
||||
charcoalModel = manager.getModelLocation("charcoal");
|
||||
manager.registerVariant(item, new ResourceLocation("forestry:charcoal"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,8 +47,6 @@ public class ModelProviderGermling implements IGermlingModelProvider {
|
||||
public ModelResourceLocation getModel(EnumGermlingType type) {
|
||||
if(type == EnumGermlingType.POLLEN){
|
||||
return pollenModel;
|
||||
}else if(type == EnumGermlingType.CHARCOAL){
|
||||
return charcoalModel;
|
||||
}else{
|
||||
return germlingModel;
|
||||
}
|
||||
|
||||
@@ -57,8 +57,6 @@ public class ModelProviderGermlingVanilla implements IGermlingModelProvider {
|
||||
}
|
||||
}else if(type == EnumGermlingType.POLLEN){
|
||||
pollenModel = manager.getModelLocation("pollen");
|
||||
}else if(type == EnumGermlingType.CHARCOAL){
|
||||
charcoalModel = manager.getModelLocation("minecraft", "charcoal");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +65,6 @@ public class ModelProviderGermlingVanilla implements IGermlingModelProvider {
|
||||
public ModelResourceLocation getModel(EnumGermlingType type) {
|
||||
if(type == EnumGermlingType.POLLEN){
|
||||
return pollenModel;
|
||||
}else if(type == EnumGermlingType.CHARCOAL){
|
||||
return charcoalModel;
|
||||
}else{
|
||||
return germlingModel;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user