mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-27 15:22:57 +00:00
Add charcoal pile
This commit is contained in:
1 parent
939d35661b
commit
c1e414b8f7
64 files changed
+2599
-83
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");
|
||||
SAPLING("sapling"), POLLEN("pollen"), CHARCOAL("charcoal");
|
||||
|
||||
public static final EnumGermlingType[] VALUES = values();
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
public enum EnumPileType{
|
||||
WOOD,
|
||||
DIRT,
|
||||
ASH;
|
||||
|
||||
public static final EnumPileType[] VALUES = values();
|
||||
}
|
||||
@@ -66,8 +66,16 @@ public enum EnumTreeChromosome implements IChromosomeType {
|
||||
* Amount of random ticks which need to elapse before a sapling will grow into a tree.
|
||||
*/
|
||||
MATURATION(IAlleleInteger.class),
|
||||
|
||||
|
||||
GIRTH(IAlleleInteger.class),
|
||||
/**
|
||||
* The combustibility of the wood, when it burn to charcoal and the combustibility of the charcoal.
|
||||
*/
|
||||
COMBUSTIBILITY(IAlleleInteger.class),
|
||||
/**
|
||||
* The amount of charcoal that a wood pile ash drop;
|
||||
*/
|
||||
CARBONIZATION(IAlleleInteger.class),
|
||||
/**
|
||||
* Determines if the tree can burn.
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,6 @@ 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;
|
||||
@@ -55,7 +54,9 @@ public interface IAlleleTreeSpecies extends IAlleleSpecies, IAlleleProperty<IAll
|
||||
*/
|
||||
@Nonnull
|
||||
String getModID();
|
||||
|
||||
|
||||
IWoodProvider getWoodProvider();
|
||||
|
||||
/* MODELS AND OVERRIDES */
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@@ -69,6 +70,6 @@ public interface IAlleleTreeSpecies extends IAlleleSpecies, IAlleleProperty<IAll
|
||||
ModelResourceLocation getGermlingModel(EnumGermlingType type);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModels(Item item, IModelManager manager);
|
||||
void registerModels(Item item, IModelManager manager, EnumGermlingType type);
|
||||
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import forestry.api.core.IModelManager;
|
||||
* There is no default implementation because every sapling has a unique icon.
|
||||
*/
|
||||
public interface IGermlingModelProvider {
|
||||
void registerModels(Item item, IModelManager manager);
|
||||
void registerModels(Item item, IModelManager manager, EnumGermlingType type);
|
||||
|
||||
@Nonnull
|
||||
ModelResourceLocation getModel(EnumGermlingType type);
|
||||
|
||||
@@ -7,6 +7,8 @@ package forestry.api.arboriculture;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import forestry.api.genetics.IClassification;
|
||||
|
||||
public interface ITreeFactory {
|
||||
@@ -26,10 +28,11 @@ public interface ITreeFactory {
|
||||
* @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, ITreeGenerator generator);
|
||||
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);
|
||||
|
||||
/** Get one of the built-in Forestry leaf types. Default type is deciduous. */
|
||||
ILeafSpriteProvider getLeafIconProvider(EnumLeafType enumLeafType, Color color, Color colorPollinated);
|
||||
|
||||
@@ -45,6 +45,10 @@ public interface ITreeGenome extends IGenome {
|
||||
int getMaturationTime();
|
||||
|
||||
int getGirth();
|
||||
|
||||
int getCombustibility();
|
||||
|
||||
int getCarbonization();
|
||||
|
||||
IAlleleLeafEffect getEffect();
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.ITextureManager;
|
||||
|
||||
public interface IWoodProvider {
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerSprites(Item item, ITextureManager manager);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The texture sprite of the wood.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
TextureAtlasSprite getSprite(boolean isTop);
|
||||
|
||||
/**
|
||||
* @return A stack of wood from the tree to craft wood pile's or other things.
|
||||
*/
|
||||
ItemStack getWoodStack();
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.api.multiblock;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.arboriculture.EnumPileType;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Needs to be implemented by TileEntities that want to be part of an charcoal pile.
|
||||
* The sub-interfaces can be implemented to alter the operation of the charcoal pile.
|
||||
* They are automatically detected and handled by the charcoal pile when they join its structure.
|
||||
*/
|
||||
public interface ICharcoalPileComponent<T extends IMultiblockLogicCharcoalPile> extends IMultiblockComponent {
|
||||
|
||||
@Override
|
||||
T getMultiblockLogic();
|
||||
|
||||
@Nonnull
|
||||
ITree getTree();
|
||||
|
||||
void setTree(@Nonnull ITree tree);
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
GameProfile getOwner();
|
||||
|
||||
void setOwner(@Nonnull GameProfile owner);
|
||||
|
||||
EnumPileType getPileType();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ITree getNextWoodPile();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package forestry.api.multiblock;
|
||||
|
||||
public interface ICharcoalPileController extends IMultiblockController{
|
||||
|
||||
boolean isActive();
|
||||
|
||||
void setActive(boolean active);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/*******************************************************************************
|
||||
* 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.api.multiblock;
|
||||
|
||||
public interface IMultiblockLogicCharcoalPile extends IMultiblockLogic {
|
||||
|
||||
/**
|
||||
* @return the multiblock controller for this logic
|
||||
*/
|
||||
@Override
|
||||
ICharcoalPileController getController();
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user