A bit of Ritual cleanup

Slowly getting rid of these BlockStack references. Slowly moving towards
a proper "API" in our internals.
This commit is contained in:
Nicholas Ignoffo 2018-03-04 09:17:23 -08:00
parent 986852e265
commit 3f5178dd6a
72 changed files with 450 additions and 594 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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<EnumRitualController> implements IGuideLinked {
public BlockRitualController() {
super(Material.ROCK, EnumRitualController.class);
@ -67,10 +67,8 @@ public class BlockRitualController extends BlockEnum<EnumRitualController> 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<EnumRitualController> 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());
}

View file

@ -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;

View file

@ -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;

View file

@ -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));

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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<RitualComponent> 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<RitualComponent> componentList = ritual.getComponents();
List<RitualComponent> 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<RitualComponent> components = ritual.getComponents();
List<RitualComponent> components = Lists.newArrayList();
ritual.gatherComponents(components);
for (RitualComponent component : components) {
if (!canPlaceRitualStone(component.getRuneType(), stack)) {
return false;

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -1,4 +1,4 @@
package WayofTime.bloodmagic.ritual.data;
package WayofTime.bloodmagic.ritual;
import WayofTime.bloodmagic.util.Constants;
import net.minecraft.nbt.NBTTagCompound;

View file

@ -1,4 +1,4 @@
package WayofTime.bloodmagic.ritual.data;
package WayofTime.bloodmagic.ritual;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagByte;

View file

@ -1,4 +1,4 @@
package WayofTime.bloodmagic.ritual.data;
package WayofTime.bloodmagic.ritual;
public enum EnumRitualReaderState {
SET_AREA,

View file

@ -1,4 +1,4 @@
package WayofTime.bloodmagic.ritual.data;
package WayofTime.bloodmagic.ritual;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
import WayofTime.bloodmagic.item.types.ISubItem;

View file

@ -1,4 +1,4 @@
package WayofTime.bloodmagic.ritual.data;
package WayofTime.bloodmagic.ritual;
import WayofTime.bloodmagic.core.data.SoulNetwork;
import WayofTime.bloodmagic.soul.EnumDemonWillType;

View file

@ -1,4 +1,4 @@
package WayofTime.bloodmagic.ritual.data;
package WayofTime.bloodmagic.ritual;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

View file

@ -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<RitualComponent> ritualComponents = new ArrayList<>();
protected final Map<String, AreaDescriptor> modableRangeMap = new HashMap<>();
protected final Map<String, Integer> volumeRangeMap = new HashMap<>();
protected final Map<String, Integer> horizontalRangeMap = new HashMap<>();
@ -262,16 +261,13 @@ public abstract class Ritual {
}
}
/**
* @return a list of {@link RitualComponent} for checking the ritual.
*/
public abstract ArrayList<RitualComponent> getComponents();
public abstract void gatherComponents(List<RitualComponent> components);
public void addRune(ArrayList<RitualComponent> components, int offset1, int y, int offset2, EnumRuneType rune) {
protected final void addRune(List<RitualComponent> components, int offset1, int y, int offset2, EnumRuneType rune) {
components.add(new RitualComponent(new BlockPos(offset1, y, offset2), rune));
}
public void addOffsetRunes(ArrayList<RitualComponent> components, int offset1, int offset2, int y, EnumRuneType rune) {
protected final void addOffsetRunes(List<RitualComponent> 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<RitualComponent> components, int offset, int y, EnumRuneType rune) {
protected final void addCornerRunes(List<RitualComponent> 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<RitualComponent> components, int offset, int y, EnumRuneType rune) {
protected final void addParallelRunes(List<RitualComponent> 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<RitualComponent> 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)

View file

@ -1,4 +1,4 @@
package WayofTime.bloodmagic.ritual.data;
package WayofTime.bloodmagic.ritual;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;

View file

@ -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<RitualComponent> first = Lists.newArrayList();
ritual1.gatherComponents(first);
List<RitualComponent> second = Lists.newArrayList();
ritual2.gatherComponents(second);
return first.size() > second.size() ? -1 : 0; // Put earlier if bigger
});
}
}

View file

@ -1,4 +1,4 @@
package WayofTime.bloodmagic.ritual.data;
package WayofTime.bloodmagic.ritual;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;

View file

@ -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;

View file

@ -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<IBlockState> 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<IBlockState> 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<IBlockState> 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<IBlockState> 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;
}

View file

@ -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;

View file

@ -1,6 +1,6 @@
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package WayofTime.bloodmagic.ritual.data.imperfect;
package WayofTime.bloodmagic.ritual.imperfect;
import mcp.MethodsReturnNonnullByDefault;

View file

@ -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<AltarComponent> altarComponentsIterator = new ArrayList<>(EnumAltarTier.SIX.getAltarComponents()).iterator();
@ -113,9 +114,7 @@ public class RitualAltarBuilder extends Ritual {
}
@Override
public ArrayList<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
public void gatherComponents(List<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
public void gatherComponents(List<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
public void gatherComponents(List<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
public void gatherComponents(List<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents()
{
ArrayList<RitualComponent> components = new ArrayList<RitualComponent>();
public void gatherComponents(List<RitualComponent> components) {
addCornerRunes(components, 1, 0, EnumRuneType.WATER);
addCornerRunes(components, 1, 1, EnumRuneType.WATER);
return components;
}
@Override

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
public void gatherComponents(List<RitualComponent> components) {
addCornerRunes(components, 1, 0, EnumRuneType.EARTH);
addCornerRunes(components, 1, 1, EnumRuneType.EARTH);
return components;
}
@Override

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
this.addCornerRunes(components, 1, 0, EnumRuneType.EARTH);
this.addParallelRunes(components, 1, 0, EnumRuneType.WATER);
return components;
public void gatherComponents(List<RitualComponent> components) {
addCornerRunes(components, 1, 0, EnumRuneType.EARTH);
addParallelRunes(components, 1, 0, EnumRuneType.WATER);
}
@Override

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
public void gatherComponents(List<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
this.addCornerRunes(components, 1, 0, EnumRuneType.AIR);
this.addParallelRunes(components, 1, 0, EnumRuneType.AIR);
return components;
public void gatherComponents(List<RitualComponent> components) {
addCornerRunes(components, 1, 0, EnumRuneType.AIR);
addParallelRunes(components, 1, 0, EnumRuneType.AIR);
}
@Override

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
public void gatherComponents(List<RitualComponent> components) {
for (int i = -1; i <= 1; i++)
this.addCornerRunes(components, 1, i, EnumRuneType.AIR);
return components;
addCornerRunes(components, 1, i, EnumRuneType.AIR);
}
@Override

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
this.addParallelRunes(components, 1, 0, EnumRuneType.FIRE);
return components;
public void gatherComponents(List<RitualComponent> components) {
addParallelRunes(components, 1, 0, EnumRuneType.FIRE);
}
@Override

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
public void gatherComponents(List<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
public void gatherComponents(List<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
public void gatherComponents(List<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
public void gatherComponents(List<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> components = new ArrayList<>();
this.addCornerRunes(components, 1, 0, EnumRuneType.WATER);
return components;
public void gatherComponents(List<RitualComponent> components) {
addCornerRunes(components, 1, 0, EnumRuneType.WATER);
}
@Override

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> 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

View file

@ -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<RitualComponent> getComponents() {
ArrayList<RitualComponent> 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<RitualComponent> components) {
addParallelRunes(components, 2, 0, EnumRuneType.AIR);
addCornerRunes(components, 1, 1, EnumRuneType.AIR);
addParallelRunes(components, 1, -1, EnumRuneType.AIR);
}
@Override

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;
}

View file

@ -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;

View file

@ -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.*;

View file

@ -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;

View file

@ -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<RitualComponent> 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<RitualComponent> 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;

View file

@ -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<RitualComponent> components = ritual.getComponents();
if (components == null)
return false;
List<RitualComponent> components = Lists.newArrayList();
ritual.gatherComponents(components);
for (RitualComponent component : components) {
BlockPos newPos = pos.add(component.getOffset(direction));