mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 12:32:23 +00:00
Add honey comb blocks and improve greenhouse nursery
This commit is contained in:
1 parent
81ef5d536f
commit
ca7d6dbc66
31 files changed
+558
-30
No files matched your search
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "2.1.0", owner = "ForestryAPI|core", provides = "ForestryAPI|farming")
|
||||
@API(apiVersion = "2.2.0", owner = "ForestryAPI|core", provides = "ForestryAPI|farming")
|
||||
package forestry.api.farming;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
@@ -5,8 +5,11 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.lepidopterology;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import forestry.api.core.IErrorState;
|
||||
import forestry.api.genetics.IIndividualLiving;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
@@ -48,6 +51,27 @@ public interface IButterfly extends IIndividualLiving {
|
||||
*/
|
||||
@Nullable
|
||||
IButterfly spawnCaterpillar(World world, IButterflyNursery nursery);
|
||||
|
||||
/**
|
||||
* Determines whether the caterpillar can grow.
|
||||
*
|
||||
* @param cocoon the {@link IButterflyCocoon} the caterpillar resides in.
|
||||
* @param nursery the {@link IButterflyNursery} of the caterpillar.
|
||||
* @return an empty set if the caterpillar can grow, a set of error states if the caterpillar can not grow
|
||||
* @since 5.3.3
|
||||
*/
|
||||
Set<IErrorState> getCanGrow(IButterflyNursery nursery, @Nullable IButterflyCocoon cocoon);
|
||||
|
||||
/**
|
||||
* Determines whether the caterpillar can spawn. (Used to auto-spawn butterflies out of a cocoon.)
|
||||
*
|
||||
* @param cocoon the {@link IButterflyCocoon} the caterpillar resides in.
|
||||
* @param nursery the {@link IButterflyNursery} of the caterpillar.
|
||||
* @return an empty set if the caterpillar can spawn, a set of error states if the caterpillar can not spawn
|
||||
* @since 5.3.3
|
||||
*/
|
||||
Set<IErrorState> getCanSpawn(IButterflyNursery nursery, @Nullable IButterflyCocoon cocoon);
|
||||
|
||||
|
||||
/**
|
||||
* @param playerKill Whether or not the butterfly was killed by a player.
|
||||
|
||||
@@ -13,7 +13,7 @@ package forestry.api.lepidopterology;
|
||||
import forestry.api.genetics.IHousing;
|
||||
|
||||
public interface IButterflyCocoon extends IHousing {
|
||||
|
||||
|
||||
IButterfly getCaterpillar();
|
||||
|
||||
void setCaterpillar(IButterfly butterfly);
|
||||
|
||||
@@ -10,15 +10,19 @@ import javax.annotation.Nullable;
|
||||
import forestry.api.climate.IClimateProvider;
|
||||
import forestry.api.genetics.IHousing;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IButterflyNursery extends IHousing, IClimateProvider {
|
||||
@Nullable
|
||||
IButterfly getCaterpillar();
|
||||
|
||||
@Nullable
|
||||
IIndividual getNanny();
|
||||
|
||||
void setCaterpillar(@Nullable IButterfly caterpillar);
|
||||
|
||||
boolean canNurse(IButterfly caterpillar);
|
||||
|
||||
World getWorldObj();
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@API(apiVersion = "1.3.0", owner = "ForestryAPI|core", provides = "ForestryAPI|lepidopterology")
|
||||
@API(apiVersion = "1.4.0", owner = "ForestryAPI|core", provides = "ForestryAPI|lepidopterology")
|
||||
package forestry.api.lepidopterology;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
@@ -10,6 +10,7 @@ import forestry.api.climate.IClimateSourceProvider;
|
||||
import forestry.api.climate.IClimatiserDefinition;
|
||||
import forestry.api.greenhouse.IGreenhouseListener;
|
||||
import forestry.api.lepidopterology.IButterflyCocoon;
|
||||
import forestry.api.lepidopterology.IButterflyNursery;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
@@ -32,7 +33,7 @@ public interface IGreenhouseComponent<T extends IMultiblockLogicGreenhouse> exte
|
||||
IClimatiserDefinition getDefinition();
|
||||
}
|
||||
|
||||
interface Nursery extends IGreenhouseComponent {
|
||||
interface Nursery extends IGreenhouseComponent, IButterflyNursery {
|
||||
void addCocoonLoot(IButterflyCocoon cocoon, NonNullList<ItemStack> loot);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import forestry.api.core.ICamouflageHandler;
|
||||
import forestry.api.greenhouse.IGreenhouseHousing;
|
||||
import forestry.api.greenhouse.IInternalBlock;
|
||||
import forestry.api.lepidopterology.IButterfly;
|
||||
import forestry.api.lepidopterology.IButterflyCocoon;
|
||||
|
||||
public interface IGreenhouseController extends IMultiblockController, IGreenhouseHousing, ICamouflageHandler, IClimateControlProvider {
|
||||
|
||||
@@ -21,6 +22,16 @@ public interface IGreenhouseController extends IMultiblockController, IGreenhous
|
||||
*/
|
||||
Set<IInternalBlock> getInternalBlocks();
|
||||
|
||||
/**
|
||||
* spawns a butterfly in a greenhouse
|
||||
* @return true if it has spawned it, and false if it has not
|
||||
*/
|
||||
boolean spawnButterfly(IGreenhouseComponent.Nursery nursery);
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #spawnButterfly(IButterflyCocoon)}
|
||||
*/
|
||||
@Deprecated
|
||||
boolean spawnButterfly(IButterfly butterfly);
|
||||
|
||||
IClimateRegion getRegion();
|
||||
|
||||
Reference in new issue
Block a user