Added the Iron Throwing Dagger

Throwing Dagger does 10 damage when it hits a mob, and triggers a 2.5s cooldown similar to Ender Pearls (so they cannot be spammed). If the player has enough Demon Will in their contained gems, when a mob is killed with the Throwing Dagger they give Will to the player similar to the Sentient Sword.
This commit is contained in:
WayofTime 2021-01-25 10:17:38 -05:00
parent e349c424bf
commit 1b06cea133
15 changed files with 904 additions and 3 deletions

View file

@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
version = '1.16.3-3.1.0-13' version = '1.16.4-3.1.0-14'
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'BloodMagic' archivesBaseName = 'BloodMagic'

View file

@ -60,7 +60,7 @@ e6d9cf699667aaa47efff37b2b033895dee29c15 assets/bloodmagic/blockstates/waterritu
42f26f715bddd16c069f9b51e3767b36477c8908 assets/bloodmagic/blockstates/woodtilepath.json 42f26f715bddd16c069f9b51e3767b36477c8908 assets/bloodmagic/blockstates/woodtilepath.json
3c6ce233dae6c1307d9016406c324bbe844b4e1e assets/bloodmagic/blockstates/wornstonebrickpath.json 3c6ce233dae6c1307d9016406c324bbe844b4e1e assets/bloodmagic/blockstates/wornstonebrickpath.json
d59655f12d1724b73b77c373fb6864fcff69db12 assets/bloodmagic/blockstates/wornstonetilepath.json d59655f12d1724b73b77c373fb6864fcff69db12 assets/bloodmagic/blockstates/wornstonetilepath.json
c6b526280893eb282ee8284df5668b0c7597200c assets/bloodmagic/lang/en_us.json d368d170cab57d2e1b382b4ff461424f82dc47aa assets/bloodmagic/lang/en_us.json
34445195b9f2459475cde53454bc8e37d32865d7 assets/bloodmagic/models/block/accelerationrune.json 34445195b9f2459475cde53454bc8e37d32865d7 assets/bloodmagic/models/block/accelerationrune.json
bcdbccc49d4509571be6988762ab87126275a4c8 assets/bloodmagic/models/block/airritualstone.json bcdbccc49d4509571be6988762ab87126275a4c8 assets/bloodmagic/models/block/airritualstone.json
adf6c0b1e25451609486dc8c8cfbd9cf0f8c67f4 assets/bloodmagic/models/block/alchemicalreactionchamber.json adf6c0b1e25451609486dc8c8cfbd9cf0f8c67f4 assets/bloodmagic/models/block/alchemicalreactionchamber.json
@ -350,6 +350,7 @@ fe2b201007c974229509f6900c6eb8b03d158b0a assets/bloodmagic/models/item/soulsword
29009ca92dc30e1ec4ae1d454cd3f8726d8edc3c assets/bloodmagic/models/item/stonebrickpath.json 29009ca92dc30e1ec4ae1d454cd3f8726d8edc3c assets/bloodmagic/models/item/stonebrickpath.json
2dc28b0e2b7ae7bb0bcf8c8e74b9ba7c800446ff assets/bloodmagic/models/item/stonetilepath.json 2dc28b0e2b7ae7bb0bcf8c8e74b9ba7c800446ff assets/bloodmagic/models/item/stonetilepath.json
1992b3655f7bbca8b7aac7c53f1a0e7b1ab3124d assets/bloodmagic/models/item/sulfur.json 1992b3655f7bbca8b7aac7c53f1a0e7b1ab3124d assets/bloodmagic/models/item/sulfur.json
451fa4812d23a207882eb95d89673b1e4c2dd257 assets/bloodmagic/models/item/throwing_dagger.json
d13731c45f6dd23b8e70d2a75d4068bdae88ef5c assets/bloodmagic/models/item/upgradetome.json d13731c45f6dd23b8e70d2a75d4068bdae88ef5c assets/bloodmagic/models/item/upgradetome.json
e8fe01c5cddc268538681889f3161472a8f1c8ad assets/bloodmagic/models/item/variants/growthsigil_activated.json e8fe01c5cddc268538681889f3161472a8f1c8ad assets/bloodmagic/models/item/variants/growthsigil_activated.json
20c802279de4df496057795c2e891fa54a21376f assets/bloodmagic/models/item/variants/growthsigil_deactivated.json 20c802279de4df496057795c2e891fa54a21376f assets/bloodmagic/models/item/variants/growthsigil_deactivated.json
@ -700,6 +701,7 @@ d6e06747c75fc06e708a15358911f1c63eee86b1 data/bloodmagic/recipes/soulforge/petty
7e281841a2953c1284d332c2bbf75097f8128241 data/bloodmagic/recipes/soulforge/sentientsword.json 7e281841a2953c1284d332c2bbf75097f8128241 data/bloodmagic/recipes/soulforge/sentientsword.json
dc977e9d98fcba66fbcce3f6c31a746db5ed60f5 data/bloodmagic/recipes/soulforge/shaped_charge.json dc977e9d98fcba66fbcce3f6c31a746db5ed60f5 data/bloodmagic/recipes/soulforge/shaped_charge.json
c4102a1573e632d0b9f894353b0d522a51a7c65e data/bloodmagic/recipes/soulforge/steadfast_crystal_block.json c4102a1573e632d0b9f894353b0d522a51a7c65e data/bloodmagic/recipes/soulforge/steadfast_crystal_block.json
ed0875aaba76e013684b8ea2f8275d5563e90e98 data/bloodmagic/recipes/soulforge/throwing_dagger.json
978033adf58e34fa317bcea448ac1ddf3f0cd69e data/bloodmagic/recipes/soulforge/vein_charge.json 978033adf58e34fa317bcea448ac1ddf3f0cd69e data/bloodmagic/recipes/soulforge/vein_charge.json
3aa852edda803a2225ebe53d2daa55bd46b0a1b9 data/bloodmagic/recipes/soulforge/vengeful_crystal_block.json 3aa852edda803a2225ebe53d2daa55bd46b0a1b9 data/bloodmagic/recipes/soulforge/vengeful_crystal_block.json
d7d993bb729284a5201c164ea81fbe1d8e4e4750 data/bloodmagic/recipes/weak_activation_crystal.json d7d993bb729284a5201c164ea81fbe1d8e4e4750 data/bloodmagic/recipes/weak_activation_crystal.json

View file

@ -65,7 +65,7 @@
"block.bloodmagic.steadfastdemoncrystal": "Steadfast Crystal Cluster", "block.bloodmagic.steadfastdemoncrystal": "Steadfast Crystal Cluster",
"block.bloodmagic.stonebrickpath": "Stone Path", "block.bloodmagic.stonebrickpath": "Stone Path",
"block.bloodmagic.stonetilepath": "Tiled Stone Path", "block.bloodmagic.stonetilepath": "Tiled Stone Path",
"block.bloodmagic.veinmine_charge": "Vein Charge", "block.bloodmagic.veinmine_charge": "Controlled Charge",
"block.bloodmagic.vengefuldemoncrystal": "Vengeful Crystal Cluster", "block.bloodmagic.vengefuldemoncrystal": "Vengeful Crystal Cluster",
"block.bloodmagic.waterritualstone": "Water Ritual Stone", "block.bloodmagic.waterritualstone": "Water Ritual Stone",
"block.bloodmagic.woodbrickpath": "Wooden Path", "block.bloodmagic.woodbrickpath": "Wooden Path",
@ -184,6 +184,7 @@
"item.bloodmagic.soulsword": "Sentient Sword", "item.bloodmagic.soulsword": "Sentient Sword",
"item.bloodmagic.steadfastcrystal": "Steadfast Will Crystal", "item.bloodmagic.steadfastcrystal": "Steadfast Will Crystal",
"item.bloodmagic.sulfur": "Sulfur", "item.bloodmagic.sulfur": "Sulfur",
"item.bloodmagic.throwing_dagger": "Iron Throwing Dagger",
"item.bloodmagic.upgradetome": "Living Armour Upgrade Tome", "item.bloodmagic.upgradetome": "Living Armour Upgrade Tome",
"item.bloodmagic.vengefulcrystal": "Vengeful Will Crystal", "item.bloodmagic.vengefulcrystal": "Vengeful Will Crystal",
"item.bloodmagic.voidsigil": "Void Sigil", "item.bloodmagic.voidsigil": "Void Sigil",
@ -493,6 +494,7 @@
"tooltip.bloodmagic.soulGem.lesser": "A gem used to contain some will", "tooltip.bloodmagic.soulGem.lesser": "A gem used to contain some will",
"tooltip.bloodmagic.soulGem.petty": "A gem used to contain a little will", "tooltip.bloodmagic.soulGem.petty": "A gem used to contain a little will",
"tooltip.bloodmagic.soulSnare.desc": "Throw at a monster and then kill them to obtain their demonic will", "tooltip.bloodmagic.soulSnare.desc": "Throw at a monster and then kill them to obtain their demonic will",
"tooltip.bloodmagic.throwing_dagger.desc": "Not to be used in the kitchen",
"tooltip.bloodmagic.tier": "Tier %d", "tooltip.bloodmagic.tier": "Tier %d",
"tooltip.bloodmagic.will": "Will Quality: %s" "tooltip.bloodmagic.will": "Will Quality: %s"
} }

View file

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "bloodmagic:item/throwing_dagger"
}
}

View file

@ -0,0 +1,18 @@
{
"type": "bloodmagic:soulforge",
"input0": {
"tag": "forge:ingots/iron"
},
"input1": {
"tag": "forge:ingots/iron"
},
"input2": {
"tag": "forge:string"
},
"output": {
"item": "bloodmagic:throwing_dagger",
"count": 16
},
"minimumDrain": 32.0,
"drain": 5.0
}

View file

@ -39,6 +39,7 @@ import wayoftime.bloodmagic.client.render.block.RenderAltar;
import wayoftime.bloodmagic.client.render.block.RenderDemonCrucible; import wayoftime.bloodmagic.client.render.block.RenderDemonCrucible;
import wayoftime.bloodmagic.client.render.entity.BloodLightRenderer; import wayoftime.bloodmagic.client.render.entity.BloodLightRenderer;
import wayoftime.bloodmagic.client.render.entity.EntityShapedChargeRenderer; import wayoftime.bloodmagic.client.render.entity.EntityShapedChargeRenderer;
import wayoftime.bloodmagic.client.render.entity.EntityThrowingDaggerRenderer;
import wayoftime.bloodmagic.client.render.entity.SoulSnareRenderer; import wayoftime.bloodmagic.client.render.entity.SoulSnareRenderer;
import wayoftime.bloodmagic.client.screens.ScreenAlchemicalReactionChamber; import wayoftime.bloodmagic.client.screens.ScreenAlchemicalReactionChamber;
import wayoftime.bloodmagic.client.screens.ScreenAlchemyTable; import wayoftime.bloodmagic.client.screens.ScreenAlchemyTable;
@ -132,6 +133,7 @@ public class ClientEvents
public static void initClientEvents(FMLClientSetupEvent event) public static void initClientEvents(FMLClientSetupEvent event)
{ {
RenderingRegistry.registerEntityRenderingHandler(BloodMagicEntityTypes.SNARE.getEntityType(), SoulSnareRenderer::new); RenderingRegistry.registerEntityRenderingHandler(BloodMagicEntityTypes.SNARE.getEntityType(), SoulSnareRenderer::new);
RenderingRegistry.registerEntityRenderingHandler(BloodMagicEntityTypes.THROWING_DAGGER.getEntityType(), EntityThrowingDaggerRenderer::new);
RenderingRegistry.registerEntityRenderingHandler(BloodMagicEntityTypes.BLOOD_LIGHT.getEntityType(), BloodLightRenderer::new); RenderingRegistry.registerEntityRenderingHandler(BloodMagicEntityTypes.BLOOD_LIGHT.getEntityType(), BloodLightRenderer::new);
RenderingRegistry.registerEntityRenderingHandler(BloodMagicEntityTypes.SHAPED_CHARGE.getEntityType(), EntityShapedChargeRenderer::new); RenderingRegistry.registerEntityRenderingHandler(BloodMagicEntityTypes.SHAPED_CHARGE.getEntityType(), EntityShapedChargeRenderer::new);

View file

@ -0,0 +1,70 @@
package wayoftime.bloodmagic.client.render.entity;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Vector3f;
import wayoftime.bloodmagic.entity.projectile.EntityThrowingDagger;
public class EntityThrowingDaggerRenderer<T extends EntityThrowingDagger> extends EntityRenderer<T>
{
private final net.minecraft.client.renderer.ItemRenderer itemRenderer;
private final float scale;
private final boolean field_229126_f_;
public EntityThrowingDaggerRenderer(EntityRendererManager p_i226035_1_, net.minecraft.client.renderer.ItemRenderer p_i226035_2_, float p_i226035_3_, boolean p_i226035_4_)
{
super(p_i226035_1_);
this.itemRenderer = p_i226035_2_;
this.scale = p_i226035_3_;
this.field_229126_f_ = p_i226035_4_;
}
public EntityThrowingDaggerRenderer(EntityRendererManager renderManagerIn)
{
this(renderManagerIn, Minecraft.getInstance().getItemRenderer(), 1.0F, false);
}
protected int getBlockLight(T entityIn, BlockPos partialTicks)
{
return this.field_229126_f_ ? 15 : super.getBlockLight(entityIn, partialTicks);
}
public void render(T entityIn, float entityYaw, float partialTicks, MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int packedLightIn)
{
// System.out.println("Rendering dagger");
// if (entityIn.ticksExisted >= 2 || !(this.renderManager.info.getRenderViewEntity().getDistanceSq(entityIn) < 12.25D))
{
// ArrowRenderer<?> d;
matrixStackIn.push();
matrixStackIn.scale(this.scale, this.scale, this.scale);
// matrixStackIn.rotate(this.renderManager.getCameraOrientation());
matrixStackIn.rotate(Vector3f.YP.rotationDegrees(MathHelper.lerp(partialTicks, entityIn.prevRotationYaw, entityIn.rotationYaw) - 90.0F));
matrixStackIn.rotate(Vector3f.ZP.rotationDegrees(MathHelper.lerp(partialTicks, entityIn.prevRotationPitch, entityIn.rotationPitch) - 45F));
// matrixStackIn.rotate(Vector3f.ZP.rotationDegrees(45F));
// matrixStackIn.rotate(Vector3f.YP.rotationDegrees(180.0F));
this.itemRenderer.renderItem(entityIn.getItem(), ItemCameraTransforms.TransformType.GROUND, packedLightIn, OverlayTexture.NO_OVERLAY, matrixStackIn, bufferIn);
matrixStackIn.pop();
super.render(entityIn, entityYaw, partialTicks, matrixStackIn, bufferIn, packedLightIn);
}
}
/**
* Returns the location of an entity's texture.
*/
public ResourceLocation getEntityTexture(T entity)
{
return AtlasTexture.LOCATION_BLOCKS_TEXTURE;
}
}

View file

@ -120,6 +120,8 @@ public class GeneratorLanguage extends LanguageProvider
add("tooltip.bloodmagic.experienceTome.exp", "Exp: %0.3f"); add("tooltip.bloodmagic.experienceTome.exp", "Exp: %0.3f");
add("tooltip.bloodmagic.experienceTome.expLevel", "Level: %d"); add("tooltip.bloodmagic.experienceTome.expLevel", "Level: %d");
add("tooltip.bloodmagic.throwing_dagger.desc", "Not to be used in the kitchen");
add("key.bloodmagic.category", "Blood Magic"); add("key.bloodmagic.category", "Blood Magic");
// Ritual info // Ritual info
@ -553,6 +555,8 @@ public class GeneratorLanguage extends LanguageProvider
addItem(BloodMagicItems.LIVING_TOME, "Living Armour Upgrade Tome"); addItem(BloodMagicItems.LIVING_TOME, "Living Armour Upgrade Tome");
addItem(BloodMagicItems.THROWING_DAGGER, "Iron Throwing Dagger");
// Anointment Items // Anointment Items
addItem(BloodMagicItems.SLATE_VIAL, "Slate-infused Vial"); addItem(BloodMagicItems.SLATE_VIAL, "Slate-infused Vial");
addItem(BloodMagicItems.MELEE_DAMAGE_ANOINTMENT, "Honing Oil"); addItem(BloodMagicItems.MELEE_DAMAGE_ANOINTMENT, "Honing Oil");

View file

@ -223,6 +223,8 @@ public class BloodMagicItems
public static final RegistryObject<Item> SALTPETER = BASICITEMS.register("saltpeter", () -> new ItemBase()); public static final RegistryObject<Item> SALTPETER = BASICITEMS.register("saltpeter", () -> new ItemBase());
public static final RegistryObject<Item> PLANT_OIL = BASICITEMS.register("plantoil", () -> new ItemBase()); 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);
// Anointments // Anointments
public static final RegistryObject<Item> SLATE_VIAL = ITEMS.register("slate_vial", () -> new ItemBase(16, "slate_vial")); public static final RegistryObject<Item> SLATE_VIAL = ITEMS.register("slate_vial", () -> new ItemBase(16, "slate_vial"));
public static final RegistryObject<Item> MELEE_DAMAGE_ANOINTMENT = ITEMS.register("melee_anointment", () -> new ItemAnointmentProvider(BloodMagic.rl("melee_damage"), 0xFF0000, 1, 256)); public static final RegistryObject<Item> MELEE_DAMAGE_ANOINTMENT = ITEMS.register("melee_anointment", () -> new ItemAnointmentProvider(BloodMagic.rl("melee_damage"), 0xFF0000, 1, 256));

View file

@ -0,0 +1,109 @@
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.util.ActionResult;
import net.minecraft.util.ActionResultType;
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.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.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 double[] soulDrop = new double[] { 2, 4, 7, 10, 13, 15, 18 };
public static double[] staticDrop = new double[] { 1, 1, 2, 3, 3, 4, 4 };
public ItemThrowingDagger()
{
super(new Item.Properties().maxStackSize(64).group(BloodMagic.TAB));
// setTranslationKey(BloodMagic.MODID + ".soulSnare.");
// setCreativeTab(BloodMagic.TAB_BM);
// setHasSubtypes(true);
// setMaxStackSize(16);
}
@Override
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand hand)
{
ItemStack stack = playerIn.getHeldItem(hand);
if (!playerIn.isCreative())
{
stack.shrink(1);
}
playerIn.getCooldownTracker().setCooldown(this, 50);
worldIn.playSound((PlayerEntity) null, playerIn.getPosX(), playerIn.getPosY(), playerIn.getPosZ(), SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F));
if (!worldIn.isRemote)
{
// System.out.println("Attempting to spawn");
// EntitySoulSnare snare = new EntitySoulSnare(worldIn, playerIn);
// snare.func_234612_a_(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
// worldIn.addEntity(snare);
EnumDemonWillType largestType = PlayerDemonWillHandler.getLargestWillType(playerIn);
double souls = PlayerDemonWillHandler.getTotalDemonWill(largestType, playerIn);
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);
int level = getLevel(souls);
if (level >= 0)
{
double willDrop = (soulDrop[level] * worldIn.rand.nextDouble() + staticDrop[level]);
dagger.setWillDrop(willDrop);
dagger.setWillType(largestType);
}
worldIn.addEntity(dagger);
//
// SnowballEntity snowballentity = new SnowballEntity(worldIn, playerIn);
// snowballentity.setItem(itemstack);
// snowballentity.func_234612_a_(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
// worldIn.addEntity(snowballentity);
}
return new ActionResult<>(ActionResultType.SUCCESS, stack);
}
private int getLevel(double soulsRemaining)
{
int lvl = -1;
for (int i = 0; i < soulBracket.length; i++)
{
if (soulsRemaining >= soulBracket[i])
{
lvl = i;
}
}
return lvl;
}
@Override
@OnlyIn(Dist.CLIENT)
public void addInformation(ItemStack stack, World world, List<ITextComponent> tooltip, ITooltipFlag flag)
{
tooltip.add(new TranslationTextComponent("tooltip.bloodmagic.throwing_dagger.desc"));
super.addInformation(stack, world, tooltip, flag);
}
}

View file

@ -59,6 +59,8 @@ 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(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"));
// Changed Recipes // Changed Recipes
{ {
// TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.ARCANE_ASHES.get()), 0, 0, Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE), Ingredient.fromTag(Tags.Items.DYES_WHITE), Ingredient.fromTag(Tags.Items.GUNPOWDER), Ingredient.fromTag(ItemTags.COALS)).build(consumer, BloodMagic.rl(basePath + "arcaneashes")); // TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.ARCANE_ASHES.get()), 0, 0, Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE), Ingredient.fromTag(Tags.Items.DYES_WHITE), Ingredient.fromTag(Tags.Items.GUNPOWDER), Ingredient.fromTag(ItemTags.COALS)).build(consumer, BloodMagic.rl(basePath + "arcaneashes"));

View file

@ -8,6 +8,7 @@ import wayoftime.bloodmagic.common.registration.impl.EntityTypeRegistryObject;
import wayoftime.bloodmagic.entity.projectile.EntityBloodLight; import wayoftime.bloodmagic.entity.projectile.EntityBloodLight;
import wayoftime.bloodmagic.entity.projectile.EntityShapedCharge; import wayoftime.bloodmagic.entity.projectile.EntityShapedCharge;
import wayoftime.bloodmagic.entity.projectile.EntitySoulSnare; import wayoftime.bloodmagic.entity.projectile.EntitySoulSnare;
import wayoftime.bloodmagic.entity.projectile.EntityThrowingDagger;
public class BloodMagicEntityTypes public class BloodMagicEntityTypes
{ {
@ -19,6 +20,7 @@ public class BloodMagicEntityTypes
public static final EntityTypeDeferredRegister ENTITY_TYPES = new EntityTypeDeferredRegister(BloodMagic.MODID); 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<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<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<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)); 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));

View file

@ -2,6 +2,7 @@ package wayoftime.bloodmagic.entity.projectile;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.projectile.ArrowEntity;
import net.minecraft.entity.projectile.ProjectileItemEntity; import net.minecraft.entity.projectile.ProjectileItemEntity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -39,6 +40,7 @@ public class EntitySoulSnare extends ProjectileItemEntity
protected Item getDefaultItem() protected Item getDefaultItem()
{ {
ArrowEntity d;
return BloodMagicItems.SOUL_SNARE.get(); return BloodMagicItems.SOUL_SNARE.get();
} }

View file

@ -0,0 +1,680 @@
package wayoftime.bloodmagic.entity.projectile;
import java.util.List;
import javax.annotation.Nullable;
import com.google.common.collect.Lists;
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
import net.minecraft.block.BlockState;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.entity.projectile.AbstractArrowEntity;
import net.minecraft.entity.projectile.ProjectileHelper;
import net.minecraft.entity.projectile.ProjectileItemEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.network.IPacket;
import net.minecraft.network.play.server.SChangeGameStatePacket;
import net.minecraft.particles.IParticleData;
import net.minecraft.particles.ItemParticleData;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.util.DamageSource;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.EntityRayTraceResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceContext;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.network.NetworkHooks;
import wayoftime.bloodmagic.api.compat.EnumDemonWillType;
import wayoftime.bloodmagic.common.item.BloodMagicItems;
import wayoftime.bloodmagic.common.registries.BloodMagicEntityTypes;
import wayoftime.bloodmagic.will.PlayerDemonWillHandler;
public class EntityThrowingDagger extends ProjectileItemEntity
{
@Nullable
private BlockState inBlockState;
protected boolean inGround;
protected int timeInGround;
public AbstractArrowEntity.PickupStatus pickupStatus = AbstractArrowEntity.PickupStatus.ALLOWED;
public int arrowShake;
private int ticksInGround;
private double damage = 2.0D;
private int knockbackStrength;
private SoundEvent hitSound = this.getHitEntitySound();
private IntOpenHashSet piercedEntities;
private List<Entity> hitEntities;
private ItemStack containedStack = ItemStack.EMPTY;
private double willDrop = 0;
private EnumDemonWillType willType = EnumDemonWillType.DEFAULT;
public EntityThrowingDagger(EntityType<EntityThrowingDagger> p_i50159_1_, World p_i50159_2_)
{
super(p_i50159_1_, p_i50159_2_);
}
public EntityThrowingDagger(ItemStack stack, World worldIn, LivingEntity throwerIn)
{
super(BloodMagicEntityTypes.THROWING_DAGGER.getEntityType(), throwerIn, worldIn);
this.containedStack = stack;
if (throwerIn instanceof PlayerEntity)
{
this.pickupStatus = AbstractArrowEntity.PickupStatus.ALLOWED;
}
}
public EntityThrowingDagger(ItemStack stack, World worldIn, double x, double y, double z)
{
super(BloodMagicEntityTypes.THROWING_DAGGER.getEntityType(), x, y, z, worldIn);
this.containedStack = stack;
}
protected Item getDefaultItem()
{
return BloodMagicItems.THROWING_DAGGER.get();
}
@Override
public IPacket<?> createSpawnPacket()
{
return NetworkHooks.getEntitySpawningPacket(this);
}
@Override
public void tick()
{
// super.tick();
// RayTraceResult raytraceresult = ProjectileHelper.func_234618_a_(this, this::func_230298_a_);
//// boolean flag = false;
// if (raytraceresult.getType() == RayTraceResult.Type.BLOCK)
// {
// BlockPos blockpos = ((BlockRayTraceResult) raytraceresult).getPos().offset(((BlockRayTraceResult) raytraceresult).getFace());
// BlockState blockstate = this.world.getBlockState(blockpos);
// Material material = blockstate.getMaterial();
// if (blockstate.isAir() || blockstate.isIn(BlockTags.FIRE) || material.isLiquid() || material.isReplaceable())
// {
// this.getEntityWorld().setBlockState(blockpos, BloodMagicBlocks.BLOOD_LIGHT.get().getDefaultState());
// this.setDead();
// }
// }
// super.tick();
this.baseTick();
boolean flag = this.getNoClip();
flag = false;
Vector3d vector3d = this.getMotion();
if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
{
float f = MathHelper.sqrt(horizontalMag(vector3d));
this.rotationYaw = (float) (MathHelper.atan2(vector3d.x, vector3d.z) * (double) (180F / (float) Math.PI));
this.rotationPitch = (float) (MathHelper.atan2(vector3d.y, (double) f) * (double) (180F / (float) Math.PI));
this.prevRotationYaw = this.rotationYaw;
this.prevRotationPitch = this.rotationPitch;
}
BlockPos blockpos = this.getPosition();
BlockState blockstate = this.world.getBlockState(blockpos);
if (!blockstate.isAir(this.world, blockpos) && !flag)
{
VoxelShape voxelshape = blockstate.getCollisionShape(this.world, blockpos);
if (!voxelshape.isEmpty())
{
Vector3d vector3d1 = this.getPositionVec();
for (AxisAlignedBB axisalignedbb : voxelshape.toBoundingBoxList())
{
if (axisalignedbb.offset(blockpos).contains(vector3d1))
{
this.inGround = true;
break;
}
}
}
}
if (this.arrowShake > 0)
{
--this.arrowShake;
}
if (this.isWet())
{
this.extinguish();
}
// this.inBlockState.getBlock()
if (this.inGround && !flag)
{
if (this.inBlockState != blockstate && this.func_234593_u_())
{
this.func_234594_z_();
} else if (!this.world.isRemote)
{
this.func_225516_i_();
}
++this.timeInGround;
} else
{
this.timeInGround = 0;
Vector3d vector3d2 = this.getPositionVec();
Vector3d vector3d3 = vector3d2.add(vector3d);
RayTraceResult raytraceresult = this.world.rayTraceBlocks(new RayTraceContext(vector3d2, vector3d3, RayTraceContext.BlockMode.COLLIDER, RayTraceContext.FluidMode.NONE, this));
if (raytraceresult.getType() != RayTraceResult.Type.MISS)
{
vector3d3 = raytraceresult.getHitVec();
}
while (!this.removed)
{
EntityRayTraceResult entityraytraceresult = this.rayTraceEntities(vector3d2, vector3d3);
if (entityraytraceresult != null)
{
raytraceresult = entityraytraceresult;
}
if (raytraceresult != null && raytraceresult.getType() == RayTraceResult.Type.ENTITY)
{
Entity entity = ((EntityRayTraceResult) raytraceresult).getEntity();
Entity entity1 = this.func_234616_v_();
if (entity instanceof PlayerEntity && entity1 instanceof PlayerEntity && !((PlayerEntity) entity1).canAttackPlayer((PlayerEntity) entity))
{
raytraceresult = null;
entityraytraceresult = null;
}
}
if (raytraceresult != null && raytraceresult.getType() != RayTraceResult.Type.MISS && !flag && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, raytraceresult))
{
this.onImpact(raytraceresult);
this.isAirBorne = true;
}
if (entityraytraceresult == null || this.getPierceLevel() <= 0)
{
break;
}
raytraceresult = null;
}
vector3d = this.getMotion();
double d3 = vector3d.x;
double d4 = vector3d.y;
double d0 = vector3d.z;
if (this.getIsCritical())
{
for (int i = 0; i < 4; ++i)
{
this.world.addParticle(ParticleTypes.CRIT, this.getPosX() + d3 * (double) i / 4.0D, this.getPosY() + d4 * (double) i / 4.0D, this.getPosZ() + d0 * (double) i / 4.0D, -d3, -d4 + 0.2D, -d0);
}
}
double d5 = this.getPosX() + d3;
double d1 = this.getPosY() + d4;
double d2 = this.getPosZ() + d0;
float f1 = MathHelper.sqrt(horizontalMag(vector3d));
if (flag)
{
this.rotationYaw = (float) (MathHelper.atan2(-d3, -d0) * (double) (180F / (float) Math.PI));
} else
{
this.rotationYaw = (float) (MathHelper.atan2(d3, d0) * (double) (180F / (float) Math.PI));
}
this.rotationPitch = (float) (MathHelper.atan2(d4, (double) f1) * (double) (180F / (float) Math.PI));
this.rotationPitch = func_234614_e_(this.prevRotationPitch, this.rotationPitch);
this.rotationYaw = func_234614_e_(this.prevRotationYaw, this.rotationYaw);
float f2 = 0.99F;
float f3 = 0.05F;
if (this.isInWater())
{
for (int j = 0; j < 4; ++j)
{
float f4 = 0.25F;
this.world.addParticle(ParticleTypes.BUBBLE, d5 - d3 * 0.25D, d1 - d4 * 0.25D, d2 - d0 * 0.25D, d3, d4, d0);
}
f2 = this.getWaterDrag();
}
this.setMotion(vector3d.scale((double) f2));
if (!this.hasNoGravity() && !flag)
{
Vector3d vector3d4 = this.getMotion();
this.setMotion(vector3d4.x, vector3d4.y - (double) 0.05F, vector3d4.z);
}
this.setPosition(d5, d1, d2);
this.doBlockCollisions();
}
}
@Override
public void move(MoverType typeIn, Vector3d pos)
{
super.move(typeIn, pos);
if (typeIn != MoverType.SELF && this.func_234593_u_())
{
this.func_234594_z_();
}
}
public void writeAdditional(CompoundNBT compound)
{
super.writeAdditional(compound);
compound.putShort("life", (short) this.ticksInGround);
if (this.inBlockState != null)
{
compound.put("inBlockState", NBTUtil.writeBlockState(this.inBlockState));
}
compound.putByte("shake", (byte) this.arrowShake);
compound.putBoolean("inGround", this.inGround);
compound.putByte("pickup", (byte) this.pickupStatus.ordinal());
compound.putDouble("damage", this.damage);
// compound.putBoolean("crit", this.getIsCritical());
// compound.putByte("PierceLevel", this.getPierceLevel());
compound.putString("SoundEvent", Registry.SOUND_EVENT.getKey(this.hitSound).toString());
// compound.putBoolean("ShotFromCrossbow", this.getShotFromCrossbow());
compound.putDouble("willDrop", willDrop);
this.containedStack.write(compound);
compound.putString("willType", this.willType.name);
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
public void readAdditional(CompoundNBT compound)
{
super.readAdditional(compound);
this.ticksInGround = compound.getShort("life");
if (compound.contains("inBlockState", 10))
{
this.inBlockState = NBTUtil.readBlockState(compound.getCompound("inBlockState"));
}
this.arrowShake = compound.getByte("shake") & 255;
this.inGround = compound.getBoolean("inGround");
if (compound.contains("damage", 99))
{
this.damage = compound.getDouble("damage");
}
if (compound.contains("pickup", 99))
{
this.pickupStatus = AbstractArrowEntity.PickupStatus.getByOrdinal(compound.getByte("pickup"));
} else if (compound.contains("player", 99))
{
this.pickupStatus = compound.getBoolean("player") ? AbstractArrowEntity.PickupStatus.ALLOWED
: AbstractArrowEntity.PickupStatus.DISALLOWED;
}
this.willDrop = compound.getDouble("willDrop");
this.containedStack = ItemStack.read(compound);
this.willType = EnumDemonWillType.getType(compound.getString("willType"));
// this.setIsCritical(compound.getBoolean("crit"));
// this.setPierceLevel(compound.getByte("PierceLevel"));
// if (compound.contains("SoundEvent", 8)) {
// this.hitSound = Registry.SOUND_EVENT.getOptional(new ResourceLocation(compound.getString("SoundEvent"))).orElse(this.getHitEntitySound());
// }
//
// this.setShotFromCrossbow(compound.getBoolean("ShotFromCrossbow"));
}
public void setDamage(double damage)
{
this.damage = damage;
}
public double getDamage()
{
return this.damage;
}
protected void onEntityHit(EntityRayTraceResult p_213868_1_)
{
super.onEntityHit(p_213868_1_);
Entity entity = p_213868_1_.getEntity();
float f = (float) this.getMotion().length();
int i = MathHelper.ceil(MathHelper.clamp(this.damage, 0.0D, 2.147483647E9D));
if (this.getPierceLevel() > 0)
{
if (this.piercedEntities == null)
{
this.piercedEntities = new IntOpenHashSet(5);
}
if (this.hitEntities == null)
{
this.hitEntities = Lists.newArrayListWithCapacity(5);
}
if (this.piercedEntities.size() >= this.getPierceLevel() + 1)
{
this.remove();
return;
}
this.piercedEntities.add(entity.getEntityId());
}
if (this.getIsCritical())
{
long j = (long) this.rand.nextInt(i / 2 + 2);
i = (int) Math.min(j + (long) i, 2147483647L);
}
Entity entity1 = this.func_234616_v_();
DamageSource damagesource;
if (entity1 == null)
{
damagesource = DamageSource.causeThrownDamage(this, this);
} else
{
damagesource = DamageSource.causeThrownDamage(this, entity1);
if (entity1 instanceof LivingEntity)
{
((LivingEntity) entity1).setLastAttackedEntity(entity);
}
if (entity1 instanceof PlayerEntity && entity instanceof LivingEntity)
{
PlayerDemonWillHandler.addDemonWill(willType, (PlayerEntity) entity1, this.getWillDropForMobHealth(((LivingEntity) entity).getMaxHealth()));
}
}
boolean flag = entity.getType() == EntityType.ENDERMAN;
int k = entity.getFireTimer();
if (this.isBurning() && !flag)
{
entity.setFire(5);
}
if (entity.attackEntityFrom(damagesource, (float) i))
{
if (flag)
{
return;
}
if (entity instanceof LivingEntity)
{
LivingEntity livingentity = (LivingEntity) entity;
if (!this.world.isRemote && this.getPierceLevel() <= 0)
{
livingentity.setArrowCountInEntity(livingentity.getArrowCountInEntity() + 1);
}
if (this.knockbackStrength > 0)
{
Vector3d vector3d = this.getMotion().mul(1.0D, 0.0D, 1.0D).normalize().scale((double) this.knockbackStrength * 0.6D);
if (vector3d.lengthSquared() > 0.0D)
{
livingentity.addVelocity(vector3d.x, 0.1D, vector3d.z);
}
}
if (!this.world.isRemote && entity1 instanceof LivingEntity)
{
EnchantmentHelper.applyThornEnchantments(livingentity, entity1);
EnchantmentHelper.applyArthropodEnchantments((LivingEntity) entity1, livingentity);
}
this.daggerHit(livingentity);
if (entity1 != null && livingentity != entity1 && livingentity instanceof PlayerEntity && entity1 instanceof ServerPlayerEntity && !this.isSilent())
{
((ServerPlayerEntity) entity1).connection.sendPacket(new SChangeGameStatePacket(SChangeGameStatePacket.field_241770_g_, 0.0F));
}
if (!entity.isAlive() && this.hitEntities != null)
{
this.hitEntities.add(livingentity);
}
}
this.playSound(this.hitSound, 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
if (this.getPierceLevel() <= 0)
{
this.remove();
}
} else
{
entity.forceFireTicks(k);
this.setMotion(this.getMotion().scale(-0.1D));
this.rotationYaw += 180.0F;
this.prevRotationYaw += 180.0F;
if (!this.world.isRemote && this.getMotion().lengthSquared() < 1.0E-7D)
{
if (this.pickupStatus == AbstractArrowEntity.PickupStatus.ALLOWED)
{
this.entityDropItem(this.getArrowStack(), 0.1F);
}
this.remove();
}
}
}
/**
* Called by a player entity when they collide with an entity
*/
@Override
public void onCollideWithPlayer(PlayerEntity entityIn)
{
if (!this.world.isRemote && (this.inGround || this.getNoClip()) && this.arrowShake <= 0)
{
boolean flag = this.pickupStatus == AbstractArrowEntity.PickupStatus.ALLOWED || this.pickupStatus == AbstractArrowEntity.PickupStatus.CREATIVE_ONLY && entityIn.abilities.isCreativeMode || this.getNoClip() && this.func_234616_v_().getUniqueID() == entityIn.getUniqueID();
if (this.pickupStatus == AbstractArrowEntity.PickupStatus.ALLOWED && !entityIn.inventory.addItemStackToInventory(this.getArrowStack()))
{
flag = false;
}
if (flag)
{
// System.out.println("Um test?");
// entityIn.onItemPickup(this, 1);
world.playSound(null, entityIn.getPosX(), entityIn.getPosY() + 0.5, entityIn.getPosZ(), SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
this.remove();
}
}
}
protected ItemStack getArrowStack()
{
return containedStack;
}
// OnHitBlock
protected void func_230299_a_(BlockRayTraceResult p_230299_1_)
{
this.inBlockState = this.world.getBlockState(p_230299_1_.getPos());
super.func_230299_a_(p_230299_1_);
Vector3d vector3d = p_230299_1_.getHitVec().subtract(this.getPosX(), this.getPosY(), this.getPosZ());
this.setMotion(vector3d);
Vector3d vector3d1 = vector3d.normalize().scale((double) 0.05F);
this.setRawPosition(this.getPosX() - vector3d1.x, this.getPosY() - vector3d1.y, this.getPosZ() - vector3d1.z);
this.playSound(this.getHitGroundSound(), 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
this.inGround = true;
this.arrowShake = 7;
// this.setIsCritical(false);
// this.setPierceLevel((byte) 0);
this.setHitSound(SoundEvents.ENTITY_ARROW_HIT);
// this.setShotFromCrossbow(false);
this.func_213870_w();
}
private void func_234594_z_()
{
this.inGround = false;
Vector3d vector3d = this.getMotion();
this.setMotion(vector3d.mul((double) (this.rand.nextFloat() * 0.2F), (double) (this.rand.nextFloat() * 0.2F), (double) (this.rand.nextFloat() * 0.2F)));
this.ticksInGround = 0;
}
private boolean func_234593_u_()
{
return this.inGround && this.world.hasNoCollisions((new AxisAlignedBB(this.getPositionVec(), this.getPositionVec())).grow(0.06D));
}
protected void func_225516_i_()
{
++this.ticksInGround;
if (this.ticksInGround >= 1200)
{
this.remove();
}
}
protected void daggerHit(LivingEntity living)
{
}
/**
* The sound made when an entity is hit by this projectile
*/
protected SoundEvent getHitEntitySound()
{
return SoundEvents.ENTITY_ARROW_HIT;
}
protected final SoundEvent getHitGroundSound()
{
return this.hitSound;
}
private void func_213870_w()
{
if (this.hitEntities != null)
{
this.hitEntities.clear();
}
if (this.piercedEntities != null)
{
this.piercedEntities.clear();
}
}
public void setHitSound(SoundEvent soundIn)
{
this.hitSound = soundIn;
}
public boolean getNoClip()
{
if (!this.world.isRemote)
{
return this.noClip;
} else
{
return false;
// return (this.dataManager.get(CRITICAL) & 2) != 0;
}
}
public boolean getIsCritical()
{
// byte b0 = this.dataManager.get(CRITICAL);
// return (b0 & 1) != 0;
return false;
}
public byte getPierceLevel()
{
return 0;
// return this.dataManager.get(PIERCE_LEVEL);
}
protected float getWaterDrag()
{
return 0.6F;
}
/**
* Gets the EntityRayTraceResult representing the entity hit
*/
@Nullable
protected EntityRayTraceResult rayTraceEntities(Vector3d startVec, Vector3d endVec)
{
return ProjectileHelper.rayTraceEntities(this.world, this, startVec, endVec, this.getBoundingBox().expand(this.getMotion()).grow(1.0D), this::func_230298_a_);
}
protected boolean func_230298_a_(Entity p_230298_1_)
{
return super.func_230298_a_(p_230298_1_) && (this.piercedEntities == null || !this.piercedEntities.contains(p_230298_1_.getEntityId()));
}
// protected float getGravityVelocity()
// {
// return 0;
// }
public void setWillDrop(double willDrop)
{
this.willDrop = willDrop;
}
public double getWillDropForMobHealth(double hp)
{
return this.willDrop * hp / 20D;
}
public void setWillType(EnumDemonWillType type)
{
this.willType = type;
}
@OnlyIn(Dist.CLIENT)
private IParticleData makeParticle()
{
ItemStack itemstack = this.func_213882_k();
return (IParticleData) (itemstack.isEmpty() ? ParticleTypes.LAVA
: new ItemParticleData(ParticleTypes.ITEM, itemstack));
}
/**
* Handler for {@link World#setEntityState}
*/
@OnlyIn(Dist.CLIENT)
public void handleStatusUpdate(byte id)
{
if (id == 3)
{
IParticleData iparticledata = this.makeParticle();
for (int i = 0; i < 8; ++i)
{
this.world.addParticle(iparticledata, this.getPosX(), this.getPosY(), this.getPosZ(), 0.0D, 0.0D, 0.0D);
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B