-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Agricraft; make bloomery furnace automation-friendly
- Loading branch information
Showing
3 changed files
with
19 additions
and
26 deletions.
There are no files selected for viewing
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
33 changes: 11 additions & 22 deletions
33
src/com/jaquadro/minecraft/gardencommon/integration/mods/AgriCraft.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 |
---|---|---|
@@ -1,41 +1,30 @@ | ||
package com.jaquadro.minecraft.gardencommon.integration.mods; | ||
|
||
import com.InfinityRaider.AgriCraft.api.API; | ||
import com.InfinityRaider.AgriCraft.api.APIBase; | ||
import com.InfinityRaider.AgriCraft.api.APIStatus; | ||
import com.InfinityRaider.AgriCraft.api.v1.APIv1; | ||
import com.InfinityRaider.AgriCraft.api.v1.BlockWithMeta; | ||
import com.jaquadro.minecraft.gardencommon.integration.IntegrationModule; | ||
import com.jaquadro.minecraft.gardencore.core.ModBlocks; | ||
import net.minecraft.block.Block; | ||
|
||
import java.lang.reflect.Constructor; | ||
import java.lang.reflect.Field; | ||
import java.util.Set; | ||
|
||
public class AgriCraft extends IntegrationModule | ||
{ | ||
static Class classGrowthRequirements; | ||
static Class classBlockWithMeta; | ||
|
||
static Constructor constBlockWithMeta; | ||
|
||
static Field fieldDefaultSoils; | ||
|
||
@Override | ||
public String getModID () { | ||
return "AgriCraft"; | ||
} | ||
|
||
@Override | ||
public void init () throws Throwable { | ||
classGrowthRequirements = Class.forName("com.InfinityRaider.AgriCraft.farming.GrowthRequirements"); | ||
classBlockWithMeta = Class.forName("com.InfinityRaider.AgriCraft.utility.BlockWithMeta"); | ||
APIBase api = API.getAPI(1); | ||
if (api.getStatus() == APIStatus.OK && api.getVersion() == 1) { | ||
APIv1 agricraft = (APIv1)api; | ||
|
||
constBlockWithMeta = classBlockWithMeta.getConstructor(Block.class, int.class); | ||
|
||
fieldDefaultSoils = classGrowthRequirements.getField("defaultSoils"); | ||
agricraft.registerDefaultSoil(new BlockWithMeta(ModBlocks.gardenFarmland)); | ||
} | ||
} | ||
|
||
@Override | ||
public void postInit () throws Throwable { | ||
Set defaultSoils = (Set) fieldDefaultSoils.get(null); | ||
|
||
defaultSoils.add(constBlockWithMeta.newInstance(ModBlocks.gardenFarmland, 0)); | ||
} | ||
public void postInit () throws Throwable { } | ||
} |
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