-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3331f41
commit 3b7d199
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
common/src/main/java/miyucomics/hexical/mixin/ItemEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package miyucomics.hexical.mixin; | ||
|
||
import miyucomics.hexical.registry.HexicalItems; | ||
import net.minecraft.entity.ItemEntity; | ||
import net.minecraft.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(ItemEntity.class) | ||
public abstract class ItemEntityMixin { | ||
@Shadow public abstract ItemStack getStack(); | ||
|
||
@Inject(method = "tick", at = @At("HEAD")) | ||
void deactivateLamp(CallbackInfo ci) { | ||
if (this.getStack().getItem() == HexicalItems.INSTANCE.getARCH_LAMP_ITEM() && this.getStack().getNbt() != null) | ||
this.getStack().getNbt().putBoolean("active", false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters