Курсор

Версия Minecraft
1.7.10
344
1
47
Решил, короче сделать такую вещицу..

Допустим любой предмет выкинул из инвентаря и навел на него курсор, он в свою очередь высвечивается с своим названием при наведении, сундуком почти аналогично.


Все вроде бы ничего, но текст не высвечивается, хоть вроде все норм сделано.


Рендер
Код:
EntityPlayer player = mc.thePlayer;

if(JakovUtils.GetTargetEntity(player.worldObj, player, recordPlayingUpFor) instanceof EntityItem)
{
EntityItem ei = (EntityItem) JakovUtils.GetTargetEntity(player.worldObj, player, recordPlayingUpFor);
ItemStack renderItem = ei.getEntityItem();
if(!ei.isInvisible())
{

String giveitemloc = StatCollector.translateToLocal("micertes.giveitem");

String giveitem = giveitemloc + " " + renderItem + " [" + ei.getEntityItem().stackSize + "]"; 


//  FMLClientHandler
//  .instance().getClient().fontRenderer.drawString(giveitem, 5, 5, 16777215, true); 
  FMLClientHandler.instance().getClient().fontRenderer.drawString(EnumChatFormatting.WHITE + giveitem, event.resolution.getScaledWidth() - 5 - this.mc.fontRenderer.getStringWidth(giveitem), 5, 16777215, true); 

GL11.glColor4f(1F, 1F, 1F, 1F);

GL11.glPopMatrix();
}

}
else if(JakovUtils.GetTargetBlock(player.worldObj, 1) != null && JakovUtils.GetTargetBlock(player.worldObj, 1) instanceof BlockChest)
{
String openchestloc = StatCollector.translateToLocal("micertes.openchest");

String openchest = openchestloc + " "; 

//  FMLClientHandler
// .instance().getClient().fontRenderer.drawString(openchest, 5, 5, 16777215, true); 
  FMLClientHandler.instance().getClient().fontRenderer.drawString(EnumChatFormatting.WHITE + openchest, event.resolution.getScaledWidth() - 5 - this.mc.fontRenderer.getStringWidth(openchest), 5, 16777215, true); 

}

JakovUtils
Код:
package micertes.dayz;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class JakovUtils {

public static Entity GetTargetEntity(World world, EntityPlayer player, int scanRadius)
{
double targetDistance = Math.pow(scanRadius,2);
Entity target = null;
List lst = world.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(player.posX-scanRadius, player.posY-scanRadius, player.posZ-scanRadius, player.posX+scanRadius, player.posY+scanRadius, player.posZ+scanRadius));
for (int i = 0; i < lst.size(); i ++)
{
Entity ent = (Entity) lst.get(i);
if (ent instanceof Entity && ent!=null && ent.boundingBox != null)
{
float distance = player.getDistanceToEntity(ent) + 0.1f;
float angle = player.rotationYawHead;
float pitch = player.rotationPitch;



Vec3 look = player.getLookVec();
//Vec3 vec32 = vec3.addVector(vec31.xCoord * 2, vec31.yCoord * 2, vec31.zCoord * 2);
Vec3 targetVec = Vec3.createVectorHelper(player.posX + look.xCoord * distance, player.getEyeHeight() + player.posY + look.yCoord * distance, player.posZ + look.zCoord * distance);

if (ent.boundingBox.isVecInside(targetVec))
{
if (distance < targetDistance && distance > 0)
{
targetDistance = distance;
target = ent;
}
}
}
}
return target;
}
@SideOnly(Side.CLIENT)
public static Block GetTargetBlock(World world, int scan)
{
//double targetDistance = Math.pow(scanRadius,2);


Block target = null;
MovingObjectPosition pos = Minecraft.getMinecraft().objectMouseOver;

if(pos!=null)
{
double xB = Math.abs(pos.blockX);
double zB = Math.abs(pos.blockZ);
double xP = Math.abs(Minecraft.getMinecraft().thePlayer.posX);
double zP = Math.abs(Minecraft.getMinecraft().thePlayer.posZ);

int distance = (int)Math.sqrt(Math.pow(xP-xB, 2) + Math.pow(zP-zB, 2));
if(distance == 0)
distance = 1;

if(pos!= null && world.getTileEntity(pos.blockX, pos.blockY, pos.blockZ) != null && distance <= scan)
{
target = world.getTileEntity(pos.blockX, pos.blockY, pos.blockZ).getBlockType();
}
}
return target;
}

}
 
1,200
37
237
Попробуй проверить не с текстом, например, модель отрисовать какую, вдруг у тебя ошибка всё же раньше текста.

А ещё погляди классы отрисовки таблички (ты ведь в мире рисовать собрался?) и мод waila (часть, где подсказки для entity).


Но я могу и ошибаться ¯\_(ツ)_/¯
 
344
1
47
MJaroslav написал(а):
Попробуй проверить не с текстом, например, модель отрисовать какую, вдруг у тебя ошибка всё же раньше текста.

А ещё погляди классы отрисовки таблички (ты ведь в мире рисовать собрался?) и мод waila (часть, где подсказки для entity).


Но я могу и ошибаться ¯\_(ツ)_/¯

По ним же и делал.
Прикол в том, что даже просто текст не рендерится, если на предмет навести, не говоря о имени предмета.
 
344
1
47
MJaroslav написал(а):
Micertes написал(а):
По ним же и делал.
Прикол в том, что даже просто текст не рендерится, если на предмет навести, не говоря о имени предмета.

Так попробуй не с текстом.

Картинку например делать? Тоже пытался, не пашет.
 
344
1
47
MJaroslav написал(а):
Значит не в тексте дело ¯\_(ツ)_/¯

Может ты забыл зарегистрировать всё это?

Нет, не забыл, все легально :D

Там помимо этого делал и другие вещички, они пашут.

Возможно в таргете намудрил.


Dahaka написал(а):
Зачем ты 2 раза ищешь таргет? JakovUtils.GetTargetEntity

Разве два? Условием проверяю на таргет, если да то ловлю от туда название предмета и рендерю текст
 
1,990
18
105
Так ты же два раза вызываешь метод, который производит поиск. Не кешироваться же ему на черной магии.
Тебе просто намекнули что выполняешь лишнюю работу и есть такая вещь как локальные переменные.
 
5,018
47
783
У меня есть то что ты хочешь. Отдебаж только
Отрисовывает что либо на экране при наведении на предмет
Код:
@SubscribeEvent
   @SideOnly(Side.CLIENT)
   public void renderGameOverlay(final RenderGameOverlayEvent.Post event) {
       if (((RenderGameOverlayEvent)event).type == RenderGameOverlayEvent.ElementType.ALL) {
           final Minecraft mc = Minecraft.getMinecraft();
           final World world = (World)Minecraft.getMinecraft().theWorld;
           final EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().thePlayer;
           
           
           if (Minecraft.getMinecraft().objectMouseOver != null && Minecraft.getMinecraft().objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
               final int blockX = Minecraft.getMinecraft().objectMouseOver.blockX;
               final int blockY = Minecraft.getMinecraft().objectMouseOver.blockY;
               final int blockZ = Minecraft.getMinecraft().objectMouseOver.blockZ;
               final Block block = world.getBlock(blockX, blockY, blockZ);
               final String blockName = block.getLocalizedName();
               if (block == MyBlocks.bigMushroom) {
                   final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                   final FontRenderer fr = mc.fontRenderer;

                   Minecraft.getMinecraft().getTextureManager().bindTexture(texture );
                   Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(0, 0, 0, 0, 140, 100);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Give It:"+ " " + "Yes", 5, 5, 0xDAA520);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "--------------------------------", 5, 10, 0xFF6347);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Height:", 5, 20, 0x000000);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Size:"+ " " + "Maximum", 5, 30, 0x228B22);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Level:" + " " + "3" , 5, 40, 0x191970);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Hybrid:" + " " +"No", 5, 50, 0x00FFFF);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Sort:", 5, 60, 0xDC143C);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Type:" + " " + ConstantMushroom.nameMushroomBig, 5, 70, 0x000000);
               }
               if (block == MyBlocks.mediumMushroom) {
                   final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                   final FontRenderer fr = mc.fontRenderer;
                   Minecraft.getMinecraft().getTextureManager().bindTexture(texture );
                   Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(0, 0, 0, 0, 140, 100);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Give It:"+ " " + "Yes", 5, 5, 0xDAA520);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "--------------------------------", 5, 10, 0xFF6347);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Height:", 5, 20, 0x000000);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Size:"+ " " + "Medium", 5, 30, 0x228B22);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Level:" + " " + "2" , 5, 40, 0x191970);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Hybrid:" + " " +"No", 5, 50, 0x00FFFF);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Sort:", 5, 60, 0xDC143C);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Type:" + " " + ConstantMushroom.nameMushroomMedium, 5, 70, 0x000000);
               }
               if (block == MyBlocks.smallMushroom) {
                   final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                   final FontRenderer fr = mc.fontRenderer;

                   Minecraft.getMinecraft().getTextureManager().bindTexture(texture );
                   Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(0, 0, 0, 0, 140, 100);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Give It:"+ " " + "Yes", 5, 5, 0xDAA520);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "--------------------------------", 5, 10, 0xFF6347);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Height:", 5, 20, 0x000000);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Size:"+ " " + "Minimum", 5, 30, 0x228B22);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Level:" + " " + "1" , 5, 40, 0x191970);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Hybrid:" + " " +"No", 5, 50, 0x00FFFF);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Sort:", 5, 60, 0xDC143C);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Type:" + " " + ConstantMushroom.nameMushroomSmall, 5, 70, 0x000000);
               }
               if (block == MyBlocks.underBirchMushroom) {
                   final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                   final FontRenderer fr = mc.fontRenderer;

                   Minecraft.getMinecraft().getTextureManager().bindTexture(texture );
                   Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(0, 0, 0, 0, 140, 100);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Give It:"+ " " + "Yes", 5, 5, 0xDAA520);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "--------------------------------", 5, 10, 0xFF6347);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Height:", 5, 20, 0x000000);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Size:"+ " " + "Medium", 5, 30, 0x228B22);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Level:" + " " + "2" , 5, 40, 0x191970);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Hybrid:" + " " +"No", 5, 50, 0x00FFFF);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Sort:"+ " " + "Common UnderBirch Mushroom", 5, 60, 0xDC143C);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Type:" + " " + ConstantMushroom.nameMushroomMedium, 5, 70, 0x000000);
               }
               if (block == MyBlocks.opyataMushroomNew) {
                   final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                   final FontRenderer fr = mc.fontRenderer;

                   Minecraft.getMinecraft().getTextureManager().bindTexture(texture );
                   Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(0, 0, 0, 0, 140, 100);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Give It:"+ " " + "Yes", 5, 5, 0xDAA520);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "--------------------------------", 5, 10, 0xFF6347);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Height:", 5, 20, 0x000000);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Size:"+ " " + "Minimum", 5, 30, 0x228B22);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Level:" + " " + "1" , 5, 40, 0x191970);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Hybrid:" + " " +"No", 5, 50, 0x00FFFF);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Sort:" + " " + "Common Opyonok", 5, 60, 0xDC143C);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Type:" + " " + ConstantMushroom.nameMushroomSmall, 5, 70, 0x000000);
               }

           }
       }
   }
 
344
1
47
Maxik001 написал(а):
У меня есть то что ты хочешь. Отдебаж только
Отрисовывает что либо на экране при наведении на предмет
Код:
@SubscribeEvent
   @SideOnly(Side.CLIENT)
   public void renderGameOverlay(final RenderGameOverlayEvent.Post event) {
       if (((RenderGameOverlayEvent)event).type == RenderGameOverlayEvent.ElementType.ALL) {
           final Minecraft mc = Minecraft.getMinecraft();
           final World world = (World)Minecraft.getMinecraft().theWorld;
           final EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().thePlayer;
           
           
           if (Minecraft.getMinecraft().objectMouseOver != null && Minecraft.getMinecraft().objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
               final int blockX = Minecraft.getMinecraft().objectMouseOver.blockX;
               final int blockY = Minecraft.getMinecraft().objectMouseOver.blockY;
               final int blockZ = Minecraft.getMinecraft().objectMouseOver.blockZ;
               final Block block = world.getBlock(blockX, blockY, blockZ);
               final String blockName = block.getLocalizedName();
               if (block == MyBlocks.bigMushroom) {
                   final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                   final FontRenderer fr = mc.fontRenderer;

                   Minecraft.getMinecraft().getTextureManager().bindTexture(texture );
                   Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(0, 0, 0, 0, 140, 100);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Give It:"+ " " + "Yes", 5, 5, 0xDAA520);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "--------------------------------", 5, 10, 0xFF6347);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Height:", 5, 20, 0x000000);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Size:"+ " " + "Maximum", 5, 30, 0x228B22);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Level:" + " " + "3" , 5, 40, 0x191970);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Hybrid:" + " " +"No", 5, 50, 0x00FFFF);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Sort:", 5, 60, 0xDC143C);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Type:" + " " + ConstantMushroom.nameMushroomBig, 5, 70, 0x000000);
               }
               if (block == MyBlocks.mediumMushroom) {
                   final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                   final FontRenderer fr = mc.fontRenderer;
                   Minecraft.getMinecraft().getTextureManager().bindTexture(texture );
                   Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(0, 0, 0, 0, 140, 100);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Give It:"+ " " + "Yes", 5, 5, 0xDAA520);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "--------------------------------", 5, 10, 0xFF6347);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Height:", 5, 20, 0x000000);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Size:"+ " " + "Medium", 5, 30, 0x228B22);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Level:" + " " + "2" , 5, 40, 0x191970);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Hybrid:" + " " +"No", 5, 50, 0x00FFFF);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Sort:", 5, 60, 0xDC143C);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Type:" + " " + ConstantMushroom.nameMushroomMedium, 5, 70, 0x000000);
               }
               if (block == MyBlocks.smallMushroom) {
                   final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                   final FontRenderer fr = mc.fontRenderer;

                   Minecraft.getMinecraft().getTextureManager().bindTexture(texture );
                   Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(0, 0, 0, 0, 140, 100);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Give It:"+ " " + "Yes", 5, 5, 0xDAA520);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "--------------------------------", 5, 10, 0xFF6347);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Height:", 5, 20, 0x000000);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Size:"+ " " + "Minimum", 5, 30, 0x228B22);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Level:" + " " + "1" , 5, 40, 0x191970);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Hybrid:" + " " +"No", 5, 50, 0x00FFFF);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Sort:", 5, 60, 0xDC143C);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Type:" + " " + ConstantMushroom.nameMushroomSmall, 5, 70, 0x000000);
               }
               if (block == MyBlocks.underBirchMushroom) {
                   final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                   final FontRenderer fr = mc.fontRenderer;

                   Minecraft.getMinecraft().getTextureManager().bindTexture(texture );
                   Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(0, 0, 0, 0, 140, 100);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Give It:"+ " " + "Yes", 5, 5, 0xDAA520);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "--------------------------------", 5, 10, 0xFF6347);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Height:", 5, 20, 0x000000);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Size:"+ " " + "Medium", 5, 30, 0x228B22);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Level:" + " " + "2" , 5, 40, 0x191970);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Hybrid:" + " " +"No", 5, 50, 0x00FFFF);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Sort:"+ " " + "Common UnderBirch Mushroom", 5, 60, 0xDC143C);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Type:" + " " + ConstantMushroom.nameMushroomMedium, 5, 70, 0x000000);
               }
               if (block == MyBlocks.opyataMushroomNew) {
                   final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                   final FontRenderer fr = mc.fontRenderer;

                   Minecraft.getMinecraft().getTextureManager().bindTexture(texture );
                   Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(0, 0, 0, 0, 140, 100);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Give It:"+ " " + "Yes", 5, 5, 0xDAA520);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "--------------------------------", 5, 10, 0xFF6347);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Height:", 5, 20, 0x000000);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Size:"+ " " + "Minimum", 5, 30, 0x228B22);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Level:" + " " + "1" , 5, 40, 0x191970);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Hybrid:" + " " +"No", 5, 50, 0x00FFFF);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Sort:" + " " + "Common Opyonok", 5, 60, 0xDC143C);
                   Minecraft.getMinecraft().ingameGUI.drawString(fr, "Type:" + " " + ConstantMushroom.nameMushroomSmall, 5, 70, 0x000000);
               }

           }
       }
   }


Используя твой, как пример, тоже не работает..


if (((RenderGameOverlayEvent)event).type == RenderGameOverlayEvent.ElementType.ALL) {
          final Minecraft mc = Minecraft.getMinecraft();
          final World world = (World)Minecraft.getMinecraft().theWorld;
          final EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().thePlayer;
          
          
          if (Minecraft.getMinecraft().objectMouseOver != null && Minecraft.getMinecraft().objectMouseOver.typeOfHit == MovingObjectType.ENTITY) {
              final int itemX = Minecraft.getMinecraft().objectMouseOver.blockX;
              final int itemY = Minecraft.getMinecraft().objectMouseOver.blockY;
              final int itemZ = Minecraft.getMinecraft().objectMouseOver.blockZ;
              final Block block = world.getBlock(itemX, itemY, itemZ);
              final String blockName = block.getLocalizedName();
              if (JakovUtils.GetTargetEntity(player.worldObj, player, recordPlayingUpFor) instanceof EntityItem) {
                  final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
                  final FontRenderer fr = mc.fontRenderer;

              //    Minecraft.getMinecraft().getTextureManager().bindTexture(texture );
                  Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(0, 0, 0, 0, 140, 100);
                  Minecraft.getMinecraft().ingameGUI.drawString(fr, "Give It:"+ " " + "Yes", 5, 5, 0xDAA520);
                 // Minecraft.getMinecraft().ingameGUI.drawString(fr, "--------------------------------", 5, 10, 0xFF6347);
                  //Minecraft.getMinecraft().ingameGUI.drawString(fr, "Height:", 5, 20, 0x000000);
                 // Minecraft.getMinecraft().ingameGUI.drawString(fr, "Size:"+ " " + "Maximum", 5, 30, 0x228B22);
                 // Minecraft.getMinecraft().ingameGUI.drawString(fr, "Level:" + " " + "3" , 5, 40, 0x191970);
                 // Minecraft.getMinecraft().ingameGUI.drawString(fr, "Hybrid:" + " " +"No", 5, 50, 0x00FFFF);
                 // Minecraft.getMinecraft().ingameGUI.drawString(fr, "Sort:", 5, 60, 0xDC143C);
              //    Minecraft.getMinecraft().ingameGUI.drawString(fr, "Type:" + " " + ConstantMushroom.nameMushroomBig, 5, 70, 0x000000);
              }
             

          }
      }
 
344
1
47
Thunder написал(а):
Боюсь предположить, а ты эвент зарегал? А и еще, зачем делать final Minecraft mc = Minecraft.getMinecraft(); и всеравно почти везде юзать Minecraft.getMinecraft()?)

В самом же начале сказал, что зарегал.
Потому, что так удобно.
 
Сверху