Allowed Shaped Charges to have Anointments applied to them
Reformatted the checks, and also readded the Arcane Ash recipe
This commit is contained in:
parent
e0b0f13792
commit
5fda25052d
|
@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
|
|||
apply plugin: 'eclipse'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
version = '1.16.3-3.1.0-12'
|
||||
version = '1.16.3-3.1.0-13'
|
||||
group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = 'BloodMagic'
|
||||
|
||||
|
|
|
@ -472,7 +472,7 @@ f0827ad5bf71c06a71f50aeb0298c04d0cb1a1d9 data/bloodmagic/loot_tables/blocks/bloo
|
|||
779b809a2a51e6dab46f9e6799249f2f14653ebb data/bloodmagic/loot_tables/blocks/chargingrune.json
|
||||
0d501e4eb447e84b38250ab1c396abe1218d129c data/bloodmagic/loot_tables/blocks/corrosivedemoncrystal.json
|
||||
e59c93dcc8d42b3ddb71dad1695573b1c284213f data/bloodmagic/loot_tables/blocks/creeping_doubt.json
|
||||
0d39ff5d795638cdc39302f94acbeebd7779718a data/bloodmagic/loot_tables/blocks/deforester_charge.json
|
||||
794eab6d989fe113f797835fa6a2f7ead5bfbd38 data/bloodmagic/loot_tables/blocks/deforester_charge.json
|
||||
4c9ed83e7e7215f995df35054e96d2f4e5027016 data/bloodmagic/loot_tables/blocks/demoncrucible.json
|
||||
c590b923d28b3d7916932dfcb05091df815f71dd data/bloodmagic/loot_tables/blocks/demoncrystallizer.json
|
||||
b0ce964c69f63aa13350259279e5fe831ae18e2c data/bloodmagic/loot_tables/blocks/destructivedemoncrystal.json
|
||||
|
@ -515,7 +515,7 @@ ce5bf03f0ee03205ef6a1b6f512cb5da23addc57 data/bloodmagic/loot_tables/blocks/mimi
|
|||
26e3f34021426def32602e5ae7755e4672878320 data/bloodmagic/loot_tables/blocks/ritualstone.json
|
||||
e0239eff7762a414a4e4faa0158d844dffb8c1f6 data/bloodmagic/loot_tables/blocks/sacrificerune.json
|
||||
9b697e37046b6238b3a19eae9113b88010ccff32 data/bloodmagic/loot_tables/blocks/selfsacrificerune.json
|
||||
4c138f5a496f407fcf8b6bd6bd2117c1bcf062cf data/bloodmagic/loot_tables/blocks/shaped_charge.json
|
||||
fce757b3f3b79758be0fba70e016b3bdb373814e data/bloodmagic/loot_tables/blocks/shaped_charge.json
|
||||
f748a5ba8838b50de0502f132fe2a65f4726dae6 data/bloodmagic/loot_tables/blocks/soulforge.json
|
||||
015e07226fd90935f7ec663f4bcf3873a57a82d1 data/bloodmagic/loot_tables/blocks/speedrune.json
|
||||
128ec3ee93e927d457beeb8161e80706e9239760 data/bloodmagic/loot_tables/blocks/steadfastdemoncrystal.json
|
||||
|
@ -529,6 +529,7 @@ f748a5ba8838b50de0502f132fe2a65f4726dae6 data/bloodmagic/loot_tables/blocks/soul
|
|||
4a7395079f874ae08af94f64a8a00211a56e906a data/bloodmagic/loot_tables/blocks/wornstonetilepath.json
|
||||
c95cd70b7ca320e18618c07827add555984b0e45 data/bloodmagic/loot_tables/test.json
|
||||
966981b01944985f1fe5cfa72b21c9ceeebd9cc4 data/bloodmagic/recipes/alchemy_table.json
|
||||
6e508e442b24c2a0e3f85026277c199cc0deada0 data/bloodmagic/recipes/alchemytable/arcane_ash.json
|
||||
a343604b5a75e1b3810df97d024813fb041cffb6 data/bloodmagic/recipes/alchemytable/basic_cutting_fluid.json
|
||||
cc28a48ec4b21be99c4ec13f6e560c322012192c data/bloodmagic/recipes/alchemytable/bow_power_anointment.json
|
||||
6a93bcd65cf2636fc684276777f56630f82d710c data/bloodmagic/recipes/alchemytable/bread.json
|
||||
|
@ -673,6 +674,7 @@ d4ee90b52934c7c530fb031dcf81d4f1ccb27a9b data/bloodmagic/recipes/soul_forge.json
|
|||
8b64af8453c60b6b1ae55bd0dd1a68fe95e8ba19 data/bloodmagic/recipes/soulforge/commontartaricgem.json
|
||||
659db62f8fb71c792b00d6409b1c9a2f1ca96048 data/bloodmagic/recipes/soulforge/corrosive_crystal_block.json
|
||||
5ad148899ed46134ae0572b220736b9d38004980 data/bloodmagic/recipes/soulforge/deforester_charge.json
|
||||
9490cde280a6a0cb1bc3851df135e1c4c10da36b data/bloodmagic/recipes/soulforge/deforester_charge_smelting.json
|
||||
2c90f1da43a79e61d2b6b09c012d08f53b133264 data/bloodmagic/recipes/soulforge/demon_crucible.json
|
||||
bc4ad3b44720a3f7363ef53027b4aae35622e7c1 data/bloodmagic/recipes/soulforge/demon_crystallizer.json
|
||||
759279a190f3bc74e162dedf0f5d311267e06fbc data/bloodmagic/recipes/soulforge/destructive_crystal_block.json
|
||||
|
@ -681,16 +683,6 @@ d46b61779b3c8382862d4e66c3909a1241ecca18 data/bloodmagic/recipes/soulforge/lesse
|
|||
d6e06747c75fc06e708a15358911f1c63eee86b1 data/bloodmagic/recipes/soulforge/pettytartaricgem.json
|
||||
2468dd785e301732b1be8108caa468bdd5008e46 data/bloodmagic/recipes/soulforge/primitive_crystalline_resonator.json
|
||||
535a9ec33a425bde205dffc3254635741d1c82d6 data/bloodmagic/recipes/soulforge/raw_crystal_block.json
|
||||
42f6af3a4c723c6a6b2a6e1d680a875e15664e4f data/bloodmagic/recipes/soulforge/reagent_air.json
|
||||
16cccf4c7332b1689298da1e242498f5821d9285 data/bloodmagic/recipes/soulforge/reagent_binding.json
|
||||
cba99433d18bd61a0a7c2f5ef9f97cad91028f16 data/bloodmagic/recipes/soulforge/reagent_blood_light.json
|
||||
6b59a7e95e596997b7bbb894b6fbaf5015b213b5 data/bloodmagic/recipes/soulforge/reagent_fastminer.json
|
||||
ae3a6a760e9f793d5a62e2f0f6c45219b0017816 data/bloodmagic/recipes/soulforge/reagent_growth.json
|
||||
1c391181ea77f5ed01f7226e0782b3b45162ab3c data/bloodmagic/recipes/soulforge/reagent_lava.json
|
||||
e517023dc3e32929344ff5415397fc833bfbc29a data/bloodmagic/recipes/soulforge/reagent_magnetism.json
|
||||
c65a8b31432ec36e9de9de1447e357387de2195c data/bloodmagic/recipes/soulforge/reagent_sight.json
|
||||
c0e75e0e12290d191245c5b0b5b13bc739d2ff44 data/bloodmagic/recipes/soulforge/reagent_void.json
|
||||
a222d09abf1ea61feb684f2ac23d011c2034f526 data/bloodmagic/recipes/soulforge/reagent_water.json
|
||||
4a4340f334c51beaacb77fd201298ad94b71e79c data/bloodmagic/recipes/soulforge/sanguine_reverter.json
|
||||
799c9b83373966f70bbd6777cdae0ff2ff89fd84 data/bloodmagic/recipes/soulforge/sentientaxe.json
|
||||
6d94372ffffbe36ca91ed2a5e46991bff896726c data/bloodmagic/recipes/soulforge/sentientpickaxe.json
|
||||
|
|
|
@ -2,18 +2,9 @@
|
|||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"rolls": 1,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "bloodmagic:deforester_charge"
|
||||
}
|
||||
],
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
]
|
||||
"name": "bloodmagic:deforester_charge",
|
||||
"rolls": 1.0,
|
||||
"entries": []
|
||||
}
|
||||
]
|
||||
}
|
|
@ -2,18 +2,9 @@
|
|||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"rolls": 1,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "bloodmagic:shaped_charge"
|
||||
}
|
||||
],
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
]
|
||||
"name": "bloodmagic:shaped_charge",
|
||||
"rolls": 1.0,
|
||||
"entries": []
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"type": "bloodmagic:alchemytable",
|
||||
"input": [
|
||||
{
|
||||
"tag": "forge:dusts/redstone"
|
||||
},
|
||||
{
|
||||
"tag": "forge:dyes/white"
|
||||
},
|
||||
{
|
||||
"tag": "forge:gunpowder"
|
||||
},
|
||||
{
|
||||
"tag": "minecraft:coals"
|
||||
}
|
||||
],
|
||||
"output": {
|
||||
"item": "bloodmagic:arcaneashes",
|
||||
"nbt": "{Damage:0}"
|
||||
},
|
||||
"syphon": 500,
|
||||
"ticks": 200,
|
||||
"upgradeLevel": 1
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"type": "bloodmagic:soulforge",
|
||||
"input0": {
|
||||
"item": "bloodmagic:deforester_charge"
|
||||
},
|
||||
"output": {
|
||||
"item": "bloodmagic:deforester_charge",
|
||||
"nbt": "{anointment_holder:{anointments:[{damage:1,max_damage:1,level:1,key:\"bloodmagic:smelting\"}]}}"
|
||||
},
|
||||
"minimumDrain": 60.0,
|
||||
"drain": 1.0
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
"type": "bloodmagic:soulforge",
|
||||
"input0": {
|
||||
"item": "minecraft:ghast_tear"
|
||||
},
|
||||
"input1": {
|
||||
"tag": "forge:feathers"
|
||||
},
|
||||
"input2": {
|
||||
"tag": "forge:feathers"
|
||||
},
|
||||
"output": {
|
||||
"item": "bloodmagic:reagentair"
|
||||
},
|
||||
"minimumDrain": 128.0,
|
||||
"drain": 20.0
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"type": "bloodmagic:soulforge",
|
||||
"input0": {
|
||||
"tag": "forge:dusts/glowstone"
|
||||
},
|
||||
"input1": {
|
||||
"tag": "forge:dusts/redstone"
|
||||
},
|
||||
"input2": {
|
||||
"tag": "forge:gunpowder"
|
||||
},
|
||||
"input3": {
|
||||
"tag": "forge:nuggets/gold"
|
||||
},
|
||||
"output": {
|
||||
"item": "bloodmagic:reagentbinding"
|
||||
},
|
||||
"minimumDrain": 400.0,
|
||||
"drain": 10.0
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"type": "bloodmagic:soulforge",
|
||||
"input0": {
|
||||
"tag": "forge:dusts/glowstone"
|
||||
},
|
||||
"input1": {
|
||||
"item": "minecraft:torch"
|
||||
},
|
||||
"input2": {
|
||||
"tag": "forge:dusts/redstone"
|
||||
},
|
||||
"input3": {
|
||||
"tag": "forge:dusts/redstone"
|
||||
},
|
||||
"output": {
|
||||
"item": "bloodmagic:reagentbloodlight"
|
||||
},
|
||||
"minimumDrain": 300.0,
|
||||
"drain": 10.0
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"type": "bloodmagic:soulforge",
|
||||
"input0": {
|
||||
"item": "minecraft:iron_pickaxe"
|
||||
},
|
||||
"input1": {
|
||||
"item": "minecraft:iron_axe"
|
||||
},
|
||||
"input2": {
|
||||
"item": "minecraft:iron_shovel"
|
||||
},
|
||||
"input3": {
|
||||
"tag": "forge:gunpowder"
|
||||
},
|
||||
"output": {
|
||||
"item": "bloodmagic:reagentfastminer"
|
||||
},
|
||||
"minimumDrain": 128.0,
|
||||
"drain": 20.0
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"type": "bloodmagic:soulforge",
|
||||
"input0": {
|
||||
"tag": "minecraft:saplings"
|
||||
},
|
||||
"input1": {
|
||||
"tag": "minecraft:saplings"
|
||||
},
|
||||
"input2": {
|
||||
"item": "minecraft:sugar_cane"
|
||||
},
|
||||
"input3": {
|
||||
"item": "minecraft:sugar"
|
||||
},
|
||||
"output": {
|
||||
"item": "bloodmagic:reagentgrowth"
|
||||
},
|
||||
"minimumDrain": 128.0,
|
||||
"drain": 20.0
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"type": "bloodmagic:soulforge",
|
||||
"input0": {
|
||||
"item": "minecraft:lava_bucket"
|
||||
},
|
||||
"input1": {
|
||||
"tag": "forge:dusts/redstone"
|
||||
},
|
||||
"input2": {
|
||||
"tag": "forge:cobblestone"
|
||||
},
|
||||
"input3": {
|
||||
"tag": "forge:storage_blocks/coal"
|
||||
},
|
||||
"output": {
|
||||
"item": "bloodmagic:reagentlava"
|
||||
},
|
||||
"minimumDrain": 32.0,
|
||||
"drain": 10.0
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"type": "bloodmagic:soulforge",
|
||||
"input0": {
|
||||
"tag": "forge:string"
|
||||
},
|
||||
"input1": {
|
||||
"tag": "forge:ingots/gold"
|
||||
},
|
||||
"input2": {
|
||||
"tag": "forge:ingots/gold"
|
||||
},
|
||||
"input3": {
|
||||
"tag": "forge:storage_blocks/iron"
|
||||
},
|
||||
"output": {
|
||||
"item": "bloodmagic:reagentmagnetism"
|
||||
},
|
||||
"minimumDrain": 600.0,
|
||||
"drain": 10.0
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"type": "bloodmagic:soulforge",
|
||||
"input0": {
|
||||
"tag": "forge:dusts/glowstone"
|
||||
},
|
||||
"input1": {
|
||||
"tag": "forge:glass"
|
||||
},
|
||||
"input2": {
|
||||
"tag": "forge:glass"
|
||||
},
|
||||
"input3": {
|
||||
"item": "bloodmagic:divinationsigil"
|
||||
},
|
||||
"output": {
|
||||
"item": "bloodmagic:reagentsight"
|
||||
},
|
||||
"minimumDrain": 64.0,
|
||||
"drain": 0.0
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"type": "bloodmagic:soulforge",
|
||||
"input0": {
|
||||
"item": "minecraft:bucket"
|
||||
},
|
||||
"input1": {
|
||||
"tag": "forge:string"
|
||||
},
|
||||
"input2": {
|
||||
"tag": "forge:string"
|
||||
},
|
||||
"input3": {
|
||||
"tag": "forge:gunpowder"
|
||||
},
|
||||
"output": {
|
||||
"item": "bloodmagic:reagentvoid"
|
||||
},
|
||||
"minimumDrain": 64.0,
|
||||
"drain": 10.0
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
"type": "bloodmagic:soulforge",
|
||||
"input0": {
|
||||
"item": "minecraft:sugar"
|
||||
},
|
||||
"input1": {
|
||||
"item": "minecraft:water_bucket"
|
||||
},
|
||||
"input2": {
|
||||
"item": "minecraft:water_bucket"
|
||||
},
|
||||
"output": {
|
||||
"item": "bloodmagic:reagentwater"
|
||||
},
|
||||
"minimumDrain": 10.0,
|
||||
"drain": 3.0
|
||||
}
|
|
@ -37,6 +37,11 @@ public class AnointmentHolder
|
|||
this(Maps.newHashMap());
|
||||
}
|
||||
|
||||
public boolean isEmpty()
|
||||
{
|
||||
return anointments.isEmpty();
|
||||
}
|
||||
|
||||
// Returns true if the anointment is applied successfully.
|
||||
public boolean applyAnointment(ItemStack stack, Anointment anointment, AnointmentData data)
|
||||
{
|
||||
|
|
|
@ -5,6 +5,7 @@ import javax.annotation.Nullable;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
|
@ -16,6 +17,7 @@ import net.minecraft.util.math.shapes.VoxelShape;
|
|||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraft.world.World;
|
||||
import wayoftime.bloodmagic.tile.TileShapedExplosive;
|
||||
|
||||
public class BlockShapedExplosive extends Block
|
||||
|
@ -104,4 +106,29 @@ public class BlockShapedExplosive extends Block
|
|||
{
|
||||
return new TileShapedExplosive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World world, BlockPos blockPos, BlockState blockState, PlayerEntity player)
|
||||
{
|
||||
TileShapedExplosive tile = (TileShapedExplosive) world.getTileEntity(blockPos);
|
||||
if (tile != null && !world.isRemote)
|
||||
tile.dropSelf();
|
||||
|
||||
super.onBlockHarvested(world, blockPos, blockState, player);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving)
|
||||
// {
|
||||
// if (!state.isIn(newState.getBlock()))
|
||||
// {
|
||||
// TileEntity tileentity = worldIn.getTileEntity(pos);
|
||||
// if (tileentity instanceof TileShapedExplosive)
|
||||
// {
|
||||
// ((TileShapedExplosive) tileentity).dropSelf();
|
||||
// }
|
||||
//
|
||||
// super.onReplaced(state, worldIn, pos, newState, isMoving);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -132,8 +132,8 @@ public class GeneratorLootTable extends LootTableProvider
|
|||
|
||||
registerCropDropLootTable(BloodMagicBlocks.GROWING_DOUBT.get(), BloodMagicItems.WEAK_BLOOD_SHARD.get());
|
||||
|
||||
registerDropSelfLootTable(BloodMagicBlocks.SHAPED_CHARGE.get());
|
||||
registerDropSelfLootTable(BloodMagicBlocks.DEFORESTER_CHARGE.get());
|
||||
registerNoDropLootTable(BloodMagicBlocks.SHAPED_CHARGE.get());
|
||||
registerNoDropLootTable(BloodMagicBlocks.DEFORESTER_CHARGE.get());
|
||||
}
|
||||
|
||||
private void registerNoDropLootTable(Block block)
|
||||
|
|
|
@ -3,14 +3,18 @@ package wayoftime.bloodmagic.common.item.block;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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.world.World;
|
||||
import wayoftime.bloodmagic.anointment.AnointmentHolder;
|
||||
import wayoftime.bloodmagic.entity.projectile.EntityShapedCharge;
|
||||
import wayoftime.bloodmagic.tile.TileShapedExplosive;
|
||||
|
||||
public class ItemBlockShapedCharge extends BlockItem
|
||||
{
|
||||
|
@ -32,10 +36,10 @@ public class ItemBlockShapedCharge extends BlockItem
|
|||
|
||||
if (!worldIn.isRemote)
|
||||
{
|
||||
System.out.println("Attempting to spawn");
|
||||
// EntitySoulSnare snare = new EntitySoulSnare(worldIn, playerIn);
|
||||
EntityShapedCharge charge = new EntityShapedCharge(worldIn, this.getBlock(), playerIn);
|
||||
charge.func_234612_a_(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
|
||||
charge.setAnointmentHolder(AnointmentHolder.fromItemStack(stack));
|
||||
worldIn.addEntity(charge);
|
||||
//
|
||||
// SnowballEntity snowballentity = new SnowballEntity(worldIn, playerIn);
|
||||
|
@ -46,4 +50,22 @@ public class ItemBlockShapedCharge extends BlockItem
|
|||
|
||||
return new ActionResult<>(ActionResultType.SUCCESS, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResultType tryPlace(BlockItemUseContext context)
|
||||
{
|
||||
ActionResultType result = super.tryPlace(context);
|
||||
|
||||
AnointmentHolder holder = AnointmentHolder.fromItemStack(context.getItem());
|
||||
if (holder != null)
|
||||
{
|
||||
TileEntity tile = context.getWorld().getTileEntity(context.getPos());
|
||||
if (tile instanceof TileShapedExplosive)
|
||||
{
|
||||
((TileShapedExplosive) tile).setAnointmentHolder(holder);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ public class AlchemyTableRecipeProvider implements ISubRecipeProvider
|
|||
|
||||
}
|
||||
{
|
||||
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.ARCANE_ASHES.get()), 500, 200, 1).addIngredient(Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE)).addIngredient(Ingredient.fromTag(Tags.Items.DYES_WHITE)).addIngredient(Ingredient.fromTag(Tags.Items.GUNPOWDER)).addIngredient(Ingredient.fromTag(ItemTags.COALS)).build(consumer, BloodMagic.rl(basePath + "arcane_ash"));
|
||||
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.REAGENT_AIR.get()), 2000, 200, 2).addIngredient(Ingredient.fromItems(Items.GHAST_TEAR)).addIngredient(Ingredient.fromTag(Tags.Items.FEATHERS)).addIngredient(Ingredient.fromTag(Tags.Items.FEATHERS)).build(consumer, BloodMagic.rl(basePath + "reagent_air"));
|
||||
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.REAGENT_WATER.get()), 300, 200, 1).addIngredient(Ingredient.fromItems(Items.SUGAR)).addIngredient(Ingredient.fromItems(Items.WATER_BUCKET)).addIngredient(Ingredient.fromItems(Items.WATER_BUCKET)).build(consumer, BloodMagic.rl(basePath + "reagent_water"));
|
||||
AlchemyTableRecipeBuilder.alchemyTable(new ItemStack(BloodMagicItems.REAGENT_LAVA.get()), 1000, 200, 1).addIngredient(Ingredient.fromItems(Items.LAVA_BUCKET)).addIngredient(Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE)).addIngredient(Ingredient.fromTag(Tags.Items.COBBLESTONE)).addIngredient(Ingredient.fromTag(Tags.Items.STORAGE_BLOCKS_COAL)).build(consumer, BloodMagic.rl(basePath + "reagent_lava"));
|
||||
|
|
|
@ -9,10 +9,13 @@ import net.minecraft.item.crafting.Ingredient;
|
|||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import wayoftime.bloodmagic.BloodMagic;
|
||||
import wayoftime.bloodmagic.anointment.AnointmentData;
|
||||
import wayoftime.bloodmagic.anointment.AnointmentHolder;
|
||||
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
|
||||
import wayoftime.bloodmagic.common.data.recipe.builder.TartaricForgeRecipeBuilder;
|
||||
import wayoftime.bloodmagic.common.item.BloodMagicItems;
|
||||
import wayoftime.bloodmagic.common.tags.BloodMagicTags;
|
||||
import wayoftime.bloodmagic.core.AnointmentRegistrar;
|
||||
|
||||
public class TartaricForgeRecipeProvider implements ISubRecipeProvider
|
||||
{
|
||||
|
@ -47,19 +50,26 @@ public class TartaricForgeRecipeProvider implements ISubRecipeProvider
|
|||
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicBlocks.SHAPED_CHARGE.get(), 8), 10, 0.5, Ingredient.fromTag(Tags.Items.COBBLESTONE), Ingredient.fromItems(Items.CHARCOAL), Ingredient.fromTag(Tags.Items.SAND), Ingredient.fromTag(Tags.Items.STONE)).build(consumer, BloodMagic.rl(basePath + "shaped_charge"));
|
||||
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicBlocks.DEFORESTER_CHARGE.get(), 8), 10, 0.5, Ingredient.fromTag(Tags.Items.COBBLESTONE), Ingredient.fromItems(Items.CHARCOAL), Ingredient.fromTag(ItemTags.LOGS), Ingredient.fromTag(ItemTags.PLANKS)).build(consumer, BloodMagic.rl(basePath + "deforester_charge"));
|
||||
|
||||
ItemStack stack = new ItemStack(BloodMagicBlocks.DEFORESTER_CHARGE.get());
|
||||
AnointmentHolder smeltingHolder = new AnointmentHolder();
|
||||
smeltingHolder.applyAnointment(stack, AnointmentRegistrar.ANOINTMENT_SMELTING.get(), new AnointmentData(1, 1, 1));
|
||||
smeltingHolder.toItemStack(stack);
|
||||
|
||||
TartaricForgeRecipeBuilder.tartaricForge(stack, 60, 1, Ingredient.fromItems(BloodMagicItems.DEFORESTER_CHARGE_ITEM.get())).build(consumer, BloodMagic.rl(basePath + "deforester_charge_smelting"));
|
||||
|
||||
// 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.REAGENT_AIR.get()), 128, 20, Ingredient.fromItems(Items.GHAST_TEAR), Ingredient.fromTag(Tags.Items.FEATHERS), Ingredient.fromTag(Tags.Items.FEATHERS)).build(consumer, BloodMagic.rl(basePath + "reagent_air"));
|
||||
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_WATER.get()), 10, 3, Ingredient.fromItems(Items.SUGAR), Ingredient.fromItems(Items.WATER_BUCKET), Ingredient.fromItems(Items.WATER_BUCKET)).build(consumer, BloodMagic.rl(basePath + "reagent_water"));
|
||||
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_LAVA.get()), 32, 10, Ingredient.fromItems(Items.LAVA_BUCKET), Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE), Ingredient.fromTag(Tags.Items.COBBLESTONE), Ingredient.fromTag(Tags.Items.STORAGE_BLOCKS_COAL)).build(consumer, BloodMagic.rl(basePath + "reagent_lava"));
|
||||
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_VOID.get()), 64, 10, Ingredient.fromItems(Items.BUCKET), Ingredient.fromTag(Tags.Items.STRING), Ingredient.fromTag(Tags.Items.STRING), Ingredient.fromTag(Tags.Items.GUNPOWDER)).build(consumer, BloodMagic.rl(basePath + "reagent_void"));
|
||||
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_GROWTH.get()), 128, 20, Ingredient.fromTag(ItemTags.SAPLINGS), Ingredient.fromTag(ItemTags.SAPLINGS), Ingredient.fromItems(Items.SUGAR_CANE), Ingredient.fromItems(Items.SUGAR)).build(consumer, BloodMagic.rl(basePath + "reagent_growth"));
|
||||
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_MAGNETISM.get()), 600, 10, Ingredient.fromTag(Tags.Items.STRING), Ingredient.fromTag(Tags.Items.INGOTS_GOLD), Ingredient.fromTag(Tags.Items.INGOTS_GOLD), Ingredient.fromTag(Tags.Items.STORAGE_BLOCKS_IRON)).build(consumer, BloodMagic.rl(basePath + "reagent_magnetism"));
|
||||
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_FAST_MINER.get()), 128, 20, Ingredient.fromItems(Items.IRON_PICKAXE), Ingredient.fromItems(Items.IRON_AXE), Ingredient.fromItems(Items.IRON_SHOVEL), Ingredient.fromTag(Tags.Items.GUNPOWDER)).build(consumer, BloodMagic.rl(basePath + "reagent_fastminer"));
|
||||
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_BLOOD_LIGHT.get()), 300, 10, Ingredient.fromTag(Tags.Items.DUSTS_GLOWSTONE), Ingredient.fromItems(Items.TORCH), Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE), Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE)).build(consumer, BloodMagic.rl(basePath + "reagent_blood_light"));
|
||||
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_SIGHT.get()), 64, 0, Ingredient.fromTag(Tags.Items.DUSTS_GLOWSTONE), Ingredient.fromTag(Tags.Items.GLASS), Ingredient.fromTag(Tags.Items.GLASS), Ingredient.fromItems(BloodMagicItems.DIVINATION_SIGIL.get())).build(consumer, BloodMagic.rl(basePath + "reagent_sight"));
|
||||
TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_BINDING.get()), 400, 10, Ingredient.fromTag(Tags.Items.DUSTS_GLOWSTONE), Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE), Ingredient.fromTag(Tags.Items.GUNPOWDER), Ingredient.fromTag(Tags.Items.NUGGETS_GOLD)).build(consumer, BloodMagic.rl(basePath + "reagent_binding"));
|
||||
// TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_AIR.get()), 128, 20, Ingredient.fromItems(Items.GHAST_TEAR), Ingredient.fromTag(Tags.Items.FEATHERS), Ingredient.fromTag(Tags.Items.FEATHERS)).build(consumer, BloodMagic.rl(basePath + "reagent_air"));
|
||||
// TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_WATER.get()), 10, 3, Ingredient.fromItems(Items.SUGAR), Ingredient.fromItems(Items.WATER_BUCKET), Ingredient.fromItems(Items.WATER_BUCKET)).build(consumer, BloodMagic.rl(basePath + "reagent_water"));
|
||||
// TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_LAVA.get()), 32, 10, Ingredient.fromItems(Items.LAVA_BUCKET), Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE), Ingredient.fromTag(Tags.Items.COBBLESTONE), Ingredient.fromTag(Tags.Items.STORAGE_BLOCKS_COAL)).build(consumer, BloodMagic.rl(basePath + "reagent_lava"));
|
||||
// TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_VOID.get()), 64, 10, Ingredient.fromItems(Items.BUCKET), Ingredient.fromTag(Tags.Items.STRING), Ingredient.fromTag(Tags.Items.STRING), Ingredient.fromTag(Tags.Items.GUNPOWDER)).build(consumer, BloodMagic.rl(basePath + "reagent_void"));
|
||||
// TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_GROWTH.get()), 128, 20, Ingredient.fromTag(ItemTags.SAPLINGS), Ingredient.fromTag(ItemTags.SAPLINGS), Ingredient.fromItems(Items.SUGAR_CANE), Ingredient.fromItems(Items.SUGAR)).build(consumer, BloodMagic.rl(basePath + "reagent_growth"));
|
||||
// TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_MAGNETISM.get()), 600, 10, Ingredient.fromTag(Tags.Items.STRING), Ingredient.fromTag(Tags.Items.INGOTS_GOLD), Ingredient.fromTag(Tags.Items.INGOTS_GOLD), Ingredient.fromTag(Tags.Items.STORAGE_BLOCKS_IRON)).build(consumer, BloodMagic.rl(basePath + "reagent_magnetism"));
|
||||
// TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_FAST_MINER.get()), 128, 20, Ingredient.fromItems(Items.IRON_PICKAXE), Ingredient.fromItems(Items.IRON_AXE), Ingredient.fromItems(Items.IRON_SHOVEL), Ingredient.fromTag(Tags.Items.GUNPOWDER)).build(consumer, BloodMagic.rl(basePath + "reagent_fastminer"));
|
||||
// TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_BLOOD_LIGHT.get()), 300, 10, Ingredient.fromTag(Tags.Items.DUSTS_GLOWSTONE), Ingredient.fromItems(Items.TORCH), Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE), Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE)).build(consumer, BloodMagic.rl(basePath + "reagent_blood_light"));
|
||||
// TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_SIGHT.get()), 64, 0, Ingredient.fromTag(Tags.Items.DUSTS_GLOWSTONE), Ingredient.fromTag(Tags.Items.GLASS), Ingredient.fromTag(Tags.Items.GLASS), Ingredient.fromItems(BloodMagicItems.DIVINATION_SIGIL.get())).build(consumer, BloodMagic.rl(basePath + "reagent_sight"));
|
||||
// TartaricForgeRecipeBuilder.tartaricForge(new ItemStack(BloodMagicItems.REAGENT_BINDING.get()), 400, 10, Ingredient.fromTag(Tags.Items.DUSTS_GLOWSTONE), Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE), Ingredient.fromTag(Tags.Items.GUNPOWDER), Ingredient.fromTag(Tags.Items.NUGGETS_GOLD)).build(consumer, BloodMagic.rl(basePath + "reagent_binding"));
|
||||
|
||||
}
|
||||
{
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.nbt.CompoundNBT;
|
|||
import net.minecraft.nbt.NBTUtil;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
|
@ -19,14 +20,17 @@ 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.anointment.AnointmentHolder;
|
||||
import wayoftime.bloodmagic.common.block.BlockShapedExplosive;
|
||||
import wayoftime.bloodmagic.common.block.BloodMagicBlocks;
|
||||
import wayoftime.bloodmagic.common.registries.BloodMagicEntityTypes;
|
||||
import wayoftime.bloodmagic.tile.TileShapedExplosive;
|
||||
|
||||
public class EntityShapedCharge extends ThrowableEntity
|
||||
{
|
||||
// private static final DataParameter<Optional<BlockState>> ITEMSTACK_DATA = EntityDataManager.createKey(ProjectileItemEntity.class, DataSerializers.OPTIONAL_BLOCK_STATE);
|
||||
private BlockState fallTile = BloodMagicBlocks.SHAPED_CHARGE.get().getDefaultState();
|
||||
private AnointmentHolder holder;
|
||||
|
||||
public EntityShapedCharge(EntityType<EntityShapedCharge> p_i50159_1_, World p_i50159_2_)
|
||||
{
|
||||
|
@ -45,6 +49,11 @@ public class EntityShapedCharge extends ThrowableEntity
|
|||
this.fallTile = block.getDefaultState();
|
||||
}
|
||||
|
||||
public void setAnointmentHolder(AnointmentHolder holder)
|
||||
{
|
||||
this.holder = holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick()
|
||||
{
|
||||
|
@ -65,6 +74,11 @@ public class EntityShapedCharge extends ThrowableEntity
|
|||
if (blockstate.isAir() || blockstate.isIn(BlockTags.FIRE) || material.isLiquid() || material.isReplaceable())
|
||||
{
|
||||
this.getEntityWorld().setBlockState(blockpos, fallTile.with(BlockShapedExplosive.ATTACHED, faceHit));
|
||||
TileEntity tile = this.getEntityWorld().getTileEntity(blockpos);
|
||||
if (tile instanceof TileShapedExplosive)
|
||||
{
|
||||
((TileShapedExplosive) tile).setAnointmentHolder(holder);
|
||||
}
|
||||
this.setDead();
|
||||
} else
|
||||
{
|
||||
|
@ -80,6 +94,8 @@ public class EntityShapedCharge extends ThrowableEntity
|
|||
protected void writeAdditional(CompoundNBT compound)
|
||||
{
|
||||
compound.put("BlockState", NBTUtil.writeBlockState(this.fallTile));
|
||||
if (holder != null)
|
||||
compound.put("holder", holder.serialize());
|
||||
// compound.putInt("Time", this.fallTime);
|
||||
// compound.putBoolean("DropItem", this.shouldDropItem);
|
||||
// compound.putBoolean("HurtEntities", this.hurtEntities);
|
||||
|
@ -98,6 +114,8 @@ public class EntityShapedCharge extends ThrowableEntity
|
|||
protected void readAdditional(CompoundNBT compound)
|
||||
{
|
||||
this.fallTile = NBTUtil.readBlockState(compound.getCompound("BlockState"));
|
||||
if (compound.contains("holder"))
|
||||
this.holder = AnointmentHolder.fromNBT(compound.getCompound("holder"));
|
||||
// this.fallTime = compound.getInt("Time");
|
||||
// if (compound.contains("HurtEntities", 99)) {
|
||||
// this.hurtEntities = compound.getBoolean("HurtEntities");
|
||||
|
@ -115,8 +133,6 @@ public class EntityShapedCharge extends ThrowableEntity
|
|||
// this.tileEntityData = compound.getCompound("TileEntityData");
|
||||
// }
|
||||
|
||||
System.out.println("Reading additional data");
|
||||
|
||||
if (this.fallTile.isAir())
|
||||
{
|
||||
this.fallTile = BloodMagicBlocks.SHAPED_CHARGE.get().getDefaultState();
|
||||
|
|
|
@ -29,9 +29,8 @@ import net.minecraft.util.math.vector.Vector3d;
|
|||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import wayoftime.bloodmagic.common.block.BlockShapedExplosive;
|
||||
import wayoftime.bloodmagic.tile.base.TileTicking;
|
||||
|
||||
public class TileDeforesterCharge extends TileTicking
|
||||
public class TileDeforesterCharge extends TileShapedExplosive
|
||||
{
|
||||
@ObjectHolder("bloodmagic:deforester_charge")
|
||||
public static TileEntityType<TileDeforesterCharge> TYPE;
|
||||
|
@ -44,8 +43,8 @@ public class TileDeforesterCharge extends TileTicking
|
|||
// private boolean cached = false;
|
||||
|
||||
public double internalCounter = 0;
|
||||
public int explosionRadius;
|
||||
public int explosionDepth;
|
||||
// public int explosionRadius;
|
||||
// public int explosionDepth;
|
||||
|
||||
public int currentLogs = 0;
|
||||
|
||||
|
@ -53,9 +52,9 @@ public class TileDeforesterCharge extends TileTicking
|
|||
|
||||
public TileDeforesterCharge(TileEntityType<?> type, int explosionRadius, int explosionDepth)
|
||||
{
|
||||
super(type);
|
||||
this.explosionRadius = explosionRadius;
|
||||
this.explosionDepth = explosionDepth;
|
||||
super(type, explosionRadius, explosionDepth);
|
||||
// this.explosionRadius = explosionRadius;
|
||||
// this.explosionDepth = explosionDepth;
|
||||
}
|
||||
|
||||
public TileDeforesterCharge()
|
||||
|
@ -172,6 +171,7 @@ public class TileDeforesterCharge extends TileTicking
|
|||
|
||||
if (internalCounter == 100)
|
||||
{
|
||||
ItemStack toolStack = this.getHarvestingTool();
|
||||
world.playSound((PlayerEntity) null, this.getPos().getX() + 0.5, this.getPos().getY() + 0.5, this.getPos().getZ() + 0.5, SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.BLOCKS, 4.0F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
|
||||
int numParticles = explosionDepth * (explosionRadius + 1);
|
||||
|
@ -193,7 +193,7 @@ public class TileDeforesterCharge extends TileTicking
|
|||
if (this.world instanceof ServerWorld)
|
||||
{
|
||||
TileEntity tileentity = blockstate.hasTileEntity() ? this.world.getTileEntity(blockPos) : null;
|
||||
LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld) this.world)).withRandom(this.world.rand).withParameter(LootParameters.field_237457_g_, Vector3d.copyCentered(blockPos)).withParameter(LootParameters.TOOL, ItemStack.EMPTY).withNullableParameter(LootParameters.BLOCK_ENTITY, tileentity);
|
||||
LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld) this.world)).withRandom(this.world.rand).withParameter(LootParameters.field_237457_g_, Vector3d.copyCentered(blockPos)).withParameter(LootParameters.TOOL, toolStack).withNullableParameter(LootParameters.BLOCK_ENTITY, tileentity);
|
||||
// if (this.mode == Explosion.Mode.DESTROY) {
|
||||
// lootcontext$builder.withParameter(LootParameters.EXPLOSION_RADIUS, this.size);
|
||||
// }
|
||||
|
|
|
@ -8,7 +8,9 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.loot.LootContext;
|
||||
import net.minecraft.loot.LootParameters;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
|
@ -22,6 +24,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.util.math.vector.Vector3d;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import wayoftime.bloodmagic.anointment.AnointmentHolder;
|
||||
import wayoftime.bloodmagic.common.block.BlockShapedExplosive;
|
||||
import wayoftime.bloodmagic.tile.base.TileTicking;
|
||||
|
||||
|
@ -34,6 +37,8 @@ public class TileShapedExplosive extends TileTicking
|
|||
public int explosionRadius;
|
||||
public int explosionDepth;
|
||||
|
||||
public AnointmentHolder anointmentHolder = new AnointmentHolder();
|
||||
|
||||
public TileShapedExplosive(TileEntityType<?> type, int explosionRadius, int explosionDepth)
|
||||
{
|
||||
super(type);
|
||||
|
@ -109,6 +114,8 @@ public class TileShapedExplosive extends TileTicking
|
|||
break;
|
||||
}
|
||||
|
||||
ItemStack toolStack = this.getHarvestingTool();
|
||||
|
||||
ObjectArrayList<Pair<ItemStack, BlockPos>> objectarraylist = new ObjectArrayList<>();
|
||||
|
||||
BlockPos initialPos = getPos();
|
||||
|
@ -130,7 +137,7 @@ public class TileShapedExplosive extends TileTicking
|
|||
{
|
||||
TileEntity tileentity = blockstate.hasTileEntity() ? this.world.getTileEntity(blockpos)
|
||||
: null;
|
||||
LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld) this.world)).withRandom(this.world.rand).withParameter(LootParameters.field_237457_g_, Vector3d.copyCentered(blockpos)).withParameter(LootParameters.TOOL, ItemStack.EMPTY).withNullableParameter(LootParameters.BLOCK_ENTITY, tileentity);
|
||||
LootContext.Builder lootcontext$builder = (new LootContext.Builder((ServerWorld) this.world)).withRandom(this.world.rand).withParameter(LootParameters.field_237457_g_, Vector3d.copyCentered(blockpos)).withParameter(LootParameters.TOOL, toolStack).withNullableParameter(LootParameters.BLOCK_ENTITY, tileentity);
|
||||
// if (this.mode == Explosion.Mode.DESTROY) {
|
||||
// lootcontext$builder.withParameter(LootParameters.EXPLOSION_RADIUS, this.size);
|
||||
// }
|
||||
|
@ -180,16 +187,50 @@ public class TileShapedExplosive extends TileTicking
|
|||
dropPositionArray.add(Pair.of(stack, pos));
|
||||
}
|
||||
|
||||
public ItemStack getHarvestingTool()
|
||||
{
|
||||
ItemStack stack = new ItemStack(Items.DIAMOND_PICKAXE);
|
||||
if (anointmentHolder != null)
|
||||
anointmentHolder.toItemStack(stack);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(CompoundNBT tag)
|
||||
{
|
||||
internalCounter = tag.getDouble("internalCounter");
|
||||
if (tag.contains("holder"))
|
||||
{
|
||||
anointmentHolder = AnointmentHolder.fromNBT(tag.getCompound("holder"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT serialize(CompoundNBT tag)
|
||||
{
|
||||
tag.putDouble("internalCounter", internalCounter);
|
||||
if (anointmentHolder != null)
|
||||
{
|
||||
tag.put("holder", anointmentHolder.serialize());
|
||||
}
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setAnointmentHolder(AnointmentHolder holder)
|
||||
{
|
||||
this.anointmentHolder = holder;
|
||||
}
|
||||
|
||||
public void dropSelf()
|
||||
{
|
||||
ItemStack stack = new ItemStack(getBlockState().getBlock());
|
||||
if (anointmentHolder != null && !anointmentHolder.isEmpty())
|
||||
{
|
||||
anointmentHolder.toItemStack(stack);
|
||||
}
|
||||
|
||||
InventoryHelper.spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), stack);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue