Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[solved][1-15] new block window not rendering correctly


Recommended Posts

Hello everyone,

 

in my new mod, I want to had windows to the game. The idea I had is to use an object inherited from the class DoorBlock. But as I try it into the game with a texture of glass it render with strange gray texture instead.

Here is the rendering in game and the following rendering in BlockBench. I guess it may be due to alpha layer but I don't know how to change it.

 

2020-02-17_18.42.28.png

window.PNG

2020-02-17_18.46.38.png

Link to post
Share on other sites

This is likely because the alpha channel in your texture is not set-up properly, or because you did not enable transparency in model.  
Are you using a custom renderer, or are you using a model.json file for this?  
Please post the code of these files.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Link to post
Share on other sites

for this block I use blockbench it generates json models. I use it to create as minecraft door block a parent model. Here is the model of th window :

 

window_bottom.json

{
   "credit": "Made with Blockbench",
   "textures": {
      "0": "gates:block/glass",
      "2": "gates:block/metal",
      "particle": "#bottom"
   },
   "elements": [
      {
         "from": [1, 3, 8],
         "to": [2, 16, 14],
         "faces": {
            "north": {"uv": [0, 0, 1, 13], "texture": "#0"},
            "east": {"uv": [0, 8, 16, 16], "texture": "#0"},
            "south": {"uv": [0, 0, 1, 13], "texture": "#0"},
            "west": {"uv": [0, 8, 16, 16], "texture": "#0"},
            "up": {"uv": [0, 0, 6, 1], "rotation": 270, "texture": "#0"},
            "down": {"uv": [0, 0, 6, 1], "rotation": 90, "texture": "#0"}
         }
      },
      {
         "from": [1, 3, 2],
         "to": [2, 16, 8],
         "faces": {
            "north": {"uv": [0, 0, 1, 13], "texture": "#0"},
            "east": {"uv": [0, 8, 16, 16], "texture": "#0"},
            "south": {"uv": [0, 0, 1, 13], "texture": "#0"},
            "west": {"uv": [0, 8, 16, 16], "texture": "#0"},
            "up": {"uv": [0, 0, 6, 1], "rotation": 270, "texture": "#0"},
            "down": {"uv": [0, 0, 6, 1], "rotation": 90, "texture": "#0"}
         }
      },
      {
         "from": [0, 0, 2],
         "to": [3, 3, 14],
         "faces": {
            "north": {"uv": [0, 0, 3, 4], "texture": "#bottom"},
            "east": {"uv": [0, 0, 12, 4], "texture": "#bottom"},
            "south": {"uv": [0, 0, 3, 4], "texture": "#bottom"},
            "west": {"uv": [0, 0, 12, 4], "texture": "#bottom"},
            "up": {"uv": [0, 0, 12, 3], "rotation": 270, "texture": "#bottom"},
            "down": {"uv": [0, 0, 12, 3], "rotation": 90, "texture": "#bottom"}
         }
      },
      {
         "from": [0, 0, 0],
         "to": [3, 16, 2],
         "faces": {
            "north": {"uv": [0, 0, 3, 16], "texture": "#bottom"},
            "east": {"uv": [0, 0, 2, 16], "texture": "#bottom"},
            "south": {"uv": [0, 0, 3, 16], "texture": "#bottom"},
            "west": {"uv": [0, 0, 2, 16], "texture": "#bottom"},
            "up": {"uv": [0, 0, 2, 3], "rotation": 270, "texture": "#bottom"},
            "down": {"uv": [0, 0, 2, 3], "rotation": 90, "texture": "#bottom"}
         }
      },
      {
         "from": [0, 0, 14],
         "to": [3, 16, 16],
         "faces": {
            "north": {"uv": [0, 0, 3, 16], "texture": "#bottom"},
            "east": {"uv": [0, 0, 2, 16], "texture": "#bottom"},
            "south": {"uv": [0, 0, 3, 16], "texture": "#bottom"},
            "west": {"uv": [0, 0, 2, 16], "texture": "#bottom"},
            "up": {"uv": [0, 0, 2, 3], "rotation": 270, "texture": "#bottom"},
            "down": {"uv": [0, 0, 2, 3], "rotation": 90, "texture": "#bottom"}
         }
      },
      {
         "from": [2, 15, 6],
         "to": [3, 16, 7],
         "faces": {
            "north": {"uv": [0, 0, 1, 1], "texture": "#2"},
            "east": {"uv": [0, 0, 1, 1], "texture": "#2"},
            "south": {"uv": [0, 0, 1, 1], "texture": "#2"},
            "west": {"uv": [0, 0, 1, 1], "texture": "#2"},
            "up": {"uv": [0, 0, 1, 1], "rotation": 270, "texture": "#2"},
            "down": {"uv": [0, 0, 1, 1], "rotation": 90, "texture": "#2"}
         }
      },
      {
         "from": [2, 15, 9],
         "to": [3, 16, 10],
         "faces": {
            "north": {"uv": [0, 0, 1, 1], "texture": "#2"},
            "east": {"uv": [0, 0, 1, 1], "texture": "#2"},
            "south": {"uv": [0, 0, 1, 1], "texture": "#2"},
            "west": {"uv": [0, 0, 1, 1], "texture": "#2"},
            "up": {"uv": [0, 0, 1, 1], "rotation": 270, "texture": "#2"},
            "down": {"uv": [0, 0, 1, 1], "rotation": 90, "texture": "#2"}
         }
      }
   ]
}

 

window_top.json

{
   "credit": "Made with Blockbench",
   "textures": {
      "0": "gates:block/glass",
      "1": "gates:block/metal",
      "particle": "#top"
   },
   "elements": [
      {
         "from": [1, 0, 8],
         "to": [2, 13, 14],
         "faces": {
            "north": {"uv": [0, 0, 1, 13], "texture": "#0"},
            "east": {"uv": [0, 0, 16, 8], "texture": "#0"},
            "south": {"uv": [0, 0, 1, 13], "texture": "#0"},
            "west": {"uv": [0, 0, 16, 8], "texture": "#0"},
            "up": {"uv": [0, 0, 6, 1], "rotation": 270, "texture": "#0"},
            "down": {"uv": [0, 0, 6, 1], "rotation": 90, "texture": "#0"}
         }
      },
      {
         "from": [1, 0, 2],
         "to": [2, 13, 8],
         "faces": {
            "north": {"uv": [0, 0, 1, 13], "texture": "#0"},
            "east": {"uv": [0, 0, 16, 8], "texture": "#0"},
            "south": {"uv": [0, 0, 1, 13], "texture": "#0"},
            "west": {"uv": [0, 0, 16, 8], "texture": "#0"},
            "up": {"uv": [0, 0, 6, 1], "rotation": 270, "texture": "#0"},
            "down": {"uv": [0, 0, 6, 1], "rotation": 90, "texture": "#0"}
         }
      },
      {
         "from": [0, 13, 2],
         "to": [3, 16, 14],
         "faces": {
            "north": {"uv": [0, 0, 3, 3], "texture": "#top"},
            "east": {"uv": [0, 0, 12, 3], "texture": "#top"},
            "south": {"uv": [0, 0, 3, 3], "texture": "#top"},
            "west": {"uv": [0, 0, 12, 3], "texture": "#top"},
            "up": {"uv": [0, 0, 12, 3], "rotation": 270, "texture": "#top"},
            "down": {"uv": [0, 0, 12, 3], "rotation": 90, "texture": "#top"}
         }
      },
      {
         "from": [0, 0, 0],
         "to": [3, 16, 2],
         "faces": {
            "north": {"uv": [0, 0, 3, 16], "texture": "#top"},
            "east": {"uv": [0, 0, 2, 16], "texture": "#top"},
            "south": {"uv": [0, 0, 3, 16], "texture": "#top"},
            "west": {"uv": [0, 0, 2, 16], "texture": "#top"},
            "up": {"uv": [0, 0, 2, 3], "rotation": 270, "texture": "#top"},
            "down": {"uv": [0, 0, 2, 3], "rotation": 90, "texture": "#top"}
         }
      },
      {
         "from": [0, 0, 14],
         "to": [3, 16, 16],
         "faces": {
            "north": {"uv": [0, 0, 3, 16], "texture": "#top"},
            "east": {"uv": [0, 0, 2, 16], "texture": "#top"},
            "south": {"uv": [0, 0, 3, 16], "texture": "#top"},
            "west": {"uv": [0, 0, 2, 16], "texture": "#top"},
            "up": {"uv": [0, 0, 2, 3], "rotation": 270, "texture": "#top"},
            "down": {"uv": [0, 0, 2, 3], "rotation": 90, "texture": "#top"}
         }
      },
      {
         "from": [2, 0, 6],
         "to": [3, 1, 7],
         "faces": {
            "north": {"uv": [0, 0, 1, 1], "texture": "#1"},
            "east": {"uv": [0, 0, 1, 1], "texture": "#1"},
            "south": {"uv": [0, 0, 1, 1], "texture": "#1"},
            "west": {"uv": [0, 0, 1, 1], "texture": "#1"},
            "up": {"uv": [0, 0, 1, 1], "rotation": 270, "texture": "#1"},
            "down": {"uv": [0, 0, 1, 1], "rotation": 90, "texture": "#1"}
         }
      },
      {
         "from": [2, 0, 9],
         "to": [3, 1, 10],
         "faces": {
            "north": {"uv": [0, 0, 1, 1], "texture": "#1"},
            "east": {"uv": [0, 0, 1, 1], "texture": "#1"},
            "south": {"uv": [0, 0, 1, 1], "texture": "#1"},
            "west": {"uv": [0, 0, 1, 1], "texture": "#1"},
            "up": {"uv": [0, 0, 1, 1], "rotation": 270, "texture": "#1"},
            "down": {"uv": [0, 0, 1, 1], "rotation": 90, "texture": "#1"}
         }
      }
   ]
}

 

stone_window_bottom

{
    "parent": "gates:block/window_bottom",
    "textures": {
        "bottom": "gates:block/stone",
        "top": "gates:block/stone"
    }
}

 

stone_window_top

{
    "parent": "gates:block/window_top",
    "textures": {
        "bottom": "gates:block/stone",
        "top": "gates:block/stone"
    }
}

 

This is all for the model for the code it is only the properties that I defined and I choose the Material ROCK but I try to change it and it didn't work

Edited by matt1999rd
Link to post
Share on other sites

You need to add your block to the layer lookup table.  
Run something like this after registering your block.

if (FMLEnvironment.dist == Dist.CLIENT) {
	RenderTypeLookup.setRenderLayer(yourBlock, RenderType.CUTOUT);
}

 

Edited by Busti

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Link to post
Share on other sites
2 hours ago, Busti said:

You need to add your block to the layer lookup table.  
Run something like this after registering your block.


if (FMLEnvironment.dist == Dist.CLIENT) {
	RenderTypeLookup.setRenderLayer(yourBlock, RenderType.CUTOUT);
}

 

Run this in the client setup event. You can also use DistExecutor to run code only on a specific side but be careful with lambdas and the verifier.

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)

Link to post
Share on other sites
  • matt1999rd changed the title to [solved][1-15] new block window not rendering correctly
  • 2 months later...
  • 3 weeks later...
On 5/4/2020 at 10:56 AM, matt1999rd said:

I am returning to this topic because I am about to upload my mod and the function does not work for 1.14.4 unfortunately do someone have an idea of how to do it ?

I ran into exactly the same problem, but for 1.15.2; Not sure about 1.14.4, but by looking in RenderType I found the old fields, just renamed weirdly. In my case,

RenderType.func_228643_e_() 

ended up being right; if you're using transparency, you'll probably want

RenderType.func_228645_f_()

. That is, in FMLClientSetupEvent, do

RenderTypeLookup.setRenderLayer(block, RenderType.(whichever function you need))

 

Edited by SpaceCheetah
fixed grammar
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Just downloaded MDK for 1.17.1, set up my project in IntelliJ IDEA Community 2021.1.3, but there's an error "Exception in thread "main" java.lang.module.ResolutionException: Module jline.terminal reads more than one module named cpw.mods.securejarhandler". Java version is 16.0.2. If I'll try to change it, there'll be new module instead of "jline.terminal". Here's the full log: Exception in thread "main" java.lang.module.ResolutionException: Module jline.terminal reads more than one module named cpw.mods.securejarhandler at java.base/java.lang.module.Resolver.resolveFail(Resolver.java:908) at java.base/java.lang.module.Resolver.checkExportSuppliers(Resolver.java:729) at java.base/java.lang.module.Resolver.finish(Resolver.java:379) at java.base/java.lang.module.Configuration.<init>(Configuration.java:140) at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:494) at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:298) at cpw.mods.bootstraplauncher@0.1.15/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:77) Process finished with exit code 1 Any ideas to fix it?
    • I'm trying to create a command that Changes the nbt data of the currently held item. Ive gotten to the point where everything works except for this line. EntityPlayer player= sender.getDisplayName(); @Override public void processCommand(ICommandSender sender, String[] args) { String output = String.join(" ", args); if(args.length == 0) { throw new CommandException("no name defined"); } else { EntityPlayer player= sender.getDisplayName(); ItemStack stack = player.getHeldItem(); addInformation(stack, player, output); } } public void addInformation(ItemStack istack, EntityPlayer player, String itemname) { NBTTagCompound tag = istack.stackTagCompound; if (tag == null) { tag = new NBTTagCompound(); tag.setTag("display", new NBTTagCompound()); istack.stackTagCompound = tag; } tag.getTag("display"); tag.setTag("display", new NBTTagCompound()); NBTTagCompound tagname = tag.getCompoundTag("display"); NBTTagList name = new NBTTagList(); name.appendTag(new NBTTagString("§b"+itemname)); tagname.setTag("Name", name); }  
    • How?? I don't know the method that can change time.
    • use the SleepFinishedTimeEvent and set the time in the Event to the time you want
    • I want change how is the time manipulated when player is sleeping
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.