diff --git a/src/main/java/WayofTime/bloodmagic/BloodMagic.java b/src/main/java/WayofTime/bloodmagic/BloodMagic.java index 5ff8bdc4..4581753c 100644 --- a/src/main/java/WayofTime/bloodmagic/BloodMagic.java +++ b/src/main/java/WayofTime/bloodmagic/BloodMagic.java @@ -3,7 +3,7 @@ package WayofTime.bloodmagic; import WayofTime.bloodmagic.api.BloodMagicPlugin; import WayofTime.bloodmagic.api.IBloodMagicPlugin; import WayofTime.bloodmagic.core.registry.OrbRegistry; -import WayofTime.bloodmagic.core.registry.RitualRegistry; +import WayofTime.bloodmagic.ritual.RitualRegistry; import WayofTime.bloodmagic.util.helper.LogHelper; import WayofTime.bloodmagic.client.gui.GuiHandler; import WayofTime.bloodmagic.command.CommandBloodMagic; diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDimensionalPortal.java b/src/main/java/WayofTime/bloodmagic/block/BlockDimensionalPortal.java index 02df2866..8939e5f5 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockDimensionalPortal.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockDimensionalPortal.java @@ -1,7 +1,7 @@ package WayofTime.bloodmagic.block; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.IMasterRitualStone; +import WayofTime.bloodmagic.ritual.IMasterRitualStone; import WayofTime.bloodmagic.teleport.PortalLocation; import WayofTime.bloodmagic.teleport.TeleportQueue; import WayofTime.bloodmagic.block.base.BlockInteger; diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockRitualController.java b/src/main/java/WayofTime/bloodmagic/block/BlockRitualController.java index a4405cf6..756dea87 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockRitualController.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockRitualController.java @@ -1,12 +1,11 @@ package WayofTime.bloodmagic.block; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.util.BlockStack; import WayofTime.bloodmagic.iface.IBindable; -import WayofTime.bloodmagic.core.registry.ImperfectRitualRegistry; -import WayofTime.bloodmagic.core.registry.RitualRegistry; -import WayofTime.bloodmagic.ritual.data.Ritual; -import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitualRegistry; +import WayofTime.bloodmagic.ritual.RitualRegistry; +import WayofTime.bloodmagic.ritual.Ritual; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitual; import WayofTime.bloodmagic.util.helper.RitualHelper; import WayofTime.bloodmagic.block.base.BlockEnum; import WayofTime.bloodmagic.block.enums.EnumRitualController; @@ -31,6 +30,7 @@ import net.minecraft.world.World; import javax.annotation.Nullable; public class BlockRitualController extends BlockEnum implements IGuideLinked { + public BlockRitualController() { super(Material.ROCK, EnumRitualController.class); @@ -67,10 +67,8 @@ public class BlockRitualController extends BlockEnum imple } } else if (state.getValue(getProperty()) == EnumRitualController.IMPERFECT && tile instanceof TileImperfectRitualStone) { - IBlockState determinerState = world.getBlockState(pos.up()); - BlockStack determiner = new BlockStack(determinerState.getBlock(), determinerState.getBlock().getMetaFromState(determinerState)); - - return ((TileImperfectRitualStone) tile).performRitual(world, pos, ImperfectRitualRegistry.getRitualForBlock(determiner), player); + IBlockState ritualBlock = world.getBlockState(pos.up()); + return ((TileImperfectRitualStone) tile).performRitual(world, pos, ImperfectRitualRegistry.getRitualForBlock(ritualBlock), player); } return false; @@ -115,7 +113,7 @@ public class BlockRitualController extends BlockEnum imple else return new ResourceLocation("bloodmagic", "ritual_" + mrs.getCurrentRitual().getName()); } else if (state.getValue(getProperty()).equals(EnumRitualController.IMPERFECT)) { - ImperfectRitual imperfectRitual = ImperfectRitualRegistry.getRitualForBlock(BlockStack.getStackFromPos(world, pos.up())); + ImperfectRitual imperfectRitual = ImperfectRitualRegistry.getRitualForBlock(world.getBlockState(pos.up())); if (imperfectRitual != null) return new ResourceLocation("bloodmagic", "ritual_" + imperfectRitual.getName()); } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockRitualStone.java b/src/main/java/WayofTime/bloodmagic/block/BlockRitualStone.java index 483a10fb..905c8810 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockRitualStone.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockRitualStone.java @@ -1,8 +1,8 @@ package WayofTime.bloodmagic.block; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.EnumRuneType; -import WayofTime.bloodmagic.ritual.data.IRitualStone; +import WayofTime.bloodmagic.ritual.EnumRuneType; +import WayofTime.bloodmagic.ritual.IRitualStone; import WayofTime.bloodmagic.block.base.BlockEnum; import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks; import WayofTime.bloodmagic.util.helper.TextHelper; diff --git a/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryRitual.java b/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryRitual.java index 3d77b52c..2547591b 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryRitual.java +++ b/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryRitual.java @@ -2,7 +2,7 @@ package WayofTime.bloodmagic.compat.guideapi.book; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.core.registry.AltarRecipeRegistry.AltarRecipe; -import WayofTime.bloodmagic.ritual.data.EnumRuneType; +import WayofTime.bloodmagic.ritual.EnumRuneType; import WayofTime.bloodmagic.compat.guideapi.BookUtils; import WayofTime.bloodmagic.compat.guideapi.entry.EntryText; import WayofTime.bloodmagic.compat.guideapi.page.PageAltarRecipe; diff --git a/src/main/java/WayofTime/bloodmagic/compat/waila/provider/DataProviderRitualController.java b/src/main/java/WayofTime/bloodmagic/compat/waila/provider/DataProviderRitualController.java index f5a4b923..3e97d19f 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/waila/provider/DataProviderRitualController.java +++ b/src/main/java/WayofTime/bloodmagic/compat/waila/provider/DataProviderRitualController.java @@ -2,9 +2,9 @@ package WayofTime.bloodmagic.compat.waila.provider; import WayofTime.bloodmagic.util.BlockStack; import WayofTime.bloodmagic.util.Constants; -import WayofTime.bloodmagic.core.registry.ImperfectRitualRegistry; -import WayofTime.bloodmagic.core.registry.RitualRegistry; -import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitualRegistry; +import WayofTime.bloodmagic.ritual.RitualRegistry; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitual; import WayofTime.bloodmagic.util.helper.PlayerHelper; import WayofTime.bloodmagic.tile.TileMasterRitualStone; import WayofTime.bloodmagic.util.helper.TextHelper; @@ -69,7 +69,7 @@ public class DataProviderRitualController implements IWailaDataProvider { } else { tag.setBoolean("master", false); - ImperfectRitual ritual = ImperfectRitualRegistry.getRitualForBlock(BlockStack.getStackFromPos(world, pos.up())); + ImperfectRitual ritual = ImperfectRitualRegistry.getRitualForBlock(world.getBlockState(pos.up())); if (ritual != null) { tag.setString("ritual", ritual.getUnlocalizedName()); tag.setBoolean("enabled", ImperfectRitualRegistry.ritualEnabled(ritual)); diff --git a/src/main/java/WayofTime/bloodmagic/core/RegistrarBloodMagicRecipes.java b/src/main/java/WayofTime/bloodmagic/core/RegistrarBloodMagicRecipes.java index 85ceebe4..dbd69d57 100644 --- a/src/main/java/WayofTime/bloodmagic/core/RegistrarBloodMagicRecipes.java +++ b/src/main/java/WayofTime/bloodmagic/core/RegistrarBloodMagicRecipes.java @@ -5,7 +5,7 @@ import WayofTime.bloodmagic.api.impl.BloodMagicRecipeRegistrar; import WayofTime.bloodmagic.altar.EnumAltarTier; import WayofTime.bloodmagic.core.registry.OrbRegistry; import WayofTime.bloodmagic.item.ItemSlate; -import WayofTime.bloodmagic.ritual.data.EnumRuneType; +import WayofTime.bloodmagic.ritual.EnumRuneType; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.block.BlockLifeEssence; import WayofTime.bloodmagic.item.alchemy.ItemCuttingFluid; diff --git a/src/main/java/WayofTime/bloodmagic/event/RitualEvent.java b/src/main/java/WayofTime/bloodmagic/event/RitualEvent.java index bf69e5b7..a76ceb7d 100644 --- a/src/main/java/WayofTime/bloodmagic/event/RitualEvent.java +++ b/src/main/java/WayofTime/bloodmagic/event/RitualEvent.java @@ -1,9 +1,9 @@ package WayofTime.bloodmagic.event; -import WayofTime.bloodmagic.ritual.data.IMasterRitualStone; -import WayofTime.bloodmagic.ritual.data.Ritual; -import WayofTime.bloodmagic.ritual.data.imperfect.IImperfectRitualStone; -import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; +import WayofTime.bloodmagic.ritual.IMasterRitualStone; +import WayofTime.bloodmagic.ritual.Ritual; +import WayofTime.bloodmagic.ritual.imperfect.IImperfectRitualStone; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitual; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemInscriptionTool.java b/src/main/java/WayofTime/bloodmagic/item/ItemInscriptionTool.java index 70162421..67e87565 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemInscriptionTool.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemInscriptionTool.java @@ -3,7 +3,7 @@ package WayofTime.bloodmagic.item; import WayofTime.bloodmagic.core.data.Binding; import WayofTime.bloodmagic.iface.IBindable; import WayofTime.bloodmagic.util.Constants; -import WayofTime.bloodmagic.ritual.data.EnumRuneType; +import WayofTime.bloodmagic.ritual.EnumRuneType; import WayofTime.bloodmagic.util.helper.NBTHelper; import WayofTime.bloodmagic.block.BlockRitualStone; import WayofTime.bloodmagic.util.helper.TextHelper; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java b/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java index 10b2ea3c..e6e41c4c 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java @@ -2,10 +2,10 @@ package WayofTime.bloodmagic.item; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.util.Constants; -import WayofTime.bloodmagic.core.registry.RitualRegistry; -import WayofTime.bloodmagic.ritual.data.EnumRuneType; -import WayofTime.bloodmagic.ritual.data.Ritual; -import WayofTime.bloodmagic.ritual.data.RitualComponent; +import WayofTime.bloodmagic.ritual.RitualRegistry; +import WayofTime.bloodmagic.ritual.EnumRuneType; +import WayofTime.bloodmagic.ritual.Ritual; +import WayofTime.bloodmagic.ritual.RitualComponent; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.util.helper.RitualHelper; import WayofTime.bloodmagic.client.IVariantProvider; @@ -16,6 +16,7 @@ import WayofTime.bloodmagic.util.Utils; import WayofTime.bloodmagic.util.handler.event.ClientHandler; import WayofTime.bloodmagic.util.helper.TextHelper; import com.google.common.base.Strings; +import com.google.common.collect.Lists; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.util.ITooltipFlag; @@ -117,7 +118,9 @@ public class ItemRitualDiviner extends Item implements IVariantProvider { Ritual ritual = RitualRegistry.getRitualForId(this.getCurrentRitual(stack)); if (ritual != null) { EnumFacing direction = getDirection(stack); - for (RitualComponent component : ritual.getComponents()) { + List components = Lists.newArrayList(); + ritual.gatherComponents(components); + for (RitualComponent component : components) { if (!canPlaceRitualStone(component.getRuneType(), stack)) { return false; } @@ -223,7 +226,8 @@ public class ItemRitualDiviner extends Item implements IVariantProvider { } else if (sneaking) { tooltip.add(TextHelper.localize(tooltipBase + "currentDirection", Utils.toFancyCasing(getDirection(stack).getName()))); tooltip.add(""); - ArrayList componentList = ritual.getComponents(); + List components = Lists.newArrayList(); + ritual.gatherComponents(components); int blankRunes = 0; int airRunes = 0; @@ -232,9 +236,9 @@ public class ItemRitualDiviner extends Item implements IVariantProvider { int earthRunes = 0; int duskRunes = 0; int dawnRunes = 0; - int totalRunes = componentList.size(); + int totalRunes = components.size(); - for (RitualComponent component : componentList) { + for (RitualComponent component : components) { switch (component.getRuneType()) { case BLANK: blankRunes++; @@ -486,7 +490,8 @@ public class ItemRitualDiviner extends Item implements IVariantProvider { return false; } - ArrayList components = ritual.getComponents(); + List components = Lists.newArrayList(); + ritual.gatherComponents(components); for (RitualComponent component : components) { if (!canPlaceRitualStone(component.getRuneType(), stack)) { return false; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemRitualReader.java b/src/main/java/WayofTime/bloodmagic/item/ItemRitualReader.java index a718ea5b..0b203dd9 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemRitualReader.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemRitualReader.java @@ -2,8 +2,8 @@ package WayofTime.bloodmagic.item; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.util.Constants; -import WayofTime.bloodmagic.ritual.data.EnumRitualReaderState; -import WayofTime.bloodmagic.ritual.data.IMasterRitualStone; +import WayofTime.bloodmagic.ritual.EnumRitualReaderState; +import WayofTime.bloodmagic.ritual.IMasterRitualStone; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.soul.IDiscreteDemonWill; import WayofTime.bloodmagic.util.helper.NBTHelper; diff --git a/src/main/java/WayofTime/bloodmagic/proxy/CommonProxy.java b/src/main/java/WayofTime/bloodmagic/proxy/CommonProxy.java index 34643085..6eab4d82 100644 --- a/src/main/java/WayofTime/bloodmagic/proxy/CommonProxy.java +++ b/src/main/java/WayofTime/bloodmagic/proxy/CommonProxy.java @@ -1,7 +1,7 @@ package WayofTime.bloodmagic.proxy; -import WayofTime.bloodmagic.ritual.data.CapabilityRuneType; -import WayofTime.bloodmagic.ritual.data.IRitualStone; +import WayofTime.bloodmagic.ritual.CapabilityRuneType; +import WayofTime.bloodmagic.ritual.IRitualStone; import WayofTime.bloodmagic.teleport.TeleportQueue; import com.google.common.collect.ImmutableMap; import net.minecraft.block.Block; diff --git a/src/main/java/WayofTime/bloodmagic/registry/ModRituals.java b/src/main/java/WayofTime/bloodmagic/registry/ModRituals.java index 8582d583..e1c67c19 100644 --- a/src/main/java/WayofTime/bloodmagic/registry/ModRituals.java +++ b/src/main/java/WayofTime/bloodmagic/registry/ModRituals.java @@ -1,21 +1,20 @@ package WayofTime.bloodmagic.registry; import WayofTime.bloodmagic.ConfigHandler; -import WayofTime.bloodmagic.util.BlockStack; import WayofTime.bloodmagic.ritual.harvest.HarvestRegistry; -import WayofTime.bloodmagic.core.registry.ImperfectRitualRegistry; -import WayofTime.bloodmagic.core.registry.RitualRegistry; -import WayofTime.bloodmagic.ritual.data.Ritual; -import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitualRegistry; +import WayofTime.bloodmagic.ritual.RitualRegistry; +import WayofTime.bloodmagic.ritual.Ritual; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitual; import WayofTime.bloodmagic.item.alchemy.ItemCuttingFluid; -import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.ritual.harvest.HarvestHandlerPlantable; import WayofTime.bloodmagic.ritual.harvest.HarvestHandlerStem; import WayofTime.bloodmagic.ritual.harvest.HarvestHandlerTall; -import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitualNight; -import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitualRain; -import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitualResistance; -import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitualZombie; +import WayofTime.bloodmagic.ritual.types.imperfect.ImperfectRitualNight; +import WayofTime.bloodmagic.ritual.types.imperfect.ImperfectRitualRain; +import WayofTime.bloodmagic.ritual.types.imperfect.ImperfectRitualResistance; +import WayofTime.bloodmagic.ritual.types.imperfect.ImperfectRitualZombie; +import WayofTime.bloodmagic.ritual.types.*; import net.minecraft.init.Blocks; public class ModRituals diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/AreaDescriptor.java b/src/main/java/WayofTime/bloodmagic/ritual/AreaDescriptor.java similarity index 99% rename from src/main/java/WayofTime/bloodmagic/ritual/data/AreaDescriptor.java rename to src/main/java/WayofTime/bloodmagic/ritual/AreaDescriptor.java index 59248e7f..b6bcdd7d 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/AreaDescriptor.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/AreaDescriptor.java @@ -1,4 +1,4 @@ -package WayofTime.bloodmagic.ritual.data; +package WayofTime.bloodmagic.ritual; import WayofTime.bloodmagic.util.Constants; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/CapabilityRuneType.java b/src/main/java/WayofTime/bloodmagic/ritual/CapabilityRuneType.java similarity index 97% rename from src/main/java/WayofTime/bloodmagic/ritual/data/CapabilityRuneType.java rename to src/main/java/WayofTime/bloodmagic/ritual/CapabilityRuneType.java index 3ed6c7b9..c8800b94 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/CapabilityRuneType.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/CapabilityRuneType.java @@ -1,4 +1,4 @@ -package WayofTime.bloodmagic.ritual.data; +package WayofTime.bloodmagic.ritual; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagByte; diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/EnumRitualReaderState.java b/src/main/java/WayofTime/bloodmagic/ritual/EnumRitualReaderState.java similarity index 69% rename from src/main/java/WayofTime/bloodmagic/ritual/data/EnumRitualReaderState.java rename to src/main/java/WayofTime/bloodmagic/ritual/EnumRitualReaderState.java index 6a3e7bf8..55694e32 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/EnumRitualReaderState.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/EnumRitualReaderState.java @@ -1,4 +1,4 @@ -package WayofTime.bloodmagic.ritual.data; +package WayofTime.bloodmagic.ritual; public enum EnumRitualReaderState { SET_AREA, diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/EnumRuneType.java b/src/main/java/WayofTime/bloodmagic/ritual/EnumRuneType.java similarity index 97% rename from src/main/java/WayofTime/bloodmagic/ritual/data/EnumRuneType.java rename to src/main/java/WayofTime/bloodmagic/ritual/EnumRuneType.java index 6bab1b6e..1566d5b5 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/EnumRuneType.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/EnumRuneType.java @@ -1,4 +1,4 @@ -package WayofTime.bloodmagic.ritual.data; +package WayofTime.bloodmagic.ritual; import WayofTime.bloodmagic.core.RegistrarBloodMagicItems; import WayofTime.bloodmagic.item.types.ISubItem; diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/IMasterRitualStone.java b/src/main/java/WayofTime/bloodmagic/ritual/IMasterRitualStone.java similarity index 97% rename from src/main/java/WayofTime/bloodmagic/ritual/data/IMasterRitualStone.java rename to src/main/java/WayofTime/bloodmagic/ritual/IMasterRitualStone.java index 320757ef..f6743a12 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/IMasterRitualStone.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/IMasterRitualStone.java @@ -1,4 +1,4 @@ -package WayofTime.bloodmagic.ritual.data; +package WayofTime.bloodmagic.ritual; import WayofTime.bloodmagic.core.data.SoulNetwork; import WayofTime.bloodmagic.soul.EnumDemonWillType; diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/IRitualStone.java b/src/main/java/WayofTime/bloodmagic/ritual/IRitualStone.java similarity index 93% rename from src/main/java/WayofTime/bloodmagic/ritual/data/IRitualStone.java rename to src/main/java/WayofTime/bloodmagic/ritual/IRitualStone.java index 00017ab0..73c0e471 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/IRitualStone.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/IRitualStone.java @@ -1,4 +1,4 @@ -package WayofTime.bloodmagic.ritual.data; +package WayofTime.bloodmagic.ritual; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/Ritual.java b/src/main/java/WayofTime/bloodmagic/ritual/Ritual.java similarity index 93% rename from src/main/java/WayofTime/bloodmagic/ritual/data/Ritual.java rename to src/main/java/WayofTime/bloodmagic/ritual/Ritual.java index fae7e240..3ae656fa 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/Ritual.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/Ritual.java @@ -1,8 +1,7 @@ -package WayofTime.bloodmagic.ritual.data; +package WayofTime.bloodmagic.ritual; import WayofTime.bloodmagic.soul.DemonWillHolder; import WayofTime.bloodmagic.soul.EnumDemonWillType; -import WayofTime.bloodmagic.core.registry.RitualRegistry; import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -22,7 +21,7 @@ import java.util.Map.Entry; * {@link RitualRegistry#registerRitual(Ritual, String)} */ public abstract class Ritual { - public final ArrayList ritualComponents = new ArrayList<>(); + protected final Map modableRangeMap = new HashMap<>(); protected final Map volumeRangeMap = new HashMap<>(); protected final Map horizontalRangeMap = new HashMap<>(); @@ -262,16 +261,13 @@ public abstract class Ritual { } } - /** - * @return a list of {@link RitualComponent} for checking the ritual. - */ - public abstract ArrayList getComponents(); + public abstract void gatherComponents(List components); - public void addRune(ArrayList components, int offset1, int y, int offset2, EnumRuneType rune) { + protected final void addRune(List components, int offset1, int y, int offset2, EnumRuneType rune) { components.add(new RitualComponent(new BlockPos(offset1, y, offset2), rune)); } - public void addOffsetRunes(ArrayList components, int offset1, int offset2, int y, EnumRuneType rune) { + protected final void addOffsetRunes(List components, int offset1, int offset2, int y, EnumRuneType rune) { addRune(components, offset1, y, offset2, rune); addRune(components, offset2, y, offset1, rune); addRune(components, offset1, y, -offset2, rune); @@ -282,14 +278,14 @@ public abstract class Ritual { addRune(components, -offset2, y, -offset1, rune); } - public void addCornerRunes(ArrayList components, int offset, int y, EnumRuneType rune) { + protected final void addCornerRunes(List components, int offset, int y, EnumRuneType rune) { addRune(components, offset, y, offset, rune); addRune(components, offset, y, -offset, rune); addRune(components, -offset, y, -offset, rune); addRune(components, -offset, y, offset, rune); } - public void addParallelRunes(ArrayList components, int offset, int y, EnumRuneType rune) { + protected final void addParallelRunes(List components, int offset, int y, EnumRuneType rune) { addRune(components, offset, y, 0, rune); addRune(components, -offset, y, 0, rune); addRune(components, 0, y, -offset, rune); @@ -302,10 +298,6 @@ public abstract class Ritual { public abstract Ritual getNewCopy(); - public ArrayList getRitualComponents() { - return ritualComponents; - } - public String getName() { return name; } @@ -345,7 +337,6 @@ public abstract class Ritual { @Override public String toString() { return new ToStringBuilder(this) - .append("ritualComponents", ritualComponents) .append("name", name) .append("crystalLevel", crystalLevel) .append("activationCost", activationCost) diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/RitualComponent.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualComponent.java similarity index 97% rename from src/main/java/WayofTime/bloodmagic/ritual/data/RitualComponent.java rename to src/main/java/WayofTime/bloodmagic/ritual/RitualComponent.java index 25c46e62..92feb8ec 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/RitualComponent.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualComponent.java @@ -1,4 +1,4 @@ -package WayofTime.bloodmagic.ritual.data; +package WayofTime.bloodmagic.ritual; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/WayofTime/bloodmagic/core/registry/RitualRegistry.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualRegistry.java similarity index 90% rename from src/main/java/WayofTime/bloodmagic/core/registry/RitualRegistry.java rename to src/main/java/WayofTime/bloodmagic/ritual/RitualRegistry.java index b13b4614..af289560 100644 --- a/src/main/java/WayofTime/bloodmagic/core/registry/RitualRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualRegistry.java @@ -1,9 +1,9 @@ -package WayofTime.bloodmagic.core.registry; +package WayofTime.bloodmagic.ritual; -import WayofTime.bloodmagic.ritual.data.Ritual; import WayofTime.bloodmagic.util.BMLog; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; +import com.google.common.collect.Lists; import javax.annotation.Nullable; import java.util.*; @@ -114,7 +114,11 @@ public class RitualRegistry { lookupList.sort((o1, o2) -> { Ritual ritual1 = registry.get(o1); Ritual ritual2 = registry.get(o2); - return ritual1.getComponents().size() > ritual2.getComponents().size() ? -1 : 0; // Put earlier if bigger + List first = Lists.newArrayList(); + ritual1.gatherComponents(first); + List second = Lists.newArrayList(); + ritual2.gatherComponents(second); + return first.size() > second.size() ? -1 : 0; // Put earlier if bigger }); } } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/RitualRenderer.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualRenderer.java similarity index 90% rename from src/main/java/WayofTime/bloodmagic/ritual/data/RitualRenderer.java rename to src/main/java/WayofTime/bloodmagic/ritual/RitualRenderer.java index 0138310b..a5df2590 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/RitualRenderer.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualRenderer.java @@ -1,4 +1,4 @@ -package WayofTime.bloodmagic.ritual.data; +package WayofTime.bloodmagic.ritual; import net.minecraft.client.Minecraft; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/imperfect/IImperfectRitualStone.java b/src/main/java/WayofTime/bloodmagic/ritual/imperfect/IImperfectRitualStone.java similarity index 90% rename from src/main/java/WayofTime/bloodmagic/ritual/data/imperfect/IImperfectRitualStone.java rename to src/main/java/WayofTime/bloodmagic/ritual/imperfect/IImperfectRitualStone.java index eeca00f0..205bdf87 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/imperfect/IImperfectRitualStone.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/imperfect/IImperfectRitualStone.java @@ -1,4 +1,4 @@ -package WayofTime.bloodmagic.ritual.data.imperfect; +package WayofTime.bloodmagic.ritual.imperfect; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/imperfect/ImperfectRitual.java b/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitual.java similarity index 61% rename from src/main/java/WayofTime/bloodmagic/ritual/data/imperfect/ImperfectRitual.java rename to src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitual.java index bf78aaee..dae1c461 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/imperfect/ImperfectRitual.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitual.java @@ -1,10 +1,11 @@ -package WayofTime.bloodmagic.ritual.data.imperfect; +package WayofTime.bloodmagic.ritual.imperfect; -import WayofTime.bloodmagic.util.BlockStack; -import WayofTime.bloodmagic.core.registry.ImperfectRitualRegistry; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; +import java.util.function.Predicate; + /** * Abstract class for creating new imperfect rituals. ImperfectRituals need be * registered with @@ -13,26 +14,26 @@ import net.minecraft.world.World; public abstract class ImperfectRitual { private final String name; - private final BlockStack requiredBlock; + private final Predicate blockRequirement; private final int activationCost; - private final boolean lightshow; + private final boolean lightShow; private final String unlocalizedName; - public ImperfectRitual(String name, BlockStack requiredBlock, int activationCost, boolean lightshow, String unlocalizedName) { + public ImperfectRitual(String name, Predicate blockRequirement, int activationCost, boolean lightShow, String unlocalizedName) { this.name = name; - this.requiredBlock = requiredBlock; + this.blockRequirement = blockRequirement; this.activationCost = activationCost; - this.lightshow = lightshow; + this.lightShow = lightShow; this.unlocalizedName = unlocalizedName; } /** - * @param name - The name of the ritual - * @param requiredBlock - The block required above the ImperfectRitualStone - * @param activationCost - Base LP cost for activating the ritual + * @param name The name of the ritual + * @param blockRequirement The block required above the ImperfectRitualStone + * @param activationCost Base LP cost for activating the ritual */ - public ImperfectRitual(String name, BlockStack requiredBlock, int activationCost, String unlocalizedName) { - this(name, requiredBlock, activationCost, false, unlocalizedName); + public ImperfectRitual(String name, Predicate blockRequirement, int activationCost, String unlocalizedName) { + this(name, blockRequirement, activationCost, false, unlocalizedName); } /** @@ -49,16 +50,16 @@ public abstract class ImperfectRitual { return name; } - public BlockStack getRequiredBlock() { - return requiredBlock; + public Predicate getBlockRequirement() { + return blockRequirement; } public int getActivationCost() { return activationCost; } - public boolean isLightshow() { - return lightshow; + public boolean isLightShow() { + return lightShow; } public String getUnlocalizedName() { @@ -67,7 +68,7 @@ public abstract class ImperfectRitual { @Override public String toString() { - return getName() + ":" + getRequiredBlock().toString() + "@" + getActivationCost(); + return getName() + "@" + getActivationCost(); } @Override @@ -78,19 +79,14 @@ public abstract class ImperfectRitual { ImperfectRitual that = (ImperfectRitual) o; if (activationCost != that.activationCost) return false; - if (lightshow != that.lightshow) return false; if (name != null ? !name.equals(that.name) : that.name != null) return false; - if (requiredBlock != null ? !requiredBlock.equals(that.requiredBlock) : that.requiredBlock != null) - return false; return unlocalizedName != null ? unlocalizedName.equals(that.unlocalizedName) : that.unlocalizedName == null; } @Override public int hashCode() { int result = name != null ? name.hashCode() : 0; - result = 31 * result + (requiredBlock != null ? requiredBlock.hashCode() : 0); result = 31 * result + activationCost; - result = 31 * result + (lightshow ? 1 : 0); result = 31 * result + (unlocalizedName != null ? unlocalizedName.hashCode() : 0); return result; } diff --git a/src/main/java/WayofTime/bloodmagic/core/registry/ImperfectRitualRegistry.java b/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualRegistry.java similarity index 90% rename from src/main/java/WayofTime/bloodmagic/core/registry/ImperfectRitualRegistry.java rename to src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualRegistry.java index 1cf8922a..2417a24d 100644 --- a/src/main/java/WayofTime/bloodmagic/core/registry/ImperfectRitualRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualRegistry.java @@ -1,11 +1,11 @@ -package WayofTime.bloodmagic.core.registry; +package WayofTime.bloodmagic.ritual.imperfect; import WayofTime.bloodmagic.util.BMLog; -import WayofTime.bloodmagic.util.BlockStack; -import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; +import net.minecraft.block.state.IBlockState; +import javax.annotation.Nullable; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -43,9 +43,10 @@ public class ImperfectRitualRegistry { registerRitual(imperfectRitual, imperfectRitual.getName()); } - public static ImperfectRitual getRitualForBlock(BlockStack blockStack) { + @Nullable + public static ImperfectRitual getRitualForBlock(IBlockState state) { for (ImperfectRitual imperfectRitual : getRegistry().values()) - if (imperfectRitual.getRequiredBlock().equals(blockStack)) + if (imperfectRitual.getBlockRequirement().test(state)) return imperfectRitual; return null; diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/imperfect/package-info.java b/src/main/java/WayofTime/bloodmagic/ritual/imperfect/package-info.java similarity index 75% rename from src/main/java/WayofTime/bloodmagic/ritual/data/imperfect/package-info.java rename to src/main/java/WayofTime/bloodmagic/ritual/imperfect/package-info.java index 00a78dbb..9b848792 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/imperfect/package-info.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/imperfect/package-info.java @@ -1,6 +1,6 @@ @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -package WayofTime.bloodmagic.ritual.data.imperfect; +package WayofTime.bloodmagic.ritual.imperfect; import mcp.MethodsReturnNonnullByDefault; diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualAltarBuilder.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualAltarBuilder.java similarity index 96% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualAltarBuilder.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualAltarBuilder.java index 67a8bf76..145ac180 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualAltarBuilder.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualAltarBuilder.java @@ -1,14 +1,14 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.util.BlockStack; import WayofTime.bloodmagic.altar.AltarComponent; import WayofTime.bloodmagic.altar.EnumAltarComponent; import WayofTime.bloodmagic.altar.EnumAltarTier; -import WayofTime.bloodmagic.ritual.data.EnumRuneType; -import WayofTime.bloodmagic.ritual.data.IMasterRitualStone; -import WayofTime.bloodmagic.ritual.data.Ritual; -import WayofTime.bloodmagic.ritual.data.RitualComponent; +import WayofTime.bloodmagic.ritual.EnumRuneType; +import WayofTime.bloodmagic.ritual.IMasterRitualStone; +import WayofTime.bloodmagic.ritual.Ritual; +import WayofTime.bloodmagic.ritual.RitualComponent; import WayofTime.bloodmagic.block.BlockBloodRune; import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks; import WayofTime.bloodmagic.util.Utils; @@ -27,6 +27,7 @@ import net.minecraftforge.items.IItemHandler; import java.util.ArrayList; import java.util.Iterator; +import java.util.List; public class RitualAltarBuilder extends Ritual { private Iterator altarComponentsIterator = new ArrayList<>(EnumAltarTier.SIX.getAltarComponents()).iterator(); @@ -113,9 +114,7 @@ public class RitualAltarBuilder extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - + public void gatherComponents(List components) { for (int i = -12; i <= -8; i++) { addRune(components, i, -6, 13, EnumRuneType.AIR); addRune(components, i, -6, -13, EnumRuneType.FIRE); @@ -151,8 +150,6 @@ public class RitualAltarBuilder extends Ritual { for (int i = 3; i <= 5; i++) { addCornerRunes(components, 13, i, EnumRuneType.DUSK); } - - return components; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualAnimalGrowth.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualAnimalGrowth.java similarity index 95% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualAnimalGrowth.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualAnimalGrowth.java index 596d5c21..eb271087 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualAnimalGrowth.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualAnimalGrowth.java @@ -1,10 +1,10 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.core.RegistrarBloodMagic; import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler; -import WayofTime.bloodmagic.ritual.data.*; import WayofTime.bloodmagic.util.Utils; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.player.EntityPlayer; @@ -18,7 +18,6 @@ import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; import net.minecraftforge.items.IItemHandler; -import java.util.ArrayList; import java.util.List; public class RitualAnimalGrowth extends Ritual { @@ -169,11 +168,10 @@ public class RitualAnimalGrowth extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); + public void gatherComponents(List components) { - this.addParallelRunes(components, 2, 0, EnumRuneType.DUSK); - this.addParallelRunes(components, 1, 0, EnumRuneType.WATER); + addParallelRunes(components, 2, 0, EnumRuneType.DUSK); + addParallelRunes(components, 1, 0, EnumRuneType.WATER); components.add(new RitualComponent(new BlockPos(1, 0, 2), EnumRuneType.EARTH)); components.add(new RitualComponent(new BlockPos(1, 0, -2), EnumRuneType.EARTH)); components.add(new RitualComponent(new BlockPos(-1, 0, 2), EnumRuneType.EARTH)); @@ -182,8 +180,6 @@ public class RitualAnimalGrowth extends Ritual { components.add(new RitualComponent(new BlockPos(2, 0, -1), EnumRuneType.AIR)); components.add(new RitualComponent(new BlockPos(-2, 0, 1), EnumRuneType.AIR)); components.add(new RitualComponent(new BlockPos(-2, 0, -1), EnumRuneType.AIR)); - - return components; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualArmourEvolve.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualArmourEvolve.java similarity index 74% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualArmourEvolve.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualArmourEvolve.java index df617162..9c602679 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualArmourEvolve.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualArmourEvolve.java @@ -1,9 +1,9 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.item.armour.ItemLivingArmour; import WayofTime.bloodmagic.livingArmour.LivingArmour; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import com.google.common.collect.Iterables; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.player.EntityPlayer; @@ -11,7 +11,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; import java.util.List; public class RitualArmourEvolve extends Ritual { @@ -65,22 +64,19 @@ public class RitualArmourEvolve extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); + public void gatherComponents(List components) { - this.addCornerRunes(components, 1, 0, EnumRuneType.DUSK); - this.addCornerRunes(components, 2, 0, EnumRuneType.FIRE); - this.addOffsetRunes(components, 1, 2, 0, EnumRuneType.FIRE); - this.addCornerRunes(components, 1, 1, EnumRuneType.DUSK); - this.addParallelRunes(components, 4, 0, EnumRuneType.EARTH); - this.addCornerRunes(components, 1, 3, EnumRuneType.DUSK); - this.addParallelRunes(components, 1, 4, EnumRuneType.EARTH); + addCornerRunes(components, 1, 0, EnumRuneType.DUSK); + addCornerRunes(components, 2, 0, EnumRuneType.FIRE); + addOffsetRunes(components, 1, 2, 0, EnumRuneType.FIRE); + addCornerRunes(components, 1, 1, EnumRuneType.DUSK); + addParallelRunes(components, 4, 0, EnumRuneType.EARTH); + addCornerRunes(components, 1, 3, EnumRuneType.DUSK); + addParallelRunes(components, 1, 4, EnumRuneType.EARTH); for (int i = 0; i < 4; i++) { - this.addCornerRunes(components, 3, i, EnumRuneType.EARTH); + addCornerRunes(components, 3, i, EnumRuneType.EARTH); } - - return components; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualCobblestone.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualCobblestone.java similarity index 88% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualCobblestone.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualCobblestone.java index d20a3643..abae34aa 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualCobblestone.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualCobblestone.java @@ -1,8 +1,8 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.core.RegistrarBloodMagicItems; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.tile.TileAlchemyArray; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -10,7 +10,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; +import java.util.List; public class RitualCobblestone extends Ritual { @@ -83,13 +83,10 @@ public class RitualCobblestone extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); + public void gatherComponents(List components) { - this.addCornerRunes(components, 1, 1, EnumRuneType.FIRE); - this.addParallelRunes(components, 1, 0, EnumRuneType.WATER); - - return components; + addCornerRunes(components, 1, 1, EnumRuneType.FIRE); + addParallelRunes(components, 1, 0, EnumRuneType.WATER); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualContainment.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualContainment.java similarity index 80% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualContainment.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualContainment.java index 4691725c..b7c58ff3 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualContainment.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualContainment.java @@ -1,13 +1,13 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; +import java.util.List; public class RitualContainment extends Ritual { public static final String CONTAINMENT_RANGE = "containmentRange"; @@ -56,15 +56,11 @@ public class RitualContainment extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addParallelRunes(components, 1, 0, EnumRuneType.EARTH); - this.addCornerRunes(components, 2, 0, EnumRuneType.EARTH); - this.addParallelRunes(components, 1, 5, EnumRuneType.EARTH); - this.addCornerRunes(components, 2, 5, EnumRuneType.EARTH); - - return components; + public void gatherComponents(List components) { + addParallelRunes(components, 1, 0, EnumRuneType.EARTH); + addCornerRunes(components, 2, 0, EnumRuneType.EARTH); + addParallelRunes(components, 1, 5, EnumRuneType.EARTH); + addCornerRunes(components, 2, 5, EnumRuneType.EARTH); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualCrushing.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualCrushing.java similarity index 95% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualCrushing.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualCrushing.java index 5dea1dbf..06d3bc1b 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualCrushing.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualCrushing.java @@ -1,13 +1,13 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.compress.CompressionRegistry; import WayofTime.bloodmagic.recipe.alchemyTable.AlchemyTableRecipe; import WayofTime.bloodmagic.core.registry.AlchemyTableRecipeRegistry; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks; import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler; -import WayofTime.bloodmagic.ritual.data.*; import WayofTime.bloodmagic.util.Utils; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; @@ -251,15 +251,11 @@ public class RitualCrushing extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addParallelRunes(components, 1, 0, EnumRuneType.EARTH); - this.addParallelRunes(components, 2, 0, EnumRuneType.FIRE); - this.addCornerRunes(components, 2, 0, EnumRuneType.DUSK); - this.addParallelRunes(components, 2, 1, EnumRuneType.AIR); - - return components; + public void gatherComponents(List components) { + addParallelRunes(components, 1, 0, EnumRuneType.EARTH); + addParallelRunes(components, 2, 0, EnumRuneType.FIRE); + addCornerRunes(components, 2, 0, EnumRuneType.DUSK); + addParallelRunes(components, 2, 1, EnumRuneType.AIR); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualCrystalHarvest.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualCrystalHarvest.java similarity index 72% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualCrystalHarvest.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualCrystalHarvest.java index 6525cb0d..8eb060a1 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualCrystalHarvest.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualCrystalHarvest.java @@ -1,14 +1,14 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.tile.TileDemonCrystal; import net.minecraft.block.state.IBlockState; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; +import java.util.List; public class RitualCrystalHarvest extends Ritual { public static final String CRYSTAL_RANGE = "crystal"; @@ -67,20 +67,16 @@ public class RitualCrystalHarvest extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addCornerRunes(components, 1, 0, EnumRuneType.AIR); - this.addParallelRunes(components, 1, 1, EnumRuneType.DUSK); - this.addParallelRunes(components, 1, -1, EnumRuneType.FIRE); - this.addParallelRunes(components, 2, -1, EnumRuneType.FIRE); - this.addParallelRunes(components, 3, -1, EnumRuneType.FIRE); - this.addOffsetRunes(components, 3, 1, -1, EnumRuneType.FIRE); - this.addCornerRunes(components, 3, -1, EnumRuneType.EARTH); - this.addCornerRunes(components, 3, 0, EnumRuneType.EARTH); - this.addOffsetRunes(components, 3, 2, 0, EnumRuneType.DUSK); - - return components; + public void gatherComponents(List components) { + addCornerRunes(components, 1, 0, EnumRuneType.AIR); + addParallelRunes(components, 1, 1, EnumRuneType.DUSK); + addParallelRunes(components, 1, -1, EnumRuneType.FIRE); + addParallelRunes(components, 2, -1, EnumRuneType.FIRE); + addParallelRunes(components, 3, -1, EnumRuneType.FIRE); + addOffsetRunes(components, 3, 1, -1, EnumRuneType.FIRE); + addCornerRunes(components, 3, -1, EnumRuneType.EARTH); + addCornerRunes(components, 3, 0, EnumRuneType.EARTH); + addOffsetRunes(components, 3, 2, 0, EnumRuneType.DUSK); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualEllipsoid.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualEllipsoid.java similarity index 93% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualEllipsoid.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualEllipsoid.java index 1fb6b7d1..631b35b7 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualEllipsoid.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualEllipsoid.java @@ -1,10 +1,9 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; -import java.util.ArrayList; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -15,12 +14,11 @@ import net.minecraft.world.World; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.AreaDescriptor; -import WayofTime.bloodmagic.ritual.data.EnumRuneType; -import WayofTime.bloodmagic.ritual.data.IMasterRitualStone; -import WayofTime.bloodmagic.ritual.data.Ritual; -import WayofTime.bloodmagic.ritual.data.RitualComponent; -import WayofTime.bloodmagic.util.Utils; +import WayofTime.bloodmagic.ritual.AreaDescriptor; +import WayofTime.bloodmagic.ritual.EnumRuneType; +import WayofTime.bloodmagic.ritual.IMasterRitualStone; +import WayofTime.bloodmagic.ritual.Ritual; +import WayofTime.bloodmagic.ritual.RitualComponent; public class RitualEllipsoid extends Ritual { @@ -217,14 +215,9 @@ public class RitualEllipsoid extends Ritual // } @Override - public ArrayList getComponents() - { - ArrayList components = new ArrayList(); - + public void gatherComponents(List components) { addCornerRunes(components, 1, 0, EnumRuneType.WATER); addCornerRunes(components, 1, 1, EnumRuneType.WATER); - - return components; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualExpulsion.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualExpulsion.java similarity index 75% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualExpulsion.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualExpulsion.java index 04ed12f4..1be8f406 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualExpulsion.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualExpulsion.java @@ -1,9 +1,9 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.core.data.Binding; import WayofTime.bloodmagic.iface.IBindable; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.util.Utils; import com.google.common.collect.Lists; import net.minecraft.block.state.IBlockState; @@ -20,7 +20,6 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.EnderTeleportEvent; import net.minecraftforge.items.IItemHandler; -import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.UUID; @@ -190,47 +189,43 @@ public class RitualExpulsion extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addCornerRunes(components, 2, 0, EnumRuneType.EARTH); - this.addRune(components, 2, 0, 1, EnumRuneType.EARTH); - this.addRune(components, 1, 0, 2, EnumRuneType.EARTH); - this.addRune(components, 2, 0, -1, EnumRuneType.EARTH); - this.addRune(components, -1, 0, 2, EnumRuneType.EARTH); - this.addRune(components, -2, 0, 1, EnumRuneType.EARTH); - this.addRune(components, 1, 0, -2, EnumRuneType.EARTH); - this.addRune(components, -2, 0, -1, EnumRuneType.EARTH); - this.addRune(components, -1, 0, -2, EnumRuneType.EARTH); - this.addRune(components, 4, 0, 2, EnumRuneType.AIR); - this.addRune(components, 5, 0, 2, EnumRuneType.AIR); - this.addRune(components, 4, 0, -2, EnumRuneType.AIR); - this.addRune(components, 5, 0, -2, EnumRuneType.AIR); - this.addRune(components, -4, 0, 2, EnumRuneType.AIR); - this.addRune(components, -5, 0, 2, EnumRuneType.AIR); - this.addRune(components, -4, 0, -2, EnumRuneType.AIR); - this.addRune(components, -5, 0, -2, EnumRuneType.AIR); - this.addRune(components, 2, 0, 4, EnumRuneType.AIR); - this.addRune(components, 2, 0, 5, EnumRuneType.AIR); - this.addRune(components, -2, 0, 4, EnumRuneType.AIR); - this.addRune(components, -2, 0, 5, EnumRuneType.AIR); - this.addRune(components, 2, 0, -4, EnumRuneType.AIR); - this.addRune(components, 2, 0, -5, EnumRuneType.AIR); - this.addRune(components, -2, 0, -4, EnumRuneType.AIR); - this.addRune(components, -2, 0, -5, EnumRuneType.AIR); - this.addParallelRunes(components, 5, 0, EnumRuneType.DUSK); - this.addParallelRunes(components, 6, 0, EnumRuneType.EARTH); - this.addRune(components, -6, 0, 1, EnumRuneType.DUSK); - this.addRune(components, -6, 0, -1, EnumRuneType.DUSK); - this.addRune(components, 6, 0, 1, EnumRuneType.DUSK); - this.addRune(components, 6, 0, -1, EnumRuneType.DUSK); - this.addRune(components, 1, 0, 6, EnumRuneType.DUSK); - this.addRune(components, -1, 0, 6, EnumRuneType.DUSK); - this.addRune(components, 1, 0, -6, EnumRuneType.DUSK); - this.addRune(components, -1, 0, -6, EnumRuneType.DUSK); - this.addCornerRunes(components, 4, 0, EnumRuneType.FIRE); - - return components; + public void gatherComponents(List components) { + addCornerRunes(components, 2, 0, EnumRuneType.EARTH); + addRune(components, 2, 0, 1, EnumRuneType.EARTH); + addRune(components, 1, 0, 2, EnumRuneType.EARTH); + addRune(components, 2, 0, -1, EnumRuneType.EARTH); + addRune(components, -1, 0, 2, EnumRuneType.EARTH); + addRune(components, -2, 0, 1, EnumRuneType.EARTH); + addRune(components, 1, 0, -2, EnumRuneType.EARTH); + addRune(components, -2, 0, -1, EnumRuneType.EARTH); + addRune(components, -1, 0, -2, EnumRuneType.EARTH); + addRune(components, 4, 0, 2, EnumRuneType.AIR); + addRune(components, 5, 0, 2, EnumRuneType.AIR); + addRune(components, 4, 0, -2, EnumRuneType.AIR); + addRune(components, 5, 0, -2, EnumRuneType.AIR); + addRune(components, -4, 0, 2, EnumRuneType.AIR); + addRune(components, -5, 0, 2, EnumRuneType.AIR); + addRune(components, -4, 0, -2, EnumRuneType.AIR); + addRune(components, -5, 0, -2, EnumRuneType.AIR); + addRune(components, 2, 0, 4, EnumRuneType.AIR); + addRune(components, 2, 0, 5, EnumRuneType.AIR); + addRune(components, -2, 0, 4, EnumRuneType.AIR); + addRune(components, -2, 0, 5, EnumRuneType.AIR); + addRune(components, 2, 0, -4, EnumRuneType.AIR); + addRune(components, 2, 0, -5, EnumRuneType.AIR); + addRune(components, -2, 0, -4, EnumRuneType.AIR); + addRune(components, -2, 0, -5, EnumRuneType.AIR); + addParallelRunes(components, 5, 0, EnumRuneType.DUSK); + addParallelRunes(components, 6, 0, EnumRuneType.EARTH); + addRune(components, -6, 0, 1, EnumRuneType.DUSK); + addRune(components, -6, 0, -1, EnumRuneType.DUSK); + addRune(components, 6, 0, 1, EnumRuneType.DUSK); + addRune(components, 6, 0, -1, EnumRuneType.DUSK); + addRune(components, 1, 0, 6, EnumRuneType.DUSK); + addRune(components, -1, 0, 6, EnumRuneType.DUSK); + addRune(components, 1, 0, -6, EnumRuneType.DUSK); + addRune(components, -1, 0, -6, EnumRuneType.DUSK); + addCornerRunes(components, 4, 0, EnumRuneType.FIRE); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualFeatheredKnife.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualFeatheredKnife.java similarity index 92% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualFeatheredKnife.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualFeatheredKnife.java index efa144fb..476ab93c 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualFeatheredKnife.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualFeatheredKnife.java @@ -1,9 +1,10 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.ConfigHandler; import WayofTime.bloodmagic.altar.IBloodAltar; import WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.util.helper.PlayerSacrificeHelper; import WayofTime.bloodmagic.core.RegistrarBloodMagic; @@ -11,7 +12,6 @@ import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler; import WayofTime.bloodmagic.item.armour.ItemLivingArmour; import WayofTime.bloodmagic.livingArmour.LivingArmour; import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeSelfSacrifice; -import WayofTime.bloodmagic.ritual.data.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; @@ -23,7 +23,6 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; -import java.util.ArrayList; import java.util.List; public class RitualFeatheredKnife extends Ritual { @@ -185,18 +184,14 @@ public class RitualFeatheredKnife extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addParallelRunes(components, 1, 0, EnumRuneType.DUSK); - this.addParallelRunes(components, 2, -1, EnumRuneType.WATER); - this.addCornerRunes(components, 1, -1, EnumRuneType.AIR); - this.addOffsetRunes(components, 2, 4, -1, EnumRuneType.FIRE); - this.addOffsetRunes(components, 2, 4, 0, EnumRuneType.EARTH); - this.addOffsetRunes(components, 4, 3, 0, EnumRuneType.EARTH); - this.addCornerRunes(components, 3, 0, EnumRuneType.AIR); - - return components; + public void gatherComponents(List components) { + addParallelRunes(components, 1, 0, EnumRuneType.DUSK); + addParallelRunes(components, 2, -1, EnumRuneType.WATER); + addCornerRunes(components, 1, -1, EnumRuneType.AIR); + addOffsetRunes(components, 2, 4, -1, EnumRuneType.FIRE); + addOffsetRunes(components, 2, 4, 0, EnumRuneType.EARTH); + addOffsetRunes(components, 4, 3, 0, EnumRuneType.EARTH); + addCornerRunes(components, 3, 0, EnumRuneType.AIR); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualFelling.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualFelling.java similarity index 94% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualFelling.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualFelling.java index c6e3112c..31813dea 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualFelling.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualFelling.java @@ -1,7 +1,7 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.util.Utils; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; @@ -16,6 +16,7 @@ import net.minecraftforge.items.ItemHandlerHelper; import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Iterator; +import java.util.List; public class RitualFelling extends Ritual { public static final String FELLING_RANGE = "fellingRange"; @@ -85,13 +86,9 @@ public class RitualFelling extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - + public void gatherComponents(List components) { addCornerRunes(components, 1, 0, EnumRuneType.EARTH); addCornerRunes(components, 1, 1, EnumRuneType.EARTH); - - return components; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualForsakenSoul.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualForsakenSoul.java similarity index 88% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualForsakenSoul.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualForsakenSoul.java index 402a8b40..8767e150 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualForsakenSoul.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualForsakenSoul.java @@ -1,8 +1,8 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.api.impl.BloodMagicAPI; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.tile.TileDemonCrystal; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.passive.EntityAnimal; @@ -178,20 +178,16 @@ public class RitualForsakenSoul extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addCornerRunes(components, 1, 0, EnumRuneType.AIR); - this.addParallelRunes(components, 1, -1, EnumRuneType.DUSK); - this.addParallelRunes(components, 1, 1, EnumRuneType.FIRE); - this.addParallelRunes(components, 2, 1, EnumRuneType.FIRE); - this.addParallelRunes(components, 3, 1, EnumRuneType.FIRE); - this.addOffsetRunes(components, 3, 1, 1, EnumRuneType.FIRE); - this.addCornerRunes(components, 3, 1, EnumRuneType.EARTH); - this.addCornerRunes(components, 3, 0, EnumRuneType.EARTH); - this.addOffsetRunes(components, 3, 2, 0, EnumRuneType.EARTH); - - return components; + public void gatherComponents(List components) { + addCornerRunes(components, 1, 0, EnumRuneType.AIR); + addParallelRunes(components, 1, -1, EnumRuneType.DUSK); + addParallelRunes(components, 1, 1, EnumRuneType.FIRE); + addParallelRunes(components, 2, 1, EnumRuneType.FIRE); + addParallelRunes(components, 3, 1, EnumRuneType.FIRE); + addOffsetRunes(components, 3, 1, 1, EnumRuneType.FIRE); + addCornerRunes(components, 3, 1, EnumRuneType.EARTH); + addCornerRunes(components, 3, 0, EnumRuneType.EARTH); + addOffsetRunes(components, 3, 2, 0, EnumRuneType.EARTH); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualFullStomach.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualFullStomach.java similarity index 86% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualFullStomach.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualFullStomach.java index 7bcd06e7..35fa103d 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualFullStomach.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualFullStomach.java @@ -1,7 +1,7 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; @@ -12,7 +12,6 @@ import net.minecraft.world.World; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; -import java.util.ArrayList; import java.util.List; public class RitualFullStomach extends Ritual { @@ -93,16 +92,12 @@ public class RitualFullStomach extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addParallelRunes(components, 3, 0, EnumRuneType.FIRE); - this.addCornerRunes(components, 1, 0, EnumRuneType.AIR); - this.addOffsetRunes(components, 1, 2, 0, EnumRuneType.AIR); - this.addCornerRunes(components, 4, 0, EnumRuneType.WATER); - this.addOffsetRunes(components, 4, 3, 0, EnumRuneType.EARTH); - - return components; + public void gatherComponents(List components) { + addParallelRunes(components, 3, 0, EnumRuneType.FIRE); + addCornerRunes(components, 1, 0, EnumRuneType.AIR); + addOffsetRunes(components, 1, 2, 0, EnumRuneType.AIR); + addCornerRunes(components, 4, 0, EnumRuneType.WATER); + addOffsetRunes(components, 4, 3, 0, EnumRuneType.EARTH); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualGreenGrove.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualGreenGrove.java similarity index 96% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualGreenGrove.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualGreenGrove.java index 84089407..79f3b0f2 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualGreenGrove.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualGreenGrove.java @@ -1,12 +1,12 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.api.impl.BloodMagicAPI; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.soul.DemonWillHolder; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.core.RegistrarBloodMagic; import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler; -import WayofTime.bloodmagic.ritual.data.*; import WayofTime.bloodmagic.util.Utils; import net.minecraft.block.Block; import net.minecraft.block.BlockFarmland; @@ -22,7 +22,6 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; -import java.util.ArrayList; import java.util.List; import java.util.Random; @@ -259,13 +258,9 @@ public class RitualGreenGrove extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addCornerRunes(components, 1, 0, EnumRuneType.EARTH); - this.addParallelRunes(components, 1, 0, EnumRuneType.WATER); - - return components; + public void gatherComponents(List components) { + addCornerRunes(components, 1, 0, EnumRuneType.EARTH); + addParallelRunes(components, 1, 0, EnumRuneType.WATER); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualHarvest.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualHarvest.java similarity index 96% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualHarvest.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualHarvest.java index 63036470..c554cc83 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualHarvest.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualHarvest.java @@ -1,9 +1,9 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.ritual.harvest.IHarvestHandler; import WayofTime.bloodmagic.ritual.harvest.HarvestRegistry; -import WayofTime.bloodmagic.ritual.data.*; import com.google.common.collect.Lists; import net.minecraft.block.state.IBlockState; import net.minecraft.inventory.InventoryHelper; @@ -16,7 +16,6 @@ import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemHandlerHelper; -import java.util.ArrayList; import java.util.List; /** @@ -75,9 +74,7 @@ public class RitualHarvest extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - + public void gatherComponents(List components) { components.add(new RitualComponent(new BlockPos(1, 0, 1), EnumRuneType.DUSK)); components.add(new RitualComponent(new BlockPos(1, 0, -1), EnumRuneType.DUSK)); components.add(new RitualComponent(new BlockPos(-1, 0, -1), EnumRuneType.DUSK)); @@ -102,8 +99,6 @@ public class RitualHarvest extends Ritual { components.add(new RitualComponent(new BlockPos(3, 0, -2), EnumRuneType.WATER)); components.add(new RitualComponent(new BlockPos(-2, 0, -3), EnumRuneType.WATER)); components.add(new RitualComponent(new BlockPos(-3, 0, -2), EnumRuneType.WATER)); - - return components; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualInterdiction.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualInterdiction.java similarity index 85% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualInterdiction.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualInterdiction.java index 26801083..44d48d1d 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualInterdiction.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualInterdiction.java @@ -1,13 +1,13 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; +import java.util.List; public class RitualInterdiction extends Ritual { public static final String INTERDICTION_RANGE = "interdictionRange"; @@ -60,13 +60,9 @@ public class RitualInterdiction extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addCornerRunes(components, 1, 0, EnumRuneType.AIR); - this.addParallelRunes(components, 1, 0, EnumRuneType.AIR); - - return components; + public void gatherComponents(List components) { + addCornerRunes(components, 1, 0, EnumRuneType.AIR); + addParallelRunes(components, 1, 0, EnumRuneType.AIR); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualJumping.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualJumping.java similarity index 87% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualJumping.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualJumping.java index 62f6f77c..f594e44b 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualJumping.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualJumping.java @@ -1,14 +1,13 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.util.Utils; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; import java.util.List; public class RitualJumping extends Ritual { @@ -69,13 +68,9 @@ public class RitualJumping extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - + public void gatherComponents(List components) { for (int i = -1; i <= 1; i++) - this.addCornerRunes(components, 1, i, EnumRuneType.AIR); - - return components; + addCornerRunes(components, 1, i, EnumRuneType.AIR); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualLava.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualLava.java similarity index 97% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualLava.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualLava.java index 884ddf09..89e9b8ec 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualLava.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualLava.java @@ -1,12 +1,12 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.util.PleaseStopUsingMe; import WayofTime.bloodmagic.soul.DemonWillHolder; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.core.RegistrarBloodMagic; import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler; -import WayofTime.bloodmagic.ritual.data.*; import WayofTime.bloodmagic.util.Utils; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -25,7 +25,6 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; import net.minecraftforge.fluids.capability.IFluidHandler; -import java.util.ArrayList; import java.util.List; public class RitualLava extends Ritual { @@ -233,12 +232,8 @@ public class RitualLava extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addParallelRunes(components, 1, 0, EnumRuneType.FIRE); - - return components; + public void gatherComponents(List components) { + addParallelRunes(components, 1, 0, EnumRuneType.FIRE); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualLivingArmourDowngrade.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualLivingArmourDowngrade.java similarity index 75% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualLivingArmourDowngrade.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualLivingArmourDowngrade.java index 566f9019..c22915bc 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualLivingArmourDowngrade.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualLivingArmourDowngrade.java @@ -1,4 +1,4 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade; @@ -6,7 +6,7 @@ import WayofTime.bloodmagic.recipe.LivingArmourDowngradeRecipe; import WayofTime.bloodmagic.core.registry.LivingArmourDowngradeRecipeRegistry; import WayofTime.bloodmagic.item.armour.ItemLivingArmour; import WayofTime.bloodmagic.livingArmour.LivingArmour; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.util.ChatUtil; import WayofTime.bloodmagic.util.Utils; import net.minecraft.entity.effect.EntityLightningBolt; @@ -162,46 +162,41 @@ public class RitualLivingArmourDowngrade extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addRune(components, 0, 0, -1, EnumRuneType.AIR); - this.addRune(components, 0, 0, -2, EnumRuneType.DUSK); - this.addRune(components, 0, 1, -3, EnumRuneType.DUSK); - this.addRune(components, 0, 2, -3, EnumRuneType.BLANK); - this.addRune(components, 0, 3, -3, EnumRuneType.BLANK); - this.addRune(components, 0, 1, -4, EnumRuneType.FIRE); + public void gatherComponents(List components) { + addRune(components, 0, 0, -1, EnumRuneType.AIR); + addRune(components, 0, 0, -2, EnumRuneType.DUSK); + addRune(components, 0, 1, -3, EnumRuneType.DUSK); + addRune(components, 0, 2, -3, EnumRuneType.BLANK); + addRune(components, 0, 3, -3, EnumRuneType.BLANK); + addRune(components, 0, 1, -4, EnumRuneType.FIRE); for (int i = 1; i <= 3; i++) - this.addRune(components, 0, 0, i, EnumRuneType.AIR); + addRune(components, 0, 0, i, EnumRuneType.AIR); for (int sgn = -1; sgn <= 1; sgn += 2) { - this.addRune(components, sgn, 0, 4, EnumRuneType.AIR); - this.addRune(components, sgn * 2, 0, 2, EnumRuneType.AIR); - this.addRune(components, sgn * 3, 0, 2, EnumRuneType.AIR); - this.addRune(components, sgn * 3, 0, 3, EnumRuneType.AIR); - this.addRune(components, sgn, 0, 0, EnumRuneType.EARTH); - this.addRune(components, sgn, 0, 1, EnumRuneType.EARTH); - this.addRune(components, sgn * 2, 0, -1, EnumRuneType.FIRE); - this.addRune(components, sgn * 2, 0, -2, EnumRuneType.FIRE); - this.addRune(components, sgn * 3, 0, -2, EnumRuneType.FIRE); - this.addRune(components, sgn * 3, 0, -3, EnumRuneType.FIRE); - this.addRune(components, sgn * 3, 0, -4, EnumRuneType.FIRE); - this.addRune(components, sgn, 1, -1, EnumRuneType.AIR); - this.addRune(components, sgn, 1, -2, EnumRuneType.AIR); - this.addRune(components, sgn, 1, -4, EnumRuneType.FIRE); - this.addRune(components, sgn * 2, 1, -4, EnumRuneType.FIRE); - this.addRune(components, sgn, 0, -3, EnumRuneType.EARTH); - this.addRune(components, sgn, 0, -4, EnumRuneType.EARTH); - this.addRune(components, sgn, 0, -5, EnumRuneType.EARTH); - this.addRune(components, sgn, 1, -5, EnumRuneType.EARTH); - this.addRune(components, sgn, 2, -5, EnumRuneType.EARTH); - this.addRune(components, sgn, 3, -5, EnumRuneType.EARTH); - - this.addRune(components, sgn, 3, -4, EnumRuneType.EARTH); + addRune(components, sgn, 0, 4, EnumRuneType.AIR); + addRune(components, sgn * 2, 0, 2, EnumRuneType.AIR); + addRune(components, sgn * 3, 0, 2, EnumRuneType.AIR); + addRune(components, sgn * 3, 0, 3, EnumRuneType.AIR); + addRune(components, sgn, 0, 0, EnumRuneType.EARTH); + addRune(components, sgn, 0, 1, EnumRuneType.EARTH); + addRune(components, sgn * 2, 0, -1, EnumRuneType.FIRE); + addRune(components, sgn * 2, 0, -2, EnumRuneType.FIRE); + addRune(components, sgn * 3, 0, -2, EnumRuneType.FIRE); + addRune(components, sgn * 3, 0, -3, EnumRuneType.FIRE); + addRune(components, sgn * 3, 0, -4, EnumRuneType.FIRE); + addRune(components, sgn, 1, -1, EnumRuneType.AIR); + addRune(components, sgn, 1, -2, EnumRuneType.AIR); + addRune(components, sgn, 1, -4, EnumRuneType.FIRE); + addRune(components, sgn * 2, 1, -4, EnumRuneType.FIRE); + addRune(components, sgn, 0, -3, EnumRuneType.EARTH); + addRune(components, sgn, 0, -4, EnumRuneType.EARTH); + addRune(components, sgn, 0, -5, EnumRuneType.EARTH); + addRune(components, sgn, 1, -5, EnumRuneType.EARTH); + addRune(components, sgn, 2, -5, EnumRuneType.EARTH); + addRune(components, sgn, 3, -5, EnumRuneType.EARTH); + addRune(components, sgn, 3, -4, EnumRuneType.EARTH); } - - return components; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualMagnetic.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualMagnetic.java similarity index 90% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualMagnetic.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualMagnetic.java index 86e3d325..2fc4868c 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualMagnetic.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualMagnetic.java @@ -1,8 +1,8 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.util.BlockStack; -import WayofTime.bloodmagic.ritual.data.*; import WayofTime.bloodmagic.util.Utils; import net.minecraft.block.Block; import net.minecraft.block.BlockOre; @@ -16,8 +16,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; -import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; public class RitualMagnetic extends Ritual { @@ -135,15 +135,11 @@ public class RitualMagnetic extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addCornerRunes(components, 1, 0, EnumRuneType.EARTH); - this.addParallelRunes(components, 2, 1, EnumRuneType.EARTH); - this.addCornerRunes(components, 2, 1, EnumRuneType.AIR); - this.addParallelRunes(components, 2, 2, EnumRuneType.FIRE); - - return components; + public void gatherComponents(List components) { + addCornerRunes(components, 1, 0, EnumRuneType.EARTH); + addParallelRunes(components, 2, 1, EnumRuneType.EARTH); + addCornerRunes(components, 2, 1, EnumRuneType.AIR); + addParallelRunes(components, 2, 2, EnumRuneType.FIRE); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualMeteor.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualMeteor.java similarity index 73% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualMeteor.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualMeteor.java index 939fd82a..95edf4ed 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualMeteor.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualMeteor.java @@ -1,18 +1,17 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler; import WayofTime.bloodmagic.entity.projectile.EntityMeteor; import WayofTime.bloodmagic.meteor.Meteor; import WayofTime.bloodmagic.meteor.MeteorRegistry; -import WayofTime.bloodmagic.ritual.data.*; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; import java.util.List; public class RitualMeteor extends Ritual { @@ -95,36 +94,32 @@ public class RitualMeteor extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addParallelRunes(components, 2, 0, EnumRuneType.FIRE); - this.addOffsetRunes(components, 3, 1, 0, EnumRuneType.AIR); - this.addOffsetRunes(components, 4, 2, 0, EnumRuneType.AIR); - this.addOffsetRunes(components, 5, 3, 0, EnumRuneType.DUSK); - this.addCornerRunes(components, 4, 0, EnumRuneType.DUSK); + public void gatherComponents(List components) { + addParallelRunes(components, 2, 0, EnumRuneType.FIRE); + addOffsetRunes(components, 3, 1, 0, EnumRuneType.AIR); + addOffsetRunes(components, 4, 2, 0, EnumRuneType.AIR); + addOffsetRunes(components, 5, 3, 0, EnumRuneType.DUSK); + addCornerRunes(components, 4, 0, EnumRuneType.DUSK); for (int i = 4; i <= 6; i++) { - this.addParallelRunes(components, 4, 0, EnumRuneType.EARTH); + addParallelRunes(components, 4, 0, EnumRuneType.EARTH); } - this.addParallelRunes(components, 8, 0, EnumRuneType.EARTH); - this.addParallelRunes(components, 8, 1, EnumRuneType.EARTH); - this.addParallelRunes(components, 7, 1, EnumRuneType.EARTH); - this.addParallelRunes(components, 7, 2, EnumRuneType.EARTH); - this.addParallelRunes(components, 6, 2, EnumRuneType.FIRE); - this.addParallelRunes(components, 6, 3, EnumRuneType.WATER); - this.addParallelRunes(components, 5, 3, EnumRuneType.WATER); - this.addParallelRunes(components, 5, 4, EnumRuneType.AIR); + addParallelRunes(components, 8, 0, EnumRuneType.EARTH); + addParallelRunes(components, 8, 1, EnumRuneType.EARTH); + addParallelRunes(components, 7, 1, EnumRuneType.EARTH); + addParallelRunes(components, 7, 2, EnumRuneType.EARTH); + addParallelRunes(components, 6, 2, EnumRuneType.FIRE); + addParallelRunes(components, 6, 3, EnumRuneType.WATER); + addParallelRunes(components, 5, 3, EnumRuneType.WATER); + addParallelRunes(components, 5, 4, EnumRuneType.AIR); - this.addOffsetRunes(components, 1, 4, 4, EnumRuneType.AIR); - this.addParallelRunes(components, 4, 4, EnumRuneType.AIR); + addOffsetRunes(components, 1, 4, 4, EnumRuneType.AIR); + addParallelRunes(components, 4, 4, EnumRuneType.AIR); - this.addOffsetRunes(components, 2, 4, 4, EnumRuneType.WATER); - this.addOffsetRunes(components, 2, 3, 4, EnumRuneType.FIRE); - this.addCornerRunes(components, 3, 4, EnumRuneType.FIRE); - - return components; + addOffsetRunes(components, 2, 4, 4, EnumRuneType.WATER); + addOffsetRunes(components, 2, 3, 4, EnumRuneType.FIRE); + addCornerRunes(components, 3, 4, EnumRuneType.FIRE); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualPlacer.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualPlacer.java similarity index 94% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualPlacer.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualPlacer.java index 27809a91..be35f269 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualPlacer.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualPlacer.java @@ -1,7 +1,7 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemBlock; @@ -13,7 +13,7 @@ import net.minecraft.world.World; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; -import java.util.ArrayList; +import java.util.List; public class RitualPlacer extends Ritual { public static final String PLACER_RANGE = "placerRange"; @@ -80,9 +80,7 @@ public class RitualPlacer extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - + public void gatherComponents(List components) { addRune(components, 3, 0, 3, EnumRuneType.EARTH); addRune(components, 3, 0, -3, EnumRuneType.EARTH); addRune(components, -3, 0, 3, EnumRuneType.EARTH); @@ -96,8 +94,6 @@ public class RitualPlacer extends Ritual { addRune(components, -2, 0, -3, EnumRuneType.WATER); addRune(components, -3, 0, 2, EnumRuneType.WATER); addRune(components, -3, 0, -2, EnumRuneType.WATER); - - return components; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualPortal.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualPortal.java similarity index 96% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualPortal.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualPortal.java index d62f2f64..da2c5a7d 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualPortal.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualPortal.java @@ -1,10 +1,10 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.EnumRuneType; -import WayofTime.bloodmagic.ritual.data.IMasterRitualStone; -import WayofTime.bloodmagic.ritual.data.Ritual; -import WayofTime.bloodmagic.ritual.data.RitualComponent; +import WayofTime.bloodmagic.ritual.EnumRuneType; +import WayofTime.bloodmagic.ritual.IMasterRitualStone; +import WayofTime.bloodmagic.ritual.Ritual; +import WayofTime.bloodmagic.ritual.RitualComponent; import WayofTime.bloodmagic.teleport.PortalLocation; import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks; import WayofTime.bloodmagic.ritual.portal.LocationsHandler; @@ -17,7 +17,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.ForgeRegistries; -import java.util.ArrayList; +import java.util.List; import java.util.UUID; public class RitualPortal extends Ritual { @@ -183,9 +183,7 @@ public class RitualPortal extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - + public void gatherComponents(List components) { addRune(components, 1, 0, 0, EnumRuneType.AIR); addRune(components, 2, 0, 0, EnumRuneType.WATER); addRune(components, -1, 0, 0, EnumRuneType.FIRE); @@ -203,8 +201,6 @@ public class RitualPortal extends Ritual { addRune(components, -2, 3, 0, EnumRuneType.FIRE); addRune(components, -2, 2, 0, EnumRuneType.EARTH); addRune(components, -2, 1, 0, EnumRuneType.DUSK); - - return components; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualPump.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualPump.java similarity index 94% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualPump.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualPump.java index 1cb26be9..b61c1312 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualPump.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualPump.java @@ -1,7 +1,7 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import com.google.common.collect.Lists; import net.minecraft.block.BlockLiquid; import net.minecraft.block.state.IBlockState; @@ -18,7 +18,6 @@ import net.minecraftforge.fluids.capability.wrappers.BlockLiquidWrapper; import net.minecraftforge.fluids.capability.wrappers.FluidBlockWrapper; import org.apache.commons.lang3.tuple.Pair; -import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -91,17 +90,13 @@ public class RitualPump extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - + public void gatherComponents(List components) { addRune(components, 1, 0, 1, EnumRuneType.WATER); addRune(components, 1, 0, -1, EnumRuneType.EARTH); addRune(components, -1, 0, -1, EnumRuneType.AIR); addRune(components, -1, 0, 1, EnumRuneType.FIRE); addCornerRunes(components, 1, 1, EnumRuneType.DUSK); - - return components; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualRegeneration.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualRegeneration.java similarity index 92% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualRegeneration.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualRegeneration.java index 1da5a885..c547d6b8 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualRegeneration.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualRegeneration.java @@ -1,10 +1,10 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.util.PleaseStopUsingMe; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler; -import WayofTime.bloodmagic.ritual.data.*; import WayofTime.bloodmagic.util.Utils; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -14,7 +14,6 @@ import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -153,9 +152,7 @@ public class RitualRegeneration extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - + public void gatherComponents(List components) { components.add(new RitualComponent(new BlockPos(4, 0, 0), EnumRuneType.AIR)); components.add(new RitualComponent(new BlockPos(5, 0, -1), EnumRuneType.AIR)); components.add(new RitualComponent(new BlockPos(5, 0, 1), EnumRuneType.AIR)); @@ -168,13 +165,11 @@ public class RitualRegeneration extends Ritual { components.add(new RitualComponent(new BlockPos(0, 0, -4), EnumRuneType.FIRE)); components.add(new RitualComponent(new BlockPos(1, 0, -5), EnumRuneType.FIRE)); components.add(new RitualComponent(new BlockPos(-1, 0, -5), EnumRuneType.FIRE)); - this.addOffsetRunes(components, 3, 5, 0, EnumRuneType.WATER); - this.addCornerRunes(components, 3, 0, EnumRuneType.DUSK); - this.addOffsetRunes(components, 4, 5, 0, EnumRuneType.EARTH); - this.addOffsetRunes(components, 4, 5, -1, EnumRuneType.EARTH); - this.addCornerRunes(components, 5, 0, EnumRuneType.EARTH); - - return components; + addOffsetRunes(components, 3, 5, 0, EnumRuneType.WATER); + addCornerRunes(components, 3, 0, EnumRuneType.DUSK); + addOffsetRunes(components, 4, 5, 0, EnumRuneType.EARTH); + addOffsetRunes(components, 4, 5, -1, EnumRuneType.EARTH); + addCornerRunes(components, 5, 0, EnumRuneType.EARTH); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualSpeed.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualSpeed.java similarity index 91% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualSpeed.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualSpeed.java index 02d9fd7e..3bf3ab59 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualSpeed.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualSpeed.java @@ -1,9 +1,9 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler; -import WayofTime.bloodmagic.ritual.data.*; import WayofTime.bloodmagic.util.Utils; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -13,7 +13,6 @@ import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.world.World; -import java.util.ArrayList; import java.util.List; public class RitualSpeed extends Ritual { @@ -153,18 +152,14 @@ public class RitualSpeed extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addRune(components, 0, 0, -2, EnumRuneType.DUSK); - this.addRune(components, 1, 0, -1, EnumRuneType.AIR); - this.addRune(components, -1, 0, -1, EnumRuneType.AIR); + public void gatherComponents(List components) { + addRune(components, 0, 0, -2, EnumRuneType.DUSK); + addRune(components, 1, 0, -1, EnumRuneType.AIR); + addRune(components, -1, 0, -1, EnumRuneType.AIR); for (int i = 0; i < 3; i++) { - this.addRune(components, 2, 0, i, EnumRuneType.AIR); - this.addRune(components, -2, 0, i, EnumRuneType.AIR); + addRune(components, 2, 0, i, EnumRuneType.AIR); + addRune(components, -2, 0, i, EnumRuneType.AIR); } - - return components; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualSuppression.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualSuppression.java similarity index 70% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualSuppression.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualSuppression.java index b944c9ec..964744e8 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualSuppression.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualSuppression.java @@ -1,7 +1,7 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.tile.TileSpectralBlock; import WayofTime.bloodmagic.util.Utils; import net.minecraft.block.state.IBlockState; @@ -9,7 +9,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; +import java.util.List; public class RitualSuppression extends Ritual { public static final String SUPPRESSION_RANGE = "suppressionRange"; @@ -56,20 +56,16 @@ public class RitualSuppression extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addCornerRunes(components, 2, 0, EnumRuneType.WATER); - this.addRune(components, -2, 0, -1, EnumRuneType.AIR); - this.addRune(components, -1, 0, -2, EnumRuneType.AIR); - this.addRune(components, -2, 0, 1, EnumRuneType.AIR); - this.addRune(components, 1, 0, -2, EnumRuneType.AIR); - this.addRune(components, 2, 0, 1, EnumRuneType.AIR); - this.addRune(components, 1, 0, 2, EnumRuneType.AIR); - this.addRune(components, 2, 0, -1, EnumRuneType.AIR); - this.addRune(components, -1, 0, 2, EnumRuneType.AIR); - - return components; + public void gatherComponents(List components) { + addCornerRunes(components, 2, 0, EnumRuneType.WATER); + addRune(components, -2, 0, -1, EnumRuneType.AIR); + addRune(components, -1, 0, -2, EnumRuneType.AIR); + addRune(components, -2, 0, 1, EnumRuneType.AIR); + addRune(components, 1, 0, -2, EnumRuneType.AIR); + addRune(components, 2, 0, 1, EnumRuneType.AIR); + addRune(components, 1, 0, 2, EnumRuneType.AIR); + addRune(components, 2, 0, -1, EnumRuneType.AIR); + addRune(components, -1, 0, 2, EnumRuneType.AIR); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualUpgradeRemove.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualUpgradeRemove.java similarity index 84% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualUpgradeRemove.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualUpgradeRemove.java index 49ad448b..c504e747 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualUpgradeRemove.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualUpgradeRemove.java @@ -1,13 +1,13 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade; import WayofTime.bloodmagic.livingArmour.StatTracker; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.util.helper.ItemHelper.LivingUpgrades; import WayofTime.bloodmagic.core.RegistrarBloodMagicItems; import WayofTime.bloodmagic.item.armour.ItemLivingArmour; import WayofTime.bloodmagic.livingArmour.LivingArmour; -import WayofTime.bloodmagic.ritual.data.*; import com.google.common.collect.Iterables; import net.minecraft.entity.effect.EntityLightningBolt; import net.minecraft.entity.item.EntityItem; @@ -16,7 +16,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; @@ -103,22 +102,18 @@ public class RitualUpgradeRemove extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addCornerRunes(components, 1, 0, EnumRuneType.DUSK); - this.addCornerRunes(components, 2, 0, EnumRuneType.FIRE); - this.addOffsetRunes(components, 1, 2, 0, EnumRuneType.FIRE); - this.addCornerRunes(components, 1, 1, EnumRuneType.WATER); - this.addParallelRunes(components, 4, 0, EnumRuneType.EARTH); - this.addCornerRunes(components, 1, 3, EnumRuneType.WATER); - this.addParallelRunes(components, 1, 4, EnumRuneType.AIR); + public void gatherComponents(List components) { + addCornerRunes(components, 1, 0, EnumRuneType.DUSK); + addCornerRunes(components, 2, 0, EnumRuneType.FIRE); + addOffsetRunes(components, 1, 2, 0, EnumRuneType.FIRE); + addCornerRunes(components, 1, 1, EnumRuneType.WATER); + addParallelRunes(components, 4, 0, EnumRuneType.EARTH); + addCornerRunes(components, 1, 3, EnumRuneType.WATER); + addParallelRunes(components, 1, 4, EnumRuneType.AIR); for (int i = 0; i < 4; i++) { - this.addCornerRunes(components, 3, i, EnumRuneType.EARTH); + addCornerRunes(components, 3, i, EnumRuneType.EARTH); } - - return components; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualWater.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualWater.java similarity index 84% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualWater.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualWater.java index 0d784546..74867148 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualWater.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualWater.java @@ -1,12 +1,12 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; +import java.util.List; public class RitualWater extends Ritual { public static final String WATER_RANGE = "waterRange"; @@ -57,12 +57,8 @@ public class RitualWater extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addCornerRunes(components, 1, 0, EnumRuneType.WATER); - - return components; + public void gatherComponents(List components) { + addCornerRunes(components, 1, 0, EnumRuneType.WATER); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualWellOfSuffering.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualWellOfSuffering.java similarity index 85% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualWellOfSuffering.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualWellOfSuffering.java index 44604cc5..51cf4e4c 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualWellOfSuffering.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualWellOfSuffering.java @@ -1,8 +1,8 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.api.impl.BloodMagicAPI; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.tile.TileAltar; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -14,7 +14,6 @@ import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.EntityEntry; import net.minecraftforge.fml.common.registry.EntityRegistry; -import java.util.ArrayList; import java.util.List; public class RitualWellOfSuffering extends Ritual { @@ -118,18 +117,14 @@ public class RitualWellOfSuffering extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addCornerRunes(components, 1, 0, EnumRuneType.FIRE); - this.addCornerRunes(components, 2, -1, EnumRuneType.FIRE); - this.addParallelRunes(components, 2, -1, EnumRuneType.EARTH); - this.addCornerRunes(components, -3, -1, EnumRuneType.DUSK); - this.addOffsetRunes(components, 2, 4, -1, EnumRuneType.WATER); - this.addOffsetRunes(components, 1, 4, 0, EnumRuneType.WATER); - this.addParallelRunes(components, 4, 1, EnumRuneType.AIR); - - return components; + public void gatherComponents(List components) { + addCornerRunes(components, 1, 0, EnumRuneType.FIRE); + addCornerRunes(components, 2, -1, EnumRuneType.FIRE); + addParallelRunes(components, 2, -1, EnumRuneType.EARTH); + addCornerRunes(components, -3, -1, EnumRuneType.DUSK); + addOffsetRunes(components, 2, 4, -1, EnumRuneType.WATER); + addOffsetRunes(components, 1, 4, 0, EnumRuneType.WATER); + addParallelRunes(components, 4, 1, EnumRuneType.AIR); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualZephyr.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualZephyr.java similarity index 86% rename from src/main/java/WayofTime/bloodmagic/ritual/RitualZephyr.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/RitualZephyr.java index fc4ea91f..d4a15920 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualZephyr.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualZephyr.java @@ -1,7 +1,7 @@ -package WayofTime.bloodmagic.ritual; +package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.data.*; +import WayofTime.bloodmagic.ritual.*; import WayofTime.bloodmagic.util.Utils; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; @@ -10,7 +10,6 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import java.util.ArrayList; import java.util.List; public class RitualZephyr extends Ritual { @@ -81,14 +80,10 @@ public class RitualZephyr extends Ritual { } @Override - public ArrayList getComponents() { - ArrayList components = new ArrayList<>(); - - this.addParallelRunes(components, 2, 0, EnumRuneType.AIR); - this.addCornerRunes(components, 1, 1, EnumRuneType.AIR); - this.addParallelRunes(components, 1, -1, EnumRuneType.AIR); - - return components; + public void gatherComponents(List components) { + addParallelRunes(components, 2, 0, EnumRuneType.AIR); + addCornerRunes(components, 1, 1, EnumRuneType.AIR); + addParallelRunes(components, 1, -1, EnumRuneType.AIR); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualDay.java b/src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualDay.java similarity index 61% rename from src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualDay.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualDay.java index 2d60a7e8..8c6d4eda 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualDay.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualDay.java @@ -1,15 +1,14 @@ -package WayofTime.bloodmagic.ritual.imperfect; +package WayofTime.bloodmagic.ritual.types.imperfect; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.util.BlockStack; -import WayofTime.bloodmagic.ritual.data.imperfect.IImperfectRitualStone; -import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; +import WayofTime.bloodmagic.ritual.imperfect.IImperfectRitualStone; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitual; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; public class ImperfectRitualDay extends ImperfectRitual { public ImperfectRitualDay() { - super("day", new BlockStack(Blocks.GOLD_BLOCK), 5000, true, "ritual." + BloodMagic.MODID + ".imperfect.day"); + super("day", s -> s.getBlock() == Blocks.GOLD_BLOCK, 5000, true, "ritual." + BloodMagic.MODID + ".imperfect.day"); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualNight.java b/src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualNight.java similarity index 61% rename from src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualNight.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualNight.java index caa2bcd7..504fe1a0 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualNight.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualNight.java @@ -1,15 +1,14 @@ -package WayofTime.bloodmagic.ritual.imperfect; +package WayofTime.bloodmagic.ritual.types.imperfect; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.util.BlockStack; -import WayofTime.bloodmagic.ritual.data.imperfect.IImperfectRitualStone; -import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; +import WayofTime.bloodmagic.ritual.imperfect.IImperfectRitualStone; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitual; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; public class ImperfectRitualNight extends ImperfectRitual { public ImperfectRitualNight() { - super("night", new BlockStack(Blocks.LAPIS_BLOCK), 100, true, "ritual." + BloodMagic.MODID + ".imperfect.night"); + super("night", s -> s.getBlock() == Blocks.LAPIS_BLOCK, 100, true, "ritual." + BloodMagic.MODID + ".imperfect.night"); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualRain.java b/src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualRain.java similarity index 68% rename from src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualRain.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualRain.java index 098c9bba..58e1ec6c 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualRain.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualRain.java @@ -1,15 +1,14 @@ -package WayofTime.bloodmagic.ritual.imperfect; +package WayofTime.bloodmagic.ritual.types.imperfect; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.util.BlockStack; -import WayofTime.bloodmagic.ritual.data.imperfect.IImperfectRitualStone; -import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; +import WayofTime.bloodmagic.ritual.imperfect.IImperfectRitualStone; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitual; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; public class ImperfectRitualRain extends ImperfectRitual { public ImperfectRitualRain() { - super("rain", new BlockStack(Blocks.WATER), 5000, true, "ritual." + BloodMagic.MODID + ".imperfect.rain"); + super("rain", s -> s.getBlock() == Blocks.WATER, 5000, true, "ritual." + BloodMagic.MODID + ".imperfect.rain"); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualResistance.java b/src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualResistance.java similarity index 60% rename from src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualResistance.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualResistance.java index 1c3249db..9bb7e0de 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualResistance.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualResistance.java @@ -1,9 +1,8 @@ -package WayofTime.bloodmagic.ritual.imperfect; +package WayofTime.bloodmagic.ritual.types.imperfect; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.util.BlockStack; -import WayofTime.bloodmagic.ritual.data.imperfect.IImperfectRitualStone; -import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; +import WayofTime.bloodmagic.ritual.imperfect.IImperfectRitualStone; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitual; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.MobEffects; @@ -11,7 +10,7 @@ import net.minecraft.potion.PotionEffect; public class ImperfectRitualResistance extends ImperfectRitual { public ImperfectRitualResistance() { - super("resistance", new BlockStack(Blocks.BEDROCK), 5000, "ritual." + BloodMagic.MODID + ".imperfect.resistance"); + super("resistance", s -> s.getBlock() == Blocks.BEDROCK, 5000, "ritual." + BloodMagic.MODID + ".imperfect.resistance"); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualZombie.java b/src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualZombie.java similarity index 76% rename from src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualZombie.java rename to src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualZombie.java index 4f2e34fd..4c539eb4 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/imperfect/ImperfectRitualZombie.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/imperfect/ImperfectRitualZombie.java @@ -1,9 +1,8 @@ -package WayofTime.bloodmagic.ritual.imperfect; +package WayofTime.bloodmagic.ritual.types.imperfect; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.util.BlockStack; -import WayofTime.bloodmagic.ritual.data.imperfect.IImperfectRitualStone; -import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; +import WayofTime.bloodmagic.ritual.imperfect.IImperfectRitualStone; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitual; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -12,7 +11,7 @@ import net.minecraft.potion.PotionEffect; public class ImperfectRitualZombie extends ImperfectRitual { public ImperfectRitualZombie() { - super("zombie", new BlockStack(Blocks.COAL_BLOCK), 5000, "ritual." + BloodMagic.MODID + ".imperfect.zombie"); + super("zombie", s -> s.getBlock() == Blocks.COAL_BLOCK, 5000, "ritual." + BloodMagic.MODID + ".imperfect.zombie"); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/structures/Dungeon.java b/src/main/java/WayofTime/bloodmagic/structures/Dungeon.java index 8170946d..dab32935 100644 --- a/src/main/java/WayofTime/bloodmagic/structures/Dungeon.java +++ b/src/main/java/WayofTime/bloodmagic/structures/Dungeon.java @@ -1,6 +1,6 @@ package WayofTime.bloodmagic.structures; -import WayofTime.bloodmagic.ritual.data.AreaDescriptor; +import WayofTime.bloodmagic.ritual.AreaDescriptor; import WayofTime.bloodmagic.util.BMLog; import net.minecraft.util.EnumFacing; import net.minecraft.util.Mirror; diff --git a/src/main/java/WayofTime/bloodmagic/structures/DungeonRoom.java b/src/main/java/WayofTime/bloodmagic/structures/DungeonRoom.java index de848276..cef16685 100644 --- a/src/main/java/WayofTime/bloodmagic/structures/DungeonRoom.java +++ b/src/main/java/WayofTime/bloodmagic/structures/DungeonRoom.java @@ -1,6 +1,6 @@ package WayofTime.bloodmagic.structures; -import WayofTime.bloodmagic.ritual.data.AreaDescriptor; +import WayofTime.bloodmagic.ritual.AreaDescriptor; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileDimensionalPortal.java b/src/main/java/WayofTime/bloodmagic/tile/TileDimensionalPortal.java index 8fe0d65c..c58a02be 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileDimensionalPortal.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileDimensionalPortal.java @@ -1,6 +1,6 @@ package WayofTime.bloodmagic.tile; -import WayofTime.bloodmagic.ritual.RitualPortal; +import WayofTime.bloodmagic.ritual.types.RitualPortal; import WayofTime.bloodmagic.tile.base.TileBase; import com.google.common.base.Strings; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileImperfectRitualStone.java b/src/main/java/WayofTime/bloodmagic/tile/TileImperfectRitualStone.java index da6ff9b0..7e8b1d12 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileImperfectRitualStone.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileImperfectRitualStone.java @@ -1,8 +1,8 @@ package WayofTime.bloodmagic.tile; -import WayofTime.bloodmagic.core.registry.ImperfectRitualRegistry; -import WayofTime.bloodmagic.ritual.data.imperfect.IImperfectRitualStone; -import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitualRegistry; +import WayofTime.bloodmagic.ritual.imperfect.IImperfectRitualStone; +import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitual; import WayofTime.bloodmagic.util.helper.NetworkHelper; import WayofTime.bloodmagic.util.helper.PlayerHelper; import WayofTime.bloodmagic.tile.base.TileBase; @@ -11,16 +11,17 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import javax.annotation.Nullable; + public class TileImperfectRitualStone extends TileBase implements IImperfectRitualStone { - // IImperfectRitualStone @Override - public boolean performRitual(World world, BlockPos pos, ImperfectRitual imperfectRitual, EntityPlayer player) { + public boolean performRitual(World world, BlockPos pos, @Nullable ImperfectRitual imperfectRitual, EntityPlayer player) { if (imperfectRitual != null && ImperfectRitualRegistry.ritualEnabled(imperfectRitual)) { if (!PlayerHelper.isFakePlayer(player) && !world.isRemote) { NetworkHelper.getSoulNetwork(player).syphonAndDamage(player, imperfectRitual.getActivationCost()); if (imperfectRitual.onActivate(this, player)) { - if (imperfectRitual.isLightshow()) + if (imperfectRitual.isLightShow()) getWorld().addWeatherEffect(new EntityLightningBolt(getWorld(), getPos().getX(), getPos().getY() + 2, getPos().getZ(), true)); return true; } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileIncenseAltar.java b/src/main/java/WayofTime/bloodmagic/tile/TileIncenseAltar.java index 125f8cca..f0da8c4a 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileIncenseAltar.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileIncenseAltar.java @@ -1,6 +1,6 @@ package WayofTime.bloodmagic.tile; -import WayofTime.bloodmagic.ritual.data.AreaDescriptor; +import WayofTime.bloodmagic.ritual.AreaDescriptor; import WayofTime.bloodmagic.util.helper.PlayerSacrificeHelper; import WayofTime.bloodmagic.incense.*; import net.minecraft.block.Block; diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileMasterRitualStone.java b/src/main/java/WayofTime/bloodmagic/tile/TileMasterRitualStone.java index 0bbf0441..fd8fcca1 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileMasterRitualStone.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileMasterRitualStone.java @@ -4,9 +4,9 @@ import WayofTime.bloodmagic.core.data.Binding; import WayofTime.bloodmagic.iface.IBindable; import WayofTime.bloodmagic.util.Constants; import WayofTime.bloodmagic.event.RitualEvent; -import WayofTime.bloodmagic.core.registry.RitualRegistry; -import WayofTime.bloodmagic.ritual.data.IMasterRitualStone; -import WayofTime.bloodmagic.ritual.data.Ritual; +import WayofTime.bloodmagic.ritual.RitualRegistry; +import WayofTime.bloodmagic.ritual.IMasterRitualStone; +import WayofTime.bloodmagic.ritual.Ritual; import WayofTime.bloodmagic.core.data.SoulNetwork; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.util.helper.*; diff --git a/src/main/java/WayofTime/bloodmagic/tile/TilePurificationAltar.java b/src/main/java/WayofTime/bloodmagic/tile/TilePurificationAltar.java index 88ea4e75..fdcab9f4 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TilePurificationAltar.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TilePurificationAltar.java @@ -1,7 +1,7 @@ package WayofTime.bloodmagic.tile; import WayofTime.bloodmagic.iface.IPurificationAsh; -import WayofTime.bloodmagic.ritual.data.AreaDescriptor; +import WayofTime.bloodmagic.ritual.AreaDescriptor; import WayofTime.bloodmagic.util.helper.PurificationHelper; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.item.ItemStack; diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/event/ClientHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/event/ClientHandler.java index e1025a32..a63f727e 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/event/ClientHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/event/ClientHandler.java @@ -3,9 +3,9 @@ package WayofTime.bloodmagic.util.handler.event; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.ConfigHandler; import WayofTime.bloodmagic.util.Constants; -import WayofTime.bloodmagic.core.registry.RitualRegistry; -import WayofTime.bloodmagic.ritual.data.Ritual; -import WayofTime.bloodmagic.ritual.data.RitualComponent; +import WayofTime.bloodmagic.ritual.RitualRegistry; +import WayofTime.bloodmagic.ritual.Ritual; +import WayofTime.bloodmagic.ritual.RitualComponent; import WayofTime.bloodmagic.client.hud.HUDElement; import WayofTime.bloodmagic.client.key.KeyBindings; import WayofTime.bloodmagic.client.render.block.RenderFakeBlocks; @@ -18,6 +18,7 @@ import WayofTime.bloodmagic.tile.TileMasterRitualStone; import WayofTime.bloodmagic.util.GhostItemHelper; import WayofTime.bloodmagic.util.helper.TextHelper; import com.google.common.base.Stopwatch; +import com.google.common.collect.Lists; import com.google.common.collect.SetMultimap; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -269,7 +270,9 @@ public class ClientHandler { double posY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks; double posZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks; - for (RitualComponent ritualComponent : ritual.getComponents()) { + List components = Lists.newArrayList(); + ritual.gatherComponents(components); + for (RitualComponent ritualComponent : components) { vX = vec3.add(ritualComponent.getOffset(direction)); double minX = vX.getX() - posX; double minY = vX.getY() - posY; @@ -346,7 +349,9 @@ public class ClientHandler { double posY = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks; double posZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks; - for (RitualComponent ritualComponent : ritual.getComponents()) { + List components = Lists.newArrayList(); + ritual.gatherComponents(components); + for (RitualComponent ritualComponent : components) { vX = vec3.add(ritualComponent.getOffset(direction)); double minX = vX.getX() - posX; double minY = vX.getY() - posY; diff --git a/src/main/java/WayofTime/bloodmagic/util/helper/RitualHelper.java b/src/main/java/WayofTime/bloodmagic/util/helper/RitualHelper.java index 6ecfe11e..5a73de68 100644 --- a/src/main/java/WayofTime/bloodmagic/util/helper/RitualHelper.java +++ b/src/main/java/WayofTime/bloodmagic/util/helper/RitualHelper.java @@ -1,10 +1,11 @@ package WayofTime.bloodmagic.util.helper; -import WayofTime.bloodmagic.core.registry.RitualRegistry; -import WayofTime.bloodmagic.ritual.data.EnumRuneType; -import WayofTime.bloodmagic.ritual.data.IRitualStone; -import WayofTime.bloodmagic.ritual.data.Ritual; -import WayofTime.bloodmagic.ritual.data.RitualComponent; +import WayofTime.bloodmagic.ritual.RitualRegistry; +import WayofTime.bloodmagic.ritual.EnumRuneType; +import WayofTime.bloodmagic.ritual.IRitualStone; +import WayofTime.bloodmagic.ritual.Ritual; +import WayofTime.bloodmagic.ritual.RitualComponent; +import com.google.common.collect.Lists; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.tileentity.TileEntity; @@ -15,6 +16,7 @@ import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; import java.util.ArrayList; +import java.util.List; public class RitualHelper { @CapabilityInject(IRitualStone.Tile.class) @@ -76,10 +78,8 @@ public class RitualHelper { return false; } - ArrayList components = ritual.getComponents(); - - if (components == null) - return false; + List components = Lists.newArrayList(); + ritual.gatherComponents(components); for (RitualComponent component : components) { BlockPos newPos = pos.add(component.getOffset(direction));