-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
3 changed files
with
10 additions
and
19 deletions.
There are no files selected for viewing
8 changes: 3 additions & 5 deletions
8
src/main/java/gregtechfoodoption/mixins/early/GuiPlayerTabOverlayMixin.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,24 +1,22 @@ | ||
package gregtechfoodoption.mixins.early; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiPlayerTabOverlay; | ||
import net.minecraft.client.network.NetHandlerPlayClient; | ||
import net.minecraft.client.network.NetworkPlayerInfo; | ||
import net.minecraft.scoreboard.ScoreObjective; | ||
import net.minecraft.scoreboard.Scoreboard; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture; | ||
|
||
import java.util.List; | ||
|
||
@Mixin(value = GuiPlayerTabOverlay.class, priority = 500, remap = false) | ||
public class GuiPlayerTabOverlayMixin { | ||
@Inject(method = "renderPlayerlist", at = @At(value = "INVOKE_ASSIGN", target = "Lcom/google/common/collect/Ordering;sortedCopy(Ljava/lang/Iterable;)Ljava/util/List;"), | ||
cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD) | ||
public void youAreAllAlone(int width, Scoreboard scoreboardIn, ScoreObjective scoreObjectiveIn, CallbackInfo ci, NetHandlerPlayClient nethandlerplayclient, List<NetworkPlayerInfo> list) { | ||
@Inject(method = "renderPlayerlist", at = @At(value = "INVOKE_ASSIGN", target = "Lcom/google/common/collect/Ordering;sortedCopy(Ljava/lang/Iterable;)Ljava/util/List;")) | ||
public void youAreAllAlone(int width, Scoreboard scoreboardIn, ScoreObjective scoreObjectiveIn, CallbackInfo ci, @Local List<NetworkPlayerInfo> list) { | ||
list.removeIf(playerInfo -> !playerInfo.getGameProfile().getId().equals(Minecraft.getMinecraft().player.getPersistentID())); | ||
} | ||
} |
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
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