Added Syringe Throwing Daggers and Slate Ampoules

The new Throwing Daggers deal 8 damage and have a chance to drop a Slate Ampoule based on the mob killed's max health. Crafted using the Hellfire Forge.
Using a Slate Ampoule next to a Blood Altar fills its main tank with 500LP .
This commit is contained in:
WayofTime 2021-01-26 08:26:33 -05:00
parent abe7333e64
commit d15daa737c
20 changed files with 900 additions and 682 deletions

View file

@ -354,6 +354,7 @@ public class GeneratorLanguage extends LanguageProvider
add("tooltip.bloodmagic.livingarmour.extraExtraInfo", "&9-Hold shift + M for progress info-");
add("tooltip.bloodmagic.slate_vial", "A glass vial infused with a simple slate");
add("tooltip.bloodmagic.blood_provider.slate.desc", "A simple ampoule containing 500LP");
add("chat.bloodmagic.living_upgrade_level_increase", "%s has leveled up to %d");
@ -556,6 +557,8 @@ public class GeneratorLanguage extends LanguageProvider
addItem(BloodMagicItems.LIVING_TOME, "Living Armour Upgrade Tome");
addItem(BloodMagicItems.THROWING_DAGGER, "Iron Throwing Dagger");
addItem(BloodMagicItems.THROWING_DAGGER_SYRINGE, "Syringe Throwing Dagger");
addItem(BloodMagicItems.SLATE_AMPOULE, "Slate Ampoule");
// Anointment Items
addItem(BloodMagicItems.SLATE_VIAL, "Slate-infused Vial");

View file

@ -224,6 +224,8 @@ public class BloodMagicItems
public static final RegistryObject<Item> PLANT_OIL = BASICITEMS.register("plantoil", () -> new ItemBase());
public static final RegistryObject<Item> THROWING_DAGGER = BASICITEMS.register("throwing_dagger", ItemThrowingDagger::new);
public static final RegistryObject<Item> THROWING_DAGGER_SYRINGE = BASICITEMS.register("throwing_dagger_syringe", ItemThrowingDaggerSyringe::new);
public static final RegistryObject<Item> SLATE_AMPOULE = BASICITEMS.register("slate_ampoule", () -> new ItemBloodProvider("slate", 500));
// Anointments
public static final RegistryObject<Item> SLATE_VIAL = ITEMS.register("slate_vial", () -> new ItemBase(16, "slate_vial"));

View file

@ -0,0 +1,82 @@
package wayoftime.bloodmagic.common.item;
import java.util.List;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.particles.RedstoneParticleData;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
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;
import net.minecraftforge.api.distmarker.OnlyIn;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.altar.IBloodAltar;
import wayoftime.bloodmagic.util.helper.PlayerHelper;
import wayoftime.bloodmagic.util.helper.PlayerSacrificeHelper;
public class ItemBloodProvider extends Item
{
protected final String tooltipBase;
public final int lpProvided;
public ItemBloodProvider(String name, int lpProvided)
{
super(new Item.Properties().maxStackSize(64).group(BloodMagic.TAB));
this.tooltipBase = "tooltip.bloodmagic.blood_provider." + name + ".";
this.lpProvided = lpProvided;
}
public ItemBloodProvider(String name)
{
this(name, 0);
}
@Override
public ActionResult<ItemStack> onItemRightClick(World world, PlayerEntity player, Hand hand)
{
ItemStack stack = player.getHeldItem(hand);
if (PlayerHelper.isFakePlayer(player))
return super.onItemRightClick(world, player, hand);
IBloodAltar altarEntity = PlayerSacrificeHelper.getAltar(world, player.getPosition());
if (altarEntity != null)
{
double posX = player.getPosX();
double posY = player.getPosY();
double posZ = player.getPosZ();
world.playSound(player, posX, posY, posZ, SoundEvents.BLOCK_GLASS_BREAK, 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);
if (!world.isRemote && PlayerHelper.isFakePlayer(player))
return super.onItemRightClick(world, player, hand);
altarEntity.fillMainTank(lpProvided);
if (!player.isCreative())
{
stack.shrink(1);
}
}
return super.onItemRightClick(world, player, hand);
}
@Override
@OnlyIn(Dist.CLIENT)
public void addInformation(ItemStack stack, World world, List<ITextComponent> tooltip, ITooltipFlag flag)
{
tooltip.add(new TranslationTextComponent(tooltipBase + "desc").mergeStyle(TextFormatting.ITALIC));
super.addInformation(stack, world, tooltip, flag);
}
}

View file

@ -12,18 +12,20 @@ import net.minecraft.util.Hand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
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;
import net.minecraftforge.api.distmarker.OnlyIn;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.api.compat.EnumDemonWillType;
import wayoftime.bloodmagic.entity.projectile.AbstractEntityThrowingDagger;
import wayoftime.bloodmagic.entity.projectile.EntityThrowingDagger;
import wayoftime.bloodmagic.will.PlayerDemonWillHandler;
public class ItemThrowingDagger extends Item
{
public static int[] soulBracket = new int[] { 16, 60, 200, 400, 1000, 2000, 4000 };
public static int[] soulBracket = new int[] { 1, 60, 200, 400, 1000, 2000, 4000 };
public static double[] soulDrop = new double[] { 2, 4, 7, 10, 13, 15, 18 };
public static double[] staticDrop = new double[] { 1, 1, 2, 3, 3, 4, 4 };
@ -61,9 +63,7 @@ public class ItemThrowingDagger extends Item
ItemStack copyStack = stack.copy();
copyStack.setCount(1);
EntityThrowingDagger dagger = new EntityThrowingDagger(copyStack, worldIn, playerIn);
dagger.func_234612_a_(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 3F, 0.5F);
dagger.setDamage(10);
AbstractEntityThrowingDagger dagger = getDagger(copyStack, worldIn, playerIn);
int level = getLevel(souls);
if (level >= 0)
@ -84,6 +84,14 @@ public class ItemThrowingDagger extends Item
return new ActionResult<>(ActionResultType.SUCCESS, stack);
}
public AbstractEntityThrowingDagger getDagger(ItemStack stack, World world, PlayerEntity player)
{
AbstractEntityThrowingDagger dagger = new EntityThrowingDagger(stack, world, player);
dagger.func_234612_a_(player, player.rotationPitch, player.rotationYaw, 0.0F, 3F, 0.5F);
dagger.setDamage(10);
return dagger;
}
private int getLevel(double soulsRemaining)
{
int lvl = -1;
@ -102,7 +110,7 @@ public class ItemThrowingDagger extends Item
@OnlyIn(Dist.CLIENT)
public void addInformation(ItemStack stack, World world, List<ITextComponent> tooltip, ITooltipFlag flag)
{
tooltip.add(new TranslationTextComponent("tooltip.bloodmagic.throwing_dagger.desc"));
tooltip.add(new TranslationTextComponent("tooltip.bloodmagic.throwing_dagger.desc").mergeStyle(TextFormatting.ITALIC));
super.addInformation(stack, world, tooltip, flag);
}

View file

@ -0,0 +1,19 @@
package wayoftime.bloodmagic.common.item;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import wayoftime.bloodmagic.entity.projectile.AbstractEntityThrowingDagger;
import wayoftime.bloodmagic.entity.projectile.EntityThrowingDaggerSyringe;
public class ItemThrowingDaggerSyringe extends ItemThrowingDagger
{
@Override
public AbstractEntityThrowingDagger getDagger(ItemStack stack, World world, PlayerEntity player)
{
AbstractEntityThrowingDagger dagger = new EntityThrowingDaggerSyringe(stack, world, player);
dagger.func_234612_a_(player, player.rotationPitch, player.rotationYaw, 0.0F, 3F, 0.5F);
dagger.setDamage(8);
return dagger;
}
}

View file

@ -60,6 +60,7 @@ public class TartaricForgeRecipeProvider implements ISubRecipeProvider
TartaricForgeRecipeBuilder.tartaricForge(stack, 60, 1, Ingredient.fromItems(BloodMagicItems.DEFORESTER_CHARGE_ITEM.get())).build(consumer, BloodMagic.rl(basePath + "deforester_charge_smelting"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.THROWING_DAGGER.get(), 16), 32, 5, Ingredient.fromTag(Tags.Items.INGOTS_IRON), Ingredient.fromTag(Tags.Items.INGOTS_IRON), Ingredient.fromTag(Tags.Items.STRING)).build(consumer, BloodMagic.rl(basePath + "throwing_dagger"));
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.THROWING_DAGGER_SYRINGE.get(), 16), 10, 2, Ingredient.fromTag(Tags.Items.STONE), Ingredient.fromTag(Tags.Items.GLASS)).build(consumer, BloodMagic.rl(basePath + "throwing_dagger_syringe"));
// Changed Recipes
{

View file

@ -5,10 +5,10 @@ import net.minecraft.entity.EntityType;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.common.registration.impl.EntityTypeDeferredRegister;
import wayoftime.bloodmagic.common.registration.impl.EntityTypeRegistryObject;
import wayoftime.bloodmagic.entity.projectile.AbstractEntityThrowingDagger;
import wayoftime.bloodmagic.entity.projectile.EntityBloodLight;
import wayoftime.bloodmagic.entity.projectile.EntityShapedCharge;
import wayoftime.bloodmagic.entity.projectile.EntitySoulSnare;
import wayoftime.bloodmagic.entity.projectile.EntityThrowingDagger;
public class BloodMagicEntityTypes
{
@ -20,7 +20,7 @@ public class BloodMagicEntityTypes
public static final EntityTypeDeferredRegister ENTITY_TYPES = new EntityTypeDeferredRegister(BloodMagic.MODID);
public static final EntityTypeRegistryObject<EntitySoulSnare> SNARE = ENTITY_TYPES.register("soulsnare", EntityType.Builder.<EntitySoulSnare>create(EntitySoulSnare::new, EntityClassification.MISC).setTrackingRange(64).setUpdateInterval(1).size(0.25f, 0.25f));
public static final EntityTypeRegistryObject<EntityThrowingDagger> THROWING_DAGGER = ENTITY_TYPES.register("throwing_dagger", EntityType.Builder.<EntityThrowingDagger>create(EntityThrowingDagger::new, EntityClassification.MISC).setTrackingRange(64).setUpdateInterval(1).size(0.25f, 0.25f));
public static final EntityTypeRegistryObject<AbstractEntityThrowingDagger> THROWING_DAGGER = ENTITY_TYPES.register("throwing_dagger", EntityType.Builder.<AbstractEntityThrowingDagger>create(AbstractEntityThrowingDagger::new, EntityClassification.MISC).setTrackingRange(64).setUpdateInterval(1).size(0.25f, 0.25f));
public static final EntityTypeRegistryObject<EntityBloodLight> BLOOD_LIGHT = ENTITY_TYPES.register("bloodlight", EntityType.Builder.<EntityBloodLight>create(EntityBloodLight::new, EntityClassification.MISC).setTrackingRange(64).setUpdateInterval(1).size(0.25f, 0.25f));
public static final EntityTypeRegistryObject<EntityShapedCharge> SHAPED_CHARGE = ENTITY_TYPES.register("shapedcharge", EntityType.Builder.<EntityShapedCharge>create(EntityShapedCharge::new, EntityClassification.MISC).setTrackingRange(64).setUpdateInterval(1).size(0.4f, 0.4f));