-
Notifications
You must be signed in to change notification settings - Fork 11
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
a6e45fb
commit 248d4a5
Showing
23 changed files
with
216 additions
and
9 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
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
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,19 @@ | ||
package net.zepalesque.redux.item; | ||
|
||
import net.minecraft.ChatFormatting; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.network.chat.Component; | ||
|
||
import java.util.function.UnaryOperator; | ||
|
||
public class TooltipUtils { | ||
/** | ||
* Returns the given component, or the default message if the shift key is up. | ||
*/ | ||
public static final UnaryOperator<Component> TOOLTIP_SHIFT_FOR_INFO = (component -> Screen.hasShiftDown() ? component : Component.translatable("gui.aether_redux.shift_info", Minecraft.getInstance().options.keyShift.getKey().getDisplayName().getString()).withStyle(ChatFormatting.DARK_GRAY)); | ||
/** | ||
* Returns the given component, or null if the shift key is up. | ||
*/ | ||
public static final UnaryOperator<Component> TOOLTIP_HIDDEN_SHIFT_INFO = (component -> Screen.hasShiftDown() ? component : null); | ||
} |
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
64 changes: 64 additions & 0 deletions
64
src/main/java/net/zepalesque/redux/item/combat/ReduxItemTiers.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,64 @@ | ||
package net.zepalesque.redux.item.combat; | ||
|
||
import com.aetherteam.aether.AetherTags; | ||
import net.minecraft.world.item.Tier; | ||
import net.minecraft.world.item.crafting.Ingredient; | ||
import net.neoforged.neoforge.common.util.Lazy; | ||
import net.zepalesque.redux.item.ReduxItems; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public enum ReduxItemTiers implements Tier { | ||
|
||
VERIDIUM(2, 750, 2.25F, 1.0F, 0, () -> Ingredient.of(ReduxItems.VERIDIUM_INGOT.get())), | ||
INFUSED_VERIDIUM(2, 750, 7.0F, 1.0F, 0, () -> Ingredient.of(ReduxItems.VERIDIUM_INGOT.get())); | ||
|
||
private final int harvestLevel; | ||
private final int maxUses; | ||
private final float efficiency; | ||
private final float attackDamage; | ||
private final int enchantability; | ||
private final Lazy<Ingredient> repairMaterial; | ||
|
||
ReduxItemTiers(int harvestLevel, int maxUses, float efficiency, float attackDamage, int enchantability, Lazy<Ingredient> repairMaterial) { | ||
this.harvestLevel = harvestLevel; | ||
this.maxUses = maxUses; | ||
this.efficiency = efficiency; | ||
this.attackDamage = attackDamage; | ||
this.enchantability = enchantability; | ||
this.repairMaterial = repairMaterial; | ||
} | ||
|
||
@Override | ||
public int getUses() { | ||
return this.maxUses; | ||
} | ||
|
||
@Override | ||
public float getSpeed() { | ||
return this.efficiency; | ||
} | ||
|
||
@Override | ||
public float getAttackDamageBonus() { | ||
return this.attackDamage; | ||
} | ||
|
||
@Override | ||
public int getLevel() { | ||
return this.harvestLevel; | ||
} | ||
|
||
@Override | ||
public int getEnchantmentValue() { | ||
return this.enchantability; | ||
} | ||
|
||
@Override | ||
@NotNull | ||
public Ingredient getRepairIngredient() { | ||
return this.repairMaterial.get(); | ||
} | ||
|
||
} |
93 changes: 93 additions & 0 deletions
93
src/main/java/net/zepalesque/redux/item/tools/VeridiumPickaxeItem.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,93 @@ | ||
package net.zepalesque.redux.item.tools; | ||
|
||
import com.aetherteam.aether.entity.monster.dungeon.boss.Slider; | ||
import net.minecraft.ChatFormatting; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.network.chat.MutableComponent; | ||
import net.minecraft.world.entity.EquipmentSlot; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.PickaxeItem; | ||
import net.minecraft.world.item.Tier; | ||
import net.minecraft.world.item.TooltipFlag; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.zepalesque.redux.item.ReduxItems; | ||
import net.zepalesque.redux.item.TooltipUtils; | ||
import net.zepalesque.redux.item.VeridiumItem; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
import java.util.function.Consumer; | ||
|
||
public class VeridiumPickaxeItem extends PickaxeItem implements VeridiumItem { | ||
public VeridiumPickaxeItem(Tier pTier, int pAttackDamageModifier, float pAttackSpeedModifier, Properties pProperties) { | ||
super(pTier, pAttackDamageModifier, pAttackSpeedModifier, pProperties); | ||
} | ||
|
||
@Override | ||
public Item getUninfusedItem(ItemStack stack) { | ||
return ReduxItems.VERIDIUM_PICKAXE.get(); | ||
} | ||
|
||
@Override | ||
public void appendHoverText(ItemStack stack, @Nullable Level level, List<Component> tooltips, TooltipFlag advanced) { | ||
MutableComponent infusion = Component.translatable("tooltip.aether_redux.infusion_level", stack.getTagElement(VeridiumItem.NBT_KEY)).withStyle(ChatFormatting.GRAY); | ||
|
||
tooltips.add(infusion); | ||
Component info = TooltipUtils.TOOLTIP_SHIFT_FOR_INFO.apply(Component.translatable("gui.aether_redux.infusion_info")); | ||
tooltips.add(info); | ||
super.appendHoverText(stack, level, tooltips, advanced); | ||
} | ||
|
||
@Override | ||
public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) { | ||
// TODO: Entity tag | ||
int amount = target instanceof Slider ? 1 : 2; | ||
ItemStack transform = VeridiumItem.deplete(stack, attacker, amount); | ||
if (!attacker.level().isClientSide() && transform != null && transform != stack) { | ||
// TODO: play sound | ||
attacker.setItemSlot(EquipmentSlot.MAINHAND, transform); | ||
} | ||
return super.hurtEnemy(stack, target, attacker); | ||
} | ||
|
||
@Override | ||
public boolean mineBlock(ItemStack stack, Level level, BlockState state, BlockPos pos, LivingEntity user) { | ||
if (!user.level().isClientSide()) { | ||
boolean instaBreak = state.getDestroySpeed(level, pos) <= 0.0F; | ||
// Avoid decreasing infusion on insta-break blocks | ||
if (!instaBreak) { | ||
int amount = stack.isCorrectToolForDrops(state) ? 1 : 2; | ||
ItemStack transform = VeridiumItem.deplete(stack, user, amount); | ||
if (!user.level().isClientSide() && transform != null && transform != stack) { | ||
// TODO: play sound | ||
user.setItemSlot(EquipmentSlot.MAINHAND, transform); | ||
} | ||
} | ||
} | ||
return super.mineBlock(stack, level, state, pos, user); | ||
} | ||
|
||
@Override | ||
public <T extends LivingEntity> int damageItem(ItemStack stack, int amount, T entity, Consumer<T> onBroken) { | ||
return super.damageItem(stack, amount, entity, onBroken) * VeridiumItem.DURABILITY_DMG_MULTIPLIER; | ||
} | ||
|
||
public static class Uninfused extends PickaxeItem { | ||
|
||
public Uninfused(Tier pTier, int pAttackDamageModifier, float pAttackSpeedModifier, Properties pProperties) { | ||
super(pTier, pAttackDamageModifier, pAttackSpeedModifier, pProperties); | ||
} | ||
|
||
@Override | ||
public void appendHoverText(ItemStack stack, @Nullable Level level, List<Component> tooltips, TooltipFlag advanced) { | ||
Component info = TooltipUtils.TOOLTIP_SHIFT_FOR_INFO.apply(Component.translatable("gui.aether_redux.infusion_info")); | ||
tooltips.add(info); | ||
super.appendHoverText(stack, level, tooltips, advanced); | ||
} | ||
} | ||
} |
Binary file modified
BIN
-272 Bytes
(81%)
.../resources/assets/aether_redux/textures/block/construction/sentrite_lantern.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
+2.81 KB
...main/resources/assets/aether_redux/textures/item/tools/infused_veridium_axe.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
+2.83 KB
...resources/assets/aether_redux/textures/item/tools/infused_veridium_axe_glow.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
+2.8 KB
...main/resources/assets/aether_redux/textures/item/tools/infused_veridium_hoe.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
+2.77 KB
...resources/assets/aether_redux/textures/item/tools/infused_veridium_hoe_glow.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
+2.81 KB
.../resources/assets/aether_redux/textures/item/tools/infused_veridium_pickaxe.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
+2.83 KB
...urces/assets/aether_redux/textures/item/tools/infused_veridium_pickaxe_glow.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
+2.8 KB
...n/resources/assets/aether_redux/textures/item/tools/infused_veridium_shovel.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
+2.82 KB
...ources/assets/aether_redux/textures/item/tools/infused_veridium_shovel_glow.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
+2.87 KB
src/main/resources/assets/aether_redux/textures/item/tools/veridium_axe.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
+2.84 KB
src/main/resources/assets/aether_redux/textures/item/tools/veridium_hoe.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
+2.85 KB
src/main/resources/assets/aether_redux/textures/item/tools/veridium_pickaxe.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
+2.84 KB
src/main/resources/assets/aether_redux/textures/item/tools/veridium_shovel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.