mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-12-22 14:59:22 +01:00
added the staff of ancient knowledge
This commit is contained in:
parent
07390c8f69
commit
3e434b8fc8
7 changed files with 110 additions and 1 deletions
|
@ -0,0 +1,60 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.MobSpawnerTileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
|
||||
public class ItemNetheriteFinder extends ItemImpl {
|
||||
public ItemNetheriteFinder() {
|
||||
super("netherite_finder", new Properties().maxStackSize(1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) {
|
||||
ItemStack stack = playerIn.getHeldItem(handIn);
|
||||
NaturesAuraAPI.IInternalHooks inst = NaturesAuraAPI.instance();
|
||||
if (!inst.extractAuraFromPlayer(playerIn, 200000, false))
|
||||
return new ActionResult<>(ActionResultType.FAIL, stack);
|
||||
if (worldIn.isRemote) {
|
||||
inst.setParticleDepth(false);
|
||||
inst.setParticleSpawnRange(64);
|
||||
inst.setParticleCulling(false);
|
||||
|
||||
BlockPos pos = playerIn.getPosition();
|
||||
int range = 64;
|
||||
for (int x = -range; x <= range; x++) {
|
||||
for (int y = 0; y <= 128; y++) {
|
||||
for (int z = -range; z <= range; z++) {
|
||||
BlockPos offset = new BlockPos(pos.getX() + x, y, pos.getZ() + z);
|
||||
BlockState state = worldIn.getBlockState(offset);
|
||||
if (state.getBlock() == Blocks.ANCIENT_DEBRIS || state.getBlock().getRegistryName().toString().contains("netherite")) {
|
||||
inst.spawnMagicParticle(
|
||||
offset.getX() + 0.5F, offset.getY() + 0.5F, offset.getZ() + 0.5F,
|
||||
0F, 0F, 0F, 0xab4d38, 6F, 20 * 60, 0F, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inst.setParticleDepth(true);
|
||||
inst.setParticleSpawnRange(32);
|
||||
inst.setParticleCulling(true);
|
||||
playerIn.swingArm(handIn);
|
||||
}
|
||||
playerIn.getCooldownTracker().setCooldown(this, 20 * 60);
|
||||
return new ActionResult<>(ActionResultType.SUCCESS, stack);
|
||||
}
|
||||
}
|
|
@ -62,4 +62,5 @@ public final class ModItems {
|
|||
public static Item END_CITY_FINDER;
|
||||
public static Item BREAK_PREVENTION;
|
||||
public static Item PET_REVIVER;
|
||||
public static Item NETHERITE_FINDER;
|
||||
}
|
||||
|
|
|
@ -223,7 +223,8 @@ public final class ModRegistry {
|
|||
new ItemStructureFinder("fortress_finder", Structure.field_236378_n_, 0xba2800),
|
||||
new ItemStructureFinder("end_city_finder", Structure.field_236379_o_, 0xca5cd6),
|
||||
new ItemBreakPrevention(),
|
||||
new ItemPetReviver()
|
||||
new ItemPetReviver(),
|
||||
new ItemNetheriteFinder()
|
||||
);
|
||||
Helper.populateObjectHolders(ModItems.class, event.getRegistry());
|
||||
}
|
||||
|
|
|
@ -132,6 +132,7 @@
|
|||
"item.naturesaura.end_city_finder": "Eye of the Shulker",
|
||||
"item.naturesaura.break_prevention": "Eir's Token",
|
||||
"item.naturesaura.pet_reviver": "Token of Undying Friendship",
|
||||
"item.naturesaura.netherite_finder": "Staff of Ancient Knowledge",
|
||||
"container.naturesaura:tree_ritual.name": "Ritual of the Forest",
|
||||
"container.naturesaura:altar.name": "Natural Altar Infusion",
|
||||
"container.naturesaura:offering.name": "Offering to the Gods",
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 388 B |
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"name": "Staff of Ancient Knowledge",
|
||||
"icon": "naturesaura:netherite_finder",
|
||||
"category": "items",
|
||||
"advancement": "naturesaura:offering",
|
||||
"pages": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "Recent discoveries have unmasked a rather important, buried substance within the darker parts of this world: $(thing)Ancient Debris$(). This hard-to-find material is sturdy and extremely useful to miners, yet its rarity makes it hard to obtain. The $(item)Staff of Ancient Knowledge$() solves this problem in an elegant way."
|
||||
},
|
||||
{
|
||||
"type": "text",
|
||||
"text": "When using it, all $(thing)Ancient Debris$() blocks in a rather large area around the user will be highlighted, making them visible even $(thing)through other blocks$(), for about a minute or so. During this time, the material can easily be located and mined.$(br)Needless to say, this operation requires a large amount of $(aura) from an $(l:items/aura_cache)Aura Cache$() or similar device."
|
||||
},
|
||||
{
|
||||
"type": "crafting",
|
||||
"text": "Creating the $(item)Staff of Ancient Knowledge$()",
|
||||
"recipe": "naturesaura:netherite_finder"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" NE",
|
||||
"IRI",
|
||||
"RN "
|
||||
],
|
||||
"key": {
|
||||
"R": {
|
||||
"item": "naturesaura:ancient_stick"
|
||||
},
|
||||
"I": {
|
||||
"item": "naturesaura:sky_ingot"
|
||||
},
|
||||
"N": {
|
||||
"item": "minecraft:netherrack"
|
||||
},
|
||||
"E": {
|
||||
"item": "minecraft:netherite_scrap"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "naturesaura:netherite_finder"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue