Skip to content

Commit

Permalink
Ok, make it not crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Apr 23, 2024
1 parent 4fe35c0 commit 59404b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ org.gradle.jvmargs=-Xmx4G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.20.5-rc2
yarn_mappings=1.20.5-rc2+build.1
minecraft_version=1.20.5-rc3
yarn_mappings=1.20.5-rc3+build.1
loader_version=0.15.10

#Fabric api
fabric_version=0.97.1+1.20.5

maven_group = eu.pb4

mod_version = 0.8.0-beta.4
mod_version = 0.8.0-beta.5

minecraft_version_supported = ">=1.20.5-"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package eu.pb4.polymer.core.mixin.item;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local;
import eu.pb4.polymer.core.impl.other.PolymerTooltipType;
import net.minecraft.client.item.TooltipType;
Expand All @@ -17,10 +18,8 @@

@Mixin(ItemStack.class)
public class ItemStackMixin {
@Inject(method = "getTooltip", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isDamaged()Z"), cancellable = true)
private void stopEarly(Item.TooltipContext context, @Nullable PlayerEntity player, TooltipType type, CallbackInfoReturnable<List<Text>> cir, @Local(ordinal = 0) List<Text> tooltip) {
if (type instanceof PolymerTooltipType) {
cir.setReturnValue(tooltip);
}
@ModifyExpressionValue(method = "getTooltip", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/item/TooltipType;isAdvanced()Z"))
private boolean removeAdvanced(boolean original, @Local(ordinal = 0) TooltipType type) {
return original && !(type instanceof PolymerTooltipType);
}
}

0 comments on commit 59404b1

Please sign in to comment.