Gui. Сундук

Malkavian

Каменная лига
Сообщения
81
Лучшие ответы
0
Симпатии
1
#1
Версия Minecraft
1.6.4
Подтверждение
Я максимально подробно описал проблему, включая исходный код файлов, краш лог, изображения и другую информацию, которая может помочь пользователям форума решить мой вопрос!
Код 1:
 public void breakBlock(World world, int x, int y, int z, Block block, int par6)
        {
            if (world.isRemote) return;

            ArrayList drops = new ArrayList();

            TileEntity teRaw = world.getBlockTileEntity(x, y, z);

            if (teRaw != null && teRaw instanceof TileEntityStorage)
            {
                TileEntityStorage te = (TileEntityStorage) teRaw;

                for (int i = 0; i < te.getSizeInventory(); i++)
                {
                    ItemStack stack = te.getStackInSlot(i);

                    if (stack != null) drops.add(stack.copy());
                }
            }

            for (int i = 0;i < drops.size();i++)
            {
                EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, drops.get((i)));
                item.setVelocity((rand.nextDouble() - 0.5) * 0.25, rand.nextDouble() * 0.5 * 0.25, (rand.nextDouble() - 0.5) * 0.25);
                world.spawnEntityInWorld(item);
            }
        }
EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, drops.get((i))); ругается на это. Почему?




Код2:
package assets.testmod.src;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;

public class TileEntityStorage extends TileEntity implements IInventory
{
    private ItemStack[] items = new ItemStack[15];

    public int getSizeInventory()
    {
        return items.length;
    }

    public ItemStack getStackInSlot(int slot)
    {
        return items[slot];
    }

    public ItemStack decrStackSize(int slot, int amount)
    {
        if (items[slot] != null)
        {
            ItemStack itemstack;

            if (items[slot].stackSize == amount)
            {
                itemstack = items[slot];
                items[slot] = null;
                onInventoryChanged();
                return itemstack;
            }
            else
            {
                itemstack = items[slot].splitStack(amount);
                if (items[slot].stackSize == 0) items[slot] = null;
                onInventoryChanged();
                return itemstack;
            }
        }
        else
        {
            return null;
        }
    }

    public ItemStack getStackInSlotOnClosing(int slot)
    {
        if (items[slot] != null)
        {
            ItemStack itemstack = items[slot];
            items[slot] = null;
            return itemstack;
        }
        else
        {
            return null;
        }
    }

    public void setInventorySlotContents(int slot, ItemStack stack)
    {
        items[slot] = stack;
        if (stack != null && stack.stackSize > getInventoryStackLimit())
        {
            stack.stackSize = getInventoryStackLimit();
        }

        onInventoryChanged();
    }

    public String getInventoryName()
    {
        return "container.storage";
    }

    public boolean hasCustomInventoryName()
    {
        return false;
    }

    @Override
    public void readFromNBT(NBTTagCompound nbt)
    {
        super.readFromNBT(nbt);
        NBTTagList list = nbt.getTagList("Items", Constants.NBT.TAG_COMPOUND);
        items = new ItemStack[getSizeInventory()];

        for (int i = 0; i < list.tagCount(); ++i) { NBTTagCompound comp = list.getCompoundTagAt(i); int j = comp.getByte("Slot") & 255; if (j >= 0 && j < items.length)
            {
                items[j] = ItemStack.loadItemStackFromNBT(comp);
            }
        }
    }

    @Override
    public void writeToNBT(NBTTagCompound nbt)
    {
        super.writeToNBT(nbt);
        NBTTagList list = new NBTTagList();

        for (int i = 0; i < items.length; ++i)
        {
            if (items[i] != null)
            {
                NBTTagCompound comp = new NBTTagCompound();
                comp.setByte("Slot", (byte)i);
                items[i].writeToNBT(comp);
                list.appendTag(comp);
            }
        }

        nbt.setTag("Items", list);
    }

    public int getInventoryStackLimit()
    {
        return 64;
    }

    public boolean isUseableByPlayer(EntityPlayer player)
    {
        return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this ? false : player.getDistanceSq((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64.0D;
    }

    public void openInventory() {}

    public void closeInventory() {}

    public boolean isItemValidForSlot(int slot, ItemStack stack)
    {
        return true;
    } }
Ругается на :

NBTTagList list = nbt.getTagList("Items", Constants.NBT.TAG_COMPOUND);
items = new ItemStack[getSizeInventory()];

for (int i = 0; i < list.tagCount(); ++i) { NBTTagCompound comp = list.getCompoundTagAt(i); int j = comp.getByte("Slot") & 255; if (j >= 0 && j < items.length)

И
public class TileEntityStorage extends TileEntity implements IInventory
Код3:
@Override
    protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
    {
        Minecraft.getMinecraft().renderEngine.bindTexture(texture);

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

        int x = (width - xSize) / 2;
        int y = (height - ySize) / 2;

        drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
    }

    @Override
    protected void drawGuiContainerForegroundLayer(int par1, int par2)
    {
        fontRendererObj.drawString(I18n.getString(te.getInventoryName()), (xSize / 2) - (fontRendererObj.getStringWidth(I18n.getString(te.getInventoryName())) / 2), 6, 4210752, false);
        fontRendererObj.drawString(I18n.getString(inventory.getInvName()), 8, ySize - 96 + 2, 4210752);
    }
}

ругается на fontRendererObj.

Если не сложно, то обьясните, как это работает?




5. CommonProxy - это FmlInitializition?
 

timaxa007

Команда форума
Сообщения
5,055
Лучшие ответы
291
Симпатии
377
#2
EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, drops.get((i))); ругается на это. Почему?
Возможно из-за лишних круглых скобок.
На 1.6.4 нету класса Constants.
NBTTagCompound comp = list.getCompoundTagAt(i);
Другой getCompoundTagAt, т.е. tagAt:
Java:
NBTTagCompound comp = (NBTTagCompound)list.tagAt(i);
---
И
public class TileEntityStorage extends TileEntity implements IInventory
Наверное просит добавить недостающих методов.
Ты опять даже в ваниль не смотришь, просто "fontRenderer".
Если не сложно, то обьясните, как это работает?
И что именно?
breakBlock - метод обычно используется в блоке, когда блок ломается. И обычно используют для дропа предметов, пока TileEntity этого блока ещё есть в мире.
TileEntityStorage - это TileEntity который в себе хранить предметы виде ItemStack.
drawGuiContainerBackgroundLayer - метод который используется для отрисовки (заднего плана) текстуры (на квадратном полигоне) для Gui.
drawGuiContainerForegroundLayer - метод который используется для отрисовки (переднего плана) текста(-ов).
---
Не очень понятно о чём ты. Но то что я понял, то ответ нет, не обаятельно его, главное правильно указать используемый метод нужно proxy класса.
 

Malkavian

Каменная лига
Сообщения
81
Лучшие ответы
0
Симпатии
1
#3
Не очень понятно о чём ты. Но то что я понял, то ответ нет, не обаятельно его, главное правильно указать используемый метод нужно proxy класса.
Все. Сундук открывается. А как прописывать текстуры для класса enitity? На примере сундука
А ещё у меня вместо текстуры (инвентаря сундука) - ничего нет. Пропавшая текстура.
 
Последнее редактирование:

timaxa007

Команда форума
Сообщения
5,055
Лучшие ответы
291
Симпатии
377
#4
Для Entity или TileEntity. Если TileEntity, то типа:
Java:
@SideOnly(Side.CLIENT)
public class PotionMakingStandGuiContainer extends GuiContainer {

    private static final ResourceLocation brewingStandGuiTextures =
            new ResourceLocation(PotionMakingMod.MODID, "textures/gui/brewing_stand.png");
    private final InventoryPlayer inventoryPlayer;
    private final TileEntityPotionMakingStand te;

    public PotionMakingStandGuiContainer(final InventoryPlayer inventoryPlayer, final TileEntityPotionMakingStand te) {
        super(new PotionMakingStandContainer(inventoryPlayer, te));
        this.inventoryPlayer = inventoryPlayer;
        this.te = te;
        ySize = 172;
    }

    @Override
    protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
        String s = te.isInvNameLocalized() ? te.getInvName() : I18n.getString(te.getInvName());
        fontRenderer.drawString(s, xSize / 2 - fontRenderer.getStringWidth(s) / 2, 5, 4210752);
        fontRenderer.drawString(I18n.getString("container.inventory"), 8, ySize - 96 + 4, 4210752);
    }

    @Override
    protected void drawGuiContainerBackgroundLayer(float parTick, int mouseX, int mouseY) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        mc.getTextureManager().bindTexture(brewingStandGuiTextures);
        drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
    }

}
Если для Entity, то примерно так-же, просто место класса TileEntity указываешь класс Entity.
 

Malkavian

Каменная лига
Сообщения
81
Лучшие ответы
0
Симпатии
1
#5
Если для Entity, то примерно так-же, просто место класса TileEntity указываешь класс Entity.
Код:
package assets.testmod.src;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;

public class GuiStorage extends GuiContainer
{
    private ResourceLocation texture = new ResourceLocation(ModInfo.MODID, ":textures/gui/container/storage.png");

    private InventoryPlayer inventory;
    private TileEntityStorage te;

    public GuiStorage(TileEntityStorage te, EntityPlayer player)
    {
        super(new ContainerStorage(te, player));
        inventory = player.inventory;
        this.te = te;
    }

    @Override
    protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
    {
        Minecraft.getMinecraft().renderEngine.bindTexture(texture);

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

        int x = (width - xSize) / 2;
        int y = (height - ySize) / 2;

        drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
    }

    @Override
    protected void drawGuiContainerForegroundLayer(int par1, int par2)
    {
        fontRenderer.drawString(I18n.getString(te.getInventoryName()), (xSize / 2) - (fontRenderer.getStringWidth(I18n.getString(te.getInventoryName())) / 2), 6, 4210752, false);
        fontRenderer.drawString(I18n.getString(inventory.getInvName()), 8, ySize - 96 + 2, 4210752);
    }
}
Почему-то вместо текстуры у меня missing texture. И как прописывается текстура самого сундука? Не инвентаря, а блока сундука?


Как я понимаю, он почему-то не видит текстуру.:
 Failed to load texture: TestMod:textures/gui/container/storage.png
java.io.FileNotFoundException: TestMod:textures/gui/container/storage.png
    at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67)
    at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:31)
    at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:84)
    at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:41)
    at assets.testmod.src.GuiStorage.drawGuiContainerBackgroundLayer(GuiStorage.java:29)
    at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:128)
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1036)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:946)
    at net.minecraft.client.Minecraft.run(Minecraft.java:838)
    at net.minecraft.client.main.Main.main(Main.java:93)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:27)


Вот путь : src\minecraft\assets\testmod\textures\gui\container
 
Последнее редактирование:

timaxa007

Команда форума
Сообщения
5,055
Лучшие ответы
291
Симпатии
377
#6
private ResourceLocation texture = new ResourceLocation(ModInfo.MODID, ":textures/gui/container/storage.png");
Попробуй типа
Java:
private ResourceLocation texture = new ResourceLocation(ModInfo.MODID, "textures/gui/container/storage.png");
либо
Java:
private ResourceLocation texture = new ResourceLocation("testmod:textures/gui/container/storage.png");
 

Malkavian

Каменная лига
Сообщения
81
Лучшие ответы
0
Симпатии
1
#7
Решил попробовать через рендер, как в ванильке:
package assets.testmod.src;

import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;

import cpw.mods.fml.common.FMLLog;
import net.minecraft.block.Block;
import net.minecraft.block.BlockChest;
import net.minecraft.client.model.ModelChest;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.ResourceLocation;

public class TileEntityStorageRenderer extends TileEntitySpecialRenderer {
    private static final ResourceLocation Holodos = new ResourceLocation("textures/entity/chest/storage.png");
    
     private ModelChest chestModel = new ModelChest();

    

      public void renderTileEntityChestAt(TileEntityChest par1TileEntityChest, double par2, double par4, double par6, float par8)
        {
            int i;

            if (!par1TileEntityChest.hasWorldObj())
            {
                i = 0;
            }
            else
            {
                Block block = par1TileEntityChest.getBlockType();
                i = par1TileEntityChest.getBlockMetadata();

                if (block instanceof BlockChest && i == 0)
                {
                    try
                    {
                        ((BlockChest)block).unifyAdjacentChests(par1TileEntityChest.getWorldObj(), par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord);
                    }
                    catch (ClassCastException e)
                    {
                        FMLLog.severe("Attempted to render a chest at %d,  %d, %d that was not a chest",
                                      par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord);
                    }

                    i = par1TileEntityChest.getBlockMetadata();
                }

                par1TileEntityChest.checkForAdjacentChests();
            }

            if (par1TileEntityChest.adjacentChestZNeg == null && par1TileEntityChest.adjacentChestXNeg == null)
            {
                ModelChest modelchest = null;

                if (par1TileEntityChest.adjacentChestXPos == null && par1TileEntityChest.adjacentChestZPosition == null)
                {
                    modelchest = this.chestModel;

                    if (par1TileEntityChest.getChestType() == 1)
                    {
                        this.bindTexture(Holodos);
                    }
                  
                }
          

                GL11.glPushMatrix();
                GL11.glEnable(GL12.GL_RESCALE_NORMAL);
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                GL11.glTranslatef((float)par2, (float)par4 + 1.0F, (float)par6 + 1.0F);
                GL11.glScalef(1.0F, -1.0F, -1.0F);
                GL11.glTranslatef(0.5F, 0.5F, 0.5F);
                short short1 = 0;

                if (i == 2)
                {
                    short1 = 180;
                }

                if (i == 3)
                {
                    short1 = 0;
                }

                if (i == 4)
                {
                    short1 = 90;
                }

                if (i == 5)
                {
                    short1 = -90;
                }

                if (i == 2 && par1TileEntityChest.adjacentChestXPos != null)
                {
                    GL11.glTranslatef(1.0F, 0.0F, 0.0F);
                }

                if (i == 5 && par1TileEntityChest.adjacentChestZPosition != null)
                {
                    GL11.glTranslatef(0.0F, 0.0F, -1.0F);
                }

                GL11.glRotatef((float)short1, 0.0F, 1.0F, 0.0F);
                GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
                float f1 = par1TileEntityChest.prevLidAngle + (par1TileEntityChest.lidAngle - par1TileEntityChest.prevLidAngle) * par8;
                float f2;

                if (par1TileEntityChest.adjacentChestZNeg != null)
                {
                    f2 = par1TileEntityChest.adjacentChestZNeg.prevLidAngle + (par1TileEntityChest.adjacentChestZNeg.lidAngle - par1TileEntityChest.adjacentChestZNeg.prevLidAngle) * par8;

                    if (f2 > f1)
                    {
                        f1 = f2;
                    }
                }

                if (par1TileEntityChest.adjacentChestXNeg != null)
                {
                    f2 = par1TileEntityChest.adjacentChestXNeg.prevLidAngle + (par1TileEntityChest.adjacentChestXNeg.lidAngle - par1TileEntityChest.adjacentChestXNeg.prevLidAngle) * par8;

                    if (f2 > f1)
                    {
                        f1 = f2;
                    }
                }

                f1 = 1.0F - f1;
                f1 = 1.0F - f1 * f1 * f1;
                modelchest.chestLid.rotateAngleX = -(f1 * (float)Math.PI / 2.0F);
                modelchest.renderAll();
                GL11.glDisable(GL12.GL_RESCALE_NORMAL);
                GL11.glPopMatrix();
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            }
        }

        public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
        {
            this.renderTileEntityChestAt((TileEntityChest)par1TileEntity, par2, par4, par6, par8);
        }
    }
Как связать класс рендера с классом Entity ?
 

timaxa007

Команда форума
Сообщения
5,055
Лучшие ответы
291
Симпатии
377
#8

Malkavian

Каменная лига
Сообщения
81
Лучшие ответы
0
Симпатии
1
#9
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTechne.class, new RenderTileEntityTechne());
Краш:
---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!

Time: 12.01.19 13:10
Description: Rendering Tile Entity

java.lang.ClassCastException: assets.testmod.src.TileEntityStorage cannot be cast to net.minecraft.tileentity.TileEntityChest
    at assets.testmod.src.TileEntityStorageRenderer.renderTileEntityAt(TileEntityStorageRenderer.java:144)
    at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:172)
    at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntity(TileEntityRenderer.java:157)
    at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:553)
    at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1161)
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1003)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:946)
    at net.minecraft.client.Minecraft.run(Minecraft.java:839)
    at net.minecraft.client.main.Main.main(Main.java:93)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:27)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
    at assets.testmod.src.TileEntityStorageRenderer.renderTileEntityAt(TileEntityStorageRenderer.java:144)

-- Tile Entity Details --
Details:
    Name: TestModTileEntityStorage // assets.testmod.src.TileEntityStorage
    Block type: ID #2066 (tile.null // assets.testmod.src.BlockStorage)
    Block data value: 0 / 0x0 / 0b0000
    Block location: World: (-1280,14,-355), Chunk: (at 0,0,13 in -80,-23; contains blocks -1280,0,-368 to -1265,255,-353), Region: (-3,-1; contains chunks -96,-32 to -65,-1, blocks -1536,0,-512 to -1025,255,-1)
    Actual block type: ID #2066 (tile.null // assets.testmod.src.BlockStorage)
    Actual block data value: 0 / 0x0 / 0b0000
Stacktrace:
    at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:172)
    at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntity(TileEntityRenderer.java:157)
    at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:553)
    at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1161)

-- Affected level --
Details:
    Level name: MpServer
    All players: 1 total; [EntityClientPlayerMP['Player716'/131, l='MpServer', x=-1280,70, y=15,62, z=-353,72]]
    Chunk stats: MultiplayerChunkCache: 190
    Level seed: 0
    Level generator: ID 01 - flat, ver 0. Features enabled: false
    Level generator options:
    Level spawn location: World: (-1244,4,-430), Chunk: (at 4,0,2 in -78,-27; contains blocks -1248,0,-432 to -1233,255,-417), Region: (-3,-1; contains chunks -96,-32 to -65,-1, blocks -1536,0,-512 to -1025,255,-1)
    Level time: 42800 game time, 42800 day time
    Level dimension: 0
    Level storage version: 0x00000 - Unknown?
    Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
    Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
    Forced entities: 93 total; [EntityClientPlayerMP['Player716'/131, l='MpServer', x=-1280,70, y=15,62, z=-353,72], EntitySkeleton['Skeleton'/11, l='MpServer', x=-1342,22, y=4,00, z=-407,34], EntitySpider['Spider'/12, l='MpServer', x=-1343,00, y=4,00, z=-314,72], EntitySpider['Spider'/13, l='MpServer', x=-1343,81, y=4,00, z=-313,09], EntitySpider['Spider'/14, l='MpServer', x=-1332,59, y=4,00, z=-304,25], EntityZombie['Zombie'/15, l='MpServer', x=-1336,09, y=4,00, z=-307,22], EntityCreeper['Creeper'/16, l='MpServer', x=-1333,22, y=4,00, z=-295,13], EntitySheep['Sheep'/19, l='MpServer', x=-1322,75, y=4,00, z=-416,13], EntitySkeleton['Skeleton'/20, l='MpServer', x=-1318,25, y=4,00, z=-349,22], EntitySpider['Spider'/21, l='MpServer', x=-1318,77, y=4,00, z=-332,30], EntitySkeleton['Skeleton'/22, l='MpServer', x=-1314,50, y=4,00, z=-275,50], EntitySpider['Spider'/23, l='MpServer', x=-1327,16, y=4,00, z=-286,16], EntitySpider['Spider'/24, l='MpServer', x=-1323,02, y=4,00, z=-287,40], EntitySpider['Spider'/30, l='MpServer', x=-1299,19, y=4,00, z=-415,22], EntityCreeper['Creeper'/31, l='MpServer', x=-1299,09, y=4,00, z=-421,28], EntityZombie['Zombie'/32, l='MpServer', x=-1304,53, y=4,00, z=-376,13], EntityBat['Bat'/33, l='MpServer', x=-1303,05, y=5,04, z=-362,75], EntitySkeleton['Skeleton'/34, l='MpServer', x=-1309,34, y=4,00, z=-345,31], EntitySkeleton['Skeleton'/39, l='MpServer', x=-1294,13, y=4,00, z=-406,38], EntityBat['Bat'/40, l='MpServer', x=-1280,75, y=8,10, z=-386,25], EntityCreeper['Creeper'/41, l='MpServer', x=-1280,91, y=4,00, z=-398,31], EntityBat['Bat'/42, l='MpServer', x=-1281,34, y=6,10, z=-389,50], EntityCreeper['Creeper'/43, l='MpServer', x=-1289,00, y=4,00, z=-394,50], EntityZombie['Zombie'/44, l='MpServer', x=-1294,30, y=3,19, z=-369,50], EntityZombie['Zombie'/45, l='MpServer', x=-1294,30, y=3,15, z=-368,63], EntityZombie['Zombie'/46, l='MpServer', x=-1294,30, y=3,10, z=-370,36], EntityZombie['Zombie'/47, l='MpServer', x=-1292,34, y=3,00, z=-369,09], EntitySpider['Spider'/48, l='MpServer', x=-1289,31, y=5,00, z=-356,89], EntityZombie['Zombie'/49, l='MpServer', x=-1285,44, y=4,00, z=-357,94], EntitySlime['Slime'/50, l='MpServer', x=-1280,69, y=4,05, z=-351,69], EntitySkeleton['Skeleton'/53, l='MpServer', x=-1264,66, y=4,00, z=-404,00], EntityBat['Bat'/54, l='MpServer', x=-1278,34, y=7,10, z=-386,25], EntityBat['Bat'/55, l='MpServer', x=-1277,81, y=7,10, z=-387,25], EntitySkeleton['Skeleton'/56, l='MpServer', x=-1268,78, y=4,00, z=-396,16], EntityBat['Bat'/57, l='MpServer', x=-1266,44, y=6,10, z=-370,19], EntityItem['item.item.wheat'/58, l='MpServer', x=-1268,81, y=5,13, z=-374,47], EntityItem['item.item.seeds'/59, l='MpServer', x=-1266,84, y=5,13, z=-375,28], EntityZombie['Zombie'/60, l='MpServer', x=-1279,03, y=4,00, z=-375,41], EntityZombie['Zombie'/61, l='MpServer', x=-1276,56, y=4,00, z=-379,03], EntityBat['Bat'/62, l='MpServer', x=-1264,25, y=7,10, z=-366,59], EntityBat['Bat'/63, l='MpServer', x=-1264,25, y=7,10, z=-366,25], EntitySlime['Slime'/64, l='MpServer', x=-1272,11, y=3,00, z=-359,32], EntityItem['item.item.string'/65, l='MpServer', x=-1276,31, y=4,13, z=-354,94], EntityXPOrb['Experience Orb'/66, l='MpServer', x=-40868,00, y=131,97, z=-11437,00], EntityXPOrb['Experience Orb'/67, l='MpServer', x=-40841,00, y=131,97, z=-11337,00], EntityBat['Bat'/68, l='MpServer', x=-1264,25, y=7,10, z=-342,34], EntityBat['Bat'/69, l='MpServer', x=-1268,50, y=8,10, z=-343,25], EntityBat['Bat'/70, l='MpServer', x=-1267,59, y=7,10, z=-342,25], EntityXPOrb['Experience Orb'/71, l='MpServer', x=-40789,00, y=67,97, z=-11064,00], EntityXPOrb['Experience Orb'/72, l='MpServer', x=-40849,00, y=67,97, z=-11064,00], EntityXPOrb['Experience Orb'/73, l='MpServer', x=-40790,00, y=67,97, z=-11016,00], EntitySkeleton['Skeleton'/74, l='MpServer', x=-1278,22, y=4,00, z=-321,31], EntityItem['item.tile.dirt'/75, l='MpServer', x=-1259,88, y=2,13, z=-384,88], EntityBat['Bat'/76, l='MpServer', x=-1263,81, y=7,10, z=-368,75], EntityItem['item.item.rottenFlesh'/77, l='MpServer', x=-1257,44, y=2,01, z=-382,13], EntityItem['item.item.slimeball'/78, l='MpServer', x=-1258,56, y=1,13, z=-381,81], EntityItem['item.item.rottenFlesh'/79, l='MpServer', x=-1258,22, y=2,13, z=-383,44], EntityItem['item.tile.dirt'/80, l='MpServer', x=-1256,78, y=2,13, z=-382,03], EntityItem['item.tile.dirt'/81, l='MpServer', x=-1259,78, y=1,13, z=-382,31], EntityItem['item.tile.dirt'/82, l='MpServer', x=-1258,53, y=2,13, z=-383,13], EntityItem['item.tile.dirt'/83, l='MpServer', x=-1257,78, y=1,13, z=-382,88], EntityItem['item.tile.dirt'/84, l='MpServer', x=-1257,13, y=2,13, z=-380,13], EntityItem['item.tile.dirt'/85, l='MpServer', x=-1258,09, y=2,13, z=-380,47], EntityItem['item.tile.dirt'/86, l='MpServer', x=-1259,88, y=2,13, z=-380,56], EntityItem['item.tile.dirt'/87, l='MpServer', x=-1258,63, y=1,13, z=-381,13], EntityItem['item.tile.dirt'/88, l='MpServer', x=-1259,03, y=1,13, z=-382,88], EntityItem['item.tile.dirt'/89, l='MpServer', x=-1258,88, y=2,13, z=-383,97], EntityBat['Bat'/90, l='MpServer', x=-1263,81, y=7,10, z=-367,56], EntityCreeper['Creeper'/91, l='MpServer', x=-1248,50, y=4,00, z=-364,50], EntityCreeper['Creeper'/92, l='MpServer', x=-1250,75, y=4,00, z=-366,13], EntitySkeleton['Skeleton'/93, l='MpServer', x=-1258,59, y=4,00, z=-323,16], EntitySkeleton['Skeleton'/94, l='MpServer', x=-1258,41, y=4,00, z=-307,84], EntityZombie['Zombie'/95, l='MpServer', x=-1253,19, y=4,00, z=-318,11], EntitySkeleton['Skeleton'/96, l='MpServer', x=-1261,13, y=4,00, z=-313,69], EntityCreeper['Creeper'/98, l='MpServer', x=-1234,69, y=4,00, z=-362,13], EntitySpider['Spider'/99, l='MpServer', x=-1246,00, y=4,00, z=-358,06], EntitySpider['Spider'/100, l='MpServer', x=-1240,84, y=4,00, z=-352,22], EntitySpider['Spider'/101, l='MpServer', x=-1237,64, y=4,00, z=-335,00], EntitySlime['Slime'/102, l='MpServer', x=-1234,31, y=2,43, z=-310,29], EntityCreeper['Creeper'/103, l='MpServer', x=-1246,16, y=4,00, z=-318,22], EntityChicken['Chicken'/104, l='MpServer', x=-1241,74, y=4,00, z=-314,65], EntityCreeper['Creeper'/105, l='MpServer', x=-1237,69, y=4,00, z=-303,91], EntityBat['Bat'/112, l='MpServer', x=-1229,15, y=4,41, z=-368,92], EntitySpider['Spider'/113, l='MpServer', x=-1218,30, y=4,00, z=-325,97], EntitySpider['Spider'/114, l='MpServer', x=-1219,84, y=4,00, z=-322,34], EntitySpider['Spider'/115, l='MpServer', x=-1220,69, y=4,00, z=-325,50], EntitySpider['Spider'/116, l='MpServer', x=-1218,22, y=4,00, z=-311,66], EntityCreeper['Creeper'/117, l='MpServer', x=-1220,50, y=4,00, z=-290,32], EntitySpider['Spider'/120, l='MpServer', x=-1205,00, y=4,00, z=-355,44], EntitySpider['Spider'/121, l='MpServer', x=-1211,50, y=4,00, z=-354,28], EntityBat['Bat'/122, l='MpServer', x=-1211,07, y=6,76, z=-345,85], EntitySpider['Spider'/123, l='MpServer', x=-1216,59, y=4,00, z=-336,22], EntityZombie['Zombie'/124, l='MpServer', x=-1215,50, y=4,00, z=-309,50]]
    Retry entities: 0 total; []
    Server brand: fml,forge
    Server type: Integrated singleplayer server
Stacktrace:
    at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:440)
    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2312)
    at net.minecraft.client.Minecraft.run(Minecraft.java:857)
    at net.minecraft.client.main.Main.main(Main.java:93)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:27)

-- System Details --
Details:
    Minecraft Version: 1.6.4
    Operating System: Windows 7 (amd64) version 6.1
    Java Version: 1.8.0_45, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 573378712 bytes (546 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 21638 (1211728 bytes; 1 MB) allocated, 2745 (153720 bytes; 0 MB) used
    Suspicious classes: FML and Forge are installed
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP v8.11 FML v6.4.50.1,345 Minecraft Forge 9.11.1.1345 8 mods loaded, 8 mods active
    mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    FML{6.4.50.1,345} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    Forge{9.11.1.1345} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    CodeChickenCore{0.9.0.9} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    NotEnoughItems{1.6.1.9} [Not Enough Items] (NotEnoughItems-1.6.4-1.6.1.9-universal.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    TestMod{1.0.0} [TestMod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    IC2{2.0.397-experimental} [IndustrialCraft 2] (industrialcraft-2-dev-deobf_2.0.397-experimental.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    IronChest{5.4.1.620} [Iron Chest] (ironchest-universal-1.6.4-5.4.1.620.zip) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    Launched Version: 1.6

[CODE="java|Код"]    @EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
        
    }

    @EventHandler
    public void serverStarting(FMLServerStartingEvent event)
    {
    }
    @SideOnly(Side.CLIENT)
    @EventHandler
    public void preInitClient(FMLPreInitializationEvent event) {
      
    }

    @SideOnly(Side.CLIENT)
    @EventHandler
    public void initClient(FMLInitializationEvent event) {
        ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStorage.class, new TileEntityStorageRenderer());
    }

    @SideOnly(Side.CLIENT)
    @EventHandler
    public void postInitClient(FMLPostInitializationEvent event) {

    }


    @SideOnly(Side.SERVER)
    @EventHandler
    public void preInitServer(FMLPreInitializationEvent event) {
    }

    @SideOnly(Side.SERVER)
    @EventHandler
    public void initServer(FMLInitializationEvent event) {
    }

    @SideOnly(Side.SERVER)
    @EventHandler
    public void postInitServer(FMLPostInitializationEvent event) {
    }
}
LWJGL: 2.9.0
OpenGL: GeForce GTX 1050 Ti/PCIe/SSE2 GL version 4.6.0 NVIDIA 390.65, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Pack: test
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 405 (22680 bytes; 0 MB) allocated, 405 (22680 bytes; 0 MB) used[/CODE]
 

timaxa007

Команда форума
Сообщения
5,055
Лучшие ответы
291
Симпатии
377
#10
java.lang.ClassCastException: assets.testmod.src.TileEntityStorage cannot be cast to net.minecraft.tileentity.TileEntityChest
at assets.testmod.src.TileEntityStorageRenderer.renderTileEntityAt(TileEntityStorageRenderer.java:144)
Твой TileEntityStorage не может стать ванильным TileEntityChest.
TileEntityStorageRenderer строка 144
 

Malkavian

Каменная лига
Сообщения
81
Лучшие ответы
0
Симпатии
1
#11
Твой TileEntityStorage не может стать ванильным TileEntityChest.
В чем может быть проблема? Как правильно написать?

Вот этот кусок кода:
  public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
        {
            this.renderTileEntityChestAt((TileEntityChest)par1TileEntity, par2, par4, par6, par8);
        }
    }
 

timaxa007

Команда форума
Сообщения
5,055
Лучшие ответы
291
Симпатии
377
#12
this.renderTileEntityChestAt((TileEntityChest)par1TileEntity, par2, par4, par6, par8);
Типа на:
Java:
this.renderTileEntityChestAt((TileEntityStorage)par1TileEntity, par2, par4, par6, par8);
И этот метод тоже первый аргумент меняешь с TileEntityChest на TileEntityStorage.
 

Malkavian

Каменная лига
Сообщения
81
Лучшие ответы
0
Симпатии
1
#13
И этот метод тоже первый аргумент меняешь с TileEntityChest на TileEntityStorage.
Ошибка:
2019-01-12 17:12:58 [INFO] [STDERR] net.minecraft.util.ReportedException: Rendering Tile Entity
2019-01-12 17:12:58 [INFO] [STDERR]     at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:179)
2019-01-12 17:12:58 [INFO] [STDERR]     at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntity(TileEntityRenderer.java:157)
2019-01-12 17:12:58 [INFO] [STDERR]     at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:553)
2019-01-12 17:12:58 [INFO] [STDERR]     at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1161)
2019-01-12 17:12:58 [INFO] [STDERR]     at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1003)
2019-01-12 17:12:58 [INFO] [STDERR]     at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:946)
2019-01-12 17:12:58 [INFO] [STDERR]     at net.minecraft.client.Minecraft.run(Minecraft.java:839)
2019-01-12 17:12:58 [INFO] [STDERR]     at net.minecraft.client.main.Main.main(Main.java:93)
2019-01-12 17:12:58 [INFO] [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2019-01-12 17:12:58 [INFO] [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2019-01-12 17:12:58 [INFO] [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2019-01-12 17:12:58 [INFO] [STDERR]     at java.lang.reflect.Method.invoke(Unknown Source)
2019-01-12 17:12:58 [INFO] [STDERR]     at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
2019-01-12 17:12:58 [INFO] [STDERR]     at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
2019-01-12 17:12:58 [INFO] [STDERR] Caused by: java.lang.ClassCastException: assets.testmod.src.TileEntityStorage cannot be cast to net.minecraft.tileentity.TileEntityChest
2019-01-12 17:12:58 [INFO] [STDERR]     at assets.testmod.src.TileEntityStorageRenderer.renderTileEntityAt(TileEntityStorageRenderer.java:144)
2019-01-12 17:12:58 [INFO] [STDERR]     at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:172)
2019-01-12 17:12:58 [INFO] [STDERR]     ... 13 more
2019-01-12 17:12:58 [INFO] [STDOUT] ---- Minecraft Crash Report ----
2019-01-12 17:12:58 [INFO] [STDOUT] // Shall we play a game?
2019-01-12 17:12:58 [INFO] [STDOUT]
2019-01-12 17:12:58 [INFO] [STDOUT] Time: 12.01.19 17:12
2019-01-12 17:12:58 [INFO] [STDOUT] Description: Rendering Tile Entity
2019-01-12 17:12:58 [INFO] [STDOUT]
2019-01-12 17:12:58 [INFO] [STDOUT] java.lang.ClassCastException: assets.testmod.src.TileEntityStorage cannot be cast to net.minecraft.tileentity.TileEntityChest
2019-01-12 17:12:58 [INFO] [STDOUT]     at assets.testmod.src.TileEntityStorageRenderer.renderTileEntityAt(TileEntityStorageRenderer.java:144)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:172)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntity(TileEntityRenderer.java:157)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:553)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1161)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1003)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:946)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.Minecraft.run(Minecraft.java:839)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.main.Main.main(Main.java:93)
2019-01-12 17:12:58 [INFO] [STDOUT]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2019-01-12 17:12:58 [INFO] [STDOUT]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2019-01-12 17:12:58 [INFO] [STDOUT]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2019-01-12 17:12:58 [INFO] [STDOUT]     at java.lang.reflect.Method.invoke(Unknown Source)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
2019-01-12 17:12:58 [INFO] [STDOUT]
2019-01-12 17:12:58 [INFO] [STDOUT]
2019-01-12 17:12:58 [INFO] [STDOUT] A detailed walkthrough of the error, its code path and all known details is as follows:
2019-01-12 17:12:58 [INFO] [STDOUT] ---------------------------------------------------------------------------------------
2019-01-12 17:12:58 [INFO] [STDOUT]
2019-01-12 17:12:58 [INFO] [STDOUT] -- Head --
2019-01-12 17:12:58 [INFO] [STDOUT] Stacktrace:
2019-01-12 17:12:58 [INFO] [STDOUT]     at assets.testmod.src.TileEntityStorageRenderer.renderTileEntityAt(TileEntityStorageRenderer.java:144)
2019-01-12 17:12:58 [INFO] [STDOUT]
2019-01-12 17:12:58 [INFO] [STDOUT] -- Tile Entity Details --
2019-01-12 17:12:58 [INFO] [STDOUT] Details:
2019-01-12 17:12:58 [INFO] [STDOUT]     Name: TestModTileEntityStorage // assets.testmod.src.TileEntityStorage
2019-01-12 17:12:58 [INFO] [STDOUT]     Block type: ID #2066 (tile.null // assets.testmod.src.BlockStorage)
2019-01-12 17:12:58 [INFO] [STDOUT]     Block data value: 0 / 0x0 / 0b0000
2019-01-12 17:12:58 [INFO] [STDOUT]     Block location: World: (-1280,14,-355), Chunk: (at 0,0,13 in -80,-23; contains blocks -1280,0,-368 to -1265,255,-353), Region: (-3,-1; contains chunks -96,-32 to -65,-1, blocks -1536,0,-512 to -1025,255,-1)
2019-01-12 17:12:58 [INFO] [STDOUT]     Actual block type: ID #2066 (tile.null // assets.testmod.src.BlockStorage)
2019-01-12 17:12:58 [INFO] [STDOUT]     Actual block data value: 0 / 0x0 / 0b0000
2019-01-12 17:12:58 [INFO] [STDOUT] Stacktrace:
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:172)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntity(TileEntityRenderer.java:157)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:553)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1161)
2019-01-12 17:12:58 [INFO] [STDOUT]
2019-01-12 17:12:58 [INFO] [STDOUT] -- Affected level --
2019-01-12 17:12:58 [INFO] [STDOUT] Details:
2019-01-12 17:12:58 [INFO] [STDOUT]     Level name: MpServer
2019-01-12 17:12:58 [INFO] [STDOUT]     All players: 1 total; [EntityClientPlayerMP['Player39'/131, l='MpServer', x=-1280,70, y=15,62, z=-353,72]]
2019-01-12 17:12:58 [INFO] [STDOUT]     Chunk stats: MultiplayerChunkCache: 190
2019-01-12 17:12:58 [INFO] [STDOUT]     Level seed: 0
2019-01-12 17:12:58 [INFO] [STDOUT]     Level generator: ID 01 - flat, ver 0. Features enabled: false
2019-01-12 17:12:58 [INFO] [STDOUT]     Level generator options:
2019-01-12 17:12:58 [INFO] [STDOUT]     Level spawn location: World: (-1244,4,-430), Chunk: (at 4,0,2 in -78,-27; contains blocks -1248,0,-432 to -1233,255,-417), Region: (-3,-1; contains chunks -96,-32 to -65,-1, blocks -1536,0,-512 to -1025,255,-1)
2019-01-12 17:12:58 [INFO] [STDOUT]     Level time: 42850 game time, 42850 day time
2019-01-12 17:12:58 [INFO] [STDOUT]     Level dimension: 0
2019-01-12 17:12:58 [INFO] [STDOUT]     Level storage version: 0x00000 - Unknown?
2019-01-12 17:12:58 [INFO] [STDOUT]     Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
2019-01-12 17:12:58 [INFO] [STDOUT]     Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
2019-01-12 17:12:58 [INFO] [STDOUT]     Forced entities: 93 total; [EntitySkeleton['Skeleton'/11, l='MpServer', x=-1344,98, y=4,00, z=-404,80], EntitySpider['Spider'/12, l='MpServer', x=-1343,00, y=4,00, z=-314,72], EntityClientPlayerMP['Player39'/131, l='MpServer', x=-1280,70, y=15,62, z=-353,72], EntitySpider['Spider'/13, l='MpServer', x=-1343,81, y=4,00, z=-313,09], EntitySpider['Spider'/14, l='MpServer', x=-1332,15, y=4,00, z=-306,82], EntityZombie['Zombie'/15, l='MpServer', x=-1336,09, y=4,00, z=-307,22], EntityCreeper['Creeper'/16, l='MpServer', x=-1333,22, y=4,00, z=-295,13], EntitySheep['Sheep'/19, l='MpServer', x=-1322,75, y=4,00, z=-416,13], EntitySkeleton['Skeleton'/20, l='MpServer', x=-1318,25, y=4,00, z=-349,22], EntitySpider['Spider'/21, l='MpServer', x=-1317,06, y=4,00, z=-330,25], EntitySkeleton['Skeleton'/22, l='MpServer', x=-1314,50, y=4,00, z=-275,50], EntitySpider['Spider'/23, l='MpServer', x=-1327,16, y=4,00, z=-286,16], EntitySpider['Spider'/24, l='MpServer', x=-1323,13, y=4,00, z=-287,75], EntityCreeper['Creeper'/30, l='MpServer', x=-1299,09, y=4,00, z=-421,28], EntitySpider['Spider'/31, l='MpServer', x=-1298,77, y=4,00, z=-415,06], EntityZombie['Zombie'/32, l='MpServer', x=-1304,53, y=4,00, z=-376,13], EntityBat['Bat'/33, l='MpServer', x=-1308,91, y=4,74, z=-364,26], EntitySkeleton['Skeleton'/34, l='MpServer', x=-1309,34, y=4,00, z=-345,31], EntitySkeleton['Skeleton'/39, l='MpServer', x=-1294,13, y=4,00, z=-406,38], EntityBat['Bat'/40, l='MpServer', x=-1280,75, y=8,10, z=-386,25], EntityCreeper['Creeper'/41, l='MpServer', x=-1280,91, y=4,00, z=-398,31], EntityBat['Bat'/42, l='MpServer', x=-1281,34, y=6,10, z=-389,50], EntityCreeper['Creeper'/43, l='MpServer', x=-1289,00, y=4,00, z=-394,50], EntityZombie['Zombie'/44, l='MpServer', x=-1294,30, y=3,54, z=-369,56], EntityZombie['Zombie'/45, l='MpServer', x=-1294,30, y=3,12, z=-368,69], EntityZombie['Zombie'/46, l='MpServer', x=-1294,30, y=3,54, z=-370,47], EntityZombie['Zombie'/47, l='MpServer', x=-1292,34, y=3,00, z=-369,09], EntitySpider['Spider'/48, l='MpServer', x=-1289,44, y=5,00, z=-357,56], EntityZombie['Zombie'/49, l='MpServer', x=-1285,44, y=4,00, z=-357,94], EntitySlime['Slime'/50, l='MpServer', x=-1280,69, y=4,00, z=-351,69], EntitySkeleton['Skeleton'/53, l='MpServer', x=-1264,66, y=4,00, z=-404,00], EntityBat['Bat'/54, l='MpServer', x=-1278,34, y=7,10, z=-386,25], EntityBat['Bat'/55, l='MpServer', x=-1277,81, y=7,10, z=-387,25], EntitySkeleton['Skeleton'/56, l='MpServer', x=-1268,78, y=4,00, z=-396,16], EntityBat['Bat'/57, l='MpServer', x=-1266,44, y=6,10, z=-370,19], EntityItem['item.item.wheat'/58, l='MpServer', x=-1268,81, y=5,13, z=-374,47], EntityItem['item.item.seeds'/59, l='MpServer', x=-1266,84, y=5,13, z=-375,28], EntityZombie['Zombie'/60, l='MpServer', x=-1279,03, y=4,00, z=-375,41], EntityZombie['Zombie'/61, l='MpServer', x=-1276,56, y=4,00, z=-379,03], EntityBat['Bat'/62, l='MpServer', x=-1264,25, y=7,10, z=-366,59], EntityBat['Bat'/63, l='MpServer', x=-1264,25, y=7,10, z=-366,25], EntitySlime['Slime'/64, l='MpServer', x=-1273,01, y=3,00, z=-360,23], EntityItem['item.item.string'/65, l='MpServer', x=-1276,31, y=4,13, z=-354,94], EntityXPOrb['Experience Orb'/66, l='MpServer', x=-40868,00, y=131,97, z=-11437,00], EntityXPOrb['Experience Orb'/67, l='MpServer', x=-40841,00, y=131,97, z=-11337,00], EntityBat['Bat'/68, l='MpServer', x=-1264,25, y=7,10, z=-342,34], EntityBat['Bat'/69, l='MpServer', x=-1268,50, y=8,10, z=-343,25], EntityBat['Bat'/70, l='MpServer', x=-1267,59, y=7,10, z=-342,25], EntityXPOrb['Experience Orb'/71, l='MpServer', x=-40789,00, y=67,97, z=-11064,00], EntityXPOrb['Experience Orb'/72, l='MpServer', x=-40849,00, y=67,97, z=-11064,00], EntityXPOrb['Experience Orb'/73, l='MpServer', x=-40790,00, y=67,97, z=-11016,00], EntitySkeleton['Skeleton'/74, l='MpServer', x=-1278,22, y=4,00, z=-321,31], EntityItem['item.tile.dirt'/75, l='MpServer', x=-1259,88, y=2,13, z=-384,88], EntityBat['Bat'/76, l='MpServer', x=-1263,81, y=7,10, z=-368,75], EntityItem['item.item.rottenFlesh'/77, l='MpServer', x=-1257,44, y=2,01, z=-382,13], EntityItem['item.item.slimeball'/78, l='MpServer', x=-1258,56, y=1,13, z=-381,81], EntityItem['item.item.rottenFlesh'/79, l='MpServer', x=-1258,22, y=2,13, z=-383,44], EntityItem['item.tile.dirt'/80, l='MpServer', x=-1256,78, y=2,13, z=-382,03], EntityItem['item.tile.dirt'/81, l='MpServer', x=-1259,78, y=1,13, z=-382,31], EntityItem['item.tile.dirt'/82, l='MpServer', x=-1258,53, y=2,13, z=-383,13], EntityItem['item.tile.dirt'/83, l='MpServer', x=-1257,78, y=1,13, z=-382,88], EntityItem['item.tile.dirt'/84, l='MpServer', x=-1257,13, y=2,13, z=-380,13], EntityItem['item.tile.dirt'/85, l='MpServer', x=-1258,09, y=2,13, z=-380,47], EntityItem['item.tile.dirt'/86, l='MpServer', x=-1259,88, y=2,13, z=-380,56], EntityItem['item.tile.dirt'/87, l='MpServer', x=-1258,63, y=1,13, z=-381,13], EntityItem['item.tile.dirt'/88, l='MpServer', x=-1259,03, y=1,13, z=-382,88], EntityItem['item.tile.dirt'/89, l='MpServer', x=-1258,88, y=2,13, z=-383,97], EntityBat['Bat'/90, l='MpServer', x=-1263,81, y=7,10, z=-367,56], EntityCreeper['Creeper'/91, l='MpServer', x=-1248,50, y=4,00, z=-364,50], EntityCreeper['Creeper'/92, l='MpServer', x=-1250,75, y=4,00, z=-366,13], EntitySkeleton['Skeleton'/93, l='MpServer', x=-1258,59, y=4,00, z=-323,16], EntitySkeleton['Skeleton'/94, l='MpServer', x=-1258,41, y=4,00, z=-307,84], EntityZombie['Zombie'/95, l='MpServer', x=-1252,66, y=4,00, z=-315,50], EntitySkeleton['Skeleton'/96, l='MpServer', x=-1262,57, y=4,00, z=-314,08], EntityCreeper['Creeper'/98, l='MpServer', x=-1234,69, y=4,00, z=-362,13], EntitySpider['Spider'/99, l='MpServer', x=-1246,00, y=4,00, z=-358,06], EntitySpider['Spider'/100, l='MpServer', x=-1241,36, y=4,00, z=-351,98], EntityBat['Bat'/101, l='MpServer', x=-1232,91, y=4,76, z=-365,39], EntitySpider['Spider'/102, l='MpServer', x=-1237,72, y=4,00, z=-335,66], EntitySlime['Slime'/103, l='MpServer', x=-1234,31, y=2,00, z=-311,24], EntityCreeper['Creeper'/104, l='MpServer', x=-1246,16, y=4,00, z=-318,22], EntityChicken['Chicken'/105, l='MpServer', x=-1243,22, y=4,00, z=-315,88], EntityCreeper['Creeper'/106, l='MpServer', x=-1237,69, y=4,00, z=-303,91], EntitySpider['Spider'/113, l='MpServer', x=-1218,44, y=4,00, z=-337,34], EntitySpider['Spider'/114, l='MpServer', x=-1218,16, y=4,00, z=-325,78], EntitySpider['Spider'/115, l='MpServer', x=-1220,34, y=4,00, z=-322,44], EntitySpider['Spider'/116, l='MpServer', x=-1221,72, y=4,00, z=-326,09], EntitySpider['Spider'/117, l='MpServer', x=-1218,22, y=4,00, z=-311,66], EntityCreeper['Creeper'/118, l='MpServer', x=-1220,03, y=4,00, z=-289,22], EntitySpider['Spider'/121, l='MpServer', x=-1206,02, y=4,00, z=-356,43], EntitySpider['Spider'/122, l='MpServer', x=-1208,75, y=4,00, z=-355,93], EntityBat['Bat'/123, l='MpServer', x=-1208,12, y=7,41, z=-345,13], EntityZombie['Zombie'/124, l='MpServer', x=-1215,50, y=4,00, z=-309,50]]
2019-01-12 17:12:58 [INFO] [STDOUT]     Retry entities: 0 total; []
2019-01-12 17:12:58 [INFO] [STDOUT]     Server brand: fml,forge
2019-01-12 17:12:58 [INFO] [STDOUT]     Server type: Integrated singleplayer server
2019-01-12 17:12:58 [INFO] [STDOUT] Stacktrace:
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:440)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2312)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.Minecraft.run(Minecraft.java:857)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.client.main.Main.main(Main.java:93)
2019-01-12 17:12:58 [INFO] [STDOUT]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2019-01-12 17:12:58 [INFO] [STDOUT]     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
2019-01-12 17:12:58 [INFO] [STDOUT]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2019-01-12 17:12:58 [INFO] [STDOUT]     at java.lang.reflect.Method.invoke(Unknown Source)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
2019-01-12 17:12:58 [INFO] [STDOUT]     at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
2019-01-12 17:12:58 [INFO] [STDOUT]
Фулл код:
package assets.testmod.src;

import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;

import cpw.mods.fml.common.FMLLog;
import net.minecraft.block.Block;
import net.minecraft.block.BlockChest;
import net.minecraft.client.model.ModelChest;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.ResourceLocation;

public class TileEntityStorageRenderer extends TileEntitySpecialRenderer {
    private static final ResourceLocation Holodos = new ResourceLocation("textures/entity/chest/storage.png");
    
     private ModelChest chestModel = new ModelChest();

    

      public void renderTileEntityStorageAt(TileEntityChest par1TileEntityChest, double par2, double par4, double par6, float par8)
        {
            int i;

            if (!par1TileEntityChest.hasWorldObj())
            {
                i = 0;
            }
            else
            {
                Block block = par1TileEntityChest.getBlockType();
                i = par1TileEntityChest.getBlockMetadata();

                if (block instanceof BlockChest && i == 0)
                {
                    try
                    {
                        ((BlockChest)block).unifyAdjacentChests(par1TileEntityChest.getWorldObj(), par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord);
                    }
                    catch (ClassCastException e)
                    {
                        FMLLog.severe("Attempted to render a chest at %d,  %d, %d that was not a chest",
                                      par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord);
                    }

                    i = par1TileEntityChest.getBlockMetadata();
                }

                par1TileEntityChest.checkForAdjacentChests();
            }

            if (par1TileEntityChest.adjacentChestZNeg == null && par1TileEntityChest.adjacentChestXNeg == null)
            {
                ModelChest modelchest = null;

                if (par1TileEntityChest.adjacentChestXPos == null && par1TileEntityChest.adjacentChestZPosition == null)
                {
                    modelchest = this.chestModel;

                    if (par1TileEntityChest.getChestType() == 1)
                    {
                        this.bindTexture(Holodos);
                    }
                  
                }
          

                GL11.glPushMatrix();
                GL11.glEnable(GL12.GL_RESCALE_NORMAL);
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                GL11.glTranslatef((float)par2, (float)par4 + 1.0F, (float)par6 + 1.0F);
                GL11.glScalef(1.0F, -1.0F, -1.0F);
                GL11.glTranslatef(0.5F, 0.5F, 0.5F);
                short short1 = 0;

                if (i == 2)
                {
                    short1 = 180;
                }

                if (i == 3)
                {
                    short1 = 0;
                }

                if (i == 4)
                {
                    short1 = 90;
                }

                if (i == 5)
                {
                    short1 = -90;
                }

                if (i == 2 && par1TileEntityChest.adjacentChestXPos != null)
                {
                    GL11.glTranslatef(1.0F, 0.0F, 0.0F);
                }

                if (i == 5 && par1TileEntityChest.adjacentChestZPosition != null)
                {
                    GL11.glTranslatef(0.0F, 0.0F, -1.0F);
                }

                GL11.glRotatef((float)short1, 0.0F, 1.0F, 0.0F);
                GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
                float f1 = par1TileEntityChest.prevLidAngle + (par1TileEntityChest.lidAngle - par1TileEntityChest.prevLidAngle) * par8;
                float f2;

                if (par1TileEntityChest.adjacentChestZNeg != null)
                {
                    f2 = par1TileEntityChest.adjacentChestZNeg.prevLidAngle + (par1TileEntityChest.adjacentChestZNeg.lidAngle - par1TileEntityChest.adjacentChestZNeg.prevLidAngle) * par8;

                    if (f2 > f1)
                    {
                        f1 = f2;
                    }
                }

                if (par1TileEntityChest.adjacentChestXNeg != null)
                {
                    f2 = par1TileEntityChest.adjacentChestXNeg.prevLidAngle + (par1TileEntityChest.adjacentChestXNeg.lidAngle - par1TileEntityChest.adjacentChestXNeg.prevLidAngle) * par8;

                    if (f2 > f1)
                    {
                        f1 = f2;
                    }
                }

                f1 = 1.0F - f1;
                f1 = 1.0F - f1 * f1 * f1;
                modelchest.chestLid.rotateAngleX = -(f1 * (float)Math.PI / 2.0F);
                modelchest.renderAll();
                GL11.glDisable(GL12.GL_RESCALE_NORMAL);
                GL11.glPopMatrix();
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            }
        }

        public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
        {
            this.renderTileEntityStorageAt((TileEntityChest)par1TileEntity, par2, par4, par6, par8);
        }
    }
 

timaxa007

Команда форума
Сообщения
5,055
Лучшие ответы
291
Симпатии
377
#14
И этот метод тоже первый аргумент меняешь с TileEntityChest на TileEntityStorage.
Ни чего не сделал.
---
22 строка
public void renderTileEntityStorageAt(TileEntityChest par1TileEntityChest, double par2, double par4, double par6, float par8)
на
Java:
public void renderTileEntityStorageAt(TileEntityStorage par1TileEntityChest, double par2, double par4, double par6, float par8)
---
144 строка
this.renderTileEntityStorageAt((TileEntityChest)par1TileEntity, par2, par4, par6, par8);
на
Java:
this.renderTileEntityStorageAt((TileEntityStorage)par1TileEntity, par2, par4, par6, par8);
 

Malkavian

Каменная лига
Сообщения
81
Лучшие ответы
0
Симпатии
1
#15
Сделал. Но вернул обратно и скинул исходных код. Если делать, как ты говоришь, то вылезает ошибка в этой части:
Код:
  }

                par1TileEntityChest.checkForAdjacentChests();
            }

            if (par1TileEntityChest.adjacentChestZNeg == null && par1TileEntityChest.adjacentChestXNeg == null)
            {
                ModelChest modelchest = null;

                if (par1TileEntityChest.adjacentChestXPos == null && par1TileEntityChest.adjacentChestZPosition == null)
                {
                    modelchest = this.chestModel;

                    if (par1TileEntityChest.getChestType() == 1)
                    {
                        this.bindTexture(Holodos);
                    }
                
                }
        

                GL11.glPushMatrix();
                GL11.glEnable(GL12.GL_RESCALE_NORMAL);
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                GL11.glTranslatef((float)par2, (float)par4 + 1.0F, (float)par6 + 1.0F);
                GL11.glScalef(1.0F, -1.0F, -1.0F);
                GL11.glTranslatef(0.5F, 0.5F, 0.5F);
                short short1 = 0;

                if (i == 2)
                {
                    short1 = 180;
                }

                if (i == 3)
                {
                    short1 = 0;
                }

                if (i == 4)
                {
                    short1 = 90;
                }

                if (i == 5)
                {
                    short1 = -90;
                }

                if (i == 2 && par1TileEntityChest.adjacentChestXPos != null)
                {
                    GL11.glTranslatef(1.0F, 0.0F, 0.0F);
                }

                if (i == 5 && par1TileEntityChest.adjacentChestZPosition != null)
                {
                    GL11.glTranslatef(0.0F, 0.0F, -1.0F);
                }

                GL11.glRotatef((float)short1, 0.0F, 1.0F, 0.0F);
                GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
                float f1 = par1TileEntityChest.prevLidAngle + (par1TileEntityChest.lidAngle - par1TileEntityChest.prevLidAngle) * par8;
                float f2;

                if (par1TileEntityChest.adjacentChestZNeg != null)
                {
                    f2 = par1TileEntityChest.adjacentChestZNeg.prevLidAngle + (par1TileEntityChest.adjacentChestZNeg.lidAngle - par1TileEntityChest.adjacentChestZNeg.prevLidAngle) * par8;

                    if (f2 > f1)
                    {
                        f1 = f2;
                    }
                }

                if (par1TileEntityChest.adjacentChestXNeg != null)
                {
                    f2 = par1TileEntityChest.adjacentChestXNeg.prevLidAngle + (par1TileEntityChest.adjacentChestXNeg.lidAngle - par1TileEntityChest.adjacentChestXNeg.prevLidAngle) * par8;

                    if (f2 > f1)
                    {
                        f1 = f2;
                    }
Ошибки:

.checkForAdjacentChests()
par1TileEntityChest.adjacentChestXNeg
par1TileEntityChest.adjacentChestXPos == null && par1TileEntityChest.adjacentChestZPosition
if (par1TileEntityChest.getChestType() == 1)
if (i == 2 && par1TileEntityChest.adjacentChestXPos != null)
if (i == 5 && par1TileEntityChest.adjacentChestZPosition != null)
par1TileEntityChest.prevLidAngle + (par1TileEntityChest.lidAngle - par1TileEntityChest.prevLidAngle) * par8;
par1TileEntityChest.adjacentChestZNeg != null)
par1TileEntityChest.adjacentChestZNeg.prevLidAngle + (par1TileEntityChest.adjacentChestZNeg.lidAngle - par1TileEntityChest.adjacentChestZNeg.prevLidAngle
if (par1TileEntityChest.adjacentChestXNeg != null)
{
par1TileEntityChest.adjacentChestXNeg.prevLidAngle + (par1TileEntityChest.adjacentChestXNeg.lidAngle - par1TileEntityChest.adjacentChestXNeg.prevLidAngle) * par8;


А я просто хотел сделать сундук с другой текстурой.... Я слишком тупой, чтобы понять, как это делать. Вставка из ванильного кода не помогает
 
Сверху