Jump to content

Block variable attribution and check on interact[Dev Help]


wernesgruner

Recommended Posts

Hello,

 

I use Modloader and Forge and I can't seem to find a way to attribute new flags to blocks and check those flags when a player tries to interact with the blocks.

 

Basicly, I'm trying to make a cuboid protection mod without editing any base class.

 

So yea, in fact, I'm trying to attribute ownership to blocks and check for ownership every time a block is clicked. For example, lets stay a player enters an area that is protected and tries to use a button, or destroy a block, it would check if the block is owned and either block or allow the interaction.

 

Since Forge seriously lacks any form of documentation, I really cannot wrap my head around this.

All I really need is a way to receive all blocks interaction before it occurs without editing any base class.

For the rest, I can probably use custom save data.

 

Any idea on how I should approach this issue?

Link to comment
Share on other sites

1) Forge does NOT lack documentation, read the damn code the doucmentation is there

2) There is no generic block interact event for blocks that are not your own, so you are kinda screwed on that point {though things are in the works}

3) Feel free to store things in the chunk data using the ISaveEventHandler, loading that information and accessing it from where ever you deem fit.

But, point is, you can't assign arbitrary data directly to blocks that dont support it, and most blocks dont as that would require giving EVERY block a tile entity, which would be bad.

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

  • 2 months later...

1) Forge does NOT lack documentation, read the damn code the doucmentation is there

 

While being able to see the code is a big help, it's not always sufficient on its own. Often it's very helpful to have a high-level description of how a part of the system is designed to work, written by the people who designed it, or at least someone who thoroughly understands it.

 

Extracting that kind of knowledge from the code itself and its comments can be quite difficult, because it's scattered around in a lot of small pieces. This is especially true in framework-style systems that provide a number of components intended to be used together. It's not always obvious just from looking at the components themselves how they're meant to be connected.

 

I recently had the experience of figuring out how to make a GUI work properly in multiplayer. This involves interactions between 5 or 6 classes, some of which have different versions on client and server. A comment attached to one of the Forge hook methods set me on the right path, but it took me a while to get to that point, and it was by no means straightforward after that. Even now, I don't feel that I fully understand the subject. If I'd been able to read a few paragraphs somewhere about how the GUI system works overall, it would have saved me a lot of time and given me more confidence of being able to tackle more complex GUI coding in the future.

 

Thinking that because you're making the source available, you don't need to provide documentation, is a mistake, IMO.

Link to comment
Share on other sites

You are confusing things that are in vanilla minecraft, and not part of Forge with things that we should be responsible for.

That is just stupid, We are not Mojang, we are not providing generic support for all random stuff you want to do with MC.

99% of everything you want to do is not our domain. The parts that are are documented well enough in code and have logical names that with a small amount of effort on the modder's end it can be understood.

 

A Full blow javadocs or something like that is Mojang's domain not ours. We provide enough information on what Forge does that it is sufficient.

If you want documentation what Minecraft does, go bitch at Mojang.

 

As for tutorials and other things, that is not my job, I suck at writing them, the community has full access to this forum and the wiki and a plethora of other places to create them. It is just that nobody cares enough to do things properly so people just regurgitate the same stuff they have been fed.

 

If you need the highlevel descripotion of Minecraft functionality, write it.

 

Also, banned for 7 days for being a fucking thread necro over, and over, and over, and over. ALL of your posts have necroed threads that are over a month old.

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 should put some sort of requirement down about being a capable java programmer who can work things out on their own for when they install the forge source. although, that might just be me being elitist in some way with saying that only those who know how to code, should be allowed to code =/.

Link to comment
Share on other sites

you should put some sort of requirement down about being a capable java programmer who can work things out on their own for when they install the forge source. although, that might just be me being elitist in some way with saying that only those who know how to code, should be allowed to code =/.

Good idea...

 

It might be worth it to make a Coding Support board, with a good set of rules, such as knowing basic Java code (well enough to make programs without looking up the constructs)...

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.