Skip to content

Commit

Permalink
player
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyRespawnanchor committed Nov 24, 2024
1 parent bc9b4c8 commit 5f8b7ca
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.animal.Pig;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import org.ayamemc.ayame.client.gui.screen.AyameScreen;
import org.ayamemc.ayame.client.gui.screen.ModelSelectMenuScreen;
import org.ayamemc.ayame.model.AyameModelCache;
import org.ayamemc.ayame.model.ModelType;

public class ClientEventHandler {
public static final int TOOLTIP_BACKGROUND_COLOR = 0xCC_5f5f5f;
public static final int TOOLTIP_BORDER_TOP_COLOR = 0xCC_fdc7f5;
public static final int TOOLTIP_BORDER_BOTTOM_COLOR = 0xCC_fde8f5;
private final static Minecraft minecraft = Minecraft.getInstance();
private final static Player player = minecraft.player;

public static boolean shouldUseAyameTooltipColor() {
return minecraft.screen instanceof AyameScreen;
Expand All @@ -66,12 +70,14 @@ public static void openSelectMenuKeyPressed() {

public static void renderCustomHandInHud(GuiGraphics guiGraphics, DeltaTracker tickDelta) {

if (minecraft.level == null || minecraft.player == null) return;
if (minecraft.level == null || player == null) return;

ModelType model = AyameModelCache.getPlayerModel(player)

LivingEntity entity = new Pig(EntityType.PIG, minecraft.level);

// 设置实体的起始位置
entity.setPos(minecraft.player.getX(), minecraft.player.getY(), minecraft.player.getZ());
entity.setPos(player.getX(), player.getY(), player.getZ());

// 渲染逻辑
int x = minecraft.getWindow().getGuiScaledWidth() - 50; // 右下角的X坐标
Expand Down

0 comments on commit 5f8b7ca

Please sign in to comment.