Jump to content

Recommended Posts

Posted

Hello, I know I can search on YT or Google, but I didnt found any (about TileEntities and their usage).

Can anyone tell me some basic informations about: What TE doing, what things you can do with them, etc...

Or if you know a hyperlink to a good tutorial, you can write the link there  ;)

 

Reason: I am currently doing on a Energy Site in my mod. I need TE to do some hard stuff.

Like:

  Reveal hidden contents

 

 

Thanks very much!

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted

Yes hydroflame, but the tutorial dont tell me what things I can do with tile entities. But I give you good karma :D

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted

ah ok

 

generic description: tile entities are used to store any extra information that wont fit in the metadata (aka a number between 0-15)

 

vanilla blocks that use tile entities(TE): sign, store the text to be displayed, chest, store  if if or not the chest is opened by someone, beacon, store how many buff are available and if its active.

 

random idea i have at 6am just woke up: statue that holds buff that player can get and recover them periodically, 2 way teleporter, slot machine, bank

 

for more exemple look at almost any mod on github.

 

-hydroflame, FRev-

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

Ok, so. I created a this things in My Tile Entity and My Block Class. How I can "run" this things. It dont do anything.

BLOCK CLASS:

 

  Reveal hidden contents

 

TILEENTITYCLASS:

 

  Reveal hidden contents

 

Yes, I can be mad :D

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted

Hi again,

 

 

basicly you want your block to implement the "onNeighborBlockChange" method.

it is called everytime a neighbor block is updated.

Inside the implementations do

world.getBlockTileEntity

cast it into your "TileEntityPowerConduit" and call the updateEntity method you made

 

Cheers,

-hydroflame, FRev-

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

Ou, I think a know what you mean... I think  :)

But how I can do this ? I dont know what you mean the world.getBlockTileEntity

 

 

And I have another question to you, I dont want to create new topic because I think it is not a big problem.

I created a custom block model for my machine. Everything is working fine, but the block is rotated only in one direction even If I try to place him to another direction.

Explanation: If I place the block, he isnt rotated as it need to be, If you know what I am want to say to you...

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted

heuf .... here we go

 

 

  Reveal hidden contents

 

 

as for the other thing about orientation, search the forge wiki for "metadata"

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

Before that rotation worked perfectly. Now with the model doesnt.

Hmm, the code doesnt work...

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted

you might have to call something like

 

GL11.glRotate(angle, 0, 1, 0); before rendering the model to rotate it before

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

SO :D

I created a rotation thingy.

Code in TileEntityPoweredMelterRender:

 

  Reveal hidden contents

 

And changed code in Block class:

 

  Reveal hidden contents

 

But there is ONE IMPORTANT PROBLEM :D

If I place the machine, it will rotate as I want... But every machine in world is rotated the same, If I place differently rotated machine, all machines gets the rotation of last placed machine!

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted

as a opengl expert

//The PushMatrix tells the renderer to "start" doing something.

this is hilarious and also giving me cancer but dont worry I'm super anal about CG code

 

i know that its because of "MachinePoweredMelter.getSide" can you show me how this variable is set, it should be different for every block and it behing the same is the cause for the same orientation everywhere

 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

as a opengl noob :)

getSide is public static int

If you want anything else... I dont know :D

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted

yeah ok it makes a lot of sens.

 

getSide shouldnt be static, as static means its the same for everyone.

 

what you want is a way to access a world variable and call

world.getBlockMetadata(x, y, z);

thsi will return what "getSide" is, but the specific value for every different block, if you want more help,

 

 

  Reveal hidden contents

 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

Yes ...

There is something with rotate in name :D :

 

  Reveal hidden contents

 

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted

yes, except if you have to render your block before you pull the matrix (ill spare you the details)

 

but technicly

 

pushMatrix
rotate
draw
popMatrix

 

bellow will not work

 

pushMatrix
rotate
popMatrix
draw

 

 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

Heh, I set! I am totaly render idiot :D

So, I have this in my rendering class:

 

  Reveal hidden contents

 

What I need to write there :D ??

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted

 

  Reveal hidden contents

 

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

Yes :D But this wont work, it says error nad this: change modifier of blockMetadata to static...

 

//EDIT

Small fixes and the code is working, but bit weird :D

It is not rotating properly, like before :!

 

//EDIT

Ok, So, I improved the rotating code and the rotating is working fine now.  :)

                int meta = te.getBlockMetadata();
                int rotation = 0;
                if(meta == 2){rotation = 180;}//SOUTH
                if(meta == 3){rotation = 0;}//NORTH
                if(meta == 4){rotation = -90;}//EAST
                if(meta == 5){rotation = 90;}//WEST
                GL11.glRotatef(rotation, 0, 1, 0);

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted

:)

Ok, is there any way to show the model in the inventory? not the classic 16p image for the block?

Explanation:

It is showing the 16p image of block, not the custom rendered model ...

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted
  Quote
change modifier of blockMetadata to static

yeah sorry i didnt actually compiled the code, i tought you would understand what i meant

 

to render in inventory you have to make a class that implements IItemRenderer and render when the ItemRenderType is of INVENTORY_BLOCK

 

look at the javadoc and the actual class its pretty straightfoward

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

To show your model in your inventory, you need a item renderer.

 

Thats this class:

 

  Reveal hidden contents

 

 

And put this in your ClientProxy class:

 

  Reveal hidden contents

 

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

Hey Man!

Heh, thanks for the item renderer, but :  :) I DONT HAVE PROXIES ! :)

So, this is only joke, I know how to do this without any proxies :)

Thanks, one more time !

 

//EDIT

So, there is one/two more questions:

 

1) In the randomDisplayTick() I have the particle generator like in normal furnace, it is possible to generate the particles in the block? because I want to have in this setup smoke and flame particles when machine is on:

XXXXX
XXYXX
XXXXX
XXXXX
FFFFFF

The Y character is point where I want to particles come from and

the F character is the front side of the block.

 

2)Is possible to set the texturemap for the custom render, to render 2 different texturemaps?

One map if the block is active and Second if the block is inactive

 

Thank for the IItemRenderer ! :)

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted
  On 6/28/2013 at 1:53 PM, larsgerrits said:

To show your model in your inventory, you need a item renderer.

 

Thats this class:

 

  Reveal hidden contents

 

 

And put this in your ClientProxy class:

 

  Reveal hidden contents

 

 

Really ?  :) This code is making game crash... Errorlog:

 

  Reveal hidden contents

 

 

TileEntityPoweredMelterInvRender:

 

  Reveal hidden contents

 

 

My registering line in base mod class:

 

  Reveal hidden contents

 

 

I dont know why, eclipse doesnt show any errors..

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

Posted

MinecraftForgeClient.registerItemRenderer(powered_melter_idle.blockID, new TileEntityPoweredMelterInvRender());

thsi should be in a client proxy, not in a base mod class

 

 

2 eclipse isnt some kind of magical god, it will only show compilation errors, not runtime errors

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

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.