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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • DAFTAR DAN LOGIN DISINI   Hantogel atau handogel adalah bentuk pengumpulan duka uang yang populer di dunia judi online, khususnya dalam permainan slot gacor. Banyak situs judi online yang menawarkan handogel slot gacor, dan sebagai pemain, penting untuk mengetahui cara memilih dan mengakses situs tersebut dengan aman dan amanah. Dalam artikel ini, kami akan membahas cara memilih situs slot gacor online yang berkualitas dan tahu cara mengakses handogelnya.
    • DAFTAR & LOGIN SIRITOGEL Siritogel adalah kumpulan kata yang mungkin baru saja dikenal oleh masyarakat, namun dengan perkembangan teknologi dan banyaknya informasi yang tersedia di internet, kalau kita siritogel (mencari informasi dengan cara yang cermat dan rinci) tentang situs slot gacor online, maka kita akan menemukan banyak hal yang menarik dan membahayakan sama sekali. Dalam artikel ini, kita akan mencoba menjelaskan apa itu situs slot gacor online dan bagaimana cara mengatasi dampaknya yang negatif.
    • This honestly might just work for you @SubscribeEvent public static void onScreenRender(ScreenEvent.Render.Post event) { final var player = Minecraft.getInstance().player; if(!hasMyEffect(player)) return; // TODO: You provide hasMyEffect float f = Mth.lerp(event.getPartialTick(), this.minecraft.player.oSpinningEffectIntensity, this.minecraft.player.spinningEffectIntensity); float f1 = ((Double)this.minecraft.options.screenEffectScale().get()).floatValue(); if(f <= 0F || f1 >= 1F) return; float p_282656_ = f * (1.0F - f1); final var p_282460_ = event.getGuiGraphics(); int i = p_282460_.guiWidth(); int j = p_282460_.guiHeight(); p_282460_.pose().pushPose(); float f = Mth.lerp(p_282656_, 2.0F, 1.0F); p_282460_.pose().translate((float)i / 2.0F, (float)j / 2.0F, 0.0F); p_282460_.pose().scale(f, f, f); p_282460_.pose().translate((float)(-i) / 2.0F, (float)(-j) / 2.0F, 0.0F); float f1 = 0.2F * p_282656_; float f2 = 0.4F * p_282656_; float f3 = 0.2F * p_282656_; RenderSystem.disableDepthTest(); RenderSystem.depthMask(false); RenderSystem.enableBlend(); RenderSystem.blendFuncSeparate(SourceFactor.ONE, DestFactor.ONE, SourceFactor.ONE, DestFactor.ONE); p_282460_.setColor(f1, f2, f3, 1.0F); p_282460_.blit(NAUSEA_LOCATION, 0, 0, -90, 0.0F, 0.0F, i, j, i, j); p_282460_.setColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.defaultBlendFunc(); RenderSystem.disableBlend(); RenderSystem.depthMask(true); RenderSystem.enableDepthTest(); p_282460_.pose().popPose(); }   Note: Most of this is directly copied from GameRenderer as you pointed out you found. The only thing you'll have to likely do is update the `oSpinningEffectIntensity` + `spinningEffectIntensity` variables on the player when your effect is applied. Which values should be there? Not 100% sure, might be a game of guess and check, but `handleNetherPortalClient` in LocalPlayer has some hard coded you might be able to start with.
    • Dalam dunia perjudian online yang berkembang pesat, mencari platform yang dapat memberikan kemenangan maksimal dan hasil terbaik adalah impian setiap penjudi. OLXTOTO, dengan bangga, mempersembahkan dirinya sebagai jawaban atas pencarian itu. Sebagai platform terbesar untuk kemenangan maksimal dan hasil optimal, OLXTOTO telah menciptakan gelombang besar di komunitas perjudian online. Satu dari banyak keunggulan yang dimiliki OLXTOTO adalah koleksi permainan yang luas dan beragam. Dari togel hingga slot online, dari live casino hingga permainan kartu klasik, OLXTOTO memiliki sesuatu untuk setiap pemain. Dibangun dengan teknologi terkini dan dikembangkan oleh para ahli industri, setiap permainan di platform ini dirancang untuk memberikan pengalaman yang tak tertandingi bagi para penjudi. Namun, keunggulan OLXTOTO tidak hanya terletak pada variasi permainan yang mereka tawarkan. Mereka juga menonjol karena komitmen mereka terhadap keamanan dan keadilan. Dengan sistem keamanan tingkat tinggi dan proses audit yang ketat, OLXTOTO memastikan bahwa setiap putaran permainan berjalan dengan adil dan transparan. Para pemain dapat merasa aman dan yakin bahwa pengalaman berjudi mereka di OLXTOTO tidak akan terganggu oleh masalah keamanan atau keadilan. Tak hanya itu, OLXTOTO juga terkenal karena layanan pelanggan yang luar biasa. Tim dukungan mereka selalu siap sedia untuk membantu para pemain dengan segala pertanyaan atau masalah yang mereka hadapi. Dengan respon cepat dan solusi yang efisien, OLXTOTO memastikan bahwa pengalaman berjudi para pemain tetap mulus dan menyenangkan. Dengan semua fitur dan keunggulan yang ditawarkannya, tidak mengherankan bahwa OLXTOTO telah menjadi pilihan utama bagi jutaan penjudi online di seluruh dunia. Jika Anda mencari platform yang dapat memberikan kemenangan maksimal dan hasil optimal, tidak perlu mencari lebih jauh dari OLXTOTO. Bergabunglah dengan OLXTOTO hari ini dan mulailah petualangan Anda menuju kemenangan besar dan hasil terbaik!
    • Selamat datang di OLXTOTO, situs slot gacor terpanas yang sedang booming di industri perjudian online. Jika Anda mencari pengalaman bermain yang luar biasa, maka OLXTOTO adalah tempat yang tepat untuk Anda. Dapatkan sensasi tidak biasa dengan variasi slot online terlengkap dan peluang memenangkan jackpot slot maxwin yang sering. Di sini, Anda akan merasakan keseruan yang luar biasa dalam bermain judi slot. DAFTAR OLXTOTO DISINI LOGIN OLXTOTO DISINI AKUN PRO OLXTOTO DISINI   Jackpot Slot Maxwin Sering Untuk Peluang Besar Di OLXTOTO, kami tidak hanya memberikan hadiah slot biasa, tapi juga memberikan kesempatan kepada pemain untuk memenangkan jackpot slot maxwin yang sering. Dengan demikian, Anda dapat meraih keberuntungan besar dan memenangkan ribuan rupiah sebagai hadiah jackpot slot maxwin kami. Jackpot slot maxwin merupakan peluang besar bagi para pemain judi slot untuk meraih keuntungan yang lebih besar. Dalam permainan kami, Anda tidak harus terpaku pada kemenangan biasa saja. Kami hadir dengan jackpot slot maxwin yang sering, sehingga Anda memiliki peluang yang lebih besar untuk meraih kemenangan besar dengan hadiah yang menggiurkan. Dalam permainan judi slot, pengalaman bermain bukan hanya tentang keseruan dan hiburan semata. Kami memahami bahwa para pemain juga menginginkan kesempatan untuk meraih keberuntungan besar. Oleh karena itu, OLXTOTO hadir dengan jackpot slot maxwin yang sering untuk memberikan peluang besar kepada para pemain kami. Peluang Besar Menang Jackpot Slot Maxwin Peluang menang jackpot slot maxwin di OLXTOTO sangatlah besar. Anda tidak perlu khawatir tentang batasan atau pembatasan dalam meraih jackpot tersebut. Kami ingin memberikan kesempatan kepada semua pemain kami untuk merasakan sensasi menang dalam jumlah yang luar biasa. Jackpot slot maxwin kami dibuka untuk semua pemain judi slot di OLXTOTO. Anda memiliki peluang yang sama dengan pemain lainnya untuk memenangkan hadiah jackpot yang besar. Kami percaya bahwa semua orang memiliki kesempatan untuk meraih keberuntungan besar, dan itulah mengapa kami menyediakan jackpot slot maxwin yang sering untuk memenuhi harapan dan keinginan Anda.   Kesimpulan OLXTOTO adalah situs slot gacor terbaik yang memberikan pengalaman bermain judi slot online yang tak terlupakan. Dengan variasi slot online terlengkap dan peluang memenangkan jackpot slot maxwin yang sering, OLXTOTO menjadi pilihan terbaik bagi para pemain yang mencari kesenangan dan kemenangan besar dalam perjudian online. Di samping itu, OLXTOTO juga menawarkan layanan pelanggan yang ramah dan responsif, siap membantu setiap pemain dalam mengatasi masalah teknis atau pertanyaan seputar perjudian online. Kami menjaga integritas game dan memberikan lingkungan bermain yang adil serta menjalankan kebijakan perlindungan pelanggan yang cermat. Bergabunglah dengan OLXTOTO sekarang dan nikmati pengalaman bermain slot online yang luar biasa. Jadilah bagian dari komunitas perjudian yang mengagumkan ini dan raih kesempatan untuk meraih kemenangan besar. Dapatkan akses mudah dan praktis ke situs OLXTOTO dan rasakan sensasi bermain judi slot yang tak terlupakan.  
  • Topics

×
×
  • Create New...

Important Information

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