Skip to content

Commit

Permalink
implement ActAdd API version check and push version to 0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
XDjackieXD committed Oct 31, 2016
1 parent deb4f04 commit e980cfb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apply plugin: 'idea'
apply plugin: 'net.minecraftforge.gradle.forge'


version = "0.9.1-MC1.10.2"
version = "0.9.2-MC1.10.2"
group = "at.chaosfield.openradio"
archivesBaseName = "OpenRadio"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
public class Init{
public static boolean isActAddLoaded = Loader.isModLoaded("actuallyadditions");
public static int minActAddVersion = 25;
public static String[] actAddLaserRelayEnergy = {"actuallyadditions:blockLaserRelay", "actuallyadditions:blockLaserRelayAdvanced", "actuallyadditions:blockLaserRelayExtreme"};
public static String[] actAddLaserRelayItem = {"actuallyadditions:blockLaserRelayItem", "actuallyadditions:blockLaserRelayItemWhitelist"};
public static String[] actAddLaserRelayFluid = {"actuallyadditions:blockLaserRelayFluids"};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import at.chaosfield.openradio.OpenRadio;
import at.chaosfield.openradio.init.Items;
import at.chaosfield.openradio.integration.Init;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
Expand All @@ -11,11 +12,12 @@
*/
public class BookletEntry{
public static void init(){
ActuallyAdditionsAPI.methodHandler.generateBookletChapter(
"openradio.laserrelay",
ActuallyAdditionsAPI.entryMisc,
new ItemStack(Items.laserItem),
ActuallyAdditionsAPI.methodHandler.generatePicturePage(1, new ResourceLocation(OpenRadio.MODID, "textures/gui/actAddPageLaserRelay.png"), 118).addTextReplacement("<laserMaxDistance>", (int)((OpenRadio.instance.settings.LensMultiplierTier[2] + 1) * 2 * OpenRadio.instance.settings.LaserMaxDistanceTier[2]))
);
if(Integer.parseInt(ActuallyAdditionsAPI.API_VERSION) >= Init.minActAddVersion)
ActuallyAdditionsAPI.methodHandler.generateBookletChapter(
"openradio.laserrelay",
ActuallyAdditionsAPI.entryMisc,
new ItemStack(Items.laserItem),
ActuallyAdditionsAPI.methodHandler.generatePicturePage(1, new ResourceLocation(OpenRadio.MODID, "textures/gui/actAddPageLaserRelay.png"), 118).addTextReplacement("<laserMaxDistance>", (int)((OpenRadio.instance.settings.LensMultiplierTier[2] + 1) * 2 * OpenRadio.instance.settings.LaserMaxDistanceTier[2]))
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import at.chaosfield.openradio.integration.actuallyAdditions.LaserRelay;
import at.chaosfield.openradio.interfaces.ILaserAddon;
import at.chaosfield.openradio.util.Location;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
import li.cil.oc.api.API;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
Expand Down Expand Up @@ -399,16 +400,20 @@ private ILaserAddon getAddon(TileEntity tile, EnumFacing side){
return (ILaserAddon) tile;

if(tile != null && Init.isActAddLoaded && side == EnumFacing.UP){
String tileName = tile.getBlockType().getRegistryName().toString();

for(String name: Init.actAddLaserRelayEnergy)
if(name.equals(tileName))
return new LaserRelay(tile);
for(String name: Init.actAddLaserRelayItem)
if(name.equals(tileName))
return new LaserRelay(tile);
if(Integer.parseInt(ActuallyAdditionsAPI.API_VERSION) >= Init.minActAddVersion){
String tileName = tile.getBlockType().getRegistryName().toString();

for(String name : Init.actAddLaserRelayEnergy)
if(name.equals(tileName))
return new LaserRelay(tile);
for(String name : Init.actAddLaserRelayItem)
if(name.equals(tileName))
return new LaserRelay(tile);
for(String name : Init.actAddLaserRelayFluid)
if(name.equals(tileName))
return new LaserRelay(tile);
}
}

return null;
}

Expand Down

0 comments on commit e980cfb

Please sign in to comment.