generated from NeoForgeMDKs/MDK-1.21-NeoGradle
-
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.
start setting up stuff for diving armor set model
- Loading branch information
1 parent
0e2ad51
commit 95288d2
Showing
16 changed files
with
193 additions
and
82 deletions.
There are no files selected for viewing
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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/portingdeadmods/modjam/client/model/armor/DivingArmorModel.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,16 @@ | ||
package com.portingdeadmods.modjam.client.model.armor; | ||
|
||
import com.portingdeadmods.modjam.api.client.model.MJArmorModel; | ||
import net.minecraft.client.model.geom.PartPose; | ||
import net.minecraft.client.model.geom.builders.*; | ||
|
||
public class DivingArmorModel { | ||
public static LayerDefinition createBodyLayer() { | ||
return MJArmorModel.createLayer(1, 1, parts -> { | ||
parts.getHead().addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(-21, -14).addBox(-8.0F, -2.0F, -8.0F, 16.0F, 2.0F, 16.0F, new CubeDeformation(0.0F)) | ||
.texOffs(-12, -8).addBox(-5.0F, -4.0F, -5.0F, 10.0F, 2.0F, 10.0F, new CubeDeformation(0.0F)) | ||
.texOffs(-18, -12).addBox(-7.0F, -16.0F, -7.0F, 14.0F, 12.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); | ||
}); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...ds/modjam/client/model/DrainTopModel.java → ...jam/client/model/block/DrainTopModel.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
2 changes: 1 addition & 1 deletion
2
.../client/model/PrismarineCrystalModel.java → ...t/model/block/PrismarineCrystalModel.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
2 changes: 1 addition & 1 deletion
2
...dmods/modjam/client/model/WhiskModel.java → ...modjam/client/model/block/WhiskModel.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
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
82 changes: 82 additions & 0 deletions
82
src/main/java/com/portingdeadmods/modjam/content/items/NeptunesTridentItem.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,82 @@ | ||
package com.portingdeadmods.modjam.content.items; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.InteractionHand; | ||
import net.minecraft.world.InteractionResultHolder; | ||
import net.minecraft.world.entity.EquipmentSlot; | ||
import net.minecraft.world.entity.EquipmentSlotGroup; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import net.minecraft.world.entity.ai.attributes.AttributeModifier; | ||
import net.minecraft.world.entity.ai.attributes.Attributes; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.*; | ||
import net.minecraft.world.item.component.ItemAttributeModifiers; | ||
import net.minecraft.world.item.component.Tool; | ||
import net.minecraft.world.item.enchantment.EnchantmentHelper; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
|
||
import java.util.List; | ||
|
||
public class NeptunesTridentItem extends Item { | ||
public NeptunesTridentItem(Properties properties) { | ||
super(properties); | ||
} | ||
|
||
public static ItemAttributeModifiers createAttributes() { | ||
return ItemAttributeModifiers.builder() | ||
.add( | ||
Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_ID, 15, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND | ||
) | ||
.add( | ||
Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_ID, -2.8F, AttributeModifier.Operation.ADD_VALUE), EquipmentSlotGroup.MAINHAND | ||
) | ||
.build(); | ||
} | ||
|
||
public static Tool createToolProperties() { | ||
return new Tool(List.of(), 1.0F, 2); | ||
} | ||
|
||
@Override | ||
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) { | ||
ItemStack itemstack = player.getItemInHand(hand); | ||
player.startUsingItem(hand); | ||
return InteractionResultHolder.consume(itemstack); | ||
} | ||
|
||
@Override | ||
public boolean canAttackBlock(BlockState state, Level level, BlockPos pos, Player player) { | ||
return !player.isCreative(); | ||
} | ||
|
||
@Override | ||
public UseAnim getUseAnimation(ItemStack stack) { | ||
return UseAnim.SPEAR; | ||
} | ||
|
||
@Override | ||
public int getUseDuration(ItemStack stack, LivingEntity entity) { | ||
return 72000; | ||
} | ||
|
||
@Override | ||
public boolean canPerformAction(ItemStack stack, net.neoforged.neoforge.common.ItemAbility itemAbility) { | ||
return net.neoforged.neoforge.common.ItemAbilities.DEFAULT_TRIDENT_ACTIONS.contains(itemAbility); | ||
} | ||
|
||
@Override | ||
public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void postHurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) { | ||
stack.hurtAndBreak(1, attacker, EquipmentSlot.MAINHAND); | ||
} | ||
|
||
@Override | ||
public int getEnchantmentValue() { | ||
return 1; | ||
} | ||
} |
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
Oops, something went wrong.