Jump to content

Where to place my .javas in 1.3.1(Please help with a new problem!)


Thor597

Recommended Posts

READ MY NEW PROBLEM BELOW

 

I've noticed in the 1.3.1 update there a lot of new server things in the src (of course since it now merges client and server)

 

And after trying to find the Entity files and biome and worldgen files i found them in the common.net.minecraft.src package and since the render and model files and particle FX files etc are in the client(because client handles rendering and texture) and all the other files are in the server i wondered if i was to do the same things with my files too, so my Render and Model files in the client and my mod_ files and all that in the common, or is it like one package where i place everything.

 

Sorry if this sounds n00bish.

Link to comment
Share on other sites

  • Biome, worldgen, item, block etc (files that go in both client and server) go in the common folder.
  • render, gui, model (client only) files go in the client section.
  • server files go in the server section.
    If you're not sure check where the vanilla minecraft ones are.

 

How the hell do I tell my BlockFurnace class where my Gui file is?

Link to comment
Share on other sites

How do I access Minecraft.java then?

 

I want to add an effectrenderer like this:

 

AC_EntityBlueSparkle entitybluesparkle = new AC_EntityBlueSparkle(world, d, d1, d2, d3, d4, d5);

ModLoader.getMinecraftInstance().addEffect(entitybluesparkle);

 

but it doesnt work anymore

 

Import it. You can directly import it no problem.

 

But for the files that need to be separated client and server, you can't use the common folder (e.g the one that needs Minecraft.java).

Link to comment
Share on other sites

Oh derp, anyway it had to be ModLoader.getMinecraftInstance().effectRenderer.addEffect but I figured it out!

 

Also, I have a couple other problems:

 

1. My Blocks and Items names does not display when I hover over them

 

2. When I hold my Blocks in my hand they have the right coordinates in the texture file only that they use the texture from terrain png(when theyre just in the inventory or on the ground they have the right texture)

 

3. Where did usePortal go?

 

4. My Mobs look completely fucked up, the texture is messed up and they all use the player model

Link to comment
Share on other sites

Oh derp, anyway it had to be ModLoader.getMinecraftInstance().effectRenderer.addEffect but I figured it out!

 

Also, I have a couple other problems:

 

1. My Blocks and Items names does not display when I hover over them

 

2. When I hold my Blocks in my hand they have the right coordinates in the texture file only that they use the texture from terrain png(when theyre just in the inventory or on the ground they have the right texture)

 

3. Where did usePortal go?

 

4. My Mobs look completely fucked up, the texture is messed up and they all use the player model

 

1. Use this instead of ModLoader.addName(...):

LanguageRegistry.instance().addStringLocalization("yourItemName" + ".name", "en_US", "Your Item Name");

 

2. Do you use getTextureFile() in your block class?

 

3. dunno, but I believe there is an other method / hook for it now

 

4. I have several problems with my entities, too. Here:

http://www.minecraftforge.net/forum/index.php/topic,1204.0.html

 

If you use the method addRenderer(...), I saw that there is something other for that now. Maybe try this:

RenderingRegistry.instance().registerEntityRenderingHandler(YourEntity.class, new YourEntityRender(new CSM_YourEntityModel(...)));

 

Use that like map.put(...) from the addRenderer in your load method and outcomment your whole addRenderer method. Maybe then it'll work.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

Oh derp, anyway it had to be ModLoader.getMinecraftInstance().effectRenderer.addEffect but I figured it out!

 

Also, I have a couple other problems:

 

1. My Blocks and Items names does not display when I hover over them

 

2. When I hold my Blocks in my hand they have the right coordinates in the texture file only that they use the texture from terrain png(when theyre just in the inventory or on the ground they have the right texture)

 

3. Where did usePortal go?

 

4. My Mobs look completely fucked up, the texture is messed up and they all use the player model

 

1. Nothing Changed, My code: LanguageRegistry.instance().addStringLocalization("FrostedDirt" + ".name", "en_US", "Frosted Dirt");

 

2. Yes I do

 

3. Hmm, Lex?

 

4. I crashed:

 

 

2012-08-13 19:38:52 [iNFO] [sTDERR] java.lang.NullPointerException
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.Render.loadDownloadableImageTexture(Render.java:39)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.renderModel(RenderLiving.java:231)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.doRenderLiving(RenderLiving.java:99)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.doRender(RenderLiving.java:379)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:188)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:175)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:434)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1037)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:894)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:768)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:661)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at java.lang.Thread.run(Unknown Source)
2012-08-13 19:38:52 [iNFO] [sTDERR] java.lang.NullPointerException
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.Render.doRenderShadowAndFire(Render.java:328)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:189)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:175)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:434)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1037)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:894)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:768)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:661)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at java.lang.Thread.run(Unknown Source)

 

 

This is weird

 

 

Link to comment
Share on other sites

Oh derp, anyway it had to be ModLoader.getMinecraftInstance().effectRenderer.addEffect but I figured it out!

 

Also, I have a couple other problems:

 

1. My Blocks and Items names does not display when I hover over them

 

2. When I hold my Blocks in my hand they have the right coordinates in the texture file only that they use the texture from terrain png(when theyre just in the inventory or on the ground they have the right texture)

 

3. Where did usePortal go?

 

4. My Mobs look completely fucked up, the texture is messed up and they all use the player model

 

1. Nothing Changed, My code: LanguageRegistry.instance().addStringLocalization("FrostedDirt" + ".name", "en_US", "Frosted Dirt");

 

2. Yes I do

 

3. Hmm, Lex?

 

4. I crashed:

 

 

2012-08-13 19:38:52 [iNFO] [sTDERR] java.lang.NullPointerException
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.Render.loadDownloadableImageTexture(Render.java:39)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.renderModel(RenderLiving.java:231)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.doRenderLiving(RenderLiving.java:99)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.doRender(RenderLiving.java:379)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:188)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:175)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:434)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1037)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:894)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:768)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:661)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at java.lang.Thread.run(Unknown Source)
2012-08-13 19:38:52 [iNFO] [sTDERR] java.lang.NullPointerException
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.Render.doRenderShadowAndFire(Render.java:328)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:189)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:175)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:434)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1037)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:894)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:768)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:661)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at java.lang.Thread.run(Unknown Source)

 

 

This is weird

 

 

for 1.

this: "FrostedDirt" + ".name"

has to be this: "frostedDirt" + ".name"

 

for 3.

I dunno how it works on Blocks, I used that only for my items so far and that works.

 

for 4.

then I dunno. :/

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

Oh derp, anyway it had to be ModLoader.getMinecraftInstance().effectRenderer.addEffect but I figured it out!

 

Also, I have a couple other problems:

 

1. My Blocks and Items names does not display when I hover over them

 

2. When I hold my Blocks in my hand they have the right coordinates in the texture file only that they use the texture from terrain png(when theyre just in the inventory or on the ground they have the right texture)

 

3. Where did usePortal go?

 

4. My Mobs look completely fucked up, the texture is messed up and they all use the player model

 

1. Nothing Changed, My code: LanguageRegistry.instance().addStringLocalization("FrostedDirt" + ".name", "en_US", "Frosted Dirt");

 

2. Yes I do

 

3. Hmm, Lex?

 

4. I crashed:

 

 

2012-08-13 19:38:52 [iNFO] [sTDERR] java.lang.NullPointerException
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.Render.loadDownloadableImageTexture(Render.java:39)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.renderModel(RenderLiving.java:231)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.doRenderLiving(RenderLiving.java:99)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.doRender(RenderLiving.java:379)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:188)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:175)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:434)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1037)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:894)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:768)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:661)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at java.lang.Thread.run(Unknown Source)
2012-08-13 19:38:52 [iNFO] [sTDERR] java.lang.NullPointerException
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.Render.doRenderShadowAndFire(Render.java:328)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:189)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:175)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:434)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1037)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:894)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:768)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:661)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at java.lang.Thread.run(Unknown Source)

 

 

This is weird

 

 

for 1.

this: "FrostedDirt" + ".name"

has to be this: "frostedDirt" + ".name"

 

for 3.

I dunno how it works on Blocks, I used that only for my items so far and that works.

 

for 4.

then I dunno. :/

 

How can it be a lowercase f when the Block is called FrostedDirt?

Link to comment
Share on other sites

Oh derp, anyway it had to be ModLoader.getMinecraftInstance().effectRenderer.addEffect but I figured it out!

 

Also, I have a couple other problems:

 

1. My Blocks and Items names does not display when I hover over them

 

2. When I hold my Blocks in my hand they have the right coordinates in the texture file only that they use the texture from terrain png(when theyre just in the inventory or on the ground they have the right texture)

 

3. Where did usePortal go?

 

4. My Mobs look completely fucked up, the texture is messed up and they all use the player model

 

1. Nothing Changed, My code: LanguageRegistry.instance().addStringLocalization("FrostedDirt" + ".name", "en_US", "Frosted Dirt");

 

2. Yes I do

 

3. Hmm, Lex?

 

4. I crashed:

 

 

2012-08-13 19:38:52 [iNFO] [sTDERR] java.lang.NullPointerException
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.Render.loadDownloadableImageTexture(Render.java:39)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.renderModel(RenderLiving.java:231)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.doRenderLiving(RenderLiving.java:99)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderLiving.doRender(RenderLiving.java:379)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:188)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:175)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:434)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1037)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:894)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:768)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:661)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at java.lang.Thread.run(Unknown Source)
2012-08-13 19:38:52 [iNFO] [sTDERR] java.lang.NullPointerException
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.Render.doRenderShadowAndFire(Render.java:328)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:189)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:175)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:434)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1037)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:894)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:768)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at net.minecraft.client.Minecraft.run(Minecraft.java:661)
2012-08-13 19:38:52 [iNFO] [sTDERR] 	at java.lang.Thread.run(Unknown Source)

 

 

This is weird

 

 

for 1.

this: "FrostedDirt" + ".name"

has to be this: "frostedDirt" + ".name"

 

for 3.

I dunno how it works on Blocks, I used that only for my items so far and that works.

 

for 4.

then I dunno. :/

 

How can it be a lowercase f when the Block is called FrostedDirt?

 

The first initial has to be lower case. If you set the block's name like this: block.setBlockName("FrostedDirt") then you have to do this for that method, too (like this: block.setBlockName("frostedDirt")

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

You have to rewrite a lot of the things you're doing.

Directly accessing effect renderer from common code is bad, as you wont have access to it on the server

Same with the old Minecraft.usePortal

you'll have to sue the server's version.

A lot of your stuff needs to be cleaned

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

You have to rewrite a lot of the things you're doing.

Directly accessing effect renderer from common code is bad, as you wont have access to it on the server

Same with the old Minecraft.usePortal

you'll have to sue the server's version.

A lot of your stuff needs to be cleaned

 

I'll get to working out my messy code then now!

 

I've searched my workspace for the usePortal (Client and Server) and its no longer there, has it been replaced with another one? or is it a completely new thing?

 

 

Link to comment
Share on other sites

Oh yeah, the camelCase frostedDirt thing didnt make a difference:

 

public static Block frostedDirt;

 

public mod_ArcticCraft()

{

 

            {

try {

config.load();

} catch (Exception g) {

}

 

                        this.frostedDirt = (new AC_BlockFrostDirt(initIntProp(config, "frostDirt", config.CATEGORY_BLOCK, 223), 3)).setHardness(0.5F).setBlockName("frostedDirt").setStepSound(Block.soundGravelFootstep).setCreativeTab(CreativeTabs.tabBlock);

 

 

                                    LanguageRegistry.instance().addStringLocalization("frostedDirt" + ".name", "en_US", "Frosted Dirt");

 

 

          }

}

                 

 

AC_BlockFrostDirt:

 

package net.minecraft.src;

 

import java.util.ArrayList;

import java.util.List;

import java.util.Random;

 

public class AC_BlockFrostDirt extends Block {

protected AC_BlockFrostDirt(int i, int j) {

super(i, j, Material.ground);

}

 

// You declare the block materials in here and what it drops because where using forge

 

public int idDropped(int i, Random rand, int j)

{

return mod_ArcticCraft.frostedDirt.blockID;

}

 

public String getVersion()

{

return "v1.0";

}

   

    public String getTextureFile() {

return "/ArcticCraft/ACBlocks.png";

}

}

 

 

I still get the weird texture bug when its in my hand and I still dont see a name when hovering over it

Link to comment
Share on other sites

 

 

Oh yeah, the camelCase frostedDirt thing didnt make a difference:

 

public static Block frostedDirt;

 

public mod_ArcticCraft()

{

 

            {

try {

config.load();

} catch (Exception g) {

}

 

                        this.frostedDirt = (new AC_BlockFrostDirt(initIntProp(config, "frostDirt", config.CATEGORY_BLOCK, 223), 3)).setHardness(0.5F).setBlockName("frostedDirt").setStepSound(Block.soundGravelFootstep).setCreativeTab(CreativeTabs.tabBlock);

 

 

                                    LanguageRegistry.instance().addStringLocalization("frostedDirt" + ".name", "en_US", "Frosted Dirt");

 

 

          }

}

                 

 

AC_BlockFrostDirt:

 

package net.minecraft.src;

 

import java.util.ArrayList;

import java.util.List;

import java.util.Random;

 

public class AC_BlockFrostDirt extends Block {

protected AC_BlockFrostDirt(int i, int j) {

super(i, j, Material.ground);

}

 

// You declare the block materials in here and what it drops because where using forge

 

public int idDropped(int i, Random rand, int j)

{

return mod_ArcticCraft.frostedDirt.blockID;

}

 

public String getVersion()

{

return "v1.0";

}

   

    public String getTextureFile() {

return "/ArcticCraft/ACBlocks.png";

}

}

 

 

I still get the weird texture bug when its in my hand and I still dont see a name when hovering over it

 

 

 

You need to use the @Mod() annotation go here for a tutorial on how to implement it

Link to comment
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.
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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • They were already updated, and just to double check I even did a cleanup and fresh update from that same page. I'm quite sure drivers are not the problem here. 
    • i tried downloading the drivers but it says no AMD graphics hardware has been detected    
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
  • Topics

×
×
  • Create New...

Important Information

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