Skip to content

Commit

Permalink
Fixed rendering of trident in hand (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Estecka committed Nov 26, 2024
1 parent 3676273 commit d796b4c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
- Started looking for modules in `variants-cit`, marked `variant-cits` as deprecated.
### 2.5.1
- Updated for MC 1.21.2
## 2.6
### 2.6.0
- Added the modules `bucket_entity_data`, `entity_data` and `block_entity_data`.
- Added `bucket_entity_age` model predicate.
### 2.6.1
- Fixed rendering of triden in hand.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ loader_version=0.16.7
fabric_version=0.106.1+1.21.3

# Mod Properties
mod_version=2.6.0
mod_version=2.6.1
maven_group=fr.estecka.variantscit
archives_base_name=variants-cit
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.client.render.model.BakedModelManager;
import net.minecraft.client.util.ModelIdentifier;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import fr.estecka.variantscit.IItemModelProvider;
import fr.estecka.variantscit.VariantsCitMod;

Expand All @@ -41,7 +42,10 @@ private BakedModel GetVariantModel(BakedModelManager modelManager, ItemStack sta
// Most items
@WrapOperation( method="getModel", require=1, at=@At( value="INVOKE", target="net/minecraft/client/render/item/ItemModels.getModel (Lnet/minecraft/item/ItemStack;)Lnet/minecraft/client/render/model/BakedModel;") )
private BakedModel GetItemStackModel(ItemModels models, ItemStack stack, Operation<BakedModel> original) {
return GetVariantModel(bakedModelManager, stack, ()->original.call(models, stack));
if (stack.isOf(Items.TRIDENT))
return original.call(models, stack);
else
return GetVariantModel(bakedModelManager, stack, ()->original.call(models, stack));
}

// Trident and Spyglass
Expand Down

0 comments on commit d796b4c

Please sign in to comment.