-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Basic implementation * Merge duplicate ItemStackMixin * Make armour not provide defense when broken * Add 'Broken' tooltip to broken items * Remove more attributes when broken * Use item tag to detect what items should be 'unbreakable' * Make items render blackened when broken * [partial-feat] add `itemBreakingEnabled` * [chore] adjust `itemBreakingEnabled` to `true` by default * [feat] hopefully integrate `itemBreakingEnabled` * [chore] set on workflow dispatch * Bump version to beta.5 and update changelog Closes #25 --------- Co-authored-by: Bibi Reden <[email protected]>
- Loading branch information
1 parent
5bed9a6
commit 8469019
Showing
14 changed files
with
421 additions
and
144 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## Changes 🌽 | ||
- Reconciled connector based issue where old player data did not transfer over to a new player. | ||
- Updated the modded datapack to apply some attributes properly to scale. | ||
- Added "Item Breaking" mechanic | ||
- Added config option for Item Breaking |
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
23 changes: 23 additions & 0 deletions
23
src/client/java/com/bibireden/playerex/mixin/ItemRendererMixin.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,23 @@ | ||
package com.bibireden.playerex.mixin; | ||
|
||
import com.bibireden.playerex.util.PlayerEXUtil; | ||
import net.minecraft.client.renderer.entity.ItemRenderer; | ||
import net.minecraft.world.item.ItemDisplayContext; | ||
import net.minecraft.world.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
|
||
@Mixin(ItemRenderer.class) | ||
abstract class ItemRendererMixin { | ||
@ModifyVariable( | ||
method = "render", | ||
at = @At(value = "HEAD"), index = 6, argsOnly = true | ||
) | ||
public int renderBlackWhenBroken(int value, ItemStack stack, ItemDisplayContext ctx) { | ||
if (PlayerEXUtil.isBroken(stack) && ctx == ItemDisplayContext.GUI) { | ||
return 15; | ||
} | ||
return value; | ||
} | ||
} |
134 changes: 0 additions & 134 deletions
134
src/client/java/com/bibireden/playerex/mixin/ItemStackMixin.java
This file was deleted.
Oops, something went wrong.
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.