Jump to content

Gravitation Hook


Abastro

Recommended Posts

I'm making Stellarium mod, and I want to modify gravitation in minecraft.

But there is no unified method of applying gravitation in current minecraft forge,

It is impossible to apply modified gravitation for all of them. (Considering all mod entities...)

 

So I'm looking forward to the hook for gravitation.

It could be getGravitationAcceleration method in WorldProvider class,

Or Gravitation Registry, or GravitationMultiplierEvent...

or whatever.. I really need it, anyway.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

I'm making Stellarium mod, and I want to modify gravitation in minecraft.

But there is no unified method of applying gravitation in current minecraft forge,

It is impossible to apply modified gravitation for all of them. (Considering all mod entities...)

 

So I'm looking forward to the hook for gravitation.

It could be getGravitationAcceleration method in WorldProvider class,

Or Gravitation Registry, or GravitationMultiplierEvent...

or whatever.. I really need it, anyway.

 

If YOU need it so much, why not make a Pull Request? We are not here just to make your job easier. Galacticraft already does this, so its not "impossible".

Link to comment
Share on other sites

If YOU need it so much, why not make a Pull Request? We are not here just to make your job easier. Galacticraft already does this, so its not "impossible".

PR is an option, but it is hard to make the PR for this due to many reasons.

 

1. Galacticraft only changes the behavior of Player.

    Of course there are some alien mobs, but they are custom mobs by Galacticraft which can easily be modified (for Galacticraft).

 

2. Modifying Gravitation Effect is not that easy. For gravitation effect is hard-coded, and each entities got different methods for gravitation. Plus, there are custom entities added by mods which would have different mechanism of gravitation.

 

3. If this would made as a PR, it will contain so many changes. It would make the PR hard to accept.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

If YOU need it so much, why not make a Pull Request? We are not here just to make your job easier. Galacticraft already does this, so its not "impossible".

PR is an option, but it is hard to make the PR for this due to many reasons.

 

1. Galacticraft only changes the behavior of Player.

    Of course there are some alien mobs, but they are custom mobs by Galacticraft which can easily be modified (for Galacticraft).

 

2. Modifying Gravitation Effect is not that easy. For gravitation effect is hard-coded, and each entities got different methods for gravitation. Plus, there are custom entities added by mods which would have different mechanism of gravitation.

 

3. If this would made as a PR, it will contain so many changes. It would make the PR hard to accept.

 

If you think a PR will be hard to accept, who do you expect to do this? PR or a patch by one of the Forge Team, they would both contain the same amount of changes. You don't even need this in forge, use ASM or Reflection. I will say 1 thing. If you want this, you will most likely need to do it yourself and PR it.

Link to comment
Share on other sites

If you think a PR will be hard to accept, who do you expect to do this? PR or a patch by one of the Forge Team, they would both contain the same amount of changes. You don't even need this in forge, use ASM or Reflection. I will say 1 thing. If you want this, you will most likely need to do it yourself and PR it.

It is hard for this to be a PR, but for forge team it wont be a hard work.

For they can decide the way of achieving this, and they can access more codes which PR cannot. So it wont contain the same amount.

 

+ ASM cannot be an option, because it will seriously hack the compatibility with other mods. Then I'd rather make this mod non-forge, and would only use MCP. (Reflection wouldn't work for this)

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

I think that Forge team has so much knowledge with minecraft coding that it should be a lot easier for them.

In addition, I think they have their own plan to develop mcforge, and they would disallow PRs which doesn't get along with the plan.. (On coding style, way of hook(Event or Registry), and so on.)

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

Why don't you use the LivingUpdateEvent, check if the entity is inside of your dimension and multiply the motionY value of said entity?

Alongside with the LivingJumpEvent to modify how high your entities can jump, you can manipulate gravity quite well.

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

Why don't you use the LivingUpdateEvent, check if the entity is inside of your dimension and multiply the motionY value of said entity?

Alongside with the LivingJumpEvent to modify how high your entities can jump, you can manipulate gravity quite well.

If I just multiplies the motionY, it would effect flying entities as well, which is unexpected.

also it would give some odd effect when an entity got a shot.

I think it is similar with LivingUpdateEvent, and what I want is not just 'how high the entity can jump'

In addition, I want gravity is effective for arrow, falling block, and so on which is not LivingEntity.

.. in fact I have a hacky way similar to those.

 

If this suggestion cannot be accepted, then I'd make a PR(It is really hard for me but I can try),

or have to use some hacky way.

(Inspecting the entity motionY movement, and measure gravity as median of acceleration while entity is not on ground.)

and, So if these kind of suggestion cannot be accepted, then what suggestion would be able to on this board?

 

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

I hate the term 'Forge Team' as the 'Forge Team' as it sits is just one person. Me.

As for this suggestion 1) they are trying to say put your effort forth as I dont even entertain things that show no effort

2) This ins't going to happen EVERY entity interacts with gravity a differetn way there is no feasible way to change that without editng EVERY entity AND writing a transformer to TRY and edit every modded entity.

This is something Minecraft isnt designed to do generically. So... Unless you can figure out something thats both clean and efficient, doubt this  will ever happen

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 could make copies of all the entity classes that would go into your dimension, and basically convert them when they enter, rather than put the actual entity in, and do the reverse for going back to other worlds. Just make sure to extend their copied classes to retain the same compatibility.

 

Ex:

// On send entity to dimension

 

EntitySheep sheep = (EntitySheep)originalEntity;

EntityStellarSheep stellarSheep = new EntityStellarSheep();

stellarSheep.setPositionAndRotation(sheep.posX,sheep.posY,sheep.posZ, sheep.rotationYaw, sheep.rotationPitch);

stellarSheep.setFleeceColor(sheep.getFleeceColor());

// etc, etc

 

 

Then after all is said and done, just override their update methods to apply your gravity instead of the built int gravity.

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.