Jump to content

Recommended Posts

Posted

I'm building a MagicCookies mod and a have a few custom potions that are quite essential(to me) as part of the experience in my mod, and I have many more planned.

However, when my mod is coupled with botania and witchery and a few other mods the Potions array reaches it 128 limit and my Potions can't be added anymore.

 

Is there any thing forge provides for that eventuality or should I simply write my own potion handler? If I use my own potion handler which packet communicator can I use best to push data from server to client about potion id, duration and amplifyers? I use those to provide some graphical effects, but the client doesn't get my nbt data updates unless I'd push them with a packet handler. Most of my potions are serverside effect needed only, but some are client side.

How much wood could a woodchuck chuck if a wood chuck could chuck wood - Guybrush Treepwood

 

I wrote my own mod ish... still a few bugs to fix. http://thaumcraft.duckdns.org/downloads/MagicCookies-1.0.6.4.jar

Posted

Use reflection to resize the array. System#arraycopy would be needed for that.

(NOTE: You should check the size of the array before resizing it, because some mods do it too.)

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

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

Posted

Thats what i already do. But when my mod gets coupled with other mods the other mods fill up the 128 max available slots. Leaving no room for my potions.

128 is the max size of the array.

 

Thats why im looking for solution of how to deal with my potions when the array is maxed out.

How much wood could a woodchuck chuck if a wood chuck could chuck wood - Guybrush Treepwood

 

I wrote my own mod ish... still a few bugs to fix. http://thaumcraft.duckdns.org/downloads/MagicCookies-1.0.6.4.jar

Posted

What I have found that an entityLiving does have nbt data but it doesn't get synced. I can use it perfectly to store potion status and such and it gets read out the moment I log in, but only server side, so It doesn't sync it. Currently im writing my own messaging class to communicate the potion status

How much wood could a woodchuck chuck if a wood chuck could chuck wood - Guybrush Treepwood

 

I wrote my own mod ish... still a few bugs to fix. http://thaumcraft.duckdns.org/downloads/MagicCookies-1.0.6.4.jar

Posted

IEEP

IEntityExtendedProperties

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.

Posted

Yea draco, I had come to that conclusion thanks go google myself already.

I literally just finished up my own potion handler.

 

I send packages from the server to client to update the nbt data in the extended player, which then gets read out by my code. I only had to modify 75 lines luckily, and make about 50 new lines heh, but I have it working.

 

Now... what should I call my potions now that i'm loose from the official potions api... moonshine?

 

Now I'm back to another nifty problem. But i'll post that in a seperate thread. better for Google.

 

For those who are curious what I did to solve this:

 

Write my own Potion handler where I register my potions instead of the Potions.potionTypes array.

Have in it methods to write NBT data to the entity you wish to afflict with all relevant data(id, duration, amplification, etc..)

Add an IEntityExtendedProperties to the player/entity

Have all methods needed to set/get and update the Extended Entity upon spawn, death, etc... For 1.7.10 see https://github.com/coolAlias/Tutorial-Demo/blob/1.7.10/src/main/java/tutorial/TutorialMain.java it's a really good guide which things you have to consider.

Then in the entityliving make a call to extended property and ask it to update and parse all possible potions effects from there.

In the potion handler after afflicting the player have a method to get hte potion nbt from the player and sync it clientside.

 

Basically something like that.

 

I'm not posting code samples cause its all little bits over the place. + CoolAlias tutorial has all the basics needed but the potion handling, and you should be able to do that yourself ;-)

 

How much wood could a woodchuck chuck if a wood chuck could chuck wood - Guybrush Treepwood

 

I wrote my own mod ish... still a few bugs to fix. http://thaumcraft.duckdns.org/downloads/MagicCookies-1.0.6.4.jar

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



×
×
  • Create New...

Important Information

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