Jump to content

porl

Members
  • Posts

    15
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

porl's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I want it to work for all entities though - zombies etc.
  2. Ah, I understand. What would the pull request involve though, in my case? I assume what I am trying to do isn't general enough to wind up in the forge core.
  3. I'm still not understanding how the event could override the soul-sand case without modifying base classes though. If there was a way to "unregister" the soul-sand "onEntityCollidedWithBlock" and register a hook for all blocks for "onEntityWalking" (and possibly "onEntityCollidedWithBlock" if necessary) then this would be ideal. Is this what you are suggesting I request the ability to do? Without the ability to remove the soul-sand's event I don't think it would work.
  4. I thought "lockban" was someone's name for a second there haha What are the actual problems with modifying a base class (other than it being incompatible if I were to change things too much)? In essence I am just adding one event method to all blocks so I assume that isn't the problem itself. Assuming no change I make has any issue with other mods that don't also modify the class itself (obviously if two mods both change the same file there would be issues) are there any other issues to watch for?
  5. Is there any "correct" way to do what I am wanting then? If the other methods are "dodgy" anyway then I think I'd prefer to go dodgy all the way and just modify the base classes but I'd like to do the right thing if possible.
  6. I think I'm confusing myself now. Using reflection, can I do this without actually changing the block for a custom block class? If I changed the block to a custom one I wouldn't be able to know what special functions/events etc the block I'm replacing would need (due to being possibly from another mod) so I don't think that would work. That's not a definitive statement by the way, I'm happy to be proven wrong.
  7. That would be perfect but could that work (with other mods) using reflection? I can see how to do it easily (in theory anyway) if I can modify the block class (and the soul sand class to remove it's special case) but as that is a no-no I'd like to know how to do it properly but still keep the flexibility of someone being able to put in a block id of any block from any mod and the speed adjustment work.
  8. If I did it by tick would it be overridden by, say, the default soul sand behaviour? If I was to use reflection is there a way that I could keep it flexible enough that someone could put in a config something like MARBLE 1.2 where MARBLE is some block from a mod (that my mod has no knowledge of) and 1.2 is a speed? Obviously there may need to be another way to represent it but that's the basic idea I'm after. Thanks for all the advice guys, I really appreciate it.
  9. Would that work if I want it configurable for every type of block though? Say for instance someone has a mod that adds hundreds of different blocks. I'd like to be able to have in a config file a list of block ids (or some way to reference them) and a speed multiplier that gets assigned to each block. Obviously the default would be one for all blocks but I imagine it would get quite messy if I was overriding many blocks (most of which I may not know about since they are from other mods). Am I missing some "easy" way that this would work with replacing them with the custom block? My understanding is that I am needing to override the onEntityCollidedWithBlock for all blocks. Is there another way to do this?
  10. Any advice is always welcome! I'm trying to learn how to mod and I thought I'd do something that I wanted a while back. Basically I want to be able to make the "base speed" of different blocks variable - eg. stone is faster to move across than sand and so on. Would it be better to just replace the base classes since in theory I'd like it to be able to work with any block (from mods etc)?
  11. Thanks, I'll look into that. I'm still learning about what can be done with reflection.
  12. Is there a way to do this without editing the base class though?
  13. Hi all Is there an easy way to allow my mod to modify the behaviour of blocks in general without modifying the base class? I want to be able to adjust speed depending on block type an entity is on (like soul sand). I saw the event onEntityCollidedWithBlock is used for soul sand, but can I hook that in the general case for all blocks? Also, if I can do this can I stop the soul sand's version of the event from triggering? I don't want to be having to modify soul sand as a special case if possible. Thanks for the help.
  14. Thank you. It will give me somewhere to look at least.
  15. Hi all I hope this hasn't already been answered (I did search but may not have used appropriate terms). I want to basically modify the terrain generator code. In my case it is for the nether (but I assume it would be similar in any other case). How do I go about getting my mod to override (completely) the built in nether generator code? If I could copy the original nether code and modify it that would be perfect, but I am not sure how to initialise it (and make sure the original nether code does not get used). Could anyone point me in the right direction? Thanks for your time.
×
×
  • Create New...

Important Information

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