By default I don't think there is a packet that deals with fire. Whether or not an entity is burning is calculated on both the server and client sides independently when it contacts fire. I can't check any of this because I'm in class at the moment, but if it's so then you'll have to create a custom packet to tell the server when you light an entity on fire.
Follow the breadcrumb trail to find out where it originates, and what packets it sends, and then replicate that. If you need any help just PM me.
- JavaPortals
Tried that before I even posted - on the server, isBurning is still present in Entity.java, but it doesn't seem to be sent through any Packet, and obviously there's no Render files on the server. I thought for a while that Packet30Entity might cover it, but that packet doesn't seem to do anything at all.
At the moment, the only thing I can think of is creating a new Packet that sends the instance of EntityPlayerMP which should be on fire to the client, but I'd prefer to find how it actually works before I try messing with it myself.
He's using Forge, so his example is built around that; to fix it, replace every 'Wrapper.getPlayer()' with 'ModLoader.getMinecraftInstance().thePlayer'.
Im just trying to call it from item.java... it was working then something changed and now it doesnt
EDIT: It wants me to change it from protected to public
First note, if you're using iconIndex for textures, I don't really understand why, considering Forge offers its own custom texturing solution, which doesn't need you to have access to that variable.
If you need a quick explanation about access modifiers, protected means that you can only access the variable from Java files within the same package, while public means you can access it from any Java file (private means that you can only access it within the file itself).
You have three options:
a) Just change it to public and redistribute with a modified version of Item.java, breaking a bunch of other mods in the process.
b ) Place the file that needs access to iconIndex in the net.minecraft.src package.
c) Use reflection to get access to the iconIndex variable. You need to specify what Item you're accessing - in this example, I've used Item.stick, but you can change it to whatever Item you're trying to access.
// This goes where you need the iconIndex.
// Make sure to import java.lang.reflect.Field
Field field = Item.stick.getClass().getDeclaredField("iconIndex");
field.setAccessible(true);
int iconIndex = field.getInt(Item.stick);
// The value of iconIndex is now contained with iconIndex.
// You still can't directly access Item.stick.iconIndex, but you have the value it contains in the variable above.
Note that you need to catch a couple exceptions; if you can't figure it out, say so, I can help out with that.
There's probably a more efficient way to do that, but I'm not good with reflection, so as long as it works.
EDIT: That only works for getting the value of iconIndex, if you need to set the value, it's different.
The title may be a little misleading, but I didn't know how to phrase what I want correctly.
Essentially, I've been working on a mod for a while. To finish what I'm working on now, I need to find out how the client interacts with the server to render fire over the entity.
I found what I was looking for in the client - it's just a boolean in Entity called isBurning, which will render fire on the player entity if it's true. However, setting this to true when connected to a server renders fire on your entity for your client, but no one else can see it.
I tried following the code back on the server side, but I couldn't find anything about how the server and client communicate to render at all (I couldn't even find it through packets...)
My explanation wasn't very good, so if you need more information please ask.
The following was added, changed, or removed in this release:
- Updated the following effects to make them look better: Note, Dripping, Burning, Eerie, Moons, Portal, Blizzardy Storm
- Added the following new effects: Stormy Storm, Massed Flies, Green Energy, Purple Energy
- Added the following new hats: Cold Killer, Holiday Headcase, Last Breath, B.M.O.C. (all will be available via crafting, despite how rare some of the TF2 counterparts are)
- Fixed a couple bugs
Known new bugs:
- Burning will not show up for other players on servers (however, you can see Burning on your own hat). Same goes for Eerie.
- Stranges are still broken.
- Icons are missing for the 4 new hats, I wanted to push out this update quickly so I skipped the icons.
Edit 1: reinstall, I forgot to remove some test stuff which causes servers to crash fairly often.
Edit 2: I've actually had to update 3 more times since the first edit, since I missed a large amount of test stuff.
Also, have some random teaser pictures of future effects from the TestBed.
Yes it is. Forge compatibility is probably one the last things on his, "things I might do" list.
Forge is off for now, the amount of work I'd have to do to get it compatible would push the next updates back by months e.e
Aside from that, use http://zidmc.x10.bz/hatfortress/ because the .com domain expired.
edit: Also an update, just working on improving effects and adding new unusuals to the unbox list (this part is honestly the bulk of my update schedule).
0
Alright, thanks, I'll have a look into it.
0
Tried that before I even posted - on the server, isBurning is still present in Entity.java, but it doesn't seem to be sent through any Packet, and obviously there's no Render files on the server. I thought for a while that Packet30Entity might cover it, but that packet doesn't seem to do anything at all.
At the moment, the only thing I can think of is creating a new Packet that sends the instance of EntityPlayerMP which should be on fire to the client, but I'd prefer to find how it actually works before I try messing with it myself.
0
Don't suppose you know anything about it anyway?
0
0
He's using Forge, so his example is built around that; to fix it, replace every 'Wrapper.getPlayer()' with 'ModLoader.getMinecraftInstance().thePlayer'.
0
Other than that, I can't think of anything, unless a) your pre-init isn't being called or your pre-init isn't loading the texture properly.
0
0
First note, if you're using iconIndex for textures, I don't really understand why, considering Forge offers its own custom texturing solution, which doesn't need you to have access to that variable.
If you need a quick explanation about access modifiers, protected means that you can only access the variable from Java files within the same package, while public means you can access it from any Java file (private means that you can only access it within the file itself).
You have three options:
a) Just change it to public and redistribute with a modified version of Item.java, breaking a bunch of other mods in the process.
b ) Place the file that needs access to iconIndex in the net.minecraft.src package.
c) Use reflection to get access to the iconIndex variable. You need to specify what Item you're accessing - in this example, I've used Item.stick, but you can change it to whatever Item you're trying to access.
Note that you need to catch a couple exceptions; if you can't figure it out, say so, I can help out with that.
There's probably a more efficient way to do that, but I'm not good with reflection, so as long as it works.
EDIT: That only works for getting the value of iconIndex, if you need to set the value, it's different.
0
0
That'd be your mod crashing, rather than ML. I can't say much about it without a crash report or source code.
0
The title may be a little misleading, but I didn't know how to phrase what I want correctly.
Essentially, I've been working on a mod for a while. To finish what I'm working on now, I need to find out how the client interacts with the server to render fire over the entity.
I found what I was looking for in the client - it's just a boolean in Entity called isBurning, which will render fire on the player entity if it's true. However, setting this to true when connected to a server renders fire on your entity for your client, but no one else can see it.
I tried following the code back on the server side, but I couldn't find anything about how the server and client communicate to render at all (I couldn't even find it through packets...)
My explanation wasn't very good, so if you need more information please ask.
0
The following was added, changed, or removed in this release:
- Updated the following effects to make them look better: Note, Dripping, Burning, Eerie, Moons, Portal, Blizzardy Storm
- Added the following new effects: Stormy Storm, Massed Flies, Green Energy, Purple Energy
- Added the following new hats: Cold Killer, Holiday Headcase, Last Breath, B.M.O.C. (all will be available via crafting, despite how rare some of the TF2 counterparts are)
- Fixed a couple bugs
Known new bugs:
- Burning will not show up for other players on servers (however, you can see Burning on your own hat). Same goes for Eerie.
- Stranges are still broken.
- Icons are missing for the 4 new hats, I wanted to push out this update quickly so I skipped the icons.
Edit 1: reinstall, I forgot to remove some test stuff which causes servers to crash fairly often.
Edit 2: I've actually had to update 3 more times since the first edit, since I missed a large amount of test stuff.
Also, have some random teaser pictures of future effects from the TestBed.
0
Forge is off for now, the amount of work I'd have to do to get it compatible would push the next updates back by months e.e
Aside from that, use http://zidmc.x10.bz/hatfortress/ because the .com domain expired.
edit: Also an update, just working on improving effects and adding new unusuals to the unbox list (this part is honestly the bulk of my update schedule).
1
1