-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
2 changed files
with
12 additions
and
5 deletions.
There are no files selected for viewing
11 changes: 9 additions & 2 deletions
11
src/main/java/com/hb/mcfdebugger/mixin/CommandSourceHook.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 |
---|---|---|
@@ -1,14 +1,21 @@ | ||
package com.hb.mcfdebugger.mixin; | ||
|
||
import net.minecraft.entity.Entity; | ||
import net.minecraft.server.command.ServerCommandSource; | ||
import org.spongepowered.asm.mixin.Final; | ||
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.CallbackInfoReturnable; | ||
|
||
@Mixin(ServerCommandSource.class) | ||
public class CommandSourceHook { | ||
@Shadow @Final int level; | ||
public int fakeGetLevel(){ | ||
return this.level; | ||
public int fakeLevel; | ||
@Inject(method="getEntity" ,at=@At("HEAD")) | ||
public void fakeGetEntity(CallbackInfoReturnable ci) { | ||
this.fakeLevel=level; | ||
System.out.println(1234); | ||
} | ||
} |
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