Added new LocalRitualStorage methods, to allow rituals to store data more fluidly.
This commit is contained in:
parent
ac5a20d5b2
commit
fd330233dd
12 changed files with 361 additions and 38 deletions
|
@ -37,4 +37,8 @@ public interface IMasterRitualStone extends ISegmentedReagentHandler
|
|||
public boolean areTanksEmpty();
|
||||
|
||||
public int getRunningTime();
|
||||
|
||||
public LocalRitualStorage getLocalStorage();
|
||||
|
||||
public void setLocalStorage(LocalRitualStorage storage);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.api.rituals;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
/**
|
||||
* This class is used to pass ritual-specific data into the RitualEffect from the containing Master Ritual Stone. This is basically used as auxillarary storage,
|
||||
* for when simply storing to NBT becomes... difficult.
|
||||
*
|
||||
*/
|
||||
public class LocalRitualStorage
|
||||
{
|
||||
public void writeToNBT(NBTTagCompound tag)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound tag)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry.api.rituals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -53,4 +54,37 @@ public abstract class RitualEffect
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
public LocalRitualStorage getNewLocalStorage()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addOffsetRunes(ArrayList<RitualComponent> ritualList, int off1, int off2, int y, int rune)
|
||||
{
|
||||
ritualList.add(new RitualComponent(off1, y, off2, rune));
|
||||
ritualList.add(new RitualComponent(off2, y, off1, rune));
|
||||
ritualList.add(new RitualComponent(off1, y, -off2, rune));
|
||||
ritualList.add(new RitualComponent(-off2, y, off1, rune));
|
||||
ritualList.add(new RitualComponent(-off1, y, off2, rune));
|
||||
ritualList.add(new RitualComponent(off2, y, -off1, rune));
|
||||
ritualList.add(new RitualComponent(-off1, y, -off2, rune));
|
||||
ritualList.add(new RitualComponent(-off2, y, -off1, rune));
|
||||
}
|
||||
|
||||
public void addCornerRunes(ArrayList<RitualComponent> ritualList, int off1, int y, int rune)
|
||||
{
|
||||
ritualList.add(new RitualComponent(off1, y, off1, rune));
|
||||
ritualList.add(new RitualComponent(off1, y, -off1, rune));
|
||||
ritualList.add(new RitualComponent(-off1, y, -off1, rune));
|
||||
ritualList.add(new RitualComponent(-off1, y, off1, rune));
|
||||
}
|
||||
|
||||
public void addParallelRunes(ArrayList<RitualComponent> ritualList, int off1, int y, int rune)
|
||||
{
|
||||
ritualList.add(new RitualComponent(off1, y, 0, rune));
|
||||
ritualList.add(new RitualComponent(-off1, y, 0, rune));
|
||||
ritualList.add(new RitualComponent(0, y, -off1, rune));
|
||||
ritualList.add(new RitualComponent(0, y, off1, rune));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -374,4 +374,22 @@ public class Rituals
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static LocalRitualStorage getLocalStorage(String ritualID)
|
||||
{
|
||||
if (ritualMap.containsKey(ritualID))
|
||||
{
|
||||
Rituals ritual = ritualMap.get(ritualID);
|
||||
if (ritual != null)
|
||||
{
|
||||
RitualEffect eff = ritual.effect;
|
||||
if(eff != null)
|
||||
{
|
||||
return eff.getNewLocalStorage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue