Jump to content

Recommended Posts

Posted

I've been trying to make a custom tnt mod as my frist mod and I reached a deadend. I can't seem to get the entity's textures right. Whenever I ignite the TNT it switches from the texture I set to a blinking white texture.

 

ExplosiveBlock class:

  Reveal hidden contents

EntityExplosive class:

  Reveal hidden contents

RenderExplosiveBlock class:

  Reveal hidden contents

EntityInit class:

  Reveal hidden contents

RegistryHandler class:

  Reveal hidden contents

RenderHandler class:

  Reveal hidden contents

Main

  Reveal hidden contents

 

fail.png

Posted
  On 10/8/2018 at 3:04 AM, Animefan8888 said:

Post the errors.

Expand  
  Reveal hidden contents

And also after igniting it turns to blinking black.

Posted
  On 10/8/2018 at 3:07 AM, purpleshadows said:

And also after igniting it turns to blinking black.

Expand  

Modid and the textures path should be two separate parameters.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

Today I have been looking into it as much as I could and I still have no idea where it fauils. I think I may not be properly registering the entity. I've been looking everywhere online and I don't find anything about creating custom TNTs.

Posted
  On 10/8/2018 at 2:33 AM, purpleshadows said:

new ResourceLocation(Reference.MOD_ID + ":" + name)

Expand  

this -> new ResourceLocation(Reference.MOD_ID,name)

 

  On 10/8/2018 at 2:33 AM, purpleshadows said:

new ResourceLocation(Reference.MOD_ID + ":textures/entity/dankjess_explosiveblock.png");

Expand  

this -> new ResourceLocation(Reference.MOD_ID, "textures/entity/dankjess_explosiveblock.png");

 OR new ResourceLocation(Reference.MOD_ID, "entity/dankjess_explosiveblock.png");, I'm not sure which is correct, I think its the second one, but try both

 

I think your brightness is somehow off. I think that you should replace your code with just the initial translation & try rendering your block with different brightnesses.

About Me

  Reveal hidden contents

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)

Posted
  On 10/9/2018 at 2:01 AM, Cadiboo said:

this -> new ResourceLocation(Reference.MOD_ID,name)

 

this -> new ResourceLocation(Reference.MOD_ID, "textures/entity/dankjess_explosiveblock.png");

 OR new ResourceLocation(Reference.MOD_ID, "entity/dankjess_explosiveblock.png");, I'm not sure which is correct, I think its the second one, but try both

 

I think your brightness is somehow off. I think that you should replace your code with just the initial translation & try rendering your block with different brightnesses.

Expand  

I have done everything you said above but still no luck yet. This is my texture now, as you have sugested:

public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.MOD_ID, "textures/entities/dankjess_explosiveblock.png");

If I change:

@Override
	protected ResourceLocation getEntityTexture(EntityExplosive entity) {
		//return TEXTURE; <------ THIS
		return TextureMap.LOCATION_BLOCKS_TEXTURE; <----- WITH THIS
	}

Then when I ignite my custom tnt, it takes the texture of a default tnt (as expected).

I have inspected the declaration behind that, inside TextureMap class, and it is this:

public static final ResourceLocation LOCATION_BLOCKS_TEXTURE = new ResourceLocation("textures/atlas/blocks.png");

But I have not found this location anywhere. I am trying to find "textures/atlas/blocks.png" so I can understand why this texture works and mine doesn't.

 

My texture is a 64x64 png. Above I will attach a picture of my assets. I don't understand what is wrong with it, maybe blockstates?

This is my blockstates for this block:

  Reveal hidden contents

But I know the blockstate only affects the block before being ignited and "turned" into an entity.

 

I also get these errors, but I am not sure if they are related to my issue:

  Reveal hidden contents

 

image.png

Posted
  On 10/9/2018 at 10:11 PM, purpleshadows said:

Yes, I know. I made a last minute change. Changed the path in assets from entity to entities. I shouald have noted that before.

The problem persists.

Expand  

Instead of calling fuse-- in onUpdate call setFuse(fuse-1)

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 10/9/2018 at 10:34 PM, purpleshadows said:

That did not fix my problem.

Expand  

Damn. Can you use either the console(print lines) or debug mode to determine if the value is changing on the Client?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 10/8/2018 at 2:33 AM, purpleshadows said:

Blocks.TNT.getDefaultState()

Expand  

Change this to your block and do this again.

  On 10/9/2018 at 8:59 PM, purpleshadows said:

@Override protected ResourceLocation getEntityTexture(EntityExplosive entity) { //return TEXTURE; <------ THIS return TextureMap.LOCATION_BLOCKS_TEXTURE; <----- WITH THIS }

Expand  

 

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted (edited)

As @Cadiboo sugested I fidled with the brigthness in doRender, on the lines starting with "blockrendererdispatcher":

  Reveal hidden contents

Also my block now has an interesting texture after being ignited, but it is still not the texture I have asigned to it, as you can see here:

  Reveal hidden contents

EDIT: @Animefan8888 everything is as you sugest, yet it does not fix my problem.

Edited by purpleshadows
Posted
  On 10/9/2018 at 10:49 PM, purpleshadows said:

EDIT: @Animefan8888 everything is as you sugest, yet it does not fix my problem.

Expand  

Post your updated code, and just for reference did you copy your code from the vanilla TNT renderer? I'm away from my dev environment for most of the time in a week including right now, but once I get back I'll look into it deeper.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 10/9/2018 at 11:02 PM, Animefan8888 said:

Post your updated code, and just for reference did you copy your code from the vanilla TNT renderer? I'm away from my dev environment for most of the time in a week including right now, but once I get back I'll look into it deeper.

Expand  

I did copy it from there, indeed. This is the code:

  Reveal hidden contents

 

Posted
  On 10/9/2018 at 10:49 PM, purpleshadows said:

As @Cadiboo sugested I fidled with the brigthness in doRender, on the lines starting with "blockrendererdispatcher":

  Reveal hidden contents

Also my block now has an interesting texture after being ignited, but it is still not the texture I have asigned to it, as you can see here:

  Reveal hidden contents

EDIT: @Animefan8888 everything is as you sugest, yet it does not fix my problem.

Expand  

That looks like the light map (not the blocks) texture to me

About Me

  Reveal hidden contents

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...

×   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.

Announcements



×
×
  • Create New...

Important Information

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