-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fertilizer compat with EnderIO and Immersive Engineering (#1764)
- Loading branch information
1 parent
6d2ed6f
commit 5abb7b3
Showing
6 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/api/java/blusunrize/immersiveengineering/api/tool/BelljarHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package blusunrize.immersiveengineering.api.tool; | ||
|
||
import net.minecraft.item.ItemStack; | ||
|
||
/** | ||
* Adapted and minimized from <a href="https://github.com/BluSunrize/ImmersiveEngineering/blob/master/src/main/java/blusunrize/immersiveengineering/api/tool/BelljarHandler.java">BelljarHandler.java</a> | ||
*/ | ||
public final class BelljarHandler { | ||
|
||
private BelljarHandler() {/**/} | ||
|
||
public static void registerBasicItemFertilizer(@SuppressWarnings("unused") final ItemStack stack, | ||
@SuppressWarnings("unused") final float growthMultiplier) {/**/} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package crazypants.enderio.api.farm; | ||
|
||
import net.minecraftforge.registries.IForgeRegistryEntry; | ||
|
||
/** | ||
* Adapted and minimized from <a href="https://github.com/SleepyTrousers/EnderIO/blob/master/enderio-base/src/main/java/crazypants/enderio/api/farm/IFertilizer.java">IFertilizer.java</a> | ||
*/ | ||
public interface IFertilizer extends IForgeRegistryEntry<IFertilizer> { | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
src/api/java/crazypants/enderio/base/farming/fertilizer/Bonemeal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package crazypants.enderio.base.farming.fertilizer; | ||
|
||
import crazypants.enderio.api.farm.IFertilizer; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.registries.IForgeRegistryEntry; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
/** | ||
* Adapted and minimized from <a href="https://github.com/SleepyTrousers/EnderIO/blob/master/enderio-base/src/main/java/crazypants/enderio/base/farming/fertilizer/Bonemeal.java">Bonemeal.java</a> | ||
*/ | ||
public class Bonemeal extends IForgeRegistryEntry.Impl<IFertilizer> implements IFertilizer { | ||
|
||
public Bonemeal(@SuppressWarnings("unused") @Nonnull ItemStack stack) {/**/} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package gregtech.integration; | ||
|
||
import blusunrize.immersiveengineering.api.tool.BelljarHandler; | ||
import crazypants.enderio.api.farm.IFertilizer; | ||
import crazypants.enderio.base.farming.fertilizer.Bonemeal; | ||
import gregtech.api.GTValues; | ||
import gregtech.api.modules.GregTechModule; | ||
import gregtech.common.items.MetaItems; | ||
import gregtech.modules.BaseGregTechModule; | ||
import gregtech.modules.GregTechModules; | ||
import net.minecraftforge.event.RegistryEvent; | ||
import net.minecraftforge.fml.common.Loader; | ||
import net.minecraftforge.fml.common.Optional; | ||
import net.minecraftforge.fml.common.event.FMLInitializationEvent; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
import javax.annotation.Nonnull; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
@GregTechModule( | ||
moduleID = GregTechModules.MODULE_INTEGRATION, | ||
containerID = GTValues.MODID, | ||
name = "GregTech Mod Integration", | ||
descriptionKey = "gregtech.modules.integration.description" | ||
) | ||
public class IntegrationModule extends BaseGregTechModule { | ||
|
||
public static final Logger logger = LogManager.getLogger("GregTech Mod Integration"); | ||
|
||
@Nonnull | ||
@Override | ||
public Logger getLogger() { | ||
return logger; | ||
} | ||
@Nonnull | ||
@Override | ||
public List<Class<?>> getEventBusSubscribers() { | ||
return Collections.singletonList(IntegrationModule.class); | ||
} | ||
|
||
@Override | ||
public void init(FMLInitializationEvent event) { | ||
super.init(event); | ||
|
||
if (Loader.isModLoaded(GTValues.MODID_IE)) { | ||
BelljarHandler.registerBasicItemFertilizer(MetaItems.FERTILIZER.getStackForm(), 1.25f); | ||
logger.info("Registered Immersive Engineering Compat"); | ||
} | ||
} | ||
|
||
@Optional.Method(modid = GTValues.MODID_EIO) | ||
@SubscribeEvent | ||
public static void registerFertilizer(@Nonnull RegistryEvent.Register<IFertilizer> event) { | ||
event.getRegistry().register(new Bonemeal(MetaItems.FERTILIZER.getStackForm())); | ||
logger.info("Registered EnderIO Compat"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters