File tree Expand file tree Collapse file tree 5 files changed +41
-1
lines changed
java/io/github/openbagtwo/lighterend Expand file tree Collapse file tree 5 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 1+ package io .github .openbagtwo .lighterend .mixin ;
2+
3+ import io .github .openbagtwo .lighterend .registries .LighterEndSounds ;
4+ import io .github .openbagtwo .lighterend .registries .LighterEndTags ;
5+ import net .minecraft .entity .EquipmentSlot ;
6+ import net .minecraft .entity .LivingEntity ;
7+ import net .minecraft .item .ItemStack ;
8+ import net .minecraft .registry .tag .FluidTags ;
9+ import org .spongepowered .asm .mixin .Mixin ;
10+ import org .spongepowered .asm .mixin .injection .At ;
11+ import org .spongepowered .asm .mixin .injection .Inject ;
12+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
13+
14+ @ Mixin (LivingEntity .class )
15+ public abstract class WetFurMixin {
16+
17+ @ Inject (method = "baseTick" , at = @ At ("TAIL" ))
18+ public void checkForWetFur (CallbackInfo ci ) {
19+ LivingEntity thisEntity = (LivingEntity ) (Object ) this ;
20+ ItemStack maybeFur = thisEntity .getEquippedStack (EquipmentSlot .HEAD );
21+ if (
22+ thisEntity .isSubmergedIn (FluidTags .WATER )
23+ && maybeFur .isIn (LighterEndTags .FUR_ITEMS )
24+ ) {
25+ thisEntity .dropItem (maybeFur , true , true );
26+ thisEntity .equipStack (EquipmentSlot .HEAD , ItemStack .EMPTY );
27+ thisEntity .playSound (LighterEndSounds .WET_FUR );
28+ }
29+ }
30+
31+ }
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ public class LighterEndSounds {
3434 public static final SoundEvent TOTEM_TELEPORT = register ("item.totem_of_teleportation.teleport" );
3535 public static final SoundEvent TP_TOTEM_TARGET_SET = register ("item.totem_of_teleportation.set" );
3636 public static final SoundEvent MATCH_STRIKE = register ("item.matchstick.use" );
37+ public static final SoundEvent WET_FUR = register ("item.armor.wet_fur" );
3738
3839 public static final RegistryEntry <SoundEvent > EQUIP_SILK = registerReference (
3940 "item.armor.equip_silk" );
Original file line number Diff line number Diff line change 696696 "subtitles.lighterend.entity.silk_moth.hurt" : " Silk Moth hurts" ,
697697 "subtitles.lighterend.item.armor.equip_fur" : " Donned a silly hat" ,
698698 "subtitles.lighterend.item.armor.equip_silk" : " Silk armor slides on" ,
699+ "subtitles.lighterend.item.armor.wet_fur" : " Fur came loose" ,
699700 "subtitles.lighterend.item.matchstick.use" : " Struck Matchstick" ,
700701 "subtitles.lighterend.item.shadow_berry_jam.drink" : " Gulping" ,
701702 "subtitles.lighterend.item.totem_of_teleportation.set" : " Totem tethered to Obelisk" ,
Original file line number Diff line number Diff line change 15351535 ],
15361536 "subtitle" : " subtitles.lighterend.item.armor.equip_silk"
15371537 },
1538+ "item.armor.wet_fur" : {
1539+ "sounds" : [
1540+ " random/pop"
1541+ ],
1542+ "subtitle" : " subtitles.lighterend.item.armor.wet_fur"
1543+ },
15381544 "item.matchstick.use" : {
15391545 "sounds" : [
15401546 {
Original file line number Diff line number Diff line change 2222 " SurfaceGenMixin" ,
2323 " TeleportFromVoidMixin" ,
2424 " TooltipMixin" ,
25- " UnderwaterBonemealMixin"
25+ " UnderwaterBonemealMixin" ,
26+ " WetFurMixin"
2627 ],
2728 "package" : " io.github.openbagtwo.lighterend.mixin" ,
2829 "required" : true
You can’t perform that action at this time.
0 commit comments