Started work on the "Ritual Reader," which will in the future give more information about rituals as well as allow you to set the custom areas of the rituals.
This commit is contained in:
parent
f88dae6dda
commit
db268b23a4
|
@ -37,6 +37,7 @@ public class Constants
|
||||||
public static final String OUTPUT_AMOUNT = "outputAmount";
|
public static final String OUTPUT_AMOUNT = "outputAmount";
|
||||||
public static final String INPUT_AMOUNT = "inputAmount";
|
public static final String INPUT_AMOUNT = "inputAmount";
|
||||||
public static final String STORED_LP = "storedLP";
|
public static final String STORED_LP = "storedLP";
|
||||||
|
public static final String RITUAL_READER = "ritualReaderState";
|
||||||
|
|
||||||
public static final String ALTAR = "bloodAltar";
|
public static final String ALTAR = "bloodAltar";
|
||||||
public static final String ALTAR_TIER = "upgradeLevel";
|
public static final String ALTAR_TIER = "upgradeLevel";
|
||||||
|
@ -210,7 +211,8 @@ public class Constants
|
||||||
UPGRADE_TRAINER("ItemUpgradeTrainer"),
|
UPGRADE_TRAINER("ItemUpgradeTrainer"),
|
||||||
SIGIL_TELEPOSITION("ItemSigilTeleposition"),
|
SIGIL_TELEPOSITION("ItemSigilTeleposition"),
|
||||||
EXPERIENCE_TOME("ItemExperienceBook"),
|
EXPERIENCE_TOME("ItemExperienceBook"),
|
||||||
SIGIL_TRANSPOSITION("ItemSigilTransposition");
|
SIGIL_TRANSPOSITION("ItemSigilTransposition"),
|
||||||
|
RITUAL_READER("ItemRitualReader");
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final String regName;
|
private final String regName;
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package WayofTime.bloodmagic.api.ritual;
|
||||||
|
|
||||||
|
public enum EnumRitualReaderState
|
||||||
|
{
|
||||||
|
SET_AREA,
|
||||||
|
INFORMATION,
|
||||||
|
SET_WILL_TYPES;
|
||||||
|
}
|
129
src/main/java/WayofTime/bloodmagic/item/ItemRitualReader.java
Normal file
129
src/main/java/WayofTime/bloodmagic/item/ItemRitualReader.java
Normal file
|
@ -0,0 +1,129 @@
|
||||||
|
package WayofTime.bloodmagic.item;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.ActionResult;
|
||||||
|
import net.minecraft.util.EnumActionResult;
|
||||||
|
import net.minecraft.util.EnumHand;
|
||||||
|
import net.minecraft.util.text.TextComponentTranslation;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||||
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
|
|
||||||
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
|
import WayofTime.bloodmagic.api.ritual.EnumRitualReaderState;
|
||||||
|
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||||
|
import WayofTime.bloodmagic.api.util.helper.PlayerHelper;
|
||||||
|
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||||
|
import WayofTime.bloodmagic.util.ChatUtil;
|
||||||
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
|
|
||||||
|
public class ItemRitualReader extends Item implements IVariantProvider
|
||||||
|
{
|
||||||
|
public static final String tooltipBase = "tooltip.BloodMagic.ritualReader.";
|
||||||
|
|
||||||
|
public ItemRitualReader()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
setUnlocalizedName(Constants.Mod.MODID + ".ritualReader");
|
||||||
|
setMaxStackSize(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced)
|
||||||
|
{
|
||||||
|
NBTHelper.checkNBT(stack);
|
||||||
|
|
||||||
|
EnumRitualReaderState state = this.getState(stack);
|
||||||
|
tooltip.add(TextHelper.localizeEffect(tooltipBase + "currentState", TextHelper.localizeEffect(tooltipBase + state.toString().toLowerCase())));
|
||||||
|
|
||||||
|
tooltip.add("");
|
||||||
|
|
||||||
|
boolean sneaking = Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT);
|
||||||
|
|
||||||
|
if (sneaking)
|
||||||
|
{
|
||||||
|
tooltip.addAll(Arrays.asList(TextHelper.cutLongString(TextHelper.localizeEffect(tooltipBase + "desc." + state.toString().toLowerCase()))));
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
tooltip.add(TextHelper.localizeEffect("tooltip.BloodMagic.extraInfo"));
|
||||||
|
}
|
||||||
|
|
||||||
|
super.addInformation(stack, player, tooltip, advanced);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||||
|
{
|
||||||
|
if (player.isSneaking() && !world.isRemote)
|
||||||
|
{
|
||||||
|
cycleReader(stack, player);
|
||||||
|
|
||||||
|
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void cycleReader(ItemStack stack, EntityPlayer player)
|
||||||
|
{
|
||||||
|
EnumRitualReaderState prevState = getState(stack);
|
||||||
|
int val = prevState.ordinal();
|
||||||
|
int nextVal = val + 1 >= EnumRitualReaderState.values().length ? 0 : val + 1;
|
||||||
|
EnumRitualReaderState nextState = EnumRitualReaderState.values()[nextVal];
|
||||||
|
|
||||||
|
setState(stack, nextState);
|
||||||
|
notifyPlayerOfStateChange(nextState, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void notifyPlayerOfStateChange(EnumRitualReaderState state, EntityPlayer player)
|
||||||
|
{
|
||||||
|
ChatUtil.sendNoSpam(player, new TextComponentTranslation(tooltipBase + "currentState", new TextComponentTranslation(tooltipBase + state.toString().toLowerCase())));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(ItemStack stack, EnumRitualReaderState state)
|
||||||
|
{
|
||||||
|
if (!stack.hasTagCompound())
|
||||||
|
{
|
||||||
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
|
}
|
||||||
|
|
||||||
|
NBTTagCompound tag = stack.getTagCompound();
|
||||||
|
|
||||||
|
tag.setInteger(Constants.NBT.RITUAL_READER, state.ordinal());
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnumRitualReaderState getState(ItemStack stack)
|
||||||
|
{
|
||||||
|
if (!stack.hasTagCompound())
|
||||||
|
{
|
||||||
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
|
return EnumRitualReaderState.INFORMATION;
|
||||||
|
}
|
||||||
|
|
||||||
|
NBTTagCompound tag = stack.getTagCompound();
|
||||||
|
|
||||||
|
return EnumRitualReaderState.values()[tag.getInteger(Constants.NBT.RITUAL_READER)];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Pair<Integer, String>> getVariants()
|
||||||
|
{
|
||||||
|
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
||||||
|
ret.add(new ImmutablePair<Integer, String>(0, "type=normal"));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
|
@ -27,6 +27,7 @@ import WayofTime.bloodmagic.item.ItemExperienceBook;
|
||||||
import WayofTime.bloodmagic.item.ItemInscriptionTool;
|
import WayofTime.bloodmagic.item.ItemInscriptionTool;
|
||||||
import WayofTime.bloodmagic.item.ItemLavaCrystal;
|
import WayofTime.bloodmagic.item.ItemLavaCrystal;
|
||||||
import WayofTime.bloodmagic.item.ItemRitualDiviner;
|
import WayofTime.bloodmagic.item.ItemRitualDiviner;
|
||||||
|
import WayofTime.bloodmagic.item.ItemRitualReader;
|
||||||
import WayofTime.bloodmagic.item.ItemSacrificialDagger;
|
import WayofTime.bloodmagic.item.ItemSacrificialDagger;
|
||||||
import WayofTime.bloodmagic.item.ItemSlate;
|
import WayofTime.bloodmagic.item.ItemSlate;
|
||||||
import WayofTime.bloodmagic.item.ItemTelepositionFocus;
|
import WayofTime.bloodmagic.item.ItemTelepositionFocus;
|
||||||
|
@ -86,6 +87,7 @@ public class ModItems
|
||||||
public static Item packSacrifice;
|
public static Item packSacrifice;
|
||||||
public static Item daggerOfSacrifice;
|
public static Item daggerOfSacrifice;
|
||||||
public static Item ritualDiviner;
|
public static Item ritualDiviner;
|
||||||
|
public static Item ritualReader;
|
||||||
|
|
||||||
public static Item lavaCrystal;
|
public static Item lavaCrystal;
|
||||||
|
|
||||||
|
@ -179,6 +181,7 @@ public class ModItems
|
||||||
daggerOfSacrifice = registerItem(new ItemDaggerOfSacrifice(), Constants.BloodMagicItem.DAGGER_OF_SACRIFICE.getRegName());
|
daggerOfSacrifice = registerItem(new ItemDaggerOfSacrifice(), Constants.BloodMagicItem.DAGGER_OF_SACRIFICE.getRegName());
|
||||||
|
|
||||||
ritualDiviner = registerItem(new ItemRitualDiviner(), Constants.BloodMagicItem.RITUAL_DIVINER.getRegName());
|
ritualDiviner = registerItem(new ItemRitualDiviner(), Constants.BloodMagicItem.RITUAL_DIVINER.getRegName());
|
||||||
|
ritualReader = registerItem(new ItemRitualReader(), Constants.BloodMagicItem.RITUAL_READER.getRegName());
|
||||||
|
|
||||||
lavaCrystal = registerItem(new ItemLavaCrystal(), Constants.BloodMagicItem.LAVA_CRYSTAL.getRegName());
|
lavaCrystal = registerItem(new ItemLavaCrystal(), Constants.BloodMagicItem.LAVA_CRYSTAL.getRegName());
|
||||||
GameRegistry.registerFuelHandler(new ItemLavaCrystal());
|
GameRegistry.registerFuelHandler(new ItemLavaCrystal());
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"forge_marker": 1,
|
||||||
|
"defaults": {
|
||||||
|
"model": "builtin/generated",
|
||||||
|
"transform": "forge:default-item"
|
||||||
|
},
|
||||||
|
"variants": {
|
||||||
|
"type": {
|
||||||
|
"normal": {
|
||||||
|
"textures": {
|
||||||
|
"layer0": "bloodmagic:items/ItemRouterFilterExact"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -222,6 +222,8 @@ tile.BloodMagic.demonCrystalVENGEFUL.name=Vengeful Will Crystal Cluster
|
||||||
tile.BloodMagic.demonCrystalSTEADFAST.name=Steadfast Will Crystal Cluster
|
tile.BloodMagic.demonCrystalSTEADFAST.name=Steadfast Will Crystal Cluster
|
||||||
|
|
||||||
# Tooltips
|
# Tooltips
|
||||||
|
tooltip.BloodMagic.extraInfo=&9-Hold shift for more info-
|
||||||
|
|
||||||
tooltip.BloodMagic.orb.desc=Stores raw Life Essence
|
tooltip.BloodMagic.orb.desc=Stores raw Life Essence
|
||||||
tooltip.BloodMagic.orb.owner=Added by: %s
|
tooltip.BloodMagic.orb.owner=Added by: %s
|
||||||
tooltip.BloodMagic.currentOwner=Current owner: %s
|
tooltip.BloodMagic.currentOwner=Current owner: %s
|
||||||
|
@ -295,6 +297,14 @@ tooltip.BloodMagic.diviner.totalRune=Total Runes: %d
|
||||||
tooltip.BloodMagic.diviner.extraInfo=Press shift for extra info
|
tooltip.BloodMagic.diviner.extraInfo=Press shift for extra info
|
||||||
tooltip.BloodMagic.diviner.currentDirection=Current Direction: %s
|
tooltip.BloodMagic.diviner.currentDirection=Current Direction: %s
|
||||||
|
|
||||||
|
tooltip.BloodMagic.ritualReader.currentState=Current mode: %s
|
||||||
|
tooltip.BloodMagic.ritualReader.set_area=Define Area
|
||||||
|
tooltip.BloodMagic.ritualReader.information=Information
|
||||||
|
tooltip.BloodMagic.ritualReader.set_will_types=Set Will Consumed
|
||||||
|
tooltip.BloodMagic.ritualReader.desc.set_area=Right click on an active Master Ritual stone to cycle what area of the ritual you want to modify. Then click on the two corners of the new range you want to set the range.
|
||||||
|
tooltip.BloodMagic.ritualReader.desc.information=Right click on an active Master Ritual Stone to gather basic information about the ritual.
|
||||||
|
tooltip.BloodMagic.ritualReader.desc.set_will_types=Set the types of demon will that the ritual will consume from the aura by right clicking on the MRS with the same types of crystals on your hotbar.
|
||||||
|
|
||||||
tooltip.BloodMagic.arcaneAshes=Ashes used to draw an alchemy circle
|
tooltip.BloodMagic.arcaneAshes=Ashes used to draw an alchemy circle
|
||||||
|
|
||||||
tooltip.BloodMagic.telepositionFocus.coords=Current coordinates: (%d, %d, %d)
|
tooltip.BloodMagic.telepositionFocus.coords=Current coordinates: (%d, %d, %d)
|
||||||
|
|
Loading…
Reference in a new issue