Jump to content

nado

Members
  • Posts

    39
  • Joined

  • Last visited

Posts posted by nado

  1. its your code, because my world.createExplosions works very well, in the client and server, also im not using any kinda of packets or these network stuff.

     

    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

  2. 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?

     

  3. 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 :D

  4. 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.

  5. 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.

  6. 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 :P

  7. 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! xD

  8.  

    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..

  9. 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. :D

     

    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 :D

  10. 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.

  11. 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

  12. 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...?

     

  13. 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. :D 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 :P

  14. 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.

×
×
  • Create New...

Important Information

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