File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
java/com/gregtechceu/gtceu/core/mixins/client Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .gregtechceu .gtceu .core .mixins .client ;
2+
3+ import com .gregtechceu .gtceu .api .GTValues ;
4+ import com .gregtechceu .gtceu .api .data .chemical .ChemicalHelper ;
5+ import com .gregtechceu .gtceu .api .data .tag .TagPrefix ;
6+ import com .gregtechceu .gtceu .common .data .GTSoundEntries ;
7+
8+ import net .minecraft .world .entity .Entity ;
9+ import net .minecraft .world .entity .item .ItemEntity ;
10+
11+ import org .spongepowered .asm .mixin .Mixin ;
12+ import org .spongepowered .asm .mixin .Unique ;
13+ import org .spongepowered .asm .mixin .injection .At ;
14+ import org .spongepowered .asm .mixin .injection .Inject ;
15+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
16+
17+ @ Mixin (ItemEntity .class )
18+ public class ItemEntityMixin {
19+
20+ @ Unique
21+ private boolean gtceu$wasOnGround = ((Entity ) (Object ) this ).onGround ();
22+
23+ @ Inject (method = "tick" , at = @ At (value = "HEAD" ))
24+ public void beforeTick (CallbackInfo ci ) {
25+ ItemEntity entity = (ItemEntity ) (Object ) this ;
26+ if (GTValues .FOOLS .getAsBoolean () && !gtceu$wasOnGround && entity .onGround () &&
27+ ChemicalHelper .getPrefix (entity .getItem ().getItem ()) == TagPrefix .rodLong ) {
28+ GTSoundEntries .METAL_PIPE .playFrom (entity , 10 , 1 );
29+ }
30+ gtceu$wasOnGround = entity .onGround ();
31+ }
32+ }
Original file line number Diff line number Diff line change 5858 " TagLoaderMixin" ,
5959 " TagManagerMixin" ,
6060 " TagValueAccessor" ,
61+ " client.ItemEntityMixin" ,
6162 " emi.EmiRecipeFillerMixin" ,
6263 " emi.FillRecipePacketMixin" ,
6364 " emi.FluidEmiStackMixin" ,
You can’t perform that action at this time.
0 commit comments