Jump to content

How to override classes


Moritz

Recommended Posts

Reflections.

 

Also, what do you mean by "overriding a class"?  Do you want to replace another mod's block/item with your block/item or do you want to disable the other mod's block/item?  Or what?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

So the question how can i add things to the tileentity of another mod?

 

Well you would need a way to access that TileEntity somehow.

I guess the simplest way to do it would be to create your own TE and Block for whatever you are replacing and then put that block into the block list at the spot where the mods original block stood.

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

Ok. i know i need to play with full cards.

Here the full idea/problem.

 

A friend and me had the idea to make a realistic mod. With realistic blocks (like terrafirmacraft) and an envioment (Like thaumcraft with vis and aura nodes) but in this case its nature. Like in the real world.

Short version: A real world minecraft (time not included).

 

Now we want to do that in the ModJam. And override vanilla classes is not alowed.

So we decided to do a realistic Dimension.

Everyone who join this dimension will be registered (items he have will be changed so we do not break rules)

Then we want to create that machines create dirty steam and that damage the envioment. And you can heal the envioment with trees and airfilters. Like that.

Now the problem is every block which is not registered will be deactived. Only when the player joins the dimension.

Yeah and we want to do addons to IC2 and BC so you can still use them in the dim. So we have to override them to make the blocks realistic.

Understand what i mean?

Link to comment
Share on other sites

Tell me how do you write any tile if you can't override any methods of a tile or a block?

 

By what you are saying using anything which extends Block would be wrong?

Or well at least anything which extends block and modifies any method :P

 

that makes no sense at all.

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

you did not understand me.

 

In the modjam we will write the core mod which do not accept other mod blocks.

 

After the modJam we will make a API that allow people to register their blocks and items.

 

And we will make addons to it that will be cover IC2 and BC3.

 

Now i explain my idea.

 

Then a Player joins the Dimension then his inventory will be checked.

The Checker has a list with item/Block ids from vannilla.

Also the Checker has a list with replacement blocks/items.

So i do not override blocks or items with changing them. I made new items/blocks and when you join the dim the items get changed not more. So i can make a new furnace without breaking the rules.

 

Link to comment
Share on other sites

And by coremod you mean a forge coremod as in this ?

www.minecraftforum.net/topic/1854988-tutorial-162-changing-vanilla-without-editing-base-classes-coremods-and-events-very-advanced/

 

 

Well I'm sorry from my limited understanding what you are saying sounds absurd, I'm afraid you are on your own on solving your troubles.

 

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

So you want to make a core (as in a main module) mod, and then have sub modules for the other mods.

That's not about overriding a class, that's about dividing a mod into modules.

 

If you look into BC's code you should be able to see how they do it, BC is open source and can be found here:

https://github.com/BuildCraft/BuildCraft

 

 

Divine-RPG uses submods for each of it's dimensions like Arcana, Twilight and Iceika, you can see that code here: https://github.com/mazetar/Divine-Rpg

 

Also there are a few statements about this around the forum if you search for "modular" or "modules" etc. I'm sure that you will find them :)

 

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

Now You getting start to understand.

Now we get to the main problem.

 

When i make a realistic world. Engines of BC (steam and combustion) are killing the envioment. So i have to make that the code in the bc engines do that.

And there comes the overriding in the game. But the enviomentkilling comes only in the realistic dimension. So how can i do that?

Link to comment
Share on other sites

You are the one making it hard to understand.

I think you should look into some basic programming introduction as you need to expand your understanding of the terms used, it will not only make it easier for you to understand what is going on, but also easier for us trying to understand you :)

 

 

Anyways, if you want to see if an engine is running then first find the engine (world.getBlock(x,y,z) to get the block at a coord) if it's an engine block, access it's TileEntity (world.getBlockTileEntityAt(x,y,z) and do the checks to see if it's providing power. How to check that, well you will have to read into the Build Craft's code.

It is open source as mentioned above, so read into that and if you have trouble with it then consider reading up on OOP programming and java :)

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

First i do not know how to make/use a tickhandler. It could be easy but i do not know how to use it.

 

I make a new dimension. So i can make the checking part in the updateWeathereffects function. Which is ticking in the dimension and only in my dim. Also i can access all tile entities in the world class and read everything^^.

That should work. I can not test it. Because i want to code it at the modjam^^"

Link to comment
Share on other sites

First i do not know how to make/use a tickhandler. It could be easy but i do not know how to use it.

 

As I stated above, you should go study programming in general before anything else.

Focusing on OOP and programming methodology.

 

That is, if you want to participate in ModJam and create awesome mods, then this is the way to go!

The only alternative to doing the above is the courses by Vswe, but I'd recommend that you actually take time studying on the basics of programming :)

 

 

As for TickHanlders and the other things you mentioned, google will reveal several tutorials on the subjects :)

Now go learn to walk before you run a marathon <3

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

Mazetar. Cool answer.

But i told you already an answer how to prevent my trouble with a tickhandler.

Thanks for the thing with learning. But minecraft is already my learning step.

I only want to learn form minecraft how do you have to think when you want programm.

And i am someone who can not stop to think. My brain is working and working and killing me every night with stealing my sleeptime.

 

^^" I do not want to be a bad person or something like that. But i think a good programmer find always a way to his goal.

I do not want to tell that i am a good programmer. Maybe i am the biggest noop ever. But i only have these ideas (some are from myself some of them comes from other people). And i try to make them.

Also i know i am not ready for it. i know i need to get more order. (at this moment my order is not as good as shit). ^^" Now i forgot what i wrote. xD^^" happends sometimes. Anyway i do know how good i am and what i can and what not. I am not able to create my own tickhandler. But i am able to find a way to get on the right way. xD^^"

 

By the way thanks to everyone who answered here^^

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.

×
×
  • Create New...

Important Information

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