mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-28 15:36:18 +00:00
Clean Up API
This commit is contained in:
1 parent
c00fa15f0e
commit
533c9d0b2a
11 files changed
+37
-39
No files matched your search
@@ -64,7 +64,7 @@ public interface IFarmLogic {
|
||||
}
|
||||
|
||||
/**
|
||||
* Use {@link IFarmRegistry#getFarm(String)} to get the soil container for the farm logic and register the soil
|
||||
* Use {@link IFarmRegistry#getProperties(String)} to get the {@link IFarmProperties} for the farm logic and register the soil
|
||||
* with {@link IFarmProperties#registerSoil(ItemStack, IBlockState, boolean)}.
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -78,7 +78,6 @@ public interface IFarmLogic {
|
||||
String getName();
|
||||
|
||||
/* GUI ONLY */
|
||||
|
||||
/**
|
||||
* @deprecated No longer needed because mc always uses the same map for blocks and items.
|
||||
* TODO remove this method in 1.13
|
||||
|
||||
@@ -10,23 +10,39 @@ import net.minecraft.item.ItemStack;
|
||||
*/
|
||||
public interface IFarmProperties {
|
||||
|
||||
/**
|
||||
* Can be used to register a {@link IBlockState} as a valid soil.
|
||||
*/
|
||||
default void registerSoil(ItemStack resource, IBlockState soilState){
|
||||
registerSoil(resource, soilState, false);
|
||||
}
|
||||
|
||||
void registerFarmables(String identifier);
|
||||
|
||||
/**
|
||||
* Can be used to register a {@link IBlockState} as a valid soil.
|
||||
*/
|
||||
void registerSoil(ItemStack resource, IBlockState soilState, boolean hasMetaData);
|
||||
|
||||
/**
|
||||
* Adds the {@link IFarmable}s that where registered with the given identifier.
|
||||
*/
|
||||
void registerFarmables(String identifier);
|
||||
|
||||
/**
|
||||
* @return true if the given block state is a valid soil state.
|
||||
*/
|
||||
boolean isAcceptedSoil(IBlockState blockState);
|
||||
|
||||
/**
|
||||
* @return true if the given stack is the {@link ItemStack} of a soil.
|
||||
*/
|
||||
boolean isAcceptedResource(ItemStack itemStack);
|
||||
|
||||
String getIdentifier();
|
||||
|
||||
Collection<ISoil> getSoils();
|
||||
|
||||
Collection<IFarmable> getFarmables();
|
||||
|
||||
/**
|
||||
* Returns the instance of the manual or managed {@link IFarmLogic}.
|
||||
*/
|
||||
IFarmLogic getLogic(boolean manuel);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public interface IFarmRegistry {
|
||||
* @param logic corresponding instance of logic
|
||||
*
|
||||
* @deprecated Since Forestry 5.8. Use {@link #registerLogic(String, BiFunction, String...)} or
|
||||
* {@link #registerLogic(IFarmProperties)}.
|
||||
* {@link #registerLogic(String, IFarmProperties)}.
|
||||
*/
|
||||
@Deprecated
|
||||
void registerLogic(String identifier, IFarmLogic logic);
|
||||
@@ -28,7 +28,7 @@ public interface IFarmRegistry {
|
||||
* Registers farming logic in registry
|
||||
* @since Forestry 5.8
|
||||
*/
|
||||
IFarmProperties registerLogic(IFarmProperties farmInstance);
|
||||
IFarmProperties registerLogic(String identifier, IFarmProperties farmInstance);
|
||||
|
||||
/**
|
||||
* Registers farming logic in registry under given identifier
|
||||
@@ -91,13 +91,9 @@ public interface IFarmRegistry {
|
||||
IFarmLogic createCropLogic(IFarmProperties instance, boolean isManual, ISimpleFarmLogic simpleFarmLogic);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param identifier
|
||||
* @return
|
||||
*
|
||||
* @since Forestry 5.8
|
||||
*/
|
||||
@Nullable
|
||||
IFarmProperties getFarm(String identifier);
|
||||
IFarmProperties getProperties(String identifier);
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user