-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2dff2d5
commit f3bea6f
Showing
28 changed files
with
340 additions
and
29 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/main/java/dev/jaegerwald/voidlings/item/HeartItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package dev.jaegerwald.voidlings.item; | ||
|
||
import dev.jaegerwald.voidlings.sound.ModSounds; | ||
import net.minecraft.entity.EquipmentSlot; | ||
import net.minecraft.entity.effect.StatusEffects; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.sound.SoundCategory; | ||
import net.minecraft.stat.Stats; | ||
import net.minecraft.util.Hand; | ||
import net.minecraft.util.TypedActionResult; | ||
import net.minecraft.world.World; | ||
|
||
public class HeartItem extends Item { | ||
public HeartItem(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) { | ||
ItemStack itemStack = user.getStackInHand(hand); | ||
user.incrementStat(Stats.USED.getOrCreateStat(this)); | ||
|
||
if (!user.isCreative()) { | ||
itemStack.decrement(1); | ||
} | ||
|
||
return TypedActionResult.pass(itemStack); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/main/java/dev/jaegerwald/voidlings/item/ModToolMaterials.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package dev.jaegerwald.voidlings.item; | ||
|
||
import com.google.common.base.Suppliers; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.item.ItemConvertible; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.item.ToolMaterial; | ||
import net.minecraft.recipe.Ingredient; | ||
import net.minecraft.registry.tag.BlockTags; | ||
import net.minecraft.registry.tag.ItemTags; | ||
import net.minecraft.registry.tag.TagKey; | ||
|
||
import java.util.Objects; | ||
import java.util.function.Supplier; | ||
|
||
public enum ModToolMaterials implements ToolMaterial { | ||
MURIA(BlockTags.INCORRECT_FOR_NETHERITE_TOOL, 3046, 9.0F, 4.0F, 20, () -> Ingredient.ofItems(new ItemConvertible[]{ModItems.RAW_MURIA})); | ||
|
||
private final TagKey<Block> inverseTag; | ||
private final int itemDurability; | ||
private final float miningSpeed; | ||
private final float attackDamage; | ||
private final int enchantability; | ||
private final Supplier<Ingredient> repairIngredient; | ||
|
||
private ModToolMaterials(final TagKey<Block> inverseTag, final int itemDurability, final float miningSpeed, final float attackDamage, final int enchantability, final Supplier<Ingredient> repairIngredient) { | ||
this.inverseTag = inverseTag; | ||
this.itemDurability = itemDurability; | ||
this.miningSpeed = miningSpeed; | ||
this.attackDamage = attackDamage; | ||
this.enchantability = enchantability; | ||
Objects.requireNonNull(repairIngredient); | ||
this.repairIngredient = Suppliers.memoize(repairIngredient::get); | ||
} | ||
|
||
public int getDurability() { | ||
return this.itemDurability; | ||
} | ||
|
||
public float getMiningSpeedMultiplier() { | ||
return this.miningSpeed; | ||
} | ||
|
||
public float getAttackDamage() { | ||
return this.attackDamage; | ||
} | ||
|
||
public TagKey<Block> getInverseTag() { | ||
return this.inverseTag; | ||
} | ||
|
||
public int getEnchantability() { | ||
return this.enchantability; | ||
} | ||
|
||
public Ingredient getRepairIngredient() { | ||
return (Ingredient)this.repairIngredient.get(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/dev/jaegerwald/voidlings/item/SurgeonsBladeItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package dev.jaegerwald.voidlings.item; | ||
|
||
import dev.jaegerwald.voidlings.sound.ModSounds; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.EquipmentSlot; | ||
import net.minecraft.entity.ItemSteerable; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.item.SwordItem; | ||
import net.minecraft.item.ToolMaterial; | ||
import net.minecraft.sound.SoundCategory; | ||
import net.minecraft.sound.SoundEvents; | ||
import net.minecraft.stat.Stats; | ||
import net.minecraft.util.Hand; | ||
import net.minecraft.util.TypedActionResult; | ||
import net.minecraft.world.World; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class SurgeonsBladeItem extends SwordItem { | ||
public SurgeonsBladeItem(ToolMaterial toolMaterial, Settings settings) { | ||
super(toolMaterial, settings); | ||
} | ||
|
||
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) { | ||
ItemStack itemStack = user.getStackInHand(hand); | ||
user.incrementStat(Stats.USED.getOrCreateStat(this)); | ||
|
||
world.playSound((PlayerEntity)null, user.getX(), user.getY(), user.getZ(), ModSounds.ITEM_SURGEONS_BLADE_STAB, SoundCategory.PLAYERS, 0.75F, 1.0F); | ||
|
||
// mainly like this for testing purposes | ||
if (!user.isCreative()) { | ||
user.getItemCooldownManager().set(this, 600); | ||
} else { | ||
user.getItemCooldownManager().set(this, 100); | ||
} | ||
|
||
itemStack.damage(5, user, EquipmentSlot.MAINHAND); | ||
|
||
user.damage(world.getDamageSources().playerAttack(user), 9.0F); | ||
|
||
return TypedActionResult.pass(itemStack); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/voidlings/models/item/broken_voidling_heart.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "voidlings:item/broken_voidling_heart" | ||
} | ||
} |
49 changes: 25 additions & 24 deletions
49
src/main/resources/assets/voidlings/models/item/handheld_large.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"display": { | ||
"thirdperson_righthand": { | ||
"rotation": [ 0, -90, 55 ], | ||
"translation": [ 0, 4.0, 0.5 ], | ||
"scale": [ 1.7, 1.7, 0.85 ] | ||
}, | ||
"thirdperson_lefthand": { | ||
"rotation": [ 0, 90, -55 ], | ||
"translation": [ 0, 4.0, 0.5 ], | ||
"scale": [ 1.7, 1.7, 0.85 ] | ||
}, | ||
"firstperson_righthand": { | ||
"rotation": [ 0, -90, 25 ], | ||
"translation": [ 1.13, 3.2, 1.13 ], | ||
"scale": [ 1.36, 1.36, 0.68 ] | ||
}, | ||
"firstperson_lefthand": { | ||
"rotation": [ 0, 90, -25 ], | ||
"translation": [ 1.13, 3.2, 1.13 ], | ||
"scale": [ 1.36, 1.36, 0.68 ] | ||
} | ||
} | ||
} | ||
"credit": "Made by Jaegerwald", | ||
"parent": "minecraft:item/generated", | ||
"display": { | ||
"thirdperson_righthand": { | ||
"rotation": [0, -90, 55], | ||
"translation": [0, 10, 1], | ||
"scale": [1.7, 1.7, 0.85] | ||
}, | ||
"thirdperson_lefthand": { | ||
"rotation": [0, 90, -55], | ||
"translation": [0, 10, 1], | ||
"scale": [1.7, 1.7, 0.85] | ||
}, | ||
"firstperson_righthand": { | ||
"rotation": [0, -90, 25], | ||
"translation": [1.13, 6.4, 2.26], | ||
"scale": [1.36, 1.36, 0.68] | ||
}, | ||
"firstperson_lefthand": { | ||
"rotation": [0, 90, -25], | ||
"translation": [1.13, 6.4, 2.26], | ||
"scale": [1.36, 1.36, 0.68] | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/voidlings/models/item/replacement_heart.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "voidlings:item/replacement_heart" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/voidlings/models/item/voidling_heart.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "voidlings:item/voidling_heart" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"item.surgeons_blade.stab": { | ||
"subtitle": "subtitles.voidlings.item.surgeons_blade.stab", | ||
"sounds": [ | ||
"voidlings:item/surgeons_blade/stab" | ||
] | ||
}, | ||
"item.surgeons_blade.voidling_breath": { | ||
"subtitle": "subtitles.voidlings.item.surgeons_blade.voidling_breath", | ||
"sounds": [ | ||
"voidlings:item/surgeons_blade/voidling_breath" | ||
] | ||
}, | ||
"block.void_vines.pick_lamina": { | ||
"subtitle": "subtitles.voidlings.block.void_vines.pick_lamina", | ||
"sounds": [ | ||
"minecraft:item/sweet_berries/pick_from_bush1", | ||
"minecraft:item/sweet_berries/pick_from_bush2" | ||
] | ||
} | ||
} |
Binary file added
BIN
+38.7 KB
src/main/resources/assets/voidlings/sounds/item/surgeons_blade/stab.ogg
Binary file not shown.
Binary file added
BIN
+40.9 KB
src/main/resources/assets/voidlings/sounds/item/surgeons_blade/voidling_breath.ogg
Binary file not shown.
Binary file added
BIN
+236 Bytes
src/main/resources/assets/voidlings/textures/item/broken_voidling_heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+248 Bytes
src/main/resources/assets/voidlings/textures/item/replacement_heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+231 Bytes
src/main/resources/assets/voidlings/textures/item/voidling_heart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions
2
src/main/resources/data/voidlings/function/replaced_heart.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
execute unless entity @s[tag=voidlings.stabbed] run effect give @s minecraft:regeneration 3 5 true | ||
execute if entity @s[tag=voidlings.stabbed] run function voidlings:valid_heart_replacement |
7 changes: 7 additions & 0 deletions
7
src/main/resources/data/voidlings/function/stabbed.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
effect give @s minecraft:slowness 30 3 true | ||
effect give @s minecraft:blindness 31 255 true | ||
|
||
tag @s add voidlings.stabbed | ||
tag @s remove voidlings.replaced_heart | ||
|
||
schedule function voidlings:stabbed_bleed_out 600t replace |
2 changes: 2 additions & 0 deletions
2
src/main/resources/data/voidlings/function/stabbed_bleed_out.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
execute as @a[tag=voidlings.stabbed,tag=!voidlings.replaced_heart] run kill @s | ||
tag @a[tag=voidlings.stabbed,tag=!voidlings.replaced_heart] remove voidlings.stabbed |
6 changes: 6 additions & 0 deletions
6
src/main/resources/data/voidlings/function/valid_heart_replacement.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
tag @s add voidlings.replaced_heart | ||
|
||
effect clear @s minecraft:slowness | ||
effect clear @s minecraft:blindness | ||
|
||
tag @s remove voidlings.stabbed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/resources/data/voidlings/powers/replacable_heart.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"type": "origins:action_on_item_use", | ||
"trigger": "instant", | ||
"hidden": true, | ||
|
||
"entity_action": { | ||
"type": "origins:and", | ||
"actions": [ | ||
{ | ||
"type": "origins:execute_command", | ||
"command": "function voidlings:replaced_heart" | ||
} | ||
] | ||
}, | ||
|
||
"item_condition": { | ||
"type": "origins:or", | ||
"conditions": [ | ||
{ | ||
"type": "origins:ingredient", | ||
"ingredient": { | ||
"item": "voidlings:replacement_heart" | ||
} | ||
}, | ||
{ | ||
"type": "origins:ingredient", | ||
"ingredient": { | ||
"item": "voidlings:voidling_heart" | ||
} | ||
} | ||
] | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
src/main/resources/data/voidlings/powers/voidling/stabbable.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"type": "origins:action_on_item_use", | ||
"trigger": "instant", | ||
"hidden": true, | ||
|
||
"entity_action": { | ||
"type": "origins:and", | ||
"actions": [ | ||
{ | ||
"type": "origins:play_sound", | ||
"sound": "voidlings:item.surgeons_blade.voidling_breath", | ||
"volume": 0.75, | ||
"pitch": 1 | ||
}, | ||
{ | ||
"type": "origins:execute_command", | ||
"command": "function voidlings:stabbed" | ||
}, | ||
{ | ||
"type": "origins:execute_command", | ||
"command": "give @s voidlings:broken_voidling_heart 1" | ||
} | ||
] | ||
}, | ||
|
||
"item_condition": { | ||
"type": "origins:ingredient", | ||
"ingredient": { | ||
"item": "voidlings:surgeons_blade" | ||
} | ||
} | ||
} |
Oops, something went wrong.