-
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
ccfb525
commit 3331f41
Showing
5 changed files
with
50 additions
and
15 deletions.
There are no files selected for viewing
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
6 changes: 6 additions & 0 deletions
6
common/src/main/java/miyucomics/hexical/interfaces/PlayerEntityMixinInterface.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,6 @@ | ||
package miyucomics.hexical.interfaces; | ||
|
||
public interface PlayerEntityMixinInterface { | ||
boolean getArchLampCastedThisTick(); | ||
void lampCastedThisTick(); | ||
} |
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
27 changes: 27 additions & 0 deletions
27
common/src/main/java/miyucomics/hexical/mixin/PlayerEntityMixin.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,27 @@ | ||
package miyucomics.hexical.mixin; | ||
|
||
import miyucomics.hexical.interfaces.PlayerEntityMixinInterface; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(PlayerEntity.class) | ||
public class PlayerEntityMixin implements PlayerEntityMixinInterface { | ||
@Unique private boolean hexical$archLampCastedThisTick = false; | ||
|
||
@Override public boolean getArchLampCastedThisTick() { | ||
return hexical$archLampCastedThisTick; | ||
} | ||
|
||
@Override public void lampCastedThisTick() { | ||
hexical$archLampCastedThisTick = true; | ||
} | ||
|
||
@Inject(method = "tick", at = @At("TAIL")) | ||
void tick(CallbackInfo ci) { | ||
hexical$archLampCastedThisTick = 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