Implemented RitualDiviner

Finished fully implementing the Ritual Diviner item. Changed the `cycleDirection` method to occur when the player does not sneak + right clicks, because the method for when a player left clicks with an item seems to have dissapeared.
This commit is contained in:
WayofTime 2020-10-25 10:55:38 -04:00
parent 85e47dbfa8
commit e254287a5e
9 changed files with 78 additions and 50 deletions

View file

@ -109,6 +109,7 @@ public class BloodMagicItems
public static final RegistryObject<Item> DUSK_INSCRIPTION_TOOL = BASICITEMS.register("duskscribetool", () -> new ItemInscriptionTool(EnumRuneType.DUSK));
public static final RegistryObject<Item> BASE_RITUAL_DIVINER = BASICITEMS.register("ritualdiviner", () -> new ItemRitualDiviner(0));
public static final RegistryObject<Item> DUSK_RITUAL_DIVINER = BASICITEMS.register("ritualdivinerdusk", () -> new ItemRitualDiviner(1));
// Reagents used to make the Sigils
public static final RegistryObject<Item> REAGENT_WATER = BASICITEMS.register("reagentwater", () -> new ItemBase());

View file

@ -28,6 +28,7 @@ import net.minecraft.util.math.RayTraceContext;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
@ -232,7 +233,7 @@ public class ItemRitualDiviner extends Item
boolean sneaking = Screen.hasShiftDown();
// boolean extraInfo = sneaking && Keyboard.isKeyDown(Keyboard.KEY_M);
boolean extraInfo = Screen.hasAltDown();
boolean extraInfo = sneaking && Screen.hasAltDown();
if (extraInfo)
{
@ -315,8 +316,8 @@ public class ItemRitualDiviner extends Item
tooltip.add(new StringTextComponent(""));
}
tooltip.add(new TranslationTextComponent(tooltipBase + "extraInfo"));
tooltip.add(new TranslationTextComponent(tooltipBase + "extraExtraInfo"));
tooltip.add(new TranslationTextComponent(tooltipBase + "extraInfo").mergeStyle(TextFormatting.BLUE));
tooltip.add(new TranslationTextComponent(tooltipBase + "extraExtraInfo").mergeStyle(TextFormatting.BLUE));
}
}
}
@ -341,6 +342,12 @@ public class ItemRitualDiviner extends Item
}
return new ActionResult<>(ActionResultType.SUCCESS, stack);
} else
{
if (!world.isRemote)
{
cycleDirection(stack, player);
}
}
return new ActionResult<>(ActionResultType.PASS, stack);