nado
-
Posts
39 -
Joined
-
Last visited
Posts posted by nado
-
-
Hey guys, I'm having an issue where I call world.createExplosion on the server side, but the explosion doesn't propagate to clients..
I even wrote my own networking to notify clients and have the function be called.. Of course I forgot that it uses RNG so the explosion comes out different then on the server.
Shouldn't the networking already be done for us though?
Edit: My problem is only occurring when I am a certain distance away from the explosion. I wonder if explosions aren't sent to clients if they were a certain distance away?
-
Hey guys!
Here is the main thread that I maintain for EntangleCraft -> http://www.minecraftforum.net/topic/1639312-forge-mc-146147-entanglecraft-v10b/#entry20230006
The mod adds a bunch of cool stuff, such as
- Fun Machines
- Teleportation
- A cableless and omnipotent power system (because science!)
- Machines and items with 4 different channels
- TP scrolls, Mysterious shards with abilities
- Super powerful automatic miner
- Power will soon be UE/IC2/BC compatible
- Heaps of upcoming features!
Check it out
-
Sorry for slight necro. I'm doing some sounds using packets because I wasn't aware of what rich1051414 is saying.
Does that apply for simple world.playsound(...) calls, rich105? I had tried that originally with no luck, so I did the packet sending myself.
-
Ok here is a basic overview of whats going on
If I didn't include anything important let me know.
-
Is support/bug reports really the place? I always thought this was for installation issues and stuff.
Anyhow, my server packet handler sends packets to all clients like this
MinecraftServer server = ModLoader.getMinecraftServerInstance(); server.getConfigurationManager().sendPacketToAllPlayers(packet);
Feel like I'm gonna get raged at for using something from ModLoader, especially since I use it again for sending from client to server:
ModLoader.sendPacket(packet);
Just to clarify, the title of this thread isn't my problem; I just want to know how to set up packets correctly. This was Kinniken's thread title, sorry about the hi-jack.
-
Sorry to be a little off topic, but I was wondering about how to correctly set up my packet handling.
Is it ok to just have:
@NetworkMod(
clientSideRequired = true,
serverSideRequired = false,
clientPacketHandlerSpec = @SidedPacketHandler(channels={"EntangleCraft"}, packetHandler=ClientPacketHandler.class),
serverPacketHandlerSpec = @SidedPacketHandler(channels={"EntangleCraft"}, packetHandler=ServerPacketHandler.class),
connectionHandler = EntangleCraft.class,
versionBounds = "[1]"
)
,given that both of those packetHandler classes implement IPacketHandler?
I assume something else needs to be done as my packets aren't sending
-
It would be stupid-ugly to have to specify a 'fallthrough;' keyword or something each time, it would not 'fit'.
I see, thats interesting. I have to admit that I haven't used the things much They always just seemed a bit contrived.
-
Ah, so it is his code, not MC code, yep.
Switches are convenient, here is the copy/paste part scaffold for areas that use my enums (to be changed to the above on the 1.3.1 port):
Cleaner than an if/then/elseif/else tree for sure.
Sure. I like the concept, I just don't like the stupid way it assumes you want to carry on through the other cases. Like seriously, does anybody ever use them without breaks inbetween cases? I think they would just be way more elegant without that little annoyance.
Call me OCD.
edit; but since you have it nicely copy/pasted like that I'll probably use it anyway!
-
Certainly Java has a way to loop over enumerations... Every other language certainly does...
I usually use those with switch/case or just math manipulation. I actually already made my own enumeration (well, actually static final int's) of those anyway so that is something that I can remove from my code.
As for that code case, seems like something they missed...
Switches? those things are rank..
-
Seems a lot has changed, I feel we should all be posting in the same place about our findings.
At the moment I need to figure out guis and saveEventHandlers equivalent stuff... Anyway lets all post stuff we discover in this thread.
-
Are we even supposed to use IGuiHandlers anymore? I can't find one anywhere. Times be changing!
-
Too lazy to. But my mod Universal Electricity is open source and it has some network code you can take a look at:
Haha, thats cool. Thanks again!
-
Man Lex is the bro. This is gonna be awesome.
-
Have it emulate enough of its state to keep the player informed, do not send over anything not needed.
I'm actually even lazier than that. I made it so the client doesn't do ANYTHING at all except display correct GUI information. That should also reduce all client lag issues. With 1.3 coming up, I'm planning to make the client side do nothing at all except be a "display" while server sides does all the work. Hopefully this will reduce lag.
Thanks for this post, exactly what I needed to know.
If you can be bothered Calclavia, you could make a wiki explanation? I'd like to compare my way of doing it to make sure its suitable.
Otherwise, cheers for the help
-
Use packets to send data between server and client
Maybe I should have been more specific. I understand this much, I just don't know if the client should be "smelting" on the client side as well as the server-side type of thing..
-
There was an old thread on this but I feel starting a new one is appropriate. I would love it if someone knowledgeable would clear up some of my queries.
If on a server, should the client-side tile-entity do anything or just wait for updates from the server-side tile-entity? For example say the block smelted stuff; should the client-side AND server-side tile-entities smelt? Or should the client-side tile-entity just get told whats up from the server?
My tile-entities work in a crude way in SMP, but I really want to know how its supposed to be done. If anyone is up for making a tutorial I wouldn't mind at all.
-
Have you guys tried it? the intuitive way to over-write the texture didn't work out for me
you don't override the textures you just set the new ones. Also you might want to look at renderChest as well.
Yeah thats kinda what I meant, though I can understand my wording wasn't good. So have you done it?
-
I found the problem and everything is working smoothly now,
what I did wrong:
1. My class was implementing ISoundHandler
2. I didnt have onPlaySoundAtEntity() in my class
3. I was using .ogg files not wav files
Thank you!
The fact that you were implementing ISoundHandler wasn't necessarily a problem - by extending the SoundHandlerAdaptor (or whatever it was called) you are extending a class which has implemented ISoundHandler. Its just a nice simple way to do it as the SoundHandlerAdaptor has default implementations you can override.
Anyway, as long as you got it working its all good
-
Have you guys tried it? the intuitive way to over-write the texture didn't work out for me
-
So you guys can't get it to work following the tutorial?
I had some trouble initially too, I think my code is basically the same as the tutorial except I didn't put a prefix on my sound files, this means I have to put my sound files in a Sounds/ folder as it assumes this for some reason.
Make a class that extends SoundHandlerAdaptor. Most important method in there is onLoadSoundSettings, in general
My onLoadSoundSettings :
@Override public void onLoadSoundSettings(SoundManager soundManager) { String[] soundFiles = { "aSound.wav", "abeep.wav", "aSuperBeep.wav" }; for (int i = 0; i < soundFiles.length; i++){ soundManager.getSoundsPool().addSound(soundFiles[i], this.getClass().getClassLoader().getResource("/" + soundFiles[i])); } }
In your mod_**** class, I simply created an instance of this soundHandler class, and then loaded it with MinecraftForge.
//With my declarations public static awesomeSoundHandler soundHandler = new awesomeSoundHandler(); // Loading with MinecraftForge public void load() { MinecraftForgeClient.registerSoundHandler(soundHandler); }
Then when testing in MCP, I put my custom sounds in the minecraft.jar Sounds/aSounds.wav for example.
And playing a sound:
world.playSoundEffect(xPos,yPos,zPos, "aSound", world.rand.nextFloat()*0.2f + 0.8f, world.rand.nextFloat() * 0.2F + 0.8F);
Those parameters are reasonably self-explanatory bar the last 2. Note the lack of ".wav" in my sound name string.
The last two paramaters are volume and pitch respectively. If you wish, a simple 1f will suffice.
I think thats everything you need to do...?
-
Is this an ok tactic? wondering if I can get all of the groovy animation functionality and just change the texture and such.
Is it worth even trying to do this or should I just build my own from BlockContainer
-
But would people actually be forced to update? Or only when the person hosting updates? If that's the case, then they wouldn't be annoyed at youas much as they would be the host. That, or what you're actually trying to say has completely gone over my head.
But I personally feel that nobody who enjoys your mod will be annoyed at you for updating things. Even if it's only slight. If they are, they're clearly not enjoying your mod enough. However, I don't see that being the case. I update pretty much every time you release one. I'm a Millénaire fan. Also, I'm going to be trying out your multiplayer beta with my girlfriend soon. We've been so looking forward to it for a long time. Please keep up the great work.
You did misunderstand him a bit
-
I folllowed that tutorial and it worked for me.
*NOTE* if you don't use a prefix for your sound files it assumes you have your sound in a "Sounds/" folder in the jar file. Thats built in to the codec thingy.
-
Yeah, Forge is the bro!
I might take a look at the UE API.
UE (http://minecraftforge.net/forum/index.php/board,50.0.html) API will only suit your mod if it uses electricity.
Yeah I saw that, guess I'll DIY
world.createExplosion called on server, but not propagating to clients.
in Modder Support
Posted
My code worked on older versions of Minecraft/Minecraftforge.. The explosion happens on the server side, and correctly propagates to clients when I am within a certain range.
But in older versions of minecraft/minecraftforge I could go extremely far away and it would still work