mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-26 13:18:34 +01:00
Compare commits
No commits in common. "21e553f0e420d40d7ac81abf02b5e14a185cb2f7" and "8d68aa5777db2d348282c2d13daa8018e8061a8b" have entirely different histories.
21e553f0e4
...
8d68aa5777
9 changed files with 27 additions and 212 deletions
|
@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
|
||||||
version = '38.0'
|
version = '37.7'
|
||||||
group = 'de.ellpeck.naturesaura' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
group = 'de.ellpeck.naturesaura' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
archivesBaseName = 'NaturesAura'
|
archivesBaseName = 'NaturesAura'
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,10 @@ import de.ellpeck.naturesaura.items.ModItems;
|
||||||
import de.ellpeck.naturesaura.reg.ICustomItemModel;
|
import de.ellpeck.naturesaura.reg.ICustomItemModel;
|
||||||
import de.ellpeck.naturesaura.reg.IModItem;
|
import de.ellpeck.naturesaura.reg.IModItem;
|
||||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.sounds.SoundEvents;
|
import net.minecraft.sounds.SoundEvents;
|
||||||
import net.minecraft.sounds.SoundSource;
|
import net.minecraft.sounds.SoundSource;
|
||||||
import net.minecraft.util.Mth;
|
|
||||||
import net.minecraft.world.InteractionHand;
|
import net.minecraft.world.InteractionHand;
|
||||||
import net.minecraft.world.InteractionResult;
|
import net.minecraft.world.InteractionResult;
|
||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
|
@ -27,7 +25,6 @@ import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class ItemShovel extends ShovelItem implements IModItem, ICustomItemModel {
|
public class ItemShovel extends ShovelItem implements IModItem, ICustomItemModel {
|
||||||
|
|
||||||
|
@ -46,40 +43,14 @@ public class ItemShovel extends ShovelItem implements IModItem, ICustomItemModel
|
||||||
var stack = player.getItemInHand(context.getHand());
|
var stack = player.getItemInHand(context.getHand());
|
||||||
var pos = context.getClickedPos();
|
var pos = context.getClickedPos();
|
||||||
var state = level.getBlockState(pos);
|
var state = level.getBlockState(pos);
|
||||||
|
|
||||||
// turning dirt to grass
|
|
||||||
if (this == ModItems.INFUSED_IRON_SHOVEL || this == ModItems.DEPTH_SHOVEL) {
|
|
||||||
if ((state.getBlock() == Blocks.DIRT || state.getBlock() == Blocks.MYCELIUM) && level.getBlockState(pos.above()).getMaterial() == Material.AIR) {
|
|
||||||
level.setBlockAndUpdate(pos, Blocks.GRASS_BLOCK.defaultBlockState());
|
|
||||||
var damage = 5F;
|
|
||||||
|
|
||||||
if (this == ModItems.DEPTH_SHOVEL && !level.isClientSide) {
|
|
||||||
var possible = new ArrayList<BlockPos>();
|
|
||||||
for (var x = -5; x <= 5; x++) {
|
|
||||||
for (var z = -5; z <= 5; z++) {
|
|
||||||
for (var y = -1; y <= 1; y++) {
|
|
||||||
var offset = pos.offset(x, y, z);
|
|
||||||
var offState = level.getBlockState(offset);
|
|
||||||
if ((offState.getBlock() == Blocks.DIRT || offState.getBlock() == Blocks.MYCELIUM) && level.getBlockState(offset.above()).getMaterial() == Material.AIR)
|
|
||||||
possible.add(offset);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (var i = 0; i < 63 && !possible.isEmpty(); i++) {
|
|
||||||
level.setBlockAndUpdate(possible.get(level.random.nextInt(possible.size())), Blocks.GRASS_BLOCK.defaultBlockState());
|
|
||||||
damage += 0.25F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
level.playSound(player, pos, SoundEvents.GRASS_PLACE, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
||||||
stack.hurtAndBreak(Mth.ceil(damage), player, p -> p.broadcastBreakEvent(context.getHand()));
|
|
||||||
return InteractionResult.SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// flattening a large area
|
|
||||||
if (this == ModItems.INFUSED_IRON_SHOVEL) {
|
if (this == ModItems.INFUSED_IRON_SHOVEL) {
|
||||||
var flattened = false;
|
var damage = 0;
|
||||||
|
if (state.getBlock() == Blocks.DIRT || state.getBlock() == Blocks.MYCELIUM) {
|
||||||
|
if (level.getBlockState(pos.above()).getMaterial() == Material.AIR) {
|
||||||
|
level.setBlockAndUpdate(pos, Blocks.GRASS_BLOCK.defaultBlockState());
|
||||||
|
damage = 5;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
var range = player.isShiftKeyDown() ? 0 : 1;
|
var range = player.isShiftKeyDown() ? 0 : 1;
|
||||||
for (var x = -range; x <= range; x++) {
|
for (var x = -range; x <= range; x++) {
|
||||||
for (var y = -range; y <= range; y++) {
|
for (var y = -range; y <= range; y++) {
|
||||||
|
@ -91,20 +62,20 @@ public class ItemShovel extends ShovelItem implements IModItem, ICustomItemModel
|
||||||
&& level.getBlockState(actualPos).getBlock() == Blocks.GRASS_BLOCK) {
|
&& level.getBlockState(actualPos).getBlock() == Blocks.GRASS_BLOCK) {
|
||||||
if (!level.isClientSide)
|
if (!level.isClientSide)
|
||||||
level.setBlock(actualPos, Blocks.DIRT_PATH.defaultBlockState(), 11);
|
level.setBlock(actualPos, Blocks.DIRT_PATH.defaultBlockState(), 11);
|
||||||
flattened = true;
|
damage = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flattened) {
|
|
||||||
level.playSound(player, pos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F);
|
|
||||||
stack.hurtAndBreak(1, player, p -> p.broadcastBreakEvent(context.getHand()));
|
|
||||||
return InteractionResult.SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// sky shovel swapping
|
if (damage > 0) {
|
||||||
if (this == ModItems.SKY_SHOVEL) {
|
level.playSound(player, pos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F);
|
||||||
|
stack.hurtAndBreak(damage, player, p -> p.broadcastBreakEvent(context.getHand()));
|
||||||
|
return InteractionResult.SUCCESS;
|
||||||
|
}
|
||||||
|
return InteractionResult.PASS;
|
||||||
|
} else if (this == ModItems.SKY_SHOVEL) {
|
||||||
if (this.getDestroySpeed(stack, state) <= 1)
|
if (this.getDestroySpeed(stack, state) <= 1)
|
||||||
return super.useOn(context);
|
return super.useOn(context);
|
||||||
var otherHand = context.getHand() == InteractionHand.MAIN_HAND ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
|
var otherHand = context.getHand() == InteractionHand.MAIN_HAND ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
|
||||||
|
@ -119,7 +90,6 @@ public class ItemShovel extends ShovelItem implements IModItem, ICustomItemModel
|
||||||
stack.hurtAndBreak(1, player, p -> p.broadcastBreakEvent(context.getHand()));
|
stack.hurtAndBreak(1, player, p -> p.broadcastBreakEvent(context.getHand()));
|
||||||
return InteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.useOn(context);
|
return super.useOn(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -230,10 +230,6 @@
|
||||||
"advancement.naturesaura.range_visualizer.desc": "Create a Mystical Magnifier to see the range of your devices",
|
"advancement.naturesaura.range_visualizer.desc": "Create a Mystical Magnifier to see the range of your devices",
|
||||||
"advancement.naturesaura.vacuum_bottle": "Breathe Through, Breathe Deep",
|
"advancement.naturesaura.vacuum_bottle": "Breathe Through, Breathe Deep",
|
||||||
"advancement.naturesaura.vacuum_bottle.desc": "Capture a vacuum using a Bottle and Cork",
|
"advancement.naturesaura.vacuum_bottle.desc": "Capture a vacuum using a Bottle and Cork",
|
||||||
"advancement.naturesaura.depth_ingot": "Depth Stranding",
|
|
||||||
"advancement.naturesaura.depth_ingot.desc": "Craft an Ingot of the Depths",
|
|
||||||
"advancement.naturesaura.depth_tools": "Striding in Style",
|
|
||||||
"advancement.naturesaura.depth_tools.desc": "Craft a full set of Soulstrider's tools and armor",
|
|
||||||
"command.naturesaura.aura.usage": "/naaura store|drain <amount> [range] OR /naaura reset <range>",
|
"command.naturesaura.aura.usage": "/naaura store|drain <amount> [range] OR /naaura reset <range>",
|
||||||
"effect.naturesaura.breathless": "Breathless",
|
"effect.naturesaura.breathless": "Breathless",
|
||||||
"entity.naturesaura.effect_inhibitor": "Effect Powder",
|
"entity.naturesaura.effect_inhibitor": "Effect Powder",
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Soulstrider's Armor",
|
|
||||||
"icon": "naturesaura:depth_chest",
|
|
||||||
"category": "naturesaura:items",
|
|
||||||
"advancement": "naturesaura:depth_ingot",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"text": "When wearing $(item)Soulstrider's armor$(), a magical botanist can feel dark energy surging in them. While this armor can be repaired like its $(l:items/sky_armor)counterparts$(), it also provides a $(thing)set bonus$(): When wearing every piece of the armor (or swapping the chestplate for an $(item)Elytra$()), upon being struck, the armor causes all nearby enemies to fuse with the ground for a few seconds, causing them to $(thing)stand completely still$()."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "crafting",
|
|
||||||
"recipe": "naturesaura:depth_helmet",
|
|
||||||
"recipe2": "naturesaura:depth_chest"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "crafting",
|
|
||||||
"recipe": "naturesaura:depth_pants",
|
|
||||||
"recipe2": "naturesaura:depth_shoes"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Ingot of the Depths",
|
|
||||||
"icon": "naturesaura:depth_ingot",
|
|
||||||
"category": "naturesaura:items",
|
|
||||||
"advancement": "naturesaura:sky_ingot",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"text": "Years after their original inception, magical botanists have finally found a new material able to harness the powers of $(aura) through new means: the mystical and elusive $(item)Netherite$(). With it, one can create a most powerful material: $(item)Ingots of the Depths$(). These ingots, as expected, can also be turned into $(l:items/depth_armor)armor$() and $(l:items/depth_tools)tools$()."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "crafting",
|
|
||||||
"text": "Creating the $(item)Ingot of the Depths$()",
|
|
||||||
"recipe": "naturesaura:depth_ingot_creation"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
{
|
|
||||||
"name": "Soulstrider's Tools",
|
|
||||||
"icon": "naturesaura:depth_pickaxe",
|
|
||||||
"category": "naturesaura:items",
|
|
||||||
"advancement": "naturesaura:depth_ingot",
|
|
||||||
"pages": [
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"text": "$(item)Soulstrider's tools$() are extraordinarily powerful as tools go, being forged out of a combination of materials from the Skies, the Earth, and the Depths. While also functioning as regular tools, they each have an additional $(thing)special ability$() that sets them apart from their $(item)netherite$() counterparts.$(br)Additionally, these tools can be $(thing)repaired$() in the same way as $(l:items/sky_tools)Skyseeker's tools$()."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "crafting",
|
|
||||||
"text": "The $(item)Soulstrider's Pickaxe$(), when enabled by $(thing)sneak-interacting$() with it, will mine a whole $(thing)vein of ores$() all in one, allowing mining much more efficiently.",
|
|
||||||
"recipe": "naturesaura:depth_pickaxe"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "crafting",
|
|
||||||
"text": "The $(item)Soulstrider's Handaxe$(), when enabled by $(thing)sneak-interacting$() with it, is very efficient at chopping $(thing)any type of tree$(), even extraordinarily large ones, doing so in one fell swoop.",
|
|
||||||
"recipe": "naturesaura:depth_axe"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "crafting",
|
|
||||||
"text": "The $(item)Soulstrider's Shovel$(), when interacting with a barren block like $(item)Dirt$(), turns it into a luscious grass block, additionally doing so for a $(thing)large area$() around it in the process.",
|
|
||||||
"recipe": "naturesaura:depth_shovel"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "crafting",
|
|
||||||
"text": "The $(item)Soulstrider's Hoe$() helps those botanists who don't enjoy waiting for a tree to fully fall on its own, allowing them to break $(item)Leaves$() in a very large area with only a single swing.",
|
|
||||||
"recipe": "naturesaura:depth_hoe"
|
|
||||||
}, {
|
|
||||||
"type": "crafting",
|
|
||||||
"text": "The sheer size of the $(item)Soulstrider's Blade$() comes to play when attacking a larger group of monsters: Upon attacking one of them, several in a rather large area are struck, as if it was enchanted with a more powerful version of $(item)Sweeping Edge$(). Of course, these two abilities are not mutually exclusive, either.",
|
|
||||||
"recipe": "naturesaura:depth_sword"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -15,7 +15,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "crafting",
|
"type": "crafting",
|
||||||
"text": "The $(item)Skyseeker's Handaxe$(), when enabled by $(thing)sneak-interacting$() with it, is very efficient at chopping $(thing)small trees$(), doing so in one fell swoop.",
|
"text": "The $(item)Skyseeker's Handaxe$() is very efficient at chopping $(thing)small trees$(), doing so in one fell swoop.",
|
||||||
"recipe": "naturesaura:sky_axe"
|
"recipe": "naturesaura:sky_axe"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
"display": {
|
|
||||||
"icon": {
|
|
||||||
"item": "naturesaura:depth_ingot"
|
|
||||||
},
|
|
||||||
"title": {
|
|
||||||
"translate": "advancement.naturesaura.depth_ingot"
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"translate": "advancement.naturesaura.depth_ingot.desc"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"parent": "naturesaura:sky_ingot",
|
|
||||||
"criteria": {
|
|
||||||
"ingot": {
|
|
||||||
"trigger": "minecraft:inventory_changed",
|
|
||||||
"conditions": {
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"items": ["naturesaura:depth_ingot"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
{
|
|
||||||
"display": {
|
|
||||||
"icon": {
|
|
||||||
"item": "naturesaura:depth_pickaxe"
|
|
||||||
},
|
|
||||||
"title": {
|
|
||||||
"translate": "advancement.naturesaura.depth_tools"
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"translate": "advancement.naturesaura.depth_tools.desc"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"parent": "naturesaura:depth_ingot",
|
|
||||||
"criteria": {
|
|
||||||
"materials": {
|
|
||||||
"trigger": "minecraft:inventory_changed",
|
|
||||||
"conditions": {
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"items": ["naturesaura:depth_pickaxe"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"items": ["naturesaura:depth_sword"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"items": ["naturesaura:depth_axe"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"items": ["naturesaura:depth_shovel"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"items": ["naturesaura:depth_hoe"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"items": ["naturesaura:depth_helmet"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"items": ["naturesaura:depth_chest"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"items": ["naturesaura:depth_pants"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"items": ["naturesaura:depth_shoes"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue