Altar now accepts Chisel variants of given blocks
Will require a re-setup of the workspace (`gradlew [eclipse|idea]`) in order to download the Chisel API. This launches just fine without Chisel installed.
This commit is contained in:
parent
83b26eb033
commit
a91d350037
|
@ -43,6 +43,10 @@ repositories {
|
|||
maven {
|
||||
name 'TehNut Repo'
|
||||
url 'http://tehnut.info/maven/'
|
||||
}
|
||||
maven {
|
||||
name 'tterrag Repo'
|
||||
url 'http://maven.tterrag.com/'
|
||||
}
|
||||
ivy {
|
||||
name "MineTweaker3"
|
||||
|
@ -57,6 +61,7 @@ dependencies {
|
|||
compile name: 'MineTweaker3', version: config.minetweaker_version, ext: 'jar'
|
||||
compile "codechicken:ForgeMultipart:1.7.10-1.1.0.314:dev"
|
||||
compile "info.amerifrance.guideapi:Guide-API:" + config.mc_version + "-" + config.guideapi_version + ":deobf"
|
||||
compile "team.chisel:Chisel:" + config.chisel_version + ":api"
|
||||
}
|
||||
|
||||
minecraft {
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
#
|
||||
#Wed Aug 12 17:14:26 EDT 2015
|
||||
#Tue Oct 06 22:55:47 PDT 2015
|
||||
mod_name=BloodMagic
|
||||
forge_version=10.13.4.1492-1.7.10
|
||||
ccc_version=1.0.7.47
|
||||
cclib_version=1.1.3.138
|
||||
nei_version=1.0.5.111
|
||||
//=Dependency Information
|
||||
guideapi_version=1.0.1-20
|
||||
package_group=com.wayoftime.bloodmagic
|
||||
guideapi_version=1.0.1-20
|
||||
mod_version=1.3.3
|
||||
minetweaker_version=Dev-1.7.10-3.0.9B
|
||||
build_number=14
|
||||
chisel_version=2.9.2.8
|
||||
mc_version=1.7.10
|
||||
build_number=15
|
||||
|
|
|
@ -424,6 +424,7 @@ public class AlchemicalWizardry
|
|||
public static boolean isThaumcraftLoaded;
|
||||
public static boolean isForestryLoaded;
|
||||
public static boolean isBotaniaLoaded;
|
||||
public static boolean isChiselLoaded;
|
||||
public static boolean isFMPLoaded;
|
||||
public static boolean isPneumaticCraftLoaded;
|
||||
|
||||
|
@ -1262,6 +1263,7 @@ public class AlchemicalWizardry
|
|||
isBotaniaLoaded = Loader.isModLoaded("Botania");
|
||||
isPneumaticCraftLoaded = Loader.isModLoaded("PneumaticCraft");
|
||||
isFMPLoaded = Loader.isModLoaded("ForgeMultipart");
|
||||
isChiselLoaded = Loader.isModLoaded("chisel");
|
||||
|
||||
BloodMagicConfiguration.loadBlacklist();
|
||||
BloodMagicConfiguration.blacklistRituals();
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.BlockStack;
|
||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
||||
import com.google.common.base.Strings;
|
||||
|
||||
public class CompatChecks {
|
||||
|
||||
public static boolean checkChiselBlock(BlockStack blockStack, String groupName) {
|
||||
if (blockStack.getBlock() == null)
|
||||
return false;
|
||||
|
||||
ICarvingGroup group = CarvingUtils.getChiselRegistry().getGroup(blockStack.getBlock(), blockStack.getMeta());
|
||||
if (group != null) {
|
||||
String check = CarvingUtils.getChiselRegistry().getGroup(blockStack.getBlock(), blockStack.getMeta()).getName();
|
||||
|
||||
if (Strings.isNullOrEmpty(check))
|
||||
return false;
|
||||
|
||||
return check.equals(groupName);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -3,6 +3,8 @@ package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.BlockStack;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBeacon;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
@ -46,10 +48,12 @@ public class UpgradedAltars
|
|||
if (ac.isBloodRune())
|
||||
{
|
||||
Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
int testMeta = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
|
||||
if (!(testBlock instanceof BloodRune))
|
||||
{
|
||||
return false;
|
||||
if (!checkRuneSpecials(ac, new BlockStack(testBlock, testMeta)))
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
@ -58,7 +62,8 @@ public class UpgradedAltars
|
|||
|
||||
if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ())))
|
||||
{
|
||||
return false;
|
||||
if (!checkSpecials(ac, new BlockStack(block, metadata)))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,10 +76,12 @@ public class UpgradedAltars
|
|||
if (ac.isBloodRune())
|
||||
{
|
||||
Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
int testMeta = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
|
||||
if (!(testBlock instanceof BloodRune))
|
||||
{
|
||||
return false;
|
||||
if (!checkRuneSpecials(ac, new BlockStack(testBlock, testMeta)))
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
@ -83,7 +90,8 @@ public class UpgradedAltars
|
|||
|
||||
if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ())))
|
||||
{
|
||||
return false;
|
||||
if (!checkSpecials(ac, new BlockStack(block, metadata)))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -96,10 +104,12 @@ public class UpgradedAltars
|
|||
if (ac.isBloodRune())
|
||||
{
|
||||
Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
int testMeta = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
|
||||
if (!(testBlock instanceof BloodRune))
|
||||
{
|
||||
return false;
|
||||
if (!checkRuneSpecials(ac, new BlockStack(testBlock, testMeta)))
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
@ -108,7 +118,8 @@ public class UpgradedAltars
|
|||
|
||||
if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ())))
|
||||
{
|
||||
return false;
|
||||
if (!checkSpecials(ac, new BlockStack(block, metadata)))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -121,10 +132,12 @@ public class UpgradedAltars
|
|||
if (ac.isBloodRune())
|
||||
{
|
||||
Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
int testMeta = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
|
||||
if (!(testBlock instanceof BloodRune))
|
||||
{
|
||||
return false;
|
||||
if (!checkRuneSpecials(ac, new BlockStack(testBlock, testMeta)))
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
Block block = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
|
@ -132,7 +145,7 @@ public class UpgradedAltars
|
|||
|
||||
if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ())))
|
||||
{
|
||||
if (!(ac.getBlock() == Blocks.beacon && block instanceof BlockBeacon))
|
||||
if (!checkSpecials(ac, new BlockStack(block, metadata)))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -146,10 +159,12 @@ public class UpgradedAltars
|
|||
if (ac.isBloodRune())
|
||||
{
|
||||
Block testBlock = world.getBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
int testMeta = world.getBlockMetadata(x + ac.getX(), y + ac.getY(), z + ac.getZ());
|
||||
|
||||
if (!(testBlock instanceof BloodRune))
|
||||
{
|
||||
return false;
|
||||
if (!checkRuneSpecials(ac, new BlockStack(testBlock, testMeta)))
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
@ -158,7 +173,8 @@ public class UpgradedAltars
|
|||
|
||||
if (((ac.getBlock() != block) || (ac.getMetadata() != metadata)) && !(ac.getBlock() == Blocks.stonebrick && !world.isAirBlock(x + ac.getX(), y + ac.getY(), z + ac.getZ())))
|
||||
{
|
||||
return false;
|
||||
if (!checkSpecials(ac, new BlockStack(block, metadata)))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -339,6 +355,31 @@ public class UpgradedAltars
|
|||
}
|
||||
}
|
||||
|
||||
private static boolean checkRuneSpecials(AltarComponent altarComponent, BlockStack blockStack) {
|
||||
if (AlchemicalWizardry.isChiselLoaded) {
|
||||
if (altarComponent.getBlock() == ModBlocks.bloodRune && CompatChecks.checkChiselBlock(blockStack, "bloodRune"))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean checkSpecials(AltarComponent altarComponent, BlockStack blockStack) {
|
||||
|
||||
if (AlchemicalWizardry.isChiselLoaded) {
|
||||
if (altarComponent.getBlock() == Blocks.glowstone && CompatChecks.checkChiselBlock(blockStack, "glowstone"))
|
||||
return true;
|
||||
|
||||
if (altarComponent.getBlock() == ModBlocks.largeBloodStoneBrick && CompatChecks.checkChiselBlock(blockStack, "bloodBrick"))
|
||||
return true;
|
||||
}
|
||||
|
||||
if (altarComponent.getBlock() == Blocks.beacon && blockStack.getBlock() instanceof BlockBeacon)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static List<AltarComponent> getAltarUpgradeListForTier(int tier)
|
||||
{
|
||||
switch (tier)
|
||||
|
|
Loading…
Reference in a new issue