mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-20 20:12:19 +00:00
API javadoc cleanup, use NonNullList for ItemStack lists
This commit is contained in:
1 parent
55919a135e
commit
d8e735ef3b
48 files changed
+119
-207
No files matched your search
@@ -49,8 +49,6 @@ public interface IBee extends IIndividualLiving {
|
||||
|
||||
/**
|
||||
* Set the natural flag on this bee.
|
||||
*
|
||||
* @param flag
|
||||
*/
|
||||
void setIsNatural(boolean flag);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.world.World;
|
||||
public interface IBeeRoot extends ISpeciesRoot {
|
||||
|
||||
/**
|
||||
* @return true if passed item is a Forestry bee. Equal to getType(ItemStack stack) != EnumBeeType.NONE
|
||||
* @return true if passed item is a Forestry bee. Equal to getType(ItemStack stack) != null
|
||||
*/
|
||||
@Override
|
||||
boolean isMember(ItemStack stack);
|
||||
@@ -49,7 +49,6 @@ public interface IBeeRoot extends ISpeciesRoot {
|
||||
/* BREEDING TRACKER */
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @return {@link IApiaristTracker} associated with the passed world.
|
||||
*/
|
||||
@Override
|
||||
@@ -58,7 +57,7 @@ public interface IBeeRoot extends ISpeciesRoot {
|
||||
/* BEE SPECIFIC */
|
||||
|
||||
/**
|
||||
* @return type of bee encoded on the itemstack. EnumBeeType.NONE if it isn't a bee.
|
||||
* @return type of bee encoded on the itemstack. null if it isn't a bee.
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
@@ -110,7 +109,7 @@ public interface IBeeRoot extends ISpeciesRoot {
|
||||
|
||||
void registerBeekeepingMode(IBeekeepingMode mode);
|
||||
|
||||
void setBeekeepingMode(World world, String name);
|
||||
void setBeekeepingMode(World world, IBeekeepingMode mode);
|
||||
|
||||
/* MISC */
|
||||
|
||||
|
||||
@@ -28,40 +28,31 @@ public interface IBeekeepingMode {
|
||||
float getWearModifier();
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @return fertility taking into account the birthing queen and surroundings.
|
||||
*/
|
||||
int getFinalFertility(IBee queen, World world, BlockPos pos);
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @return true if the queen is genetically "fatigued" and should not be reproduced anymore.
|
||||
*/
|
||||
boolean isFatigued(IBee queen, IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @param housing
|
||||
* @return true if the queen is being overworked in the bee housing (with chance). will trigger a negative effect.
|
||||
*/
|
||||
boolean isOverworked(IBee queen, IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @param offspring
|
||||
* @param housing
|
||||
* @return true if the genetic structure of the queen is breaking down during spawning of the offspring (with chance). will trigger a negative effect.
|
||||
*/
|
||||
boolean isDegenerating(IBee queen, IBee offspring, IBeeHousing housing);
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @return true if an offspring of this queen is considered a natural
|
||||
*/
|
||||
boolean isNaturalOffspring(IBee queen);
|
||||
|
||||
/**
|
||||
* @param queen
|
||||
* @return true if this mode allows the passed queen or princess to be multiplied
|
||||
*/
|
||||
boolean mayMultiplyPrincess(IBee queen);
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
@@ -22,7 +21,7 @@ public interface IHiveDrop {
|
||||
|
||||
IBee getBeeType(IBlockAccess world, BlockPos pos);
|
||||
|
||||
Collection<ItemStack> getExtraItems(IBlockAccess world, BlockPos pos, int fortune);
|
||||
NonNullList<ItemStack> getExtraItems(IBlockAccess world, BlockPos pos, int fortune);
|
||||
|
||||
/**
|
||||
* Chance to drop a bee or extra items. Default drops have 0.80 (= 80 %).
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
@@ -36,7 +37,7 @@ public interface ITree extends IIndividual, ITreeGenData {
|
||||
/**
|
||||
* @since Forestry 4.0
|
||||
*/
|
||||
ITree[] getSaplings(World world, @Nullable GameProfile playerProfile, BlockPos pos, float modifier);
|
||||
List<ITree> getSaplings(World world, @Nullable GameProfile playerProfile, BlockPos pos, float modifier);
|
||||
|
||||
// Products, Chance
|
||||
Map<ItemStack, Float> getProducts();
|
||||
|
||||
@@ -8,32 +8,26 @@ package forestry.api.arboriculture;
|
||||
public interface ITreeModifier {
|
||||
|
||||
/**
|
||||
* @param genome
|
||||
* @return Float used to modify the height.
|
||||
*/
|
||||
float getHeightModifier(ITreeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome
|
||||
* @return Float used to modify the yield.
|
||||
*/
|
||||
float getYieldModifier(ITreeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome
|
||||
* @return Float used to modify the sappiness.
|
||||
*/
|
||||
float getSappinessModifier(ITreeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome
|
||||
* @return Float used to modify the maturation.
|
||||
*/
|
||||
float getMaturationModifier(ITreeGenome genome, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome0
|
||||
* @param genome1
|
||||
* @return Float used to modify the base mutation chance.
|
||||
*/
|
||||
float getMutationModifier(ITreeGenome genome0, ITreeGenome genome1, float currentModifier);
|
||||
|
||||
@@ -43,7 +43,6 @@ public interface ITreeRoot extends ISpeciesRootPollinatable {
|
||||
ITreeGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive);
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @return {@link IArboristTracker} associated with the passed world.
|
||||
*/
|
||||
@Override
|
||||
@@ -87,11 +86,12 @@ public interface ITreeRoot extends ISpeciesRootPollinatable {
|
||||
|
||||
ITreekeepingMode getTreekeepingMode(World world);
|
||||
|
||||
@Nullable
|
||||
ITreekeepingMode getTreekeepingMode(String name);
|
||||
|
||||
void registerTreekeepingMode(ITreekeepingMode mode);
|
||||
|
||||
void setTreekeepingMode(World world, String name);
|
||||
void setTreekeepingMode(World world, ITreekeepingMode mode);
|
||||
|
||||
/* TEMPLATES */
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.arboriculture;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public interface ITreekeepingMode extends ITreeModifier {
|
||||
|
||||
@@ -17,6 +17,6 @@ public interface ITreekeepingMode extends ITreeModifier {
|
||||
/**
|
||||
* @return Localized list of strings outlining the behaviour of this treekeeping mode.
|
||||
*/
|
||||
ArrayList<String> getDescription();
|
||||
List<String> getDescription();
|
||||
|
||||
}
|
||||
@@ -5,7 +5,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.core;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -22,7 +21,6 @@ public interface ICamouflageAccess {
|
||||
/**
|
||||
* @return A list of all item camouflage handler's that are registered for that camouflage type.
|
||||
*/
|
||||
@Nullable
|
||||
List<ICamouflageItemHandler> getCamouflageItemHandler(String type);
|
||||
|
||||
void addItemToBlackList(String type, ItemStack camouflageBlock);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class DefaultFarmListener implements IFarmListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCropHarvest(Collection<ItemStack> harvested, ICrop crop) {
|
||||
public void afterCropHarvest(NonNullList<ItemStack> harvested, ICrop crop) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface IFarmListener {
|
||||
* @param harvested Collection of harvested stacks. May be manipulated. Ensure removal of stacks with 0 or less items!
|
||||
* @param crop Harvested {@link ICrop}
|
||||
*/
|
||||
void afterCropHarvest(Collection<ItemStack> harvested, ICrop crop);
|
||||
void afterCropHarvest(NonNullList<ItemStack> harvested, ICrop crop);
|
||||
|
||||
/**
|
||||
* Called after the stack of collected items has been returned by the farm logic, but before it is added to the farm's pending queue.
|
||||
|
||||
@@ -18,7 +18,6 @@ public interface IAlleleEffect extends IAllele {
|
||||
/**
|
||||
* Returns the passed data storage if it is valid for this effect or a new one if the passed storage object was invalid for this effect.
|
||||
*
|
||||
* @param storedData
|
||||
* @return {@link IEffectData} for the next cycle.
|
||||
*/
|
||||
IEffectData validateStorage(IEffectData storedData);
|
||||
|
||||
@@ -55,11 +55,11 @@ public interface IAlleleRegistry {
|
||||
/**
|
||||
* Retrieve a matching {@link ISpeciesRoot} for the given {@link IIndividual}-class.
|
||||
*
|
||||
* @param clz Class extending {@link IIndividual}.
|
||||
* @param individualClass Class extending {@link IIndividual}.
|
||||
* @return {@link ISpeciesRoot} if found, null otherwise.
|
||||
*/
|
||||
@Nullable
|
||||
ISpeciesRoot getSpeciesRoot(Class<? extends IIndividual> clz);
|
||||
ISpeciesRoot getSpeciesRoot(Class<? extends IIndividual> individualClass);
|
||||
|
||||
/**
|
||||
* Retrieve a matching {@link ISpeciesRoot} for the given {@link IIndividual}
|
||||
@@ -71,7 +71,6 @@ public interface IAlleleRegistry {
|
||||
/**
|
||||
* Tests the itemstack for genetic information.
|
||||
*
|
||||
* @param stack
|
||||
* @return true if the itemstack is an individual.
|
||||
*/
|
||||
boolean isIndividual(ItemStack stack);
|
||||
@@ -183,15 +182,12 @@ public interface IAlleleRegistry {
|
||||
|
||||
/**
|
||||
* Registers a new fruit family.
|
||||
*
|
||||
* @param family
|
||||
*/
|
||||
void registerFruitFamily(IFruitFamily family);
|
||||
|
||||
/**
|
||||
* Retrieves a fruit family identified by uid.
|
||||
*
|
||||
* @param uid
|
||||
* @return {IFruitFamily} if found, false otherwise.
|
||||
*/
|
||||
IFruitFamily getFruitFamily(String uid);
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
@@ -57,19 +58,14 @@ public interface IAlleleSpecies extends IAllele {
|
||||
int getComplexity();
|
||||
|
||||
/**
|
||||
* @param itemstack
|
||||
* @return A float signifying the chance for the passed itemstack to yield a research success.
|
||||
*/
|
||||
float getResearchSuitability(ItemStack itemstack);
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @param gameProfile
|
||||
* @param individual
|
||||
* @param bountyLevel
|
||||
* @return Array of itemstacks representing the bounty for this research success.
|
||||
* @return itemstacks representing the bounty for this research success.
|
||||
*/
|
||||
ItemStack[] getResearchBounty(World world, GameProfile gameProfile, IIndividual individual, int bountyLevel);
|
||||
NonNullList<ItemStack> getResearchBounty(World world, GameProfile gameProfile, IIndividual individual, int bountyLevel);
|
||||
|
||||
/* CLIMATE */
|
||||
|
||||
|
||||
@@ -33,29 +33,21 @@ public interface IBreedingTracker {
|
||||
|
||||
/**
|
||||
* Register the birth of an individual. Will mark it as discovered.
|
||||
*
|
||||
* @param individual
|
||||
*/
|
||||
void registerBirth(IIndividual individual);
|
||||
|
||||
/**
|
||||
* Register the pickup of an individual.
|
||||
*
|
||||
* @param individual
|
||||
*/
|
||||
void registerPickup(IIndividual individual);
|
||||
|
||||
/**
|
||||
* Marks a species as discovered. Should only be called from registerIndividual normally.
|
||||
*
|
||||
* @param species
|
||||
*/
|
||||
void registerSpecies(IAlleleSpecies species);
|
||||
|
||||
/**
|
||||
* Register a successful mutation. Will mark it as discovered.
|
||||
*
|
||||
* @param mutation
|
||||
*/
|
||||
void registerMutation(IMutation mutation);
|
||||
|
||||
|
||||
@@ -90,8 +90,6 @@ public interface IClassification {
|
||||
|
||||
/**
|
||||
* Used by the allele registry to populate internal collection of branch members on the fly.
|
||||
*
|
||||
* @param species
|
||||
*/
|
||||
void addMemberSpecies(IAlleleSpecies species);
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ public interface IIndividual extends INbtWritable {
|
||||
/**
|
||||
* Check whether the genetic makeup of two IIndividuals is identical. Ignores additional data like generations, irregular mating, etc..
|
||||
*
|
||||
* @param other
|
||||
* @return true if the given other IIndividual has the amount of chromosomes and their alleles are identical.
|
||||
*/
|
||||
boolean isGeneticEqual(IIndividual other);
|
||||
|
||||
@@ -34,9 +34,6 @@ public interface IIndividualLiving extends IIndividual {
|
||||
|
||||
/**
|
||||
* Age the individual.
|
||||
*
|
||||
* @param world
|
||||
* @param ageModifier
|
||||
*/
|
||||
void age(World world, float ageModifier);
|
||||
|
||||
|
||||
@@ -49,13 +49,11 @@ public interface IMutation {
|
||||
Collection<String> getSpecialConditions();
|
||||
|
||||
/**
|
||||
* @param allele
|
||||
* @return true if the passed allele is one of the alleles participating in this mutation.
|
||||
*/
|
||||
boolean isPartner(IAllele allele);
|
||||
|
||||
/**
|
||||
* @param allele
|
||||
* @return the other allele which was not passed as argument.
|
||||
*/
|
||||
IAllele getPartner(IAllele allele);
|
||||
|
||||
@@ -96,15 +96,11 @@ public interface ISpeciesRoot {
|
||||
|
||||
/**
|
||||
* Registers a bee template using the UID of the first allele as identifier.
|
||||
*
|
||||
* @param template
|
||||
*/
|
||||
void registerTemplate(IAllele[] template);
|
||||
|
||||
/**
|
||||
* Registers a bee template using the passed identifier.
|
||||
*
|
||||
* @param template
|
||||
*/
|
||||
void registerTemplate(String identifier, IAllele[] template);
|
||||
|
||||
@@ -144,8 +140,6 @@ public interface ISpeciesRoot {
|
||||
|
||||
/**
|
||||
* Use to register mutations.
|
||||
*
|
||||
* @param mutation
|
||||
*/
|
||||
void registerMutation(IMutation mutation);
|
||||
|
||||
|
||||
@@ -14,10 +14,9 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
public class GreenhouseEvents extends Event {
|
||||
|
||||
@Nullable
|
||||
public final IGreenhouseController controller;
|
||||
|
||||
public GreenhouseEvents(@Nullable IGreenhouseController state) {
|
||||
public GreenhouseEvents(IGreenhouseController state) {
|
||||
this.controller = state;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ public interface IAlleleButterflyEffect extends IAlleleEffect {
|
||||
* Used by butterflies to trigger effects in the world.
|
||||
*
|
||||
* @param butterfly {@link IEntityButterfly}
|
||||
* @param storedData
|
||||
* @return {@link forestry.api.genetics.IEffectData} for the next cycle.
|
||||
*/
|
||||
IEffectData doEffect(IEntityButterfly butterfly, IEffectData storedData);
|
||||
|
||||
@@ -29,41 +29,27 @@ public interface IButterfly extends IIndividualLiving {
|
||||
float getSize();
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return true if the butterfly can naturally spawn at the given location at this time. (Used to auto-spawn butterflies from tree leaves.)
|
||||
*/
|
||||
boolean canSpawn(World world, double x, double y, double z);
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return true if the butterfly can take flight at the given location at this time. (Used to auto-spawn butterflies from dropped items.)
|
||||
*/
|
||||
boolean canTakeFlight(World world, double x, double y, double z);
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @return true if the environment (temperature, humidity) is valid for the butterfly at the given location.
|
||||
*/
|
||||
boolean isAcceptedEnvironment(World world, double x, double y, double z);
|
||||
|
||||
/**
|
||||
* @param world
|
||||
* @return create a caterpillar with the two genome's from the nursery.
|
||||
*/
|
||||
@Nullable
|
||||
IButterfly spawnCaterpillar(World world, IButterflyNursery nursery);
|
||||
|
||||
/**
|
||||
* @param entity
|
||||
* @param playerKill Whether or not the butterfly was killed by a player.
|
||||
* @param lootLevel Loot level according to the weapon used to kill the butterfly.
|
||||
* @return Array of itemstacks to drop on death of the given entity.
|
||||
@@ -71,7 +57,6 @@ public interface IButterfly extends IIndividualLiving {
|
||||
NonNullList<ItemStack> getLootDrop(IEntityButterfly entity, boolean playerKill, int lootLevel);
|
||||
|
||||
/**
|
||||
* @param nursery
|
||||
* @param playerKill Whether or not the nursery was broken by a player.
|
||||
* @param lootLevel Fortune level.
|
||||
* @return Array of itemstacks to drop on breaking of the nursery.
|
||||
@@ -79,8 +64,7 @@ public interface IButterfly extends IIndividualLiving {
|
||||
NonNullList<ItemStack> getCaterpillarDrop(IButterflyNursery nursery, boolean playerKill, int lootLevel);
|
||||
|
||||
/**
|
||||
* @param cocoon
|
||||
* @return Array of itemstacks to drop on breaking of the cocoon.
|
||||
* @return itemstacks to drop on breaking of the cocoon.
|
||||
*/
|
||||
NonNullList<ItemStack> getCocoonDrop(IButterflyCocoon cocoon);
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ public interface IButterflyNursery extends IHousing, IClimateProvider {
|
||||
|
||||
IIndividual getNanny();
|
||||
|
||||
void setCaterpillar(@Nullable IButterfly butterfly);
|
||||
void setCaterpillar(@Nullable IButterfly caterpillar);
|
||||
|
||||
boolean canNurse(IButterfly butterfly);
|
||||
boolean canNurse(IButterfly caterpillar);
|
||||
|
||||
}
|
||||
@@ -48,7 +48,6 @@ public interface IButterflyRoot extends ISpeciesRoot {
|
||||
/**
|
||||
* Spawns the given butterfly in the world.
|
||||
*
|
||||
* @param butterfly
|
||||
* @return butterfly entity on success, null otherwise.
|
||||
*/
|
||||
EntityLiving spawnButterflyInWorld(World world, IButterfly butterfly, double x, double y, double z);
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.recipes;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
public interface ICentrifugeRecipe extends IForestryRecipe {
|
||||
|
||||
@@ -26,7 +26,7 @@ public interface ICentrifugeRecipe extends IForestryRecipe {
|
||||
/**
|
||||
* Returns the randomized products from processing one input item.
|
||||
**/
|
||||
Collection<ItemStack> getProducts(Random random);
|
||||
NonNullList<ItemStack> getProducts(Random random);
|
||||
|
||||
/**
|
||||
* Returns a list of all possible products and their estimated probabilities (0.0 to 1.0],
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface IDescriptiveRecipe {
|
||||
|
||||
/**
|
||||
* @return array of all the ingredients in the crafting table.
|
||||
* Ingredients may be null, ItemStack, ItemStack[], or a List of ItemStack
|
||||
* Each inner list represents one slot's accepted ItemStacks
|
||||
*/
|
||||
NonNullList<NonNullList<ItemStack>> getIngredients();
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ public interface IFabricatorRecipe extends IForestryRecipe {
|
||||
|
||||
/**
|
||||
* @return the list of ingredients in the crafting grid to create this recipe.
|
||||
* Each inner list represents one slot's accepted ItemStacks
|
||||
*/
|
||||
NonNullList<NonNullList<ItemStack>> getIngredients();
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
public interface ISqueezerRecipe extends IForestryRecipe {
|
||||
|
||||
/**
|
||||
* @return Array of item stacks representing the required resources for one process. Stack size will be taken into account.
|
||||
* @return item stacks representing the required resources for one process. Stack size will be taken into account.
|
||||
*/
|
||||
NonNullList<ItemStack> getResources();
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ import net.minecraft.item.ItemStack;
|
||||
public interface IVariableFermentable {
|
||||
|
||||
/**
|
||||
* @param itemstack
|
||||
* @return Float representing the modification to be applied to the matching recipe's biomass output.
|
||||
*/
|
||||
float getFermentationModifier(ItemStack itemstack);
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.commands;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -34,24 +33,19 @@ public class BeeModeHelper implements ICommandModeHelper {
|
||||
return modeStrings.toArray(new String[modeStringCount]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getModeNameMatching(String desired) {
|
||||
IBeekeepingMode mode = BeeManager.beeRoot.getBeekeepingMode(desired);
|
||||
if (mode == null) {
|
||||
return null;
|
||||
}
|
||||
return mode.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModeName(World world) {
|
||||
return BeeManager.beeRoot.getBeekeepingMode(world).getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMode(World world, String modeName) {
|
||||
BeeManager.beeRoot.setBeekeepingMode(world, modeName);
|
||||
public boolean setMode(World world, String modeName) {
|
||||
IBeekeepingMode mode = BeeManager.beeRoot.getBeekeepingMode(modeName);
|
||||
if (mode != null) {
|
||||
BeeManager.beeRoot.setBeekeepingMode(world, mode);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -293,7 +293,9 @@ public class BeeRoot extends SpeciesRoot implements IBeeRoot {
|
||||
|
||||
// No beekeeping mode yet, get it.
|
||||
IApiaristTracker tracker = getBreedingTracker(world, null);
|
||||
String mode = tracker.getModeName();
|
||||
String modeName = tracker.getModeName();
|
||||
IBeekeepingMode mode = getBeekeepingMode(modeName);
|
||||
Preconditions.checkNotNull(mode);
|
||||
|
||||
setBeekeepingMode(world, mode);
|
||||
FMLCommonHandler.instance().getFMLLogger().debug("Set beekeeping mode for a world to " + mode);
|
||||
@@ -307,9 +309,11 @@ public class BeeRoot extends SpeciesRoot implements IBeeRoot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeekeepingMode(World world, String name) {
|
||||
activeBeekeepingMode = getBeekeepingMode(name);
|
||||
getBreedingTracker(world, null).setModeName(name);
|
||||
public void setBeekeepingMode(World world, IBeekeepingMode mode) {
|
||||
Preconditions.checkNotNull(world);
|
||||
Preconditions.checkNotNull(mode);
|
||||
activeBeekeepingMode = mode;
|
||||
getBreedingTracker(world, null).setModeName(mode.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,20 +10,19 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.genetics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class HiveDrop implements IHiveDrop {
|
||||
|
||||
private final IBeeDefinition beeTemplate;
|
||||
private final ArrayList<ItemStack> additional = new ArrayList<>();
|
||||
private final NonNullList<ItemStack> additional = NonNullList.create();
|
||||
private final double chance;
|
||||
private double ignobleShare = 0.0;
|
||||
|
||||
@@ -45,8 +44,8 @@ public class HiveDrop implements IHiveDrop {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getExtraItems(IBlockAccess world, BlockPos pos, int fortune) {
|
||||
List<ItemStack> ret = new ArrayList<>();
|
||||
public NonNullList<ItemStack> getExtraItems(IBlockAccess world, BlockPos pos, int fortune) {
|
||||
NonNullList<ItemStack> ret = NonNullList.create();
|
||||
for (ItemStack stack : additional) {
|
||||
ret.add(stack.copy());
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.apiculture.genetics.alleles;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -39,6 +37,7 @@ import forestry.core.utils.ItemStackUtil;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -141,9 +140,9 @@ public class AlleleBeeSpecies extends AlleleSpecies implements IAlleleBeeSpecies
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) {
|
||||
ArrayList<ItemStack> bounty = new ArrayList<>();
|
||||
Collections.addAll(bounty, super.getResearchBounty(world, researcher, individual, bountyLevel));
|
||||
public NonNullList<ItemStack> getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) {
|
||||
NonNullList<ItemStack> bounty = NonNullList.create();
|
||||
bounty.addAll(super.getResearchBounty(world, researcher, individual, bountyLevel));
|
||||
|
||||
if (bountyLevel > 10) {
|
||||
for (ItemStack stack : specialtyChances.keySet()) {
|
||||
@@ -153,7 +152,7 @@ public class AlleleBeeSpecies extends AlleleSpecies implements IAlleleBeeSpecies
|
||||
for (ItemStack stack : productChances.keySet()) {
|
||||
bounty.add(ItemStackUtil.copyWithRandomSize(stack, (int) ((float) bountyLevel / 2), world.rand));
|
||||
}
|
||||
return bounty.toArray(new ItemStack[bounty.size()]);
|
||||
return bounty;
|
||||
}
|
||||
|
||||
/* OTHER */
|
||||
|
||||
@@ -175,7 +175,7 @@ public class BlockForestryLeaves extends BlockLeaves implements ITileEntityProvi
|
||||
}
|
||||
|
||||
// Add saplings
|
||||
ITree[] saplings = tree.getSaplings((World) world, playerProfile, pos, saplingModifier);
|
||||
List<ITree> saplings = tree.getSaplings((World) world, playerProfile, pos, saplingModifier);
|
||||
|
||||
for (ITree sapling : saplings) {
|
||||
if (sapling != null) {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package forestry.arboriculture.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.arboriculture.ITreekeepingMode;
|
||||
@@ -32,25 +33,27 @@ public class TreeModeHelper implements ICommandModeHelper {
|
||||
return modeStrings.toArray(new String[modeStringCount]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModeNameMatching(String desired) {
|
||||
ITreekeepingMode mode = TreeManager.treeRoot.getTreekeepingMode(desired);
|
||||
return mode.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModeName(World world) {
|
||||
return TreeManager.treeRoot.getTreekeepingMode(world).getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMode(World world, String modeName) {
|
||||
TreeManager.treeRoot.setTreekeepingMode(world, modeName);
|
||||
public boolean setMode(World world, String modeName) {
|
||||
ITreekeepingMode mode = TreeManager.treeRoot.getTreekeepingMode(modeName);
|
||||
if (mode != null) {
|
||||
TreeManager.treeRoot.setTreekeepingMode(world, mode);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<String> getDescription(String modeName) {
|
||||
ITreekeepingMode mode = TreeManager.treeRoot.getTreekeepingMode(modeName);
|
||||
if (mode == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return mode.getDescription();
|
||||
}
|
||||
|
||||
|
||||
@@ -279,8 +279,8 @@ public class Tree extends Individual implements ITree, IPlantable {
|
||||
|
||||
/* REPRODUCTION */
|
||||
@Override
|
||||
public ITree[] getSaplings(World world, @Nullable GameProfile playerProfile, BlockPos pos, float modifier) {
|
||||
ArrayList<ITree> prod = new ArrayList<>();
|
||||
public List<ITree> getSaplings(World world, @Nullable GameProfile playerProfile, BlockPos pos, float modifier) {
|
||||
List<ITree> prod = new ArrayList<>();
|
||||
|
||||
float chance = genome.getFertility() * modifier;
|
||||
|
||||
@@ -292,7 +292,7 @@ public class Tree extends Individual implements ITree, IPlantable {
|
||||
}
|
||||
}
|
||||
|
||||
return prod.toArray(new ITree[prod.size()]);
|
||||
return prod;
|
||||
}
|
||||
|
||||
private ITree createOffspring(World world, ITreeGenome mate, @Nullable GameProfile playerProfile, BlockPos pos) {
|
||||
|
||||
@@ -325,8 +325,9 @@ public class TreeRoot extends SpeciesRoot implements ITreeRoot {
|
||||
|
||||
// No Treekeeping mode yet, item it.
|
||||
IArboristTracker tracker = getBreedingTracker(world, null);
|
||||
String mode = tracker.getModeName();
|
||||
|
||||
String modeName = tracker.getModeName();
|
||||
ITreekeepingMode mode = getTreekeepingMode(modeName);
|
||||
Preconditions.checkNotNull(mode);
|
||||
setTreekeepingMode(world, mode);
|
||||
FMLCommonHandler.instance().getFMLLogger().debug("Set Treekeeping mode for a world to " + mode);
|
||||
|
||||
@@ -339,9 +340,9 @@ public class TreeRoot extends SpeciesRoot implements ITreeRoot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTreekeepingMode(World world, String name) {
|
||||
activeTreekeepingMode = getTreekeepingMode(name);
|
||||
getBreedingTracker(world, null).setModeName(name);
|
||||
public void setTreekeepingMode(World world, ITreekeepingMode mode) {
|
||||
activeTreekeepingMode = mode;
|
||||
getBreedingTracker(world, null).setModeName(mode.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ package forestry.arboriculture.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
@@ -45,8 +46,8 @@ public class TreekeepingMode implements ITreekeepingMode {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> getDescription() {
|
||||
ArrayList<String> ret = new ArrayList<>();
|
||||
public List<String> getDescription() {
|
||||
List<String> ret = new ArrayList<>();
|
||||
ret.add("treemode." + name.toLowerCase(Locale.ENGLISH) + ".desc");
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -488,16 +488,16 @@ public class TileLeaves extends TileTreeContainer implements IPollinatable, IFru
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCaterpillar(@Nullable IButterfly butterfly) {
|
||||
public void setCaterpillar(@Nullable IButterfly caterpillar) {
|
||||
maturationTime = 0;
|
||||
caterpillar = butterfly;
|
||||
this.caterpillar = caterpillar;
|
||||
sendNetworkUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNurse(IButterfly butterfly) {
|
||||
public boolean canNurse(IButterfly caterpillar) {
|
||||
ITree tree = getTree();
|
||||
return !isDestroyed(tree, damage) && caterpillar == null;
|
||||
return !isDestroyed(tree, damage) && this.caterpillar == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,12 +10,11 @@
|
||||
******************************************************************************/
|
||||
package forestry.core;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.ListMultimap;
|
||||
import forestry.api.core.CamouflageManager;
|
||||
import forestry.api.core.ICamouflageAccess;
|
||||
import forestry.api.core.ICamouflageItemHandler;
|
||||
@@ -27,17 +26,14 @@ import net.minecraftforge.fml.common.Loader;
|
||||
|
||||
public class CamouflageAccess implements ICamouflageAccess {
|
||||
|
||||
private static final Map<String, List<ICamouflageItemHandler>> camouflageItemHandlers = new HashMap<>();
|
||||
private static final Map<String, List<ItemStack>> camouflageItemBlacklist = new HashMap<>();
|
||||
private static final Map<String, List<String>> blacklistedMods = new HashMap<>();
|
||||
private static final ListMultimap<String, ICamouflageItemHandler> camouflageItemHandlers = ArrayListMultimap.create();
|
||||
private static final ListMultimap<String, ItemStack> camouflageItemBlacklist = ArrayListMultimap.create();
|
||||
private static final ListMultimap<String, String> blacklistedMods = ArrayListMultimap.create();
|
||||
public static final ICamouflageItemHandler NONE = new CamouflageHandlerNone();
|
||||
|
||||
@Override
|
||||
public void registerCamouflageItemHandler(ICamouflageItemHandler itemHandler) {
|
||||
String type = itemHandler.getType();
|
||||
if (!camouflageItemHandlers.containsKey(type)) {
|
||||
camouflageItemHandlers.put(type, new ArrayList<>());
|
||||
}
|
||||
|
||||
List<ICamouflageItemHandler> handlers = camouflageItemHandlers.get(type);
|
||||
if (!handlers.contains(itemHandler)) {
|
||||
@@ -48,13 +44,10 @@ public class CamouflageAccess implements ICamouflageAccess {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public List<ICamouflageItemHandler> getCamouflageItemHandler(String type) {
|
||||
if (type.equals(CamouflageManager.NONE)) {
|
||||
List<ICamouflageItemHandler> handlers = new ArrayList<>();
|
||||
for (List<ICamouflageItemHandler> handler : camouflageItemHandlers.values()) {
|
||||
handlers.addAll(handler);
|
||||
}
|
||||
handlers.addAll(camouflageItemHandlers.values());
|
||||
return handlers;
|
||||
}
|
||||
|
||||
@@ -63,11 +56,8 @@ public class CamouflageAccess implements ICamouflageAccess {
|
||||
|
||||
@Override
|
||||
public void addModIdToBlackList(String type, String modID) {
|
||||
if (!blacklistedMods.containsKey(type)) {
|
||||
blacklistedMods.put(type, new ArrayList<>());
|
||||
}
|
||||
if (!blacklistedMods.get(type).contains(modID)) {
|
||||
blacklistedMods.get(type).add(modID);
|
||||
blacklistedMods.put(type, modID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,15 +74,13 @@ public class CamouflageAccess implements ICamouflageAccess {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!camouflageItemBlacklist.containsKey(type)) {
|
||||
camouflageItemBlacklist.put(type, new ArrayList<>());
|
||||
}
|
||||
camouflageItemBlacklist.get(type).add(camouflageBlock);
|
||||
|
||||
camouflageItemBlacklist.put(type, camouflageBlock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemBlackListed(String type, ItemStack camouflageBlock) {
|
||||
if (camouflageBlock.isEmpty() || Block.getBlockFromItem(camouflageBlock.getItem()) == Blocks.AIR || type != null && !camouflageItemBlacklist.containsKey(type)) {
|
||||
if (camouflageBlock.isEmpty() || Block.getBlockFromItem(camouflageBlock.getItem()) == Blocks.AIR || !type.equals(CamouflageManager.NONE) && !camouflageItemBlacklist.containsKey(type)) {
|
||||
return false;
|
||||
}
|
||||
String modId = camouflageBlock.getItem().getRegistryName().getResourceDomain();
|
||||
@@ -100,11 +88,9 @@ public class CamouflageAccess implements ICamouflageAccess {
|
||||
return true;
|
||||
}
|
||||
List<ItemStack> camouflageItemBlacklisted;
|
||||
if (type == null) {
|
||||
if (type.equals(CamouflageManager.NONE)) {
|
||||
camouflageItemBlacklisted = new ArrayList<>();
|
||||
for (List<ItemStack> stacks : camouflageItemBlacklist.values()) {
|
||||
camouflageItemBlacklisted.addAll(stacks);
|
||||
}
|
||||
camouflageItemBlacklisted.addAll(camouflageItemBlacklist.values());
|
||||
} else {
|
||||
camouflageItemBlacklisted = camouflageItemBlacklist.get(type);
|
||||
}
|
||||
@@ -116,7 +102,7 @@ public class CamouflageAccess implements ICamouflageAccess {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ICamouflageItemHandler getNoneItemHandler() {
|
||||
return NONE;
|
||||
@@ -127,11 +113,9 @@ public class CamouflageAccess implements ICamouflageAccess {
|
||||
if (stack.isEmpty()) {
|
||||
return NONE;
|
||||
}
|
||||
for (List<ICamouflageItemHandler> handlers : camouflageItemHandlers.values()) {
|
||||
for (ICamouflageItemHandler handler : handlers) {
|
||||
if (handler.canHandle(stack)) {
|
||||
return handler;
|
||||
}
|
||||
for (ICamouflageItemHandler handler : camouflageItemHandlers.values()) {
|
||||
if (handler.canHandle(stack)) {
|
||||
return handler;
|
||||
}
|
||||
}
|
||||
return NONE;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class CommandModeInfo extends SubCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
String modeName = modeHelper.getModeNameMatching(args[0]);
|
||||
String modeName = args[0];
|
||||
|
||||
if (modeName == null) {
|
||||
CommandHelpers.sendLocalizedChatMessage(sender, "for.chat.command.forestry.mode.info.error", args[0]);
|
||||
|
||||
@@ -41,17 +41,14 @@ public final class CommandModeSet extends SubCommand {
|
||||
|
||||
World world = sender.getEntityWorld();
|
||||
|
||||
String desired = args[args.length - 1];
|
||||
String modeName = args[args.length - 1];
|
||||
|
||||
String modeName = modeSetter.getModeNameMatching(desired);
|
||||
if (modeName == null) {
|
||||
CommandHelpers.sendLocalizedChatMessage(sender, "for.chat.command.forestry.mode.set.error", desired);
|
||||
if (modeSetter.setMode(world, modeName)) {
|
||||
CommandHelpers.sendLocalizedChatMessage(sender, "for.chat.command.forestry.mode.set.success", modeName);
|
||||
} else {
|
||||
CommandHelpers.sendLocalizedChatMessage(sender, "for.chat.command.forestry.mode.set.error", modeName);
|
||||
printHelp(sender);
|
||||
return;
|
||||
}
|
||||
|
||||
modeSetter.setMode(world, modeName);
|
||||
CommandHelpers.sendLocalizedChatMessage(sender, "for.chat.command.forestry.mode.set.success", modeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,19 +10,14 @@
|
||||
******************************************************************************/
|
||||
package forestry.core.commands;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface ICommandModeHelper {
|
||||
String[] getModeNames();
|
||||
|
||||
@Nullable
|
||||
String getModeNameMatching(String desired);
|
||||
|
||||
String getModeName(World world);
|
||||
|
||||
void setMode(World world, String modeName);
|
||||
boolean setMode(World world, String modeName);
|
||||
|
||||
Iterable<String> getDescription(String modeName);
|
||||
}
|
||||
@@ -90,9 +90,9 @@ public class AlleleRegistry implements IAlleleRegistry {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ISpeciesRoot getSpeciesRoot(Class<? extends IIndividual> clz) {
|
||||
public ISpeciesRoot getSpeciesRoot(Class<? extends IIndividual> individualClass) {
|
||||
for (ISpeciesRoot root : rootMap.values()) {
|
||||
if (root.getMemberClass().isAssignableFrom(clz)) {
|
||||
if (root.getMemberClass().isAssignableFrom(individualClass)) {
|
||||
return root;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import forestry.core.utils.Translator;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class AlleleSpecies extends Allele implements IAlleleSpeciesBuilder, IAlleleSpecies {
|
||||
@@ -115,7 +116,7 @@ public abstract class AlleleSpecies extends Allele implements IAlleleSpeciesBuil
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) {
|
||||
public NonNullList<ItemStack> getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) {
|
||||
if (world.rand.nextFloat() < bountyLevel / 16.0f) {
|
||||
List<? extends IMutation> allMutations = getRoot().getCombinations(this);
|
||||
if (!allMutations.isEmpty()) {
|
||||
@@ -135,11 +136,13 @@ public abstract class AlleleSpecies extends Allele implements IAlleleSpeciesBuil
|
||||
}
|
||||
|
||||
ItemStack researchNote = AlleleManager.alleleRegistry.getMutationNoteStack(researcher, chosenMutation);
|
||||
return new ItemStack[]{researchNote};
|
||||
NonNullList<ItemStack> bounty = NonNullList.create();
|
||||
bounty.add(researchNote);
|
||||
return bounty;
|
||||
}
|
||||
}
|
||||
|
||||
return ItemStackUtil.EMPTY_STACK_ARRAY;
|
||||
return NonNullList.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,15 +10,13 @@
|
||||
******************************************************************************/
|
||||
package forestry.factory.recipes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import forestry.api.recipes.ICentrifugeRecipe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
public class CentrifugeRecipe implements ICentrifugeRecipe {
|
||||
|
||||
@@ -49,8 +47,8 @@ public class CentrifugeRecipe implements ICentrifugeRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ItemStack> getProducts(Random random) {
|
||||
List<ItemStack> products = new ArrayList<>();
|
||||
public NonNullList<ItemStack> getProducts(Random random) {
|
||||
NonNullList<ItemStack> products = NonNullList.create();
|
||||
|
||||
for (Map.Entry<ItemStack, Float> entry : this.outputs.entrySet()) {
|
||||
float probability = entry.getValue();
|
||||
|
||||
@@ -32,6 +32,7 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
@@ -149,8 +150,11 @@ public class AlleleButterflySpecies extends AlleleSpecies implements IAlleleButt
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) {
|
||||
return new ItemStack[]{getRoot().getMemberStack(individual.copy(), EnumFlutterType.SERUM)};
|
||||
public NonNullList<ItemStack> getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) {
|
||||
ItemStack serum = getRoot().getMemberStack(individual.copy(), EnumFlutterType.SERUM);
|
||||
NonNullList<ItemStack> bounty = NonNullList.create();
|
||||
bounty.add(serum);
|
||||
return bounty;
|
||||
}
|
||||
|
||||
/* OTHER */
|
||||
|
||||
Reference in new issue
Block a user