Git Product home page Git Product logo

trinkets's Introduction

Trinkets

A data-driven accessory mod for Minecraft using Fabric.

Image of the Trinkets UI

About

Trinkets adds a slot group and slot system to Minecraft. Slot groups are collections of slots for a certain body part or more vague area. By default there are 6 slot groups (head, chest, legs, feet, offhand, hand) that can have slots added to them, but more groups can be added if desired. Trinkets' UI is intuitive to use, accessible, and attempts to do away with clutter. Its system means that you'll never have a slot that's not used for anything, as mods request the slots they want.

Developers

To add Trinkets to your project you need to add jitpack and nerdhubmc to your repositories in your build.gradle

repositories {
	maven {
		name = "TerraformersMC"
		url = "https://maven.terraformersmc.com/"
	}
	maven {
		name = "Ladysnake Libs"
		url = 'https://maven.ladysnake.org/releases'
	}
}

And then to add Trinkets you add it as a dependency in your build.gradle

dependencies {
	modImplementation "dev.emi:trinkets:${trinkets_version}"
}

For basic tutorials and comprehensive documentation, visit this repository's wiki.

trinkets's People

Contributors

aegide avatar altegar avatar ayutac avatar boypika avatar cdagaming avatar cmplstofb avatar davidalb97 avatar deirn avatar emilyploszaj avatar fitfc avatar florensie avatar gaming32 avatar hexasan avatar ims212 avatar kb-1000 avatar lakuna avatar lemmaeof avatar mindy15963 avatar osiitb avatar patbox avatar pinkgoosik avatar powerboat9 avatar raft08 avatar rookiestwo avatar strubbelkopp avatar sweepswap avatar theillusivec4 avatar williewillus avatar zano1999 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

trinkets's Issues

Requesting Compiling Assistance

Hi,
I am attempting to try and compile this so I can test some of my ideas.
Right now, I just have the base files, and as a newbie minecraft coder (not of coding in general) I don't know where to get started on compiling.
My goal is to add a toggle to make trinkets visible or not, in general. It'd be client-side, and I think I have some code to base it off of but I cannot get it to compile.
I'm using Visual Studio Code, if you could tell me how you compile Trinkets, that'd be great.

Mending XP does not properly apply to held items while using items in chest slot

This is pretty confusing to explain but essentially on our server if we have an item in either our cape slot or chestplate slot, xp does not go to our held items with mending.The XP bar will just fill without repairing the item held in hand. Items equipped on the player still gain XP through mending properly. Removing the chestplate AND cape is the only way to direct XP to the held item.

Allow ticking on client

Currently trinkets only tick on the server side, it would be nice if you made it tick on both the server and client.

Change Item Durability

I'm trying to set a Trinket's durability through the tick method, and I can see, through logging, that the damage is being updated, but it's not rendered on the UI.

This is my code:

@Override
public void tick(PlayerEntity player, ItemStack stack) {
  boolean shouldIncreaseStackDamage = this.damage >= 1;
  System.out.format("Processing damage. Current damage level: %.2f. shouldIncreaseStackDamage: %s\n", this.damage, shouldIncreaseStackDamage);
  if (shouldIncreaseStackDamage) {
    this.damage = 0;
    stack.setDamage(stack.getDamage() + 1);
    System.out.format("Current item damage: %s\n", stack.getDamage());
    return;
  }
  System.out.format("Setting internal damage level to %.2f\n", this.damage + 0.1);
  this.damage += 0.1;
  TrinketsApi.getTrinketsInventory(player).markDirty();
}

I'd love to get some help with it, if possible.

Using an elytra on multiplayer is broken

Playing modded minecraft on my server with no mods which affect flight or elytras (except for Trinkets). When entering flight with the elytra I cannot use a firework to take off (characters hand moves as if they are trying to use a firework but no fireworks actually get used). Additonally my character ends getting stuck in this broken flight mode and cant stand back up without pressing shift and I keep sliding across the floor as if I am flying. Game works prefectly fine in singleplayer, just on my server it seems to be broken.

missing language keys

Hello, I wanted to translate the mod into Russian, but I found that some phrases are simply missing for translation, can you add them?

Equippable in trinket slots:
Equippable in all trinket slots
Equippable in the %name% trinket slot
When equiped in any trinket slot:
When equiped in the %name% trinket slot:

image

Equipping new Trinket removes already equipped one

I'm using version v2.6.3 and I have this on my BaseTrinket, from which all my trinkets extend:

@Override
public TypedActionResult<ItemStack> use(World world, PlayerEntity player, Hand hand) {
  ItemStack stack = player.getStackInHand(hand);
  boolean success = new PlayerTrinketComponent(player).equip(stack);
  ActionResult result = success ? ActionResult.SUCCESS : ActionResult.FAIL;
  return new TypedActionResult<>(result, stack);
}

Whenever I right click with a new trinket, it equips it, but removes ones that were already equipped.
If I go to the slot where the old item was and try to remove it, its effect gets applied, but the item goes missing. Then, if I try to remove the missing item from the slot, the other trinket gets removed too.

I can try to up a video if words are confusing.

This behaviour does not happen when you equip the item manually.

Readme typo

in the readme you have
modImplementation "com.github.emilyploszaj:trinkets:{trinkets_version}"
you seem to have forgotten the $ before the {version} tags:
modImplementation "com.github.emilyploszaj:trinkets:${trinkets_version}"

[3.0.0] Only allow one Trinket to be equipped in a slot by default

In both current versions of Trinkets you can stack multiple items in one slot. I think it makes sense for most usages of the library that a slot only allows one trinket to fit. When stacking should be allowed this could be enabled on per-slot or per-trinket basis. To me this seems better than having to disable it for all other trinkets.

The main use case for stacking trinkets would be items like heart containers.

Game Crash

Newest release 2.6.0 of trinkets crashes client upon attempting to launch

Removing a mod that enables a Trinket slot, can cause player(s) to no longer be able to rejoin the server.

Tfarcenim/DankStorageFabric#9

I posted most of the information over there, before I knew what was causing the issue. But basically, I'm currently testing a new 1.16.4 fabric modpack multiplayer, and we removed the mod Artifacts (on both clients and the server). Soon after I suddenly found myself unable to join the server, with no information on my client other than Internal Server Error. So far, other players have not had this issue however. So I got my character's playerdata from the server, replicated the environment on my own machine, then watched for an error. Something like this would show up server side every time I tried to connect:

[17:39:03] [Server thread/INFO]: [STDOUT]: [trinkets] Found item in slot that doesn't exist! head:hat
[17:39:03] [Server thread/WARN]: Failed to handle packet for /127.0.0.1:5266
net.minecraft.class_148: Loading entity NBT
	at Not Enough Crashes deobfuscated stack trace.(1.16.4+build.7) ~[?:?]
	at net.minecraft.entity.Entity.fromTag(Entity:1663) ~[?:?]
	at net.minecraft.world.WorldSaveHandler.loadPlayerData(WorldSaveHandler:57) ~[?:?]
	at net.minecraft.server.PlayerManager.loadPlayerData(PlayerManager:344) ~[?:?]
	at net.minecraft.server.PlayerManager.onPlayerConnect(PlayerManager:138) ~[?:?]
	at net.minecraft.server.network.ServerLoginNetworkHandler.acceptPlayer(ServerLoginNetworkHandler:113) ~[?:?]
	at net.minecraft.server.network.ServerLoginNetworkHandler.redirect$bpl000$handlePlayerJoin(ServerLoginNetworkHandler:562) ~[?:?]
	at net.minecraft.server.network.ServerLoginNetworkHandler.tick(ServerLoginNetworkHandler:65) ~[?:?]
	at net.minecraft.network.ClientConnection.tick(ClientConnection:228) ~[?:?]
	at net.minecraft.server.ServerNetworkIo.tick(ServerNetworkIo:173) ~[?:?]
	at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer:882) ~[intermediary-server.jar:?]
	at net.minecraft.server.dedicated.MinecraftDedicatedServer.tickWorlds(MinecraftDedicatedServer:312) ~[?:?]
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer:811) ~[intermediary-server.jar:?]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer:670) ~[intermediary-server.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer:257) ~[intermediary-server.jar:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_271]
Caused by: java.lang.NullPointerException
	at Not Enough Crashes deobfuscated stack trace.(1.16.4+build.7) ~[?:?]
	at net.minecraft.item.ItemStack.handler$zmo000$areTagsEqualReturn1(ItemStack:6655) ~[?:?]
	at net.minecraft.item.ItemStack.areTagsEqual(ItemStack:383) ~[?:?]
	at tfar.dankstorage.event.MixinHooks.areItemStacksCompatible(MixinHooks.java:227) ~[dankstorage-1.9a-1.16.3.jar:?]
	at tfar.dankstorage.event.MixinHooks.doesItemStackExist(MixinHooks.java:232) ~[dankstorage-1.9a-1.16.3.jar:?]
	at tfar.dankstorage.event.MixinHooks.voidPickup(MixinHooks.java:150) ~[dankstorage-1.9a-1.16.3.jar:?]
	at tfar.dankstorage.event.MixinHooks.onItemPickup(MixinHooks.java:132) ~[dankstorage-1.9a-1.16.3.jar:?]
	at tfar.dankstorage.event.MixinHooks.interceptItem(MixinHooks.java:47) ~[dankstorage-1.9a-1.16.3.jar:?]
	at net.minecraft.entity.player.PlayerInventory.handler$bdi000$interceptItems(PlayerInventory:2690) ~[?:?]
	at net.minecraft.entity.player.PlayerInventory.insertStack(PlayerInventory) ~[?:?]
	at net.minecraft.entity.player.PlayerEntity.giveItemStack(PlayerEntity:1907) ~[?:?]
	at dev.emi.trinkets.api.PlayerTrinketComponent.fromTag(PlayerTrinketComponent.java:42) ~[trinkets-2.6.7.jar:?]
	at nerdhub.cardinal.components.api.util.container.AbstractComponentContainer.fromTag(AbstractComponentContainer.java:180) ~[2d6540cc-4e4c-4548-904e-94e8517a01a4.jar:?]
	at net.minecraft.entity.Entity.handler$bdp000$fromTag(Entity:8692) ~[?:?]
	at net.minecraft.entity.Entity.fromTag(Entity:1654) ~[?:?]
	... 14 more

Because the log mentioned dankstorage, I thought one of the danks on my character might have been glitching out. But after using an nbt editor to remove the danks from my character, nothing changed. So I started looking at Trinkets, since it's also mentioned. Sure enough, if I remove the trinkets tree out of cardinal_components using the nbt editor, the error goes away and I'm able to join the server again. My character didn't actually have anything in any trinket slots either, and the only thing the nbt said was in those slots, was an air block.

Trouble rendering backpack on the back of player

I added a backpack item using your mod and wanted to add a FeatureRenderer to the game that renders the model if the player has one equipped. I saw that you included transformation matrices for the chest but couldn't find one that is for the back of the player.

[Suggestion] Vanilla-like slots

The title of this issue is vague because otherwise it'd be huge, haha

While working on my mod VanitySlots, I noticed a few things I had to find workarounds for:

  1. There doesn't seem to be an easy way to let already existing items enter slots. What if you want to have a slot that can have whatever in it? For example, if I want to be able to put slimeballs in a slot, I would have to write a mixin. This isn't too bad, but for stuff like armor...
  2. There should be a way to make a new slot act like vanilla slots. Without this, you have to write a mixin for things like ArmorItem.
  3. There should be some sort of way to choose whether shift-clicking an item goes into the vanilla slot first instead of the new slot. For example, if you add a slot in the chest group, and you shift-click, and the item can go in either the custom slot or the vanilla chestplate slot, there should be a way to make it go into the vanilla chestplate slot if it's empty, instead of going into the custom slot first.

[Suggestion] Banner Capes

It would be great if we could wear banners as capes.
To go along with the other issue that requests disabling the cape slot, It would be great if we had a setting that allowed banners but not elytra, so it's purely cosmetic.

Item overlays when in creative

Elytra equipped in the cape trinket slot appear in the second slot of the hotbar when in creative mode.

MultiMC Launcher
Minecraft 1.14.4 Client
Fabric Loader 0.6.1+build.165

Fabric API 0.3.2+build.226-1.14
Trinkets 1.0.0

2019-09-13_23 32 05

Allow configuration of cape slot

I've noticed there is no way to disable placing the elytra within the capes slot. Even though this is a well liked feature I feel a way to configure it would be a good option for mod packs which wish to use trinkets for other reasons but want a harder balance in their packs.

Rendering tutorial is out of date

In 1.16, there appears to have been a change to several parts of the item rendering system. The current documentation for rendering trinkets is out of date and invalid for the latest versions.

More streamlined API

I while ago I worked on a rewrite of the trinkets API from the ground up to streamline the whole thing and implement layers of inheritance to make it more customizable depending upon the use cases. I never finished the rewrite, but a solid 75% of it was done so there might be some ideas for a v3 of trinkets.

This issue can be closed immediately, I just didn't know where else to put this message other than a PR, and as the code was not completely ready a PR seemed improper.

Here's a link to the forked repo with the changes in it... link

There's also a README file that explains how developers would use the api to get a better idea of how exactly the rewrite was supposed to function... link

Again, this issue can be immediately resolved, and obviously there's no obligation to use any of this I just wanted to make sure it was on your radar in case you were interested.

Mod + Elytra on vanilla servers broken

When you're playing on a vanilla/spigot/paper server, and forget to disable the mod first, there are some optical glitches with trinkets (which don't really hurt much), but your Elytra won't work either even when it's in the chest (and not chest trinket) slot.

[3.0.0] Allow entity type tags for entity slot loader

Example:

"entities": ["#skeletons"],
"slots": [
  "head/hat",
  "chest/necklace",
  "legs/belt",
  "feet/shoes"
]

This should probably even replace the array behavior completely and require an entity type tag if multiple entity types are desired:

"entities": "#skeletons",
"slots": [...]

Useful vanilla implementation reference:

  • data/minecraft/tags/entity_types/
  • net.minecraft.predicate.entity.EntityTypePredicate

Tooltip issues

Hello! I'm having some issues with Trinkets Tooltips. (1.16)

Here is a screenshot of my issue:
image

It seems that some texts are not being translated correctly, including attributes.

suggestion

can u make it that u can disable trinkets from showing just like curious?

Ghost Items in Creative Inventory

If you go into creative mode and place an item in a trinket slot the item isn't actually real. In creative mode, the elytra, for example, can be placed in the cape slot, but you cannot fly with it. Additionally, when you have an item in a trinket slot that was placed there in creative mode, and then you switch to survival mode and try to remove said item, the item will disappear like it was never there.

Video Example

old cca dependency breaks with newer fabric version

Using a relatively new fabric version, I noticed that the cardinal components api v2.5.0 dependency causes minecraft to freeze during world generation/loading.
Here's the full log file
latest.log

This should get fixed when updating the cca dependency to a version above 2.5.0 (I only tested with 2.8.2 which fixed the problem)

Note that there already is a pull request #71 by @florensie that would update the dependency to 2.7.13

How to reproduce:

  • Install trinkets with fabric API v0.34.1
  • create a new world

Cardinal Components security certificate expired

When trying to build i get the following issue, and it looks like the security certificate expired on Mon Apr 26 16:05:42 MDT 2021 or Cardinal Components v2.5.0 does not exist. I believe that upgrading to Cardinal components 2.6.0 might work. Below is the error message outputed by IDEA.

Could not resolve all files for configuration ':modCompileClasspath'.
   > Could not resolve io.github.onyxstudios.Cardinal-Components-API:cardinal-components-base:2.5.0.
     Required by:
         project : > dev.emi:trinkets:2.6.7
      > Could not resolve io.github.onyxstudios.Cardinal-Components-API:cardinal-components-base:2.5.0.
         > Could not get resource 'https://maven.abusedmaster.xyz/io/github/onyxstudios/Cardinal-Components-API/cardinal-components-base/2.5.0/cardinal-components-base-2.5.0.pom'.
            > Could not GET 'https://maven.abusedmaster.xyz/io/github/onyxstudios/Cardinal-Components-API/cardinal-components-base/2.5.0/cardinal-components-base-2.5.0.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.0/userguide/build_environment.html#gradle_system_properties
                  > PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed

trinket slot doesnt work with BetterEnd's armored elytra

idk who's side it's on, posted an issue at the BetterEnd mod and they said not a vanilla slot->problem not on our side.
you can equip it in the trinket slot(shift clicking prioritizes it even), just cant actually open it(and with mods that show durability, doesnt even register as equipped)

SlotGroup Mouseover displays when right-click equipped in creative

(Non-native speaker)
Trinkets equipped by right-clicking in creative while having the last tab selected to be a tab other than the survival inventory will make the tooltip display when opening the inventory (Persists through tab switches, inventory close and enter and disappears when selecting survival inventory)

Launcher: Intellij Idea (Development Environment)
Minecraft: 1.15.1
Fabric Loader: 0.7.2+build.175
Fabric API: 0.4.25+build.282-1.15
Trinkets: 2.3.0

Video: https://youtu.be/7w3I6mkv-5o
Image: Down Below
Tooltip Bug

Language Based Slot Names

It would be good if the slots could use the language system that Minecraft has. It would allow for localization and better naming that automatically picking a name based off of the slot identifier.

A language file for en_us might look something like:

{
    "trinkets.slot.chest.cape": "Cape",
    "trinkets.slot.chest.necklace": "Necklace",
    "trinkets.slot.feet.aglet": "Aglet",
    "trinkets.slot.hand.ring": "Ring",
    "trinkets.slot.hand.gloves": "Gloves",
    "trinkets.slot.head.mask": "Mask",
    "trinkets.slot.legs.belt": "Belt",
    "trinkets.slot.offhand.ring": "Ring"
}

This won't make much of a difference for English speaking users, but for everyone else it would be a good feature.

Console flooded with method not found errors when moving elytra to trinket slot

When mousing over the cape trinket slot to equip elytra, console gets flooded with stderr messages reporting a missing method:
clipped_log.txt

The "no such method" report spams the log over 600 lines in just a second, if an item is being hovered over the slot; and seems to continue indefinitely until placing said item in or moving the mouse off the slot.

MultiMC Launcher
Minecraft 1.14.4 Client
Fabric Loader 0.6.1+build.165

Fabric API 0.3.2+build.226-1.14
Trinkets 1.0.0

canEquip Callback

Add a callback to the equip method in PlayerTrinketComponent as an override so that items can be added to slots without implementing ITrinket, and other use cases.

game crash with optifabric mod installed

The game crashes on start up whenever I have the optifabric and optifine mods installed along side the artifacts mod. I assume its a compatibility issue but I'm not sure why that would be the case. It worked fine after I took out just the optifabric mod, and just to be safe I doubled checked with every other mod that I had in my mod folder.

here is the crash report
Crash Report Artifact+Optifabric.txt

Hide slots for specific players.

Would it be possible to add a way to disable certain slots for certain players, as in hide them in the inventory and prevent rendering/ticking/etc.? I'm mainly thinking about this for the purpose of Origins compatibility, as in trinket slots that are only available to specific origins.

No LICENSE file.

CurseForge lists as MIT yet there is no LICENSE file in the repo saying its MIT.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.