Finished implementation of Incense Altar and associated blocks.

Also added the recipe for the Ritual Tinkerer, as well as the finalized book entry for the Incense Altar.
This commit is contained in:
WayofTime 2020-11-13 19:44:57 -05:00
parent 7634404dac
commit cb2db9bc50
108 changed files with 2197 additions and 81 deletions

View file

@ -78,6 +78,16 @@ public class BloodMagicItems
public static final RegistryObject<Item> BLOOD_ALTAR_ITEM = ITEMS.register("altar", () -> new BlockItem(BloodMagicBlocks.BLOOD_ALTAR.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> ALCHEMY_TABLE_ITEM = ITEMS.register("alchemytable", () -> new ItemBlockAlchemyTable(BloodMagicBlocks.ALCHEMY_TABLE.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> INCENSE_ALTAR_ITEM = ITEMS.register("incensealtar", () -> new BlockItem(BloodMagicBlocks.INCENSE_ALTAR.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> WOOD_PATH_ITEM = ITEMS.register("woodbrickpath", () -> new BlockItem(BloodMagicBlocks.WOOD_PATH.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> WOOD_TILE_PATH_ITEM = ITEMS.register("woodtilepath", () -> new BlockItem(BloodMagicBlocks.WOOD_TILE_PATH.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> STONE_PATH_ITEM = ITEMS.register("stonebrickpath", () -> new BlockItem(BloodMagicBlocks.STONE_PATH.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> STONE_TILE_PATH_ITEM = ITEMS.register("stonetilepath", () -> new BlockItem(BloodMagicBlocks.STONE_TILE_PATH.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> WORN_STONE_PATH_ITEM = ITEMS.register("wornstonebrickpath", () -> new BlockItem(BloodMagicBlocks.WORN_STONE_PATH.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> WORN_STONE_TILE_PATH_ITEM = ITEMS.register("wornstonetilepath", () -> new BlockItem(BloodMagicBlocks.WORN_STONE_TILE_PATH.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> OBSIDIAN_PATH_ITEM = ITEMS.register("obsidianbrickpath", () -> new BlockItem(BloodMagicBlocks.OBSIDIAN_PATH.get(), new Item.Properties().group(BloodMagic.TAB)));
public static final RegistryObject<Item> OBSIDIAN_TILE_PATH_ITEM = ITEMS.register("obsidiantilepath", () -> new BlockItem(BloodMagicBlocks.OBSIDIAN_TILE_PATH.get(), new Item.Properties().group(BloodMagic.TAB)));
// TODO: Need to rework the above instantiations for the ItemBlocks so that it's
// done with the Blocks.
@ -90,6 +100,7 @@ public class BloodMagicItems
public static final RegistryObject<Item> MASTER_BLOOD_ORB = BASICITEMS.register("masterbloodorb", () -> new ItemBloodOrb(ORB_MASTER));
public static final RegistryObject<Item> DIVINATION_SIGIL = BASICITEMS.register("divinationsigil", () -> new ItemSigilDivination(true));
public static final RegistryObject<Item> SEER_SIGIL = BASICITEMS.register("seersigil", () -> new ItemSigilDivination(false));
public static final RegistryObject<Item> SACRIFICIAL_DAGGER = BASICITEMS.register("sacrificialdagger", () -> new ItemSacrificialDagger());
public static final RegistryObject<Item> SLATE = BASICITEMS.register("blankslate", () -> new ItemBase());
public static final RegistryObject<Item> REINFORCED_SLATE = BASICITEMS.register("reinforcedslate", () -> new ItemBase());
@ -136,6 +147,7 @@ public class BloodMagicItems
public static final RegistryObject<Item> REAGENT_MAGNETISM = BASICITEMS.register("reagentmagnetism", () -> new ItemBase());
public static final RegistryObject<Item> REAGENT_AIR = BASICITEMS.register("reagentair", () -> new ItemBase());
public static final RegistryObject<Item> REAGENT_BLOOD_LIGHT = BASICITEMS.register("reagentbloodlight", () -> new ItemBase());
public static final RegistryObject<Item> REAGENT_SIGHT = BASICITEMS.register("reagentsight", () -> new ItemBase());
// Tartaric Gems
public static final RegistryObject<Item> PETTY_GEM = ITEMS.register("soulgempetty", () -> new ItemSoulGem("petty", 64));

View file

@ -25,6 +25,7 @@ import wayoftime.bloodmagic.ConfigHandler;
import wayoftime.bloodmagic.event.SacrificeKnifeUsedEvent;
import wayoftime.bloodmagic.util.Constants;
import wayoftime.bloodmagic.util.DamageSourceBloodMagic;
import wayoftime.bloodmagic.util.helper.IncenseHelper;
import wayoftime.bloodmagic.util.helper.NBTHelper;
import wayoftime.bloodmagic.util.helper.PlayerHelper;
import wayoftime.bloodmagic.util.helper.PlayerSacrificeHelper;
@ -52,7 +53,14 @@ public class ItemSacrificialDagger extends Item
public void onPlayerStoppedUsing(ItemStack stack, World worldIn, LivingEntity entityLiving, int timeLeft)
{
if (entityLiving instanceof PlayerEntity && !entityLiving.getEntityWorld().isRemote)
PlayerSacrificeHelper.sacrificePlayerHealth((PlayerEntity) entityLiving);
if (PlayerSacrificeHelper.sacrificePlayerHealth((PlayerEntity) entityLiving))
IncenseHelper.setHasMaxIncense(stack, (PlayerEntity) entityLiving, false);
}
@Override
public boolean hasEffect(ItemStack stack)
{
return IncenseHelper.getHasMaxIncense(stack) || super.hasEffect(stack);
}
@Override
@ -114,13 +122,15 @@ public class ItemSacrificialDagger extends Item
return super.onItemRightClick(world, player, hand);
lpAdded = evt.lpAdded;
} else if (player.isSneaking())
{
lpAdded = Integer.MAX_VALUE;
}
double posX = player.getPosX();
double posY = player.getPosY();
double posZ = player.getPosZ();
world.playSound(player, posX, posY, posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat())
* 0.8F);
world.playSound(player, posX, posY, posZ, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
for (int l = 0; l < 8; ++l)
world.addParticle(RedstoneParticleData.REDSTONE_DUST, posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), 0, 0, 0);

View file

@ -6,6 +6,7 @@ import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
@ -36,7 +37,7 @@ public class ItemSigilBase extends ItemSigil
@OnlyIn(Dist.CLIENT)
public void addInformation(ItemStack stack, World world, List<ITextComponent> tooltip, ITooltipFlag flag)
{
tooltip.add(new TranslationTextComponent(tooltipBase + "desc"));
tooltip.add(new TranslationTextComponent(tooltipBase + "desc").mergeStyle(TextFormatting.ITALIC));
// if (TextHelper.canTranslate(tooltipBase + "desc"))
// tooltip.addAll(Arrays.asList(WordUtils.wrap(TextHelper.localizeEffect(tooltipBase
// + "desc"), 30, "/cut", false).split("/cut")));

View file

@ -20,6 +20,7 @@ import wayoftime.bloodmagic.altar.IBloodAltar;
import wayoftime.bloodmagic.core.data.Binding;
import wayoftime.bloodmagic.iface.IAltarReader;
import wayoftime.bloodmagic.iface.ISigil;
import wayoftime.bloodmagic.tile.TileIncenseAltar;
import wayoftime.bloodmagic.util.ChatUtil;
import wayoftime.bloodmagic.util.helper.NetworkHelper;
import wayoftime.bloodmagic.util.helper.NumeralHelper;
@ -27,10 +28,12 @@ import wayoftime.bloodmagic.util.helper.PlayerHelper;
public class ItemSigilDivination extends ItemSigilBase implements IAltarReader
{
private final boolean isSimple;
public ItemSigilDivination(boolean simple)
{
super(simple ? "divination" : "seer");
isSimple = simple;
}
@Override
@ -51,7 +54,7 @@ public class ItemSigilDivination extends ItemSigilBase implements IAltarReader
super.onItemRightClick(world, player, hand);
Binding binding = getBinding(stack);
if (binding != null)
if (isSimple && binding != null)
{
int currentEssence = NetworkHelper.getSoulNetwork(binding).getCurrentEssence();
List<ITextComponent> toSend = Lists.newArrayList();
@ -73,18 +76,21 @@ public class ItemSigilDivination extends ItemSigilBase implements IAltarReader
int currentEssence = altar.getCurrentBlood();
int capacity = altar.getCapacity();
altar.checkTier();
ChatUtil.sendNoSpam(player, new TranslationTextComponent(tooltipBase
+ "currentAltarTier", NumeralHelper.toRoman(tier)), new TranslationTextComponent(tooltipBase
+ "currentEssence", currentEssence), new TranslationTextComponent(tooltipBase
+ "currentAltarCapacity", capacity));
if (isSimple)
{
ChatUtil.sendNoSpam(player, new TranslationTextComponent(tooltipBase + "currentAltarTier", NumeralHelper.toRoman(tier)), new TranslationTextComponent(tooltipBase + "currentEssence", currentEssence), new TranslationTextComponent(tooltipBase + "currentAltarCapacity", capacity));
} else
{
ChatUtil.sendNoSpam(player, new TranslationTextComponent(tooltipBase + "currentAltarTier", NumeralHelper.toRoman(tier)), new TranslationTextComponent(tooltipBase + "currentEssence", currentEssence), new TranslationTextComponent(tooltipBase + "currentAltarCapacity", capacity));
}
} else if (tile != null && tile instanceof TileIncenseAltar)
{
TileIncenseAltar altar = (TileIncenseAltar) tile;
altar.recheckConstruction();
double tranquility = altar.tranquility;
ChatUtil.sendNoSpam(player, new TranslationTextComponent(tooltipBase + "currentTranquility", (int) ((100D * (int) (100 * tranquility)) / 100d)), new TranslationTextComponent(tooltipBase + "currentBonus", (int) (100 * altar.incenseAddition)));
}
// else if (tile != null && tile instanceof TileIncenseAltar)
// {
// TileIncenseAltar altar = (TileIncenseAltar) tile;
// altar.recheckConstruction();
// double tranquility = altar.tranquility;
// ChatUtil.sendNoSpam(player, new TextComponentTranslation(tooltipBase + "currentTranquility", (int) ((100D * (int) (100 * tranquility)) / 100d)), new TextComponentTranslation(tooltipBase + "currentBonus", (int) (100 * altar.incenseAddition)));
// } else if (tile != null && tile instanceof TileInversionPillar)
// else if (tile != null && tile instanceof TileInversionPillar)
// {
// TileInversionPillar pillar = (TileInversionPillar) tile;
// double inversion = pillar.getCurrentInversion();
@ -98,8 +104,7 @@ public class ItemSigilDivination extends ItemSigilBase implements IAltarReader
int currentEssence = NetworkHelper.getSoulNetwork(binding).getCurrentEssence();
List<ITextComponent> toSend = Lists.newArrayList();
if (!binding.getOwnerId().equals(player.getGameProfile().getId()))
toSend.add(new TranslationTextComponent(tooltipBase
+ "otherNetwork", binding.getOwnerName()));
toSend.add(new TranslationTextComponent(tooltipBase + "otherNetwork", binding.getOwnerName()));
toSend.add(new TranslationTextComponent(tooltipBase + "currentEssence", currentEssence));
ChatUtil.sendNoSpam(player, toSend.toArray(new ITextComponent[toSend.size()]));
}

View file

@ -8,7 +8,6 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ActionResult;
import net.minecraft.util.ActionResultType;
@ -77,8 +76,6 @@ public class ItemSoulGem extends Item implements IDemonWillGem, IMultiWillTool
if (!stack.hasTag())
return;
Items d;
EnumDemonWillType type = this.getCurrentType(stack);
tooltip.add(new TranslationTextComponent("tooltip.bloodmagic.soulGem." + name));
tooltip.add(new TranslationTextComponent("tooltip.bloodmagic.will", ChatUtil.DECIMAL_FORMAT.format(getWill(type, stack))));
@ -133,8 +130,7 @@ public class ItemSoulGem extends Item implements IDemonWillGem, IMultiWillTool
if (soulsLeft < getMaxWill(thisType, soulGemStack))
{
double newSoulsLeft = Math.min(soulsLeft
+ soul.getWill(thisType, soulStack), getMaxWill(thisType, soulGemStack));
double newSoulsLeft = Math.min(soulsLeft + soul.getWill(thisType, soulStack), getMaxWill(thisType, soulGemStack));
soul.drainWill(thisType, soulStack, newSoulsLeft - soulsLeft);
setWill(thisType, soulGemStack, newSoulsLeft);