Compare commits

..
4 Commits
18 changed files with 853 additions and 375 deletions

No files matched your search

+8 -8
View File
@@ -23,16 +23,16 @@
*/
dependencies {
api("com.github.GTNewHorizons:waila:1.8.13:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.87-GTNH:dev")
api("com.github.GTNewHorizons:waila:1.8.10:dev")
api("com.github.GTNewHorizons:NotEnoughItems:2.7.59-GTNH:dev")
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.457:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.51.362:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Botania:1.12.25-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForestryMC:4.10.17:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.6.8:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Botania:1.12.12-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForestryMC:4.10.13:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.6.6:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Chisel:2.16.13-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:Chisel:2.16.5-GTNH:api") {transitive = false }
compileOnly("com.github.GTNewHorizons:ZenScript:1.0.0-GTNH") {transitive = false }
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.2:dev") {transitive = false }
@@ -40,5 +40,5 @@ dependencies {
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false }
compileOnly("curse.maven:guide-api-228832:2287185") {transitive = false }
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.23:dev")
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.12:dev")
}
+1 -1
View File
@@ -151,7 +151,7 @@ modrinthProjectId =
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.42'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.38'
}
@@ -496,18 +496,12 @@ public class AlchemicalWizardry {
public static boolean disableBoundToolsRightClick;
public static boolean allowPotionRepair;
public static List<BlockStack> secondTierRunes;
public static List<BlockStack> thirdTierRunes;
public static List<BlockStack> fourthTierRunes;
public static List<BlockStack> fifthTierRunes;
public static List<BlockStack> sixthTierRunes;
public static List<BlockStack> fifthTierBeacons;
public static List<BlockStack> thirdTierCaps;
public static List<BlockStack> thirdTierPillars;
public static List<BlockStack> fourthTierCaps;
public static List<BlockStack> fourthTierPillars;
public static List<BlockStack> sixthTierCaps;
public static List<BlockStack> sixthTierPillars;
public static BlockStack[] secondTierRunes = new BlockStack[10];
public static BlockStack[] thirdTierRunes = new BlockStack[10];
public static BlockStack[] fourthTierRunes = new BlockStack[10];
public static BlockStack[] fifthTierRunes = new BlockStack[10];
public static BlockStack[] sixthTierRunes = new BlockStack[10];
public static BlockStack[] specialAltarBlock = new BlockStack[7];
public static int lpPerSelfSacrifice = 200;
public static int lpPerSelfSacrificeSoulFray = 20;
@@ -1437,42 +1431,39 @@ public class AlchemicalWizardry {
emptyBucketStack,
'l',
new ItemStack(Items.leather_chestplate));
customPotionDrowning = (new PotionDrowning(customPotionDrowningID, true, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.drowning");
customPotionBoost = (new PotionBoost(customPotionBoostID, false, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.boost");
.setPotionName("Drowning");
customPotionBoost = (new PotionBoost(customPotionBoostID, false, 0)).setIconIndex(0, 0).setPotionName("Boost");
customPotionProjProt = (new PotionProjectileProtect(customPotionProjProtID, false, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.whirlwind");
.setPotionName("Whirlwind");
customPotionInhibit = (new PotionInhibit(customPotionInhibitID, false, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.inhibit");
.setPotionName("Inhibit");
customPotionFlight = (new PotionFlight(customPotionFlightID, false, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.flight");
.setPotionName("Flight");
customPotionReciprocation = (new PotionReciprocation(customPotionReciprocationID, false, 0xFFFFFF))
.setIconIndex(0, 0).setPotionName("bm.buff.reciprocation");
customPotionFlameCloak = (new PotionFlameCloak(customPotionFlameCloakID, false, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.flame_cloak");
customPotionIceCloak = (new PotionIceCloak(customPotionIceCloakID, false, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.ice_cloak");
customPotionHeavyHeart = (new PotionHeavyHeart(customPotionHeavyHeartID, true, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.heavy_heart");
customPotionFireFuse = (new PotionFireFuse(customPotionFireFuseID, true, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.fire_fuse");
customPotionPlanarBinding = (new PotionPlanarBinding(customPotionPlanarBindingID, true, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.planar_binding");
customPotionSoulFray = (new PotionSoulFray(customPotionSoulFrayID, true, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.soul_fray");
.setIconIndex(0, 0).setPotionName("Reciprocation");
customPotionFlameCloak = (new PotionFlameCloak(customPotionFlameCloakID, false, 0).setIconIndex(0, 0)
.setPotionName("Flame Cloak"));
customPotionIceCloak = (new PotionIceCloak(customPotionIceCloakID, false, 0).setIconIndex(0, 0)
.setPotionName("Ice Cloak"));
customPotionHeavyHeart = (new PotionHeavyHeart(customPotionHeavyHeartID, true, 0).setIconIndex(0, 0)
.setPotionName("Heavy Heart"));
customPotionFireFuse = (new PotionFireFuse(customPotionFireFuseID, true, 0).setIconIndex(0, 0)
.setPotionName("Fire Fuse"));
customPotionPlanarBinding = (new PotionPlanarBinding(customPotionPlanarBindingID, true, 0).setIconIndex(0, 0)
.setPotionName("Planar Binding"));
customPotionSoulFray = (new PotionSoulFray(customPotionSoulFrayID, true, 0).setIconIndex(0, 0)
.setPotionName("Soul Fray"));
PlayerSacrificeHandler.soulFrayId = customPotionSoulFray;
customPotionSoulHarden = (new PotionSoulHarden(customPotionSoulHardenID, false, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.soul_harden");
customPotionDeaf = (new PotionDeaf(customPotionDeafID, true, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.deafness");
customPotionFeatherFall = (new PotionFeatherFall(customPotionFeatherFallID, false, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.feather_fall");
customPotionDemonCloak = (new PotionDemonCloak(customPotionDemonCloakID, false, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.demon_cloak");
customPotionAmphibian = (new PotionAmphibian(customPotionAmphibianID, false, 0)).setIconIndex(0, 0)
.setPotionName("bm.buff.amphibian");
customPotionSoulHarden = (new PotionSoulHarden(customPotionSoulHardenID, false, 0).setIconIndex(0, 0)
.setPotionName("Soul Harden"));
customPotionDeaf = (new PotionDeaf(customPotionDeafID, true, 0).setIconIndex(0, 0).setPotionName("Deafness"));
customPotionFeatherFall = (new PotionFeatherFall(customPotionFeatherFallID, false, 0).setIconIndex(0, 0)
.setPotionName("Feather Fall"));
customPotionDemonCloak = (new PotionDemonCloak(customPotionDemonCloakID, false, 0).setIconIndex(0, 0)
.setPotionName("Demon Cloaking"));
customPotionAmphibian = (new PotionAmphibian(customPotionAmphibianID, false, 0).setIconIndex(0, 0)
.setPotionName("Amphibian"));
ItemStack masterBloodOrbStack = new ItemStack(ModItems.masterBloodOrb);
ItemStack transcendentBloodOrbStack = new ItemStack(ModItems.transcendentBloodOrb);
@@ -16,6 +16,7 @@ import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.init.Blocks;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.oredict.OreDictionary;
@@ -623,63 +624,66 @@ public class BloodMagicConfiguration {
}
public static void finishLoading() {
String[] defaultRunes = { "AWWayofTime:AlchemicalWizardrybloodRune", "AWWayofTime:speedRune",
"AWWayofTime:efficiencyRune", "AWWayofTime:runeOfSacrifice", "AWWayofTime:runeOfSelfSacrifice",
"AWWayofTime:AlchemicalWizardrybloodRune:1", "AWWayofTime:AlchemicalWizardrybloodRune:2",
"AWWayofTime:AlchemicalWizardrybloodRune:3", "AWWayofTime:AlchemicalWizardrybloodRune:4",
"AWWayofTime:AlchemicalWizardrybloodRune:5", "AWWayofTime:AlchemicalWizardrybloodRune:6" };
AlchemicalWizardry.secondTierRunes = readRuneOverrides("secondTier", defaultRunes);
AlchemicalWizardry.thirdTierRunes = readRuneOverrides("thirdTier", defaultRunes);
AlchemicalWizardry.fourthTierRunes = readRuneOverrides("fourthTier", defaultRunes);
AlchemicalWizardry.fifthTierRunes = readRuneOverrides("fifthTier", defaultRunes);
AlchemicalWizardry.sixthTierRunes = readRuneOverrides("sixthTier", defaultRunes);
AlchemicalWizardry.fifthTierBeacons = readBlockConfig(
"altar blocks",
"fifthTierBeacons",
new String[] { "minecraft:beacon", "etfuturum:beacon", "chisel:beacon:*" },
"Valid blocks for the Blood Altar's tier 5 beacons:\n"
+ "Use the following format for all of these entries: mod:block(:meta). Meta * or 32767 allows for any meta.\n"
+ "An empty entry allows for any non-air block to be used for that part of the structure.\n"
+ "Invalid or missing blocks are skipped. If all entries are invalid, any block can be used as a fallback.");
AlchemicalWizardry.thirdTierCaps = readBlockConfig(
"altar blocks",
"thirdTierCaps",
new String[] { "minecraft:glowstone", "BloodArsenal:blood_infused_glowstone", "Botania:seaLamp",
"chisel:glowstone:*", "etfuturum:sea_lantern", "etfuturum:shroomlight",
"ExtraUtilities:color_lightgem:*" },
"Valid blocks for the Blood Altar's tier 3 caps:");
AlchemicalWizardry.thirdTierPillars = readBlockConfig(
"altar blocks",
"thirdTierPillars",
new String[] {},
"Valid blocks for the Blood Altar's tier 3 pillars:");
AlchemicalWizardry.fourthTierCaps = readBlockConfig(
"altar blocks",
"fourthTierCaps",
new String[] { "AWWayofTime:largeBloodStoneBrick" },
"Valid blocks for the Blood Altar's tier 4 caps:");
AlchemicalWizardry.fourthTierPillars = readBlockConfig(
"altar blocks",
"fourthTierPillars",
new String[] {},
"Valid blocks for the Blood Altar's tier 4 pillars.");
AlchemicalWizardry.sixthTierCaps = readBlockConfig(
"altar blocks",
"sixthTierCaps",
new String[] { "AWWayofTime:blockCrystal" },
"Valid blocks for the Blood Altar's tier 6 caps:");
AlchemicalWizardry.sixthTierPillars = readBlockConfig(
"altar blocks",
"sixthTierPillars",
new String[] {},
"Valid blocks for the Blood Altar's tier 6 pillars:");
AlchemicalWizardry.secondTierRunes = BloodMagicConfiguration.getAltarRunesForTier(
"secondTier",
new BlockStack[] { new BlockStack(ModBlocks.bloodRune, 0), new BlockStack(ModBlocks.speedRune, 0),
new BlockStack(ModBlocks.efficiencyRune, 0), new BlockStack(ModBlocks.runeOfSacrifice, 0),
new BlockStack(ModBlocks.runeOfSelfSacrifice, 0), new BlockStack(ModBlocks.bloodRune, 1),
new BlockStack(ModBlocks.bloodRune, 2), new BlockStack(ModBlocks.bloodRune, 3),
new BlockStack(ModBlocks.bloodRune, 4), new BlockStack(ModBlocks.bloodRune, 5),
new BlockStack(ModBlocks.bloodRune, 6) });
AlchemicalWizardry.thirdTierRunes = BloodMagicConfiguration.getAltarRunesForTier(
"thirdTier",
new BlockStack[] { new BlockStack(ModBlocks.bloodRune, 0), new BlockStack(ModBlocks.speedRune, 0),
new BlockStack(ModBlocks.efficiencyRune, 0), new BlockStack(ModBlocks.runeOfSacrifice, 0),
new BlockStack(ModBlocks.runeOfSelfSacrifice, 0), new BlockStack(ModBlocks.bloodRune, 1),
new BlockStack(ModBlocks.bloodRune, 2), new BlockStack(ModBlocks.bloodRune, 3),
new BlockStack(ModBlocks.bloodRune, 4), new BlockStack(ModBlocks.bloodRune, 5),
new BlockStack(ModBlocks.bloodRune, 6) });
AlchemicalWizardry.fourthTierRunes = BloodMagicConfiguration.getAltarRunesForTier(
"fourthTier",
new BlockStack[] { new BlockStack(ModBlocks.bloodRune, 0), new BlockStack(ModBlocks.speedRune, 0),
new BlockStack(ModBlocks.efficiencyRune, 0), new BlockStack(ModBlocks.runeOfSacrifice, 0),
new BlockStack(ModBlocks.runeOfSelfSacrifice, 0), new BlockStack(ModBlocks.bloodRune, 1),
new BlockStack(ModBlocks.bloodRune, 2), new BlockStack(ModBlocks.bloodRune, 3),
new BlockStack(ModBlocks.bloodRune, 4), new BlockStack(ModBlocks.bloodRune, 5),
new BlockStack(ModBlocks.bloodRune, 6) });
AlchemicalWizardry.fifthTierRunes = BloodMagicConfiguration.getAltarRunesForTier(
"fifthTier",
new BlockStack[] { new BlockStack(ModBlocks.bloodRune, 0), new BlockStack(ModBlocks.speedRune, 0),
new BlockStack(ModBlocks.efficiencyRune, 0), new BlockStack(ModBlocks.runeOfSacrifice, 0),
new BlockStack(ModBlocks.runeOfSelfSacrifice, 0), new BlockStack(ModBlocks.bloodRune, 1),
new BlockStack(ModBlocks.bloodRune, 2), new BlockStack(ModBlocks.bloodRune, 3),
new BlockStack(ModBlocks.bloodRune, 4), new BlockStack(ModBlocks.bloodRune, 5),
new BlockStack(ModBlocks.bloodRune, 6) });
AlchemicalWizardry.sixthTierRunes = BloodMagicConfiguration.getAltarRunesForTier(
"sixthTier",
new BlockStack[] { new BlockStack(ModBlocks.bloodRune, 0), new BlockStack(ModBlocks.speedRune, 0),
new BlockStack(ModBlocks.efficiencyRune, 0), new BlockStack(ModBlocks.runeOfSacrifice, 0),
new BlockStack(ModBlocks.runeOfSelfSacrifice, 0), new BlockStack(ModBlocks.bloodRune, 1),
new BlockStack(ModBlocks.bloodRune, 2), new BlockStack(ModBlocks.bloodRune, 3),
new BlockStack(ModBlocks.bloodRune, 4), new BlockStack(ModBlocks.bloodRune, 5),
new BlockStack(ModBlocks.bloodRune, 6) });
AlchemicalWizardry.specialAltarBlock = getAltarRunesForTier(
"specialBlocks",
new BlockStack[] { new BlockStack(Blocks.air, 0), new BlockStack(Blocks.glowstone, 0),
new BlockStack(Blocks.air, 0), new BlockStack(ModBlocks.largeBloodStoneBrick, 0),
new BlockStack(Blocks.beacon, 0), new BlockStack(Blocks.air, 0),
new BlockStack(ModBlocks.blockCrystal, 0) },
"Set the special blocks for the altar with the format mod:block(:meta) in the following order:\n"
+ "Tier 3 pillar\n"
+ "Tier 3 cap\n"
+ "Tier 4 pillar\n"
+ "Tier 4 cap\n"
+ "Tier 5 beacon\n"
+ "Tier 6 pillar\n"
+ "Tier 6 cap\n"
+ "Set any of these to minecraft:air to allow for that component to be any block EXCEPT air (e.g., let any block be used for a pillar).");
config.save();
}
public static void loadCustomLPValues() {
AlchemicalWizardry.lpPerSactificeCustom = new HashMap<>();
AlchemicalWizardry.lpPerSactificeCustom = new HashMap<Class<?>, Integer>();
for (Object object : EntityList.stringToClassMapping.entrySet()) {
Entry entry = (Entry) object;
String entityName = (String) entry.getKey();
@@ -794,6 +798,7 @@ public class BloodMagicConfiguration {
// Check if it's an int, if so, parse it. If not, set meta to 0 to avoid crashing.
if (isInteger(blockData[2])) meta = Integer.parseInt(blockData[2]);
else if (blockData[2].equals("*")) meta = OreDictionary.WILDCARD_VALUE;
else meta = 0;
}
AlchemicalWizardryEventHooks.teleposerBlacklist.add(new BlockStack(block, meta));
@@ -803,43 +808,53 @@ public class BloodMagicConfiguration {
private static boolean isInteger(String s) {
try {
Integer.parseInt(s);
} catch (NumberFormatException | NullPointerException e) {
} catch (NumberFormatException e) {
return false;
} catch (NullPointerException e) {
return false;
}
// only got here if we didn't return false
return true;
}
private static List<BlockStack> readRuneOverrides(String key, String[] defaultValues) {
return readBlockConfig("rune overrides", key, defaultValues, "");
private static BlockStack[] getAltarRunesForTier(String tierName, BlockStack[] defaultValues) {
return getAltarRunesForTier(tierName, defaultValues, "");
}
private static List<BlockStack> readBlockConfig(String category, String key, String[] defaultValues,
String comment) {
Property property = config.get(category, key, defaultValues, comment);
List<BlockStack> validStacks = new ArrayList<>();
for (String name : property.getStringList()) {
String[] blockData = name.split(":");
if (blockData.length < 2 || blockData.length > 3) {
continue;
}
Block block = GameRegistry.findBlock(blockData[0], blockData[1]);
if (block == null) {
AlchemicalWizardry.logger.info("Block not found for {} {}: {}", category, key, name);
continue;
}
int meta = 0;
if (blockData.length == 3) {
if (isInteger(blockData[2])) meta = Integer.parseInt(blockData[2]);
else if (blockData[2].equals("*")) meta = OreDictionary.WILDCARD_VALUE;
}
validStacks.add(new BlockStack(block, meta));
private static BlockStack[] getAltarRunesForTier(String tierName, BlockStack[] defaultValues, String comment) {
String[] defaultNames = new String[defaultValues.length];
for (int i = 0; i < defaultValues.length; i++) {
defaultNames[i] = Block.blockRegistry.getNameForObject(defaultValues[i].getBlock()) + ":"
+ defaultValues[i].getMeta();
}
return validStacks;
Property property = config.get("rune overrides", tierName, defaultNames, comment);
String[] names = property.getStringList();
if (names.length != defaultNames.length) {
property.set(defaultNames);
return defaultValues;
}
BlockStack[] blockStacks = new BlockStack[names.length];
for (int i = 0; i < names.length; i++) {
String[] parts = names[i].split(":");
if (parts.length < 2 || parts.length > 3) {
property.set(defaultNames);
return defaultValues;
}
Block block = GameRegistry.findBlock(parts[0], parts[1]);
int metadata = 0;
if (parts.length == 3) {
try {
metadata = Integer.parseInt(parts[2]);
} catch (NumberFormatException exception) {
metadata = 0;
}
}
if (block == null) {
property.set(defaultNames);
return defaultValues;
}
blockStacks[i] = new BlockStack(block, metadata);
}
return blockStacks;
}
}
@@ -9,8 +9,8 @@ import cpw.mods.fml.common.registry.GameData;
*/
public class BlockStack {
private final Block block;
private final int meta;
private Block block;
private int meta;
public BlockStack(Block block, int meta) {
this.block = block;
@@ -15,7 +15,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
@@ -217,9 +216,4 @@ public class BlockTeleposer extends BlockContainer {
teleposer.hasRedstone = isPowered;
}
}
@Override
public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) {
return true;
}
}
@@ -1,37 +1,23 @@
package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraftforge.oredict.OreDictionary;
import WayofTime.alchemicalWizardry.api.BlockStack;
public class AltarComponent {
private final int x, y, z;
private final List<BlockStack> validBlocks;
private final boolean isBloodRune, isUpgradeSlot;
private int x;
private int y;
private int z;
private Block block;
private int metadata;
private boolean isBloodRune;
private boolean isUpgradeSlot;
public AltarComponent(int x, int y, int z, Block block, int metadata, boolean isBloodRune, boolean isUpgradeSlot) {
this.x = x;
this.y = y;
this.z = z;
this.validBlocks = new ArrayList<>();
this.validBlocks.add(new BlockStack(block, metadata));
this.isBloodRune = isBloodRune;
this.isUpgradeSlot = isUpgradeSlot;
}
public AltarComponent(int x, int y, int z, List<BlockStack> validBlocks, boolean isBloodRune,
boolean isUpgradeSlot) {
this.x = x;
this.y = y;
this.z = z;
this.validBlocks = validBlocks;
this.block = block;
this.metadata = metadata;
this.isBloodRune = isBloodRune;
this.isUpgradeSlot = isUpgradeSlot;
}
@@ -49,17 +35,11 @@ public class AltarComponent {
}
public Block getBlock() {
if (anyBlockMatches()) {
return Blocks.air;
}
return validBlocks.get(0).getBlock();
return block;
}
public int getMetadata() {
if (anyBlockMatches()) {
return OreDictionary.WILDCARD_VALUE;
}
return validBlocks.get(0).getMeta();
return metadata;
}
public boolean isBloodRune() {
@@ -69,24 +49,4 @@ public class AltarComponent {
public boolean isUpgradeSlot() {
return isUpgradeSlot;
}
public List<BlockStack> getValidBlocks() {
return validBlocks;
}
public boolean matches(Block block, int meta) {
if (anyBlockMatches()) return true;
for (BlockStack pair : validBlocks) {
if (pair.getBlock() == block
&& (pair.getMeta() == meta || pair.getMeta() == OreDictionary.WILDCARD_VALUE)) {
return true;
}
}
return false;
}
public boolean anyBlockMatches() {
return validBlocks.isEmpty();
}
}
@@ -1,9 +1,11 @@
package WayofTime.alchemicalWizardry.common.bloodAltarUpgrade;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -45,15 +47,21 @@ public class UpgradedAltars {
return true;
}
private static List<BlockStack> getRuneOverrides(int altarTier) {
return switch (altarTier) {
case 2 -> AlchemicalWizardry.secondTierRunes;
case 3 -> AlchemicalWizardry.thirdTierRunes;
case 4 -> AlchemicalWizardry.fourthTierRunes;
case 5 -> AlchemicalWizardry.fifthTierRunes;
case 6 -> AlchemicalWizardry.sixthTierRunes;
default -> null;
};
private static BlockStack[] getRuneOverrides(int altarTier) {
switch (altarTier) {
case 2:
return AlchemicalWizardry.secondTierRunes;
case 3:
return AlchemicalWizardry.thirdTierRunes;
case 4:
return AlchemicalWizardry.fourthTierRunes;
case 5:
return AlchemicalWizardry.fifthTierRunes;
case 6:
return AlchemicalWizardry.sixthTierRunes;
default:
return null;
}
}
private static boolean checkAltarComponent(AltarComponent altarComponent, IBlockAccess world, int x, int y, int z,
@@ -61,29 +69,28 @@ public class UpgradedAltars {
int compX = x + altarComponent.getX();
int compY = y + altarComponent.getY();
int compZ = z + altarComponent.getZ();
if (altarComponent.anyBlockMatches()) {
if (altarComponent.getBlock() == Blocks.air) {
return !world.isAirBlock(compX, compY, compZ);
}
Block block = world.getBlock(compX, compY, compZ);
int meta = world.getBlockMetadata(compX, compY, compZ);
if (!altarComponent.isBloodRune()) {
return altarComponent.matches(block, meta);
}
List<BlockStack> runes = getRuneOverrides(altarTier);
if (runes == null) {
return false;
}
for (BlockStack rune : runes) {
if (altarComponent.isUpgradeSlot() ? block == rune.getBlock() && meta == rune.getMeta()
: altarComponent.matches(block, meta)) {
return true;
int metadata = world.getBlockMetadata(compX, compY, compZ);
if (altarComponent.isBloodRune()) {
boolean result = false;
BlockStack[] runes = getRuneOverrides(altarTier);
if (runes == null) {
return false;
}
for (BlockStack rune : runes) {
result |= altarComponent.isUpgradeSlot() ? block == rune.getBlock() && metadata == rune.getMeta()
: block == altarComponent.getBlock() && metadata == altarComponent.getMetadata();
}
return result;
} else {
if (altarComponent.getBlock() != block || altarComponent.getMetadata() != metadata) {
return false;
}
}
return false;
return true;
}
public static AltarUpgradeComponent getUpgrades(World world, int x, int y, int z, int altarTier) {
@@ -92,132 +99,683 @@ public class UpgradedAltars {
}
AltarUpgradeComponent upgrades = new AltarUpgradeComponent();
List<AltarComponent> list = UpgradedAltars.getAltarUpgradeListForTier(altarTier);
List<BlockStack> runes = getRuneOverrides(altarTier);
BlockStack[] runes = getRuneOverrides(altarTier);
if (list == null || runes == null) {
return upgrades;
}
for (AltarComponent altarComponent : list) {
if (!altarComponent.isUpgradeSlot()) {
continue;
}
if (altarComponent.isUpgradeSlot()) {
Block block = world
.getBlock(x + altarComponent.getX(), y + altarComponent.getY(), z + altarComponent.getZ());
int metadata = world.getBlockMetadata(
x + altarComponent.getX(),
y + altarComponent.getY(),
z + altarComponent.getZ());
BlockStack blockStack = new BlockStack(block, metadata);
switch (Arrays.asList(runes).indexOf(blockStack)) {
case 1:
upgrades.addSpeedUpgrade();
break;
Block block = world
.getBlock(x + altarComponent.getX(), y + altarComponent.getY(), z + altarComponent.getZ());
int metadata = world
.getBlockMetadata(x + altarComponent.getX(), y + altarComponent.getY(), z + altarComponent.getZ());
BlockStack blockStack = new BlockStack(block, metadata);
switch (runes.indexOf(blockStack)) {
case 1 -> upgrades.addSpeedUpgrade();
case 2 -> upgrades.addEfficiencyUpgrade();
case 3 -> upgrades.addSacrificeUpgrade();
case 4 -> upgrades.addSelfSacrificeUpgrade();
case 5 -> upgrades.addaltarCapacitiveUpgrade();
case 6 -> upgrades.addDisplacementUpgrade();
case 7 -> upgrades.addorbCapacitiveUpgrade();
case 8 -> upgrades.addBetterCapacitiveUpgrade();
case 9 -> upgrades.addAccelerationUpgrade();
case 10 -> upgrades.addQuicknessUpgrade();
case 2:
upgrades.addEfficiencyUpgrade();
break;
case 3:
upgrades.addSacrificeUpgrade();
break;
case 4:
upgrades.addSelfSacrificeUpgrade();
break;
case 5:
upgrades.addaltarCapacitiveUpgrade();
break;
case 6:
upgrades.addDisplacementUpgrade();
break;
case 7:
upgrades.addorbCapacitiveUpgrade();
break;
case 8:
upgrades.addBetterCapacitiveUpgrade();
break;
case 9:
upgrades.addAccelerationUpgrade();
break;
case 10:
upgrades.addQuicknessUpgrade();
break;
}
}
}
return upgrades;
}
public static void loadAltars() {
secondTierAltar.add(new AltarComponent(-1, -1, -1, AlchemicalWizardry.secondTierRunes, true, false));
secondTierAltar.add(new AltarComponent(0, -1, -1, AlchemicalWizardry.secondTierRunes, true, true));
secondTierAltar.add(new AltarComponent(1, -1, -1, AlchemicalWizardry.secondTierRunes, true, false));
secondTierAltar.add(new AltarComponent(-1, -1, 0, AlchemicalWizardry.secondTierRunes, true, true));
secondTierAltar.add(new AltarComponent(1, -1, 0, AlchemicalWizardry.secondTierRunes, true, true));
secondTierAltar.add(new AltarComponent(-1, -1, 1, AlchemicalWizardry.secondTierRunes, true, false));
secondTierAltar.add(new AltarComponent(0, -1, 1, AlchemicalWizardry.secondTierRunes, true, true));
secondTierAltar.add(new AltarComponent(1, -1, 1, AlchemicalWizardry.secondTierRunes, true, false));
secondTierAltar.add(
new AltarComponent(
-1,
-1,
-1,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
false));
secondTierAltar.add(
new AltarComponent(
0,
-1,
-1,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
true));
secondTierAltar.add(
new AltarComponent(
1,
-1,
-1,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
false));
secondTierAltar.add(
new AltarComponent(
-1,
-1,
0,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
true));
secondTierAltar.add(
new AltarComponent(
1,
-1,
0,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
true));
secondTierAltar.add(
new AltarComponent(
-1,
-1,
1,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
false));
secondTierAltar.add(
new AltarComponent(
0,
-1,
1,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
true));
secondTierAltar.add(
new AltarComponent(
1,
-1,
1,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
false));
thirdTierAltar.add(new AltarComponent(-1, -1, -1, AlchemicalWizardry.secondTierRunes, true, true));
thirdTierAltar.add(new AltarComponent(0, -1, -1, AlchemicalWizardry.secondTierRunes, true, true));
thirdTierAltar.add(new AltarComponent(1, -1, -1, AlchemicalWizardry.secondTierRunes, true, true));
thirdTierAltar.add(new AltarComponent(-1, -1, 0, AlchemicalWizardry.secondTierRunes, true, true));
thirdTierAltar.add(new AltarComponent(1, -1, 0, AlchemicalWizardry.secondTierRunes, true, true));
thirdTierAltar.add(new AltarComponent(-1, -1, 1, AlchemicalWizardry.secondTierRunes, true, true));
thirdTierAltar.add(new AltarComponent(0, -1, 1, AlchemicalWizardry.secondTierRunes, true, true));
thirdTierAltar.add(new AltarComponent(1, -1, 1, AlchemicalWizardry.secondTierRunes, true, true));
thirdTierAltar.add(new AltarComponent(-3, -1, -3, AlchemicalWizardry.thirdTierPillars, false, false));
thirdTierAltar.add(new AltarComponent(-3, 0, -3, AlchemicalWizardry.thirdTierPillars, false, false));
thirdTierAltar.add(new AltarComponent(3, -1, -3, AlchemicalWizardry.thirdTierPillars, false, false));
thirdTierAltar.add(new AltarComponent(3, 0, -3, AlchemicalWizardry.thirdTierPillars, false, false));
thirdTierAltar.add(new AltarComponent(-3, -1, 3, AlchemicalWizardry.thirdTierPillars, false, false));
thirdTierAltar.add(new AltarComponent(-3, 0, 3, AlchemicalWizardry.thirdTierPillars, false, false));
thirdTierAltar.add(new AltarComponent(3, -1, 3, AlchemicalWizardry.thirdTierPillars, false, false));
thirdTierAltar.add(new AltarComponent(3, 0, 3, AlchemicalWizardry.thirdTierPillars, false, false));
thirdTierAltar.add(new AltarComponent(-3, 1, -3, AlchemicalWizardry.thirdTierCaps, false, false));
thirdTierAltar.add(new AltarComponent(3, 1, -3, AlchemicalWizardry.thirdTierCaps, false, false));
thirdTierAltar.add(new AltarComponent(-3, 1, 3, AlchemicalWizardry.thirdTierCaps, false, false));
thirdTierAltar.add(new AltarComponent(3, 1, 3, AlchemicalWizardry.thirdTierCaps, false, false));
thirdTierAltar.add(
new AltarComponent(
-1,
-1,
-1,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
true));
thirdTierAltar.add(
new AltarComponent(
0,
-1,
-1,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
true));
thirdTierAltar.add(
new AltarComponent(
1,
-1,
-1,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
true));
thirdTierAltar.add(
new AltarComponent(
-1,
-1,
0,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
true));
thirdTierAltar.add(
new AltarComponent(
1,
-1,
0,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
true));
thirdTierAltar.add(
new AltarComponent(
-1,
-1,
1,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
true));
thirdTierAltar.add(
new AltarComponent(
0,
-1,
1,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
true));
thirdTierAltar.add(
new AltarComponent(
1,
-1,
1,
AlchemicalWizardry.secondTierRunes[0].getBlock(),
AlchemicalWizardry.secondTierRunes[0].getMeta(),
true,
true));
thirdTierAltar.add(
new AltarComponent(
-3,
-1,
-3,
AlchemicalWizardry.specialAltarBlock[0].getBlock(),
AlchemicalWizardry.specialAltarBlock[0].getMeta(),
false,
false));
thirdTierAltar.add(
new AltarComponent(
-3,
0,
-3,
AlchemicalWizardry.specialAltarBlock[0].getBlock(),
AlchemicalWizardry.specialAltarBlock[0].getMeta(),
false,
false));
thirdTierAltar.add(
new AltarComponent(
3,
-1,
-3,
AlchemicalWizardry.specialAltarBlock[0].getBlock(),
AlchemicalWizardry.specialAltarBlock[0].getMeta(),
false,
false));
thirdTierAltar.add(
new AltarComponent(
3,
0,
-3,
AlchemicalWizardry.specialAltarBlock[0].getBlock(),
AlchemicalWizardry.specialAltarBlock[0].getMeta(),
false,
false));
thirdTierAltar.add(
new AltarComponent(
-3,
-1,
3,
AlchemicalWizardry.specialAltarBlock[0].getBlock(),
AlchemicalWizardry.specialAltarBlock[0].getMeta(),
false,
false));
thirdTierAltar.add(
new AltarComponent(
-3,
0,
3,
AlchemicalWizardry.specialAltarBlock[0].getBlock(),
AlchemicalWizardry.specialAltarBlock[0].getMeta(),
false,
false));
thirdTierAltar.add(
new AltarComponent(
3,
-1,
3,
AlchemicalWizardry.specialAltarBlock[0].getBlock(),
AlchemicalWizardry.specialAltarBlock[0].getMeta(),
false,
false));
thirdTierAltar.add(
new AltarComponent(
3,
0,
3,
AlchemicalWizardry.specialAltarBlock[0].getBlock(),
AlchemicalWizardry.specialAltarBlock[0].getMeta(),
false,
false));
thirdTierAltar.add(
new AltarComponent(
-3,
1,
-3,
AlchemicalWizardry.specialAltarBlock[1].getBlock(),
AlchemicalWizardry.specialAltarBlock[1].getMeta(),
false,
false));
thirdTierAltar.add(
new AltarComponent(
3,
1,
-3,
AlchemicalWizardry.specialAltarBlock[1].getBlock(),
AlchemicalWizardry.specialAltarBlock[1].getMeta(),
false,
false));
thirdTierAltar.add(
new AltarComponent(
-3,
1,
3,
AlchemicalWizardry.specialAltarBlock[1].getBlock(),
AlchemicalWizardry.specialAltarBlock[1].getMeta(),
false,
false));
thirdTierAltar.add(
new AltarComponent(
3,
1,
3,
AlchemicalWizardry.specialAltarBlock[1].getBlock(),
AlchemicalWizardry.specialAltarBlock[1].getMeta(),
false,
false));
for (int i = -2; i <= 2; i++) {
thirdTierAltar.add(new AltarComponent(3, -2, i, AlchemicalWizardry.thirdTierRunes, true, true));
thirdTierAltar.add(new AltarComponent(-3, -2, i, AlchemicalWizardry.thirdTierRunes, true, true));
thirdTierAltar.add(new AltarComponent(i, -2, 3, AlchemicalWizardry.thirdTierRunes, true, true));
thirdTierAltar.add(new AltarComponent(i, -2, -3, AlchemicalWizardry.thirdTierRunes, true, true));
thirdTierAltar.add(
new AltarComponent(
3,
-2,
i,
AlchemicalWizardry.thirdTierRunes[0].getBlock(),
AlchemicalWizardry.thirdTierRunes[0].getMeta(),
true,
true));
thirdTierAltar.add(
new AltarComponent(
-3,
-2,
i,
AlchemicalWizardry.thirdTierRunes[0].getBlock(),
AlchemicalWizardry.thirdTierRunes[0].getMeta(),
true,
true));
thirdTierAltar.add(
new AltarComponent(
i,
-2,
3,
AlchemicalWizardry.thirdTierRunes[0].getBlock(),
AlchemicalWizardry.thirdTierRunes[0].getMeta(),
true,
true));
thirdTierAltar.add(
new AltarComponent(
i,
-2,
-3,
AlchemicalWizardry.thirdTierRunes[0].getBlock(),
AlchemicalWizardry.thirdTierRunes[0].getMeta(),
true,
true));
}
fourthTierAltar.addAll(thirdTierAltar);
for (int i = -3; i <= 3; i++) {
fourthTierAltar.add(new AltarComponent(5, -3, i, AlchemicalWizardry.fourthTierRunes, true, true));
fourthTierAltar.add(new AltarComponent(-5, -3, i, AlchemicalWizardry.fourthTierRunes, true, true));
fourthTierAltar.add(new AltarComponent(i, -3, 5, AlchemicalWizardry.fourthTierRunes, true, true));
fourthTierAltar.add(new AltarComponent(i, -3, -5, AlchemicalWizardry.fourthTierRunes, true, true));
fourthTierAltar.add(
new AltarComponent(
5,
-3,
i,
AlchemicalWizardry.fourthTierRunes[0].getBlock(),
AlchemicalWizardry.fourthTierRunes[0].getMeta(),
true,
true));
fourthTierAltar.add(
new AltarComponent(
-5,
-3,
i,
AlchemicalWizardry.fourthTierRunes[0].getBlock(),
AlchemicalWizardry.fourthTierRunes[0].getMeta(),
true,
true));
fourthTierAltar.add(
new AltarComponent(
i,
-3,
5,
AlchemicalWizardry.fourthTierRunes[0].getBlock(),
AlchemicalWizardry.fourthTierRunes[0].getMeta(),
true,
true));
fourthTierAltar.add(
new AltarComponent(
i,
-3,
-5,
AlchemicalWizardry.fourthTierRunes[0].getBlock(),
AlchemicalWizardry.fourthTierRunes[0].getMeta(),
true,
true));
}
for (int i = -2; i <= 1; i++) {
fourthTierAltar.add(new AltarComponent(5, i, 5, AlchemicalWizardry.fourthTierPillars, false, false));
fourthTierAltar.add(new AltarComponent(5, i, -5, AlchemicalWizardry.fourthTierPillars, false, false));
fourthTierAltar.add(new AltarComponent(-5, i, -5, AlchemicalWizardry.fourthTierPillars, false, false));
fourthTierAltar.add(new AltarComponent(-5, i, 5, AlchemicalWizardry.fourthTierPillars, false, false));
fourthTierAltar.add(
new AltarComponent(
5,
i,
5,
AlchemicalWizardry.specialAltarBlock[2].getBlock(),
AlchemicalWizardry.specialAltarBlock[2].getMeta(),
false,
false));
fourthTierAltar.add(
new AltarComponent(
5,
i,
-5,
AlchemicalWizardry.specialAltarBlock[2].getBlock(),
AlchemicalWizardry.specialAltarBlock[2].getMeta(),
false,
false));
fourthTierAltar.add(
new AltarComponent(
-5,
i,
-5,
AlchemicalWizardry.specialAltarBlock[2].getBlock(),
AlchemicalWizardry.specialAltarBlock[2].getMeta(),
false,
false));
fourthTierAltar.add(
new AltarComponent(
-5,
i,
5,
AlchemicalWizardry.specialAltarBlock[2].getBlock(),
AlchemicalWizardry.specialAltarBlock[2].getMeta(),
false,
false));
}
fourthTierAltar.add(new AltarComponent(5, 2, 5, AlchemicalWizardry.fourthTierCaps, false, false));
fourthTierAltar.add(new AltarComponent(5, 2, -5, AlchemicalWizardry.fourthTierCaps, false, false));
fourthTierAltar.add(new AltarComponent(-5, 2, -5, AlchemicalWizardry.fourthTierCaps, false, false));
fourthTierAltar.add(new AltarComponent(-5, 2, 5, AlchemicalWizardry.fourthTierCaps, false, false));
fourthTierAltar.add(
new AltarComponent(
5,
2,
5,
AlchemicalWizardry.specialAltarBlock[3].getBlock(),
AlchemicalWizardry.specialAltarBlock[3].getMeta(),
false,
false));
fourthTierAltar.add(
new AltarComponent(
5,
2,
-5,
AlchemicalWizardry.specialAltarBlock[3].getBlock(),
AlchemicalWizardry.specialAltarBlock[3].getMeta(),
false,
false));
fourthTierAltar.add(
new AltarComponent(
-5,
2,
-5,
AlchemicalWizardry.specialAltarBlock[3].getBlock(),
AlchemicalWizardry.specialAltarBlock[3].getMeta(),
false,
false));
fourthTierAltar.add(
new AltarComponent(
-5,
2,
5,
AlchemicalWizardry.specialAltarBlock[3].getBlock(),
AlchemicalWizardry.specialAltarBlock[3].getMeta(),
false,
false));
fifthTierAltar.addAll(fourthTierAltar);
fifthTierAltar.add(new AltarComponent(-8, -3, 8, AlchemicalWizardry.fifthTierBeacons, false, false));
fifthTierAltar.add(new AltarComponent(-8, -3, -8, AlchemicalWizardry.fifthTierBeacons, false, false));
fifthTierAltar.add(new AltarComponent(8, -3, -8, AlchemicalWizardry.fifthTierBeacons, false, false));
fifthTierAltar.add(new AltarComponent(8, -3, 8, AlchemicalWizardry.fifthTierBeacons, false, false));
fifthTierAltar.add(
new AltarComponent(
-8,
-3,
8,
AlchemicalWizardry.specialAltarBlock[4].getBlock(),
AlchemicalWizardry.specialAltarBlock[4].getMeta(),
false,
false));
fifthTierAltar.add(
new AltarComponent(
-8,
-3,
-8,
AlchemicalWizardry.specialAltarBlock[4].getBlock(),
AlchemicalWizardry.specialAltarBlock[4].getMeta(),
false,
false));
fifthTierAltar.add(
new AltarComponent(
8,
-3,
-8,
AlchemicalWizardry.specialAltarBlock[4].getBlock(),
AlchemicalWizardry.specialAltarBlock[4].getMeta(),
false,
false));
fifthTierAltar.add(
new AltarComponent(
8,
-3,
8,
AlchemicalWizardry.specialAltarBlock[4].getBlock(),
AlchemicalWizardry.specialAltarBlock[4].getMeta(),
false,
false));
for (int i = -6; i <= 6; i++) {
fifthTierAltar.add(new AltarComponent(8, -4, i, AlchemicalWizardry.fifthTierRunes, true, true));
fifthTierAltar.add(new AltarComponent(-8, -4, i, AlchemicalWizardry.fifthTierRunes, true, true));
fifthTierAltar.add(new AltarComponent(i, -4, 8, AlchemicalWizardry.fifthTierRunes, true, true));
fifthTierAltar.add(new AltarComponent(i, -4, -8, AlchemicalWizardry.fifthTierRunes, true, true));
fifthTierAltar.add(
new AltarComponent(
8,
-4,
i,
AlchemicalWizardry.fifthTierRunes[0].getBlock(),
AlchemicalWizardry.fifthTierRunes[0].getMeta(),
true,
true));
fifthTierAltar.add(
new AltarComponent(
-8,
-4,
i,
AlchemicalWizardry.fifthTierRunes[0].getBlock(),
AlchemicalWizardry.fifthTierRunes[0].getMeta(),
true,
true));
fifthTierAltar.add(
new AltarComponent(
i,
-4,
8,
AlchemicalWizardry.fifthTierRunes[0].getBlock(),
AlchemicalWizardry.fifthTierRunes[0].getMeta(),
true,
true));
fifthTierAltar.add(
new AltarComponent(
i,
-4,
-8,
AlchemicalWizardry.fifthTierRunes[0].getBlock(),
AlchemicalWizardry.fifthTierRunes[0].getMeta(),
true,
true));
}
sixthTierAltar.addAll(fifthTierAltar);
for (int i = -4; i <= 2; i++) {
sixthTierAltar.add(new AltarComponent(11, i, 11, AlchemicalWizardry.sixthTierPillars, false, false));
sixthTierAltar.add(new AltarComponent(-11, i, -11, AlchemicalWizardry.sixthTierPillars, false, false));
sixthTierAltar.add(new AltarComponent(11, i, -11, AlchemicalWizardry.sixthTierPillars, false, false));
sixthTierAltar.add(new AltarComponent(-11, i, 11, AlchemicalWizardry.sixthTierPillars, false, false));
sixthTierAltar.add(
new AltarComponent(
11,
i,
11,
AlchemicalWizardry.specialAltarBlock[5].getBlock(),
AlchemicalWizardry.specialAltarBlock[5].getMeta(),
false,
false));
sixthTierAltar.add(
new AltarComponent(
-11,
i,
-11,
AlchemicalWizardry.specialAltarBlock[5].getBlock(),
AlchemicalWizardry.specialAltarBlock[5].getMeta(),
false,
false));
sixthTierAltar.add(
new AltarComponent(
11,
i,
-11,
AlchemicalWizardry.specialAltarBlock[5].getBlock(),
AlchemicalWizardry.specialAltarBlock[5].getMeta(),
false,
false));
sixthTierAltar.add(
new AltarComponent(
-11,
i,
11,
AlchemicalWizardry.specialAltarBlock[5].getBlock(),
AlchemicalWizardry.specialAltarBlock[5].getMeta(),
false,
false));
}
sixthTierAltar.add(new AltarComponent(11, 3, 11, AlchemicalWizardry.sixthTierCaps, false, false));
sixthTierAltar.add(new AltarComponent(-11, 3, -11, AlchemicalWizardry.sixthTierCaps, false, false));
sixthTierAltar.add(new AltarComponent(11, 3, -11, AlchemicalWizardry.sixthTierCaps, false, false));
sixthTierAltar.add(new AltarComponent(-11, 3, 11, AlchemicalWizardry.sixthTierCaps, false, false));
sixthTierAltar.add(
new AltarComponent(
11,
3,
11,
AlchemicalWizardry.specialAltarBlock[6].getBlock(),
AlchemicalWizardry.specialAltarBlock[6].getMeta(),
false,
false));
sixthTierAltar.add(
new AltarComponent(
-11,
3,
-11,
AlchemicalWizardry.specialAltarBlock[6].getBlock(),
AlchemicalWizardry.specialAltarBlock[6].getMeta(),
false,
false));
sixthTierAltar.add(
new AltarComponent(
11,
3,
-11,
AlchemicalWizardry.specialAltarBlock[6].getBlock(),
AlchemicalWizardry.specialAltarBlock[6].getMeta(),
false,
false));
sixthTierAltar.add(
new AltarComponent(
-11,
3,
11,
AlchemicalWizardry.specialAltarBlock[6].getBlock(),
AlchemicalWizardry.specialAltarBlock[6].getMeta(),
false,
false));
for (int i = -9; i <= 9; i++) {
sixthTierAltar.add(new AltarComponent(11, -5, i, AlchemicalWizardry.sixthTierRunes, true, true));
sixthTierAltar.add(new AltarComponent(-11, -5, i, AlchemicalWizardry.sixthTierRunes, true, true));
sixthTierAltar.add(new AltarComponent(i, -5, 11, AlchemicalWizardry.sixthTierRunes, true, true));
sixthTierAltar.add(new AltarComponent(i, -5, -11, AlchemicalWizardry.sixthTierRunes, true, true));
sixthTierAltar.add(
new AltarComponent(
11,
-5,
i,
AlchemicalWizardry.sixthTierRunes[0].getBlock(),
AlchemicalWizardry.sixthTierRunes[0].getMeta(),
true,
true));
sixthTierAltar.add(
new AltarComponent(
-11,
-5,
i,
AlchemicalWizardry.sixthTierRunes[0].getBlock(),
AlchemicalWizardry.sixthTierRunes[0].getMeta(),
true,
true));
sixthTierAltar.add(
new AltarComponent(
i,
-5,
11,
AlchemicalWizardry.sixthTierRunes[0].getBlock(),
AlchemicalWizardry.sixthTierRunes[0].getMeta(),
true,
true));
sixthTierAltar.add(
new AltarComponent(
i,
-5,
-11,
AlchemicalWizardry.sixthTierRunes[0].getBlock(),
AlchemicalWizardry.sixthTierRunes[0].getMeta(),
true,
true));
}
}
public static List<AltarComponent> getAltarUpgradeListForTier(int tier) {
return switch (tier) {
case 2 -> secondTierAltar;
case 3 -> thirdTierAltar;
case 4 -> fourthTierAltar;
case 5 -> fifthTierAltar;
case 6 -> sixthTierAltar;
default -> null;
};
switch (tier) {
case 2:
return secondTierAltar;
case 3:
return thirdTierAltar;
case 4:
return fourthTierAltar;
case 5:
return fifthTierAltar;
case 6:
return sixthTierAltar;
}
return null;
}
}
@@ -49,7 +49,7 @@ public class BoundAxe extends ItemAxe implements IBindable {
this.damageVsEntity = 5;
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
setEnergyUsed(5);
this.setHarvestLevel("axe", 7);
this.setHarvestLevel("axe", 5);
}
public void setEnergyUsed(int i) {
@@ -50,7 +50,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
this.damageVsEntity = 5;
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
this.setEnergyUsed(5);
setHarvestLevel("pickaxe", 7);
setHarvestLevel("pickaxe", 5);
}
public void setEnergyUsed(int i) {
@@ -51,7 +51,7 @@ public class BoundShovel extends ItemSpade implements IBindable {
this.damageVsEntity = 5;
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
setEnergyUsed(5);
setHarvestLevel("shovel", 7);
setHarvestLevel("shovel", 5);
}
public void setEnergyUsed(int i) {
@@ -12,18 +12,15 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain;
import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraftforge.oredict.OreDictionary;
import com.github.bsideup.jabel.Desugar;
import com.google.common.base.Joiner;
import com.gtnewhorizon.structurelib.alignment.constructable.IMultiblockInfoContainer;
import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.IStructureElement;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
@@ -85,42 +82,27 @@ public class AltarStructure {
.addElement('r',ofChain(ofBlockAnyMeta(ModBlocks.bloodRune),ofBlockAnyMeta(ModBlocks.speedRune),ofBlockAnyMeta(ModBlocks.runeOfSelfSacrifice),ofBlockAnyMeta(ModBlocks.runeOfSacrifice),ofBlockAnyMeta(ModBlocks.efficiencyRune)));
char[] keys = {'t', 'g', 'v', 'b', 'e', 'i', 'c'};
List<BlockStack>[] values = new List[] {
AlchemicalWizardry.thirdTierPillars,
AlchemicalWizardry.thirdTierCaps,
AlchemicalWizardry.fourthTierPillars,
AlchemicalWizardry.fourthTierCaps,
AlchemicalWizardry.fifthTierBeacons,
AlchemicalWizardry.sixthTierPillars,
AlchemicalWizardry.sixthTierCaps
};
for (int i = 0; i < keys.length; i++) {
if (values[i].isEmpty()) {
BlockStack stack = AlchemicalWizardry.specialAltarBlock[i];
if (stack != null && stack.getBlock() != Blocks.air) {
altarBuilder.addElement(keys[i], ofBlock(stack.getBlock(), stack.getMeta()));
} else {
altarBuilder.addElement(keys[i], ANY_BLOCK);
continue;
}
altarBuilder.addElement(keys[i],
ofChain(
values[i].stream()
.map(s -> s.getMeta() == OreDictionary.WILDCARD_VALUE
? ofBlockAnyMeta(s.getBlock())
: ofBlock(s.getBlock(), s.getMeta()))
.toArray(IStructureElement[]::new)
)
);
}
IMultiblockInfoContainer.registerTileClass(TEAltar.class,
new AltarStructure.AltarMultiblockInfoContainer(altarBuilder.build()));
// spotless:on
}
@Desugar
private record AltarMultiblockInfoContainer(IStructureDefinition<TEAltar> structureAltar)
implements IMultiblockInfoContainer<TEAltar> {
private static class AltarMultiblockInfoContainer implements IMultiblockInfoContainer<TEAltar> {
private final IStructureDefinition<TEAltar> structureAltar;
public AltarMultiblockInfoContainer(IStructureDefinition<TEAltar> structureAltar) {
this.structureAltar = structureAltar;
}
@Override
public void construct(ItemStack triggerStack, boolean hintsOnly, TEAltar ctx, ExtendedFacing aSide) {
@@ -175,20 +157,18 @@ public class AltarStructure {
return built;
}
@SuppressWarnings("unchecked")
@Override
public String[] getDescription(ItemStack stackSize) {
ArrayList<String> out = new ArrayList<>();
out.add(StatCollector.translateToLocal("structurelib.bloodmagic.altar.1"));
out.add(StatCollector.translateToLocal("structurelib.bloodmagic.altar.2"));
int[] pillarIndices = { 0, 2, 5 };
int[] pillarTiers = { 3, 4, 6 };
List<BlockStack>[] pillarLists = new List[] { AlchemicalWizardry.thirdTierPillars,
AlchemicalWizardry.fourthTierPillars, AlchemicalWizardry.sixthTierPillars };
ArrayList<Integer> pillars = new ArrayList<>();
for (int i = 0; i < pillarTiers.length; i++) {
if (pillarLists[i].isEmpty()) {
for (int i = 0; i < pillarIndices.length; i++) {
if (AlchemicalWizardry.specialAltarBlock[pillarIndices[i]].getBlock() == Blocks.air) {
pillars.add(pillarTiers[i]);
}
}
@@ -200,13 +180,12 @@ public class AltarStructure {
Joiner.on(", ").join(pillars)));
}
int[] capIndices = { 1, 3, 6 };
int[] capTiers = { 3, 4, 6 };
List<BlockStack>[] capLists = new List[] { AlchemicalWizardry.thirdTierCaps,
AlchemicalWizardry.fourthTierCaps, AlchemicalWizardry.sixthTierCaps };
ArrayList<Integer> caps = new ArrayList<>();
for (int i = 0; i < capTiers.length; i++) {
if (capLists[i].isEmpty()) {
for (int i = 0; i < capIndices.length; i++) {
if (AlchemicalWizardry.specialAltarBlock[capIndices[i]].getBlock() == Blocks.air) {
caps.add(capTiers[i]);
}
}
@@ -218,7 +197,7 @@ public class AltarStructure {
Joiner.on(", ").join(caps)));
}
if (AlchemicalWizardry.fifthTierBeacons.isEmpty()) { // T5 Beacon
if (AlchemicalWizardry.specialAltarBlock[4].getBlock() == Blocks.air) { // T5 Beacon
out.add(StatCollector.translateToLocal("structurelib.bloodmagic.altar.5"));
}
@@ -631,25 +631,6 @@ achievement.alchemicalwizardry:demons.desc=Kill a demon summoned by the Convocat
achievement.alchemicalwizardry:trancsendentOrb=OVERPOWERED
achievement.alchemicalwizardry:trancsendentOrb.desc=Pick up a Transcendent Blood Orb
#Buff
bm.buff.drowning=Drowning
bm.buff.boost=Boost
bm.buff.whirlwind=Whirlwind
bm.buff.inhibit=Inhibit
bm.buff.flight=Flight
bm.buff.reciprocation=Reciprocation
bm.buff.flame_cloak=Flame Cloak
bm.buff.ice_cloak=Ice Cloak
bm.buff.heavy_heart=Heavy Heart
bm.buff.fire_fuse=Fire Fuse
bm.buff.planar_binding=Planar Binding
bm.buff.soul_fray=Soul Fray
bm.buff.soul_harden=Soul Harden
bm.buff.deafness=Deafness
bm.buff.feather_fall=Feather Fall
bm.buff.demon_cloak=Demon Cloaking
bm.buff.amphibian=Amphibian
#G-API Downloading
bm.versioning.getGAPI=["[BM] You don't have Guide-API installed! Install it to get it to unlock the book! [",{"text":"Download","color":"red","hoverEvent":{"action":"show_text","value":{"text":"Click this to auto-magically download the latest version","color":"red"}},"clickEvent":{"action":"run_command","value":"/bloodmagic-download-g-api"}},"]"]
bm.versioning.startingDownload=[{"text":"Starting download of %s Please do not remove your hard disk.", "color":"orange"}]