generated from neoforged/MDK
-
Notifications
You must be signed in to change notification settings - Fork 19
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
b48a5d8
commit 2eee62c
Showing
22 changed files
with
378 additions
and
19 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
src/generated/resources/.cache/7e4928c403af173c11f4d1675461c34bf5d23056
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,8 +1,10 @@ | ||
// 1.21.1 2024-09-25T19:43:29.0537222 Tags for minecraft:entity_type mod id justdirethings | ||
// 1.21.1 2024-12-07T15:14:23.6887728 Tags for minecraft:entity_type mod id justdirethings | ||
b7ee8eaecff151e619b9a22ecae620a5b3ce15a0 data/c/tags/entity_type/teleporting_not_supported.json | ||
e00f2931577049b9a4400a87ed9c249373be376c data/justdirethings/tags/entity_type/creature_catcher_deny.json | ||
669025814936e708d42d9d0a5b88c11e62cf12ef data/justdirethings/tags/entity_type/no_ai_deny.json | ||
669025814936e708d42d9d0a5b88c11e62cf12ef data/justdirethings/tags/entity_type/no_earthquake.json | ||
b7ee8eaecff151e619b9a22ecae620a5b3ce15a0 data/justdirethings/tags/entity_type/paradox_absorb_deny.json | ||
b7ee8eaecff151e619b9a22ecae620a5b3ce15a0 data/justdirethings/tags/entity_type/paradox_deny.json | ||
263995270039da950f2e27b535f1b7c71a5f5423 data/justdirethings/tags/entity_type/polymorphic_hostile.json | ||
d53ddb5be22b17ec02beda6e2e3695f074abc70f data/justdirethings/tags/entity_type/polymorphic_peaceful.json | ||
6a890ea62d03cc1110fa8d1fe5a0669082d9d96b data/minecraft/tags/entity_type/arrows.json |
4 changes: 2 additions & 2 deletions
4
src/generated/resources/.cache/8202586f691eec5ad0bb88d13a278951d0c130fb
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,2 +1,2 @@ | ||
// 1.21.1 2024-12-07T12:22:16.5157473 Languages: en_us for mod: justdirethings | ||
3b47394404270f860109f4004040665ac95dfef0 assets/justdirethings/lang/en_us.json | ||
// 1.21.1 2024-12-07T15:35:26.0358297 Languages: en_us for mod: justdirethings | ||
dc7bbea3a13870709a7bafccf7758ac21f7bffec assets/justdirethings/lang/en_us.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
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
35 changes: 35 additions & 0 deletions
35
src/generated/resources/data/justdirethings/tags/entity_type/polymorphic_hostile.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,35 @@ | ||
{ | ||
"values": [ | ||
"minecraft:zombie", | ||
"minecraft:skeleton", | ||
"minecraft:creeper", | ||
"minecraft:spider", | ||
"minecraft:enderman", | ||
"minecraft:silverfish", | ||
"minecraft:zombified_piglin", | ||
"minecraft:piglin", | ||
"minecraft:piglin_brute", | ||
"minecraft:hoglin", | ||
"minecraft:zoglin", | ||
"minecraft:ghast", | ||
"minecraft:blaze", | ||
"minecraft:slime", | ||
"minecraft:witch", | ||
"minecraft:rabbit", | ||
"minecraft:endermite", | ||
"minecraft:stray", | ||
"minecraft:wither_skeleton", | ||
"minecraft:skeleton_horse", | ||
"minecraft:zombie_horse", | ||
"minecraft:zombie_villager", | ||
"minecraft:husk", | ||
"minecraft:guardian", | ||
"minecraft:evoker", | ||
"minecraft:vex", | ||
"minecraft:vindicator", | ||
"minecraft:shulker", | ||
"minecraft:drowned", | ||
"minecraft:phantom", | ||
"minecraft:pillager" | ||
] | ||
} |
40 changes: 40 additions & 0 deletions
40
src/generated/resources/data/justdirethings/tags/entity_type/polymorphic_peaceful.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,40 @@ | ||
{ | ||
"values": [ | ||
"minecraft:sheep", | ||
"minecraft:pig", | ||
"minecraft:cow", | ||
"minecraft:mooshroom", | ||
"minecraft:chicken", | ||
"minecraft:bat", | ||
"minecraft:villager", | ||
"minecraft:squid", | ||
"minecraft:ocelot", | ||
"minecraft:wolf", | ||
"minecraft:horse", | ||
"minecraft:rabbit", | ||
"minecraft:donkey", | ||
"minecraft:mule", | ||
"minecraft:polar_bear", | ||
"minecraft:llama", | ||
"minecraft:parrot", | ||
"minecraft:dolphin", | ||
"minecraft:cod", | ||
"minecraft:salmon", | ||
"minecraft:pufferfish", | ||
"minecraft:tropical_fish", | ||
"minecraft:turtle", | ||
"minecraft:cat", | ||
"minecraft:fox", | ||
"minecraft:panda", | ||
"minecraft:trader_llama", | ||
"minecraft:wandering_trader", | ||
"minecraft:strider", | ||
"minecraft:glow_squid", | ||
"minecraft:goat", | ||
"minecraft:bee", | ||
"minecraft:frog", | ||
"minecraft:tadpole", | ||
"minecraft:camel", | ||
"minecraft:axolotl" | ||
] | ||
} |
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
72 changes: 67 additions & 5 deletions
72
src/main/java/com/direwolf20/justdirethings/common/items/PolymorphicWand.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 |
---|---|---|
@@ -1,15 +1,77 @@ | ||
package com.direwolf20.justdirethings.common.items; | ||
|
||
import com.direwolf20.justdirethings.common.items.interfaces.Ability; | ||
import com.direwolf20.justdirethings.common.items.interfaces.BaseToggleableTool; | ||
import com.direwolf20.justdirethings.common.items.interfaces.LeftClickableTool; | ||
import com.direwolf20.justdirethings.common.items.interfaces.*; | ||
import com.direwolf20.justdirethings.setup.Config; | ||
import com.direwolf20.justdirethings.util.MagicHelpers; | ||
import net.minecraft.ChatFormatting; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.InteractionHand; | ||
import net.minecraft.world.InteractionResult; | ||
import net.minecraft.world.InteractionResultHolder; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.TooltipFlag; | ||
import net.minecraft.world.item.context.UseOnContext; | ||
import net.minecraft.world.level.ClipContext; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.phys.BlockHitResult; | ||
import net.minecraft.world.phys.HitResult; | ||
import net.neoforged.neoforge.capabilities.Capabilities; | ||
import net.neoforged.neoforge.fluids.capability.IFluidHandlerItem; | ||
|
||
public class PolymorphicWand extends BaseToggleableTool implements LeftClickableTool { | ||
import java.util.List; | ||
|
||
public class PolymorphicWand extends BaseToggleableTool implements LeftClickableTool, FluidContainingItem { | ||
public PolymorphicWand() { | ||
super(new Properties() | ||
.fireResistant() | ||
.durability(200)); | ||
registerAbility(Ability.LAVAREPAIR); | ||
//registerAbility(Ability.AIRBURST, new AbilityParams(1, 2, 1, 2)); | ||
registerAbility(Ability.POLYMORPH_RANDOM); | ||
} | ||
|
||
@Override | ||
public int getMaxMB() { | ||
return Config.POLYMORPHIC_WAND_MAX_FLUID.get(); | ||
} | ||
|
||
@Override | ||
public InteractionResult useOn(UseOnContext pContext) { | ||
ItemStack itemStack = pContext.getItemInHand(); | ||
Player player = pContext.getPlayer(); | ||
if (player == null || itemStack.isEmpty()) return InteractionResult.FAIL; | ||
BlockHitResult blockhitresult = getPlayerPOVHitResult(player.level(), player, ClipContext.Fluid.SOURCE_ONLY); | ||
if (blockhitresult.getType() == HitResult.Type.BLOCK) { | ||
if (FluidContainingItem.pickupFluid(player.level(), player, itemStack, blockhitresult)) | ||
return InteractionResult.SUCCESS; | ||
} | ||
return super.useOn(pContext); | ||
} | ||
|
||
@Override | ||
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) { | ||
ItemStack itemStack = player.getItemInHand(hand); | ||
BlockHitResult blockhitresult = getPlayerPOVHitResult(level, player, ClipContext.Fluid.SOURCE_ONLY); | ||
if (blockhitresult.getType() == HitResult.Type.BLOCK) { | ||
if (FluidContainingItem.pickupFluid(level, player, itemStack, blockhitresult)) | ||
return InteractionResultHolder.fail(itemStack); | ||
} | ||
return super.use(level, player, hand); | ||
} | ||
|
||
@Override | ||
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltip, TooltipFlag flagIn) { | ||
super.appendHoverText(stack, context, tooltip, flagIn); | ||
Level level = context.level(); | ||
if (level == null) { | ||
return; | ||
} | ||
IFluidHandlerItem fluidHandler = stack.getCapability(Capabilities.FluidHandler.ITEM); | ||
if (fluidHandler == null) { | ||
return; | ||
} | ||
tooltip.add(Component.translatable("justdirethings.polymorphicfluidamt", MagicHelpers.formatted(fluidHandler.getFluidInTank(0).getAmount()), MagicHelpers.formatted(fluidHandler.getTankCapacity(0))).withStyle(ChatFormatting.GREEN)); | ||
} | ||
|
||
} |
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
Oops, something went wrong.