mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-27 23:33:00 +00:00
Clean up more null/nonnull, refactor gui ledgers
This commit is contained in:
1 parent
b2d4e6eaba
commit
35f9b95f37
124 files changed
+827
-655
No files matched your search
@@ -5,6 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Easily extendable default IBeeModifier.
|
||||
* By itself, this IBeeModifier does nothing.
|
||||
@@ -23,7 +25,7 @@ public class DefaultBeeModifier implements IBeeModifier {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
public float getLifespanModifier(IBeeGenome genome, @Nullable IBeeGenome mate, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import forestry.api.genetics.IEffectData;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IIndividualLiving;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
/**
|
||||
@@ -72,16 +73,16 @@ public interface IBee extends IIndividualLiving {
|
||||
|
||||
List<Biome> getSuitableBiomes();
|
||||
|
||||
ItemStack[] getProduceList();
|
||||
NonNullList<ItemStack> getProduceList();
|
||||
|
||||
ItemStack[] getSpecialtyList();
|
||||
NonNullList<ItemStack> getSpecialtyList();
|
||||
|
||||
List<ItemStack> produceStacks(IBeeHousing housing);
|
||||
NonNullList<ItemStack> produceStacks(IBeeHousing housing);
|
||||
|
||||
@Nullable
|
||||
IBee spawnPrincess(IBeeHousing housing);
|
||||
|
||||
IBee[] spawnDrones(IBeeHousing housing);
|
||||
List<IBee> spawnDrones(IBeeHousing housing);
|
||||
|
||||
void plantFlowerRandom(IBeeHousing housing);
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.apiculture;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public interface IBeeModifier {
|
||||
/**
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
@@ -26,7 +28,7 @@ public interface IBeeModifier {
|
||||
* @param currentModifier Current modifier.
|
||||
* @return Float used to modify the life span of queens.
|
||||
*/
|
||||
float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier);
|
||||
float getLifespanModifier(IBeeGenome genome, @Nullable IBeeGenome mate, float currentModifier);
|
||||
|
||||
/**
|
||||
* @param genome Genome of the bee this modifier is called for.
|
||||
|
||||
@@ -24,9 +24,10 @@ public interface IBeeRoot extends ISpeciesRoot {
|
||||
boolean isMember(ItemStack stack);
|
||||
|
||||
/**
|
||||
* @return {@link IBee} pattern parsed from the passed stack's nbt data.
|
||||
* @return {@link IBee} pattern parsed from the passed stack's nbt data. Null if the ItemStack is not a valid member.
|
||||
*/
|
||||
@Override
|
||||
@Nullable
|
||||
IBee getMember(ItemStack stack);
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,7 +36,7 @@ public interface ITree extends IIndividual, ITreeGenData {
|
||||
/**
|
||||
* @since Forestry 4.0
|
||||
*/
|
||||
ITree[] getSaplings(World world, GameProfile playerProfile, BlockPos pos, float modifier);
|
||||
ITree[] getSaplings(World world, @Nullable GameProfile playerProfile, BlockPos pos, float modifier);
|
||||
|
||||
// Products, Chance
|
||||
Map<ItemStack, Float> getProducts();
|
||||
|
||||
@@ -24,6 +24,7 @@ public interface ITreeRoot extends ISpeciesRootPollinatable {
|
||||
boolean isMember(ItemStack itemstack);
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
ITree getMember(ItemStack itemstack);
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,6 +18,7 @@ public interface ICircuitRegistry {
|
||||
|
||||
void registerCircuit(ICircuit circuit);
|
||||
|
||||
@Nullable
|
||||
ICircuit getCircuit(String uid);
|
||||
|
||||
ICircuitLibrary getCircuitLibrary(World world, String playerName);
|
||||
@@ -27,6 +28,7 @@ public interface ICircuitRegistry {
|
||||
|
||||
void registerLayout(ICircuitLayout layout);
|
||||
|
||||
@Nullable
|
||||
ICircuitLayout getLayout(String uid);
|
||||
|
||||
ICircuitLayout getDefaultLayout();
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.genetics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -32,5 +31,5 @@ public interface IFlowerProvider {
|
||||
*
|
||||
* @return Array of itemstacks being the (modified or unmodified) produce.
|
||||
*/
|
||||
List<ItemStack> affectProducts(World world, IIndividual individual, BlockPos pos, List<ItemStack> products);
|
||||
NonNullList<ItemStack> affectProducts(World world, IIndividual individual, BlockPos pos, NonNullList<ItemStack> products);
|
||||
}
|
||||
@@ -61,6 +61,7 @@ public interface ISpeciesRoot {
|
||||
*/
|
||||
boolean isMember(IIndividual individual);
|
||||
|
||||
@Nullable
|
||||
IIndividual getMember(ItemStack stack);
|
||||
|
||||
IIndividual getMember(NBTTagCompound compound);
|
||||
|
||||
@@ -22,6 +22,7 @@ public interface IButterflyRoot extends ISpeciesRoot {
|
||||
boolean isMember(ItemStack stack);
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
IButterfly getMember(ItemStack stack);
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.api.mail;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.core.INbtWritable;
|
||||
|
||||
@@ -18,6 +16,5 @@ public interface IMailAddress extends INbtWritable {
|
||||
|
||||
boolean isValid();
|
||||
|
||||
@Nullable
|
||||
GameProfile getPlayerProfile();
|
||||
}
|
||||
Reference in new issue
Block a user