Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

5 minutes ago, Wilfsadude said:

   "parent": "block/orientable",

Blockstates can't have parents.

That aside this is not a blockstate file. It is a model file. Blockstates have a completely different format. Read the docs.

3 minutes ago, Wilfsadude said:

where would i find a full debug log

%mdkDir%/run/logs/debug.log(this may be different if you are using eclipse though so you might have to search for it yourself)

  • Author

sorry this is my block state

{
  "variants":
  {
    "facing=north": { "model": "mm:redstone_generator" },
    "facing=east": { "model": "mm:redstone_generator", "y": 90 },
    "facing=south": { "model": "mm:redstone_generator", "y": 180 },
    "facing=west": { "model": "mm:redstone_generator", "y": 270 }
  }
}

39 minutes ago, Wilfsadude said:

Exception loading model mm:redstone_generator#normal

39 minutes ago, Wilfsadude said:

Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException

 

I would need a full debug log to tell more(sometimes one model loader will just report a generic error and the other one will actually tell something usefull) but this says that the game is looking for a normal(generic, no properties) variant. Is your BlockStateCotainer setup correctly?

8 minutes ago, Wilfsadude said:

i dont think i have a block state container

Well every block has one. The queston is - did you set it up correctly as in did you pass your properties to the container created in your overridden Block#createBlockState. Your blockstate file says that your block has a facing variant with 4 possible values. Is the same true for your BlockStateContainer?

 

8 minutes ago, Wilfsadude said:

 and i cant find the debug log. i am using intellij

As I've said it will be at your %mdkDir%/run/logs/debug.log. I can only randomly guess in the dark at the error you've posted which may even not be the correct error without the full log. I need to see the full error message, not just one of the two model loaders erroring.

  • Author

my gui is doing wierd stuff. 

@Override
    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
    {
        String tileName = this.tileentity.getDisplayName().getUnformattedText();
        this.fontRenderer.drawString(tileName, (this.xSize / 2 - this.fontRenderer.getStringWidth(tileName) / 2) -5, 6, 4210752);
        this.fontRenderer.drawString(this.player.getDisplayName().getUnformattedText(), 7, this.ySize - 96 + 2, 4210752);
        this.fontRenderer.drawString(Integer.toString(this.tileentity.getEnergyStored()), 115, 72, 4210752);
    }

    @Override
    protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
    {
        GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
        this.mc.getTextureManager().bindTexture(TEXTURES);
        this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);

        int l = this.getCookProgressScaled(24);
        this.drawTexturedModalRect(this.guiLeft + 113, this.guiTop + 32, 176, 14, l + 1, 16);

        int k = this.getEnergyStoredScaled(75);
        this.drawTexturedModalRect(this.guiLeft + 152, this.guiTop + 7, 176, 32, 16, 76 - k);
    }

    private int getEnergyStoredScaled(int pixels)
    {
        int i = this.tileentity.getEnergyStored();
        int j = this.tileentity.getMaxEnergyStored();
        return i != 0 && j != 0 ? i * pixels / j : 0;
    }

    private int getCookProgressScaled(int pixels)
    {
        int i = this.tileentity.cookTime;
        if (i == 0) {return 0;}
        return i * pixels / 25;
    }

i think CookProgressScaled sometimes returns minus?

anyway i attached a file of what it looks like

broken.PNG

27 minutes ago, Wilfsadude said:

if (i == 0) {return 0;}

This check is useless. Any number * 0 = 0.

 

Use the debugger. This number

29 minutes ago, Wilfsadude said:

this.tileentity.cookTime

gets really big. Find out why.

If it crashes then you must provide a crashreport. Simply saying "it crashes" is not helpful.

However you might be mistaking the debugger suspending the main thread for crashing. I don't know which is true since you have not described anything nor provided a crash report.

  • Author

well by printing to the config i worked out it changes to 1213223344556778889910101111121213131414151516171718181819192020212122232324242400.

public void update() {
    if (!handler.getStackInSlot(0).isEmpty() && isItemFuel(handler.getStackInSlot(0))) {

        cookTime++;
        if (cookTime == 25) {
            energy += getFuelValue(handler.getStackInSlot(0));
            handler.getStackInSlot(0).shrink(1);
            cookTime = 0;
        }
        System.out.print(cookTime);

    }

}

here is the update bit i reckon its wrong here

You need to check the value in your gui(hint: on the client) hence my suggestion of using the debugger. It's a powerful tool. Learn how to use it.

Apart from redundant code I do not see anything wrong with this update method and your output confirms that it is counting in a range of [0-24]. Check the values in your gui, something is wrong there.

On 9/11/2018 at 2:30 AM, Wilfsadude said:

i fixed it by adding 


if (this.cookTime >= 25) {this.cookTime = 0;}

to my update() void

If its not meant to be going over 25, you should probably investigate why its going over 25

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.