aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
diff options
context:
space:
mode:
authorMartin Robertz <dream-master@gmx.net>2021-12-15 16:11:54 +0100
committerGitHub <noreply@github.com>2021-12-15 16:11:54 +0100
commit128c74faa99dfef8d056c1d82c6e4388b9d470e8 (patch)
tree2c84162154ba681232f86dffd4106db530236814 /src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
parent47ce336f288a45aa3244c8ae1177499fa5080942 (diff)
parentff4b8c7068c2ea7d654e9beda00646d23e62b314 (diff)
downloadGT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.tar.gz
GT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.tar.bz2
GT5-Unofficial-128c74faa99dfef8d056c1d82c6e4388b9d470e8.zip
Merge pull request #65 from GTNewHorizons/unified-build-script2
Move sources and resources
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java')
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java b/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
new file mode 100644
index 0000000000..05d00b06d9
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
@@ -0,0 +1,61 @@
+package gtPlusPlus.xmod.forestry;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import cpw.mods.fml.common.Optional;
+
+import net.minecraft.block.Block;
+import net.minecraft.world.World;
+
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.xmod.forestry.bees.items.FR_ItemRegistry;
+import gtPlusPlus.xmod.forestry.bees.recipe.FR_Gregtech_Recipes;
+
+public class HANDLER_FR {
+
+ public static void preInit(){
+ if (LoadedMods.Forestry){
+ FR_ItemRegistry.Register();
+ }
+ }
+
+ public static void Init(){
+ if (LoadedMods.Forestry){
+ //new GTPP_Bees(); TODO- Will Investigate this properly later.
+ }
+ }
+
+ public static void postInit(){
+ if (LoadedMods.Forestry){
+ FR_Gregtech_Recipes.registerItems();
+ }
+ }
+
+ public static boolean createBlockBreakParticles(final World world, final int x, final int y, final int z, final Block block){
+ if (LoadedMods.Forestry){
+ createBlockBreakParticles_INTERNAL(world, x, y, z, block);
+ }
+ return false;
+ }
+
+ @Optional.Method(modid = "Forestry")
+ private static void createBlockBreakParticles_INTERNAL(final World world, final int x, final int y, final int z, final Block block){
+ if (LoadedMods.Forestry){
+ Class oClass;
+ try {
+ oClass = ReflectionUtils.getClass("forestry.core.proxy.ProxyCommon");
+ Object oProxy = ReflectionUtils.getField(oClass, "common");
+ if (oProxy != null && oClass.isInstance(oProxy)){
+ Method mParticles = ReflectionUtils.getMethod(oClass, "addBlockDestroyEffects", World.class, int.class, int.class, int.class, Block.class, int.class);
+ mParticles.invoke(oProxy, world, x, y, z, block, 0);
+ }
+ }
+ catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ }
+ }
+ }
+
+
+}