Jump to content

toss

Members
  • Posts

    24
  • Joined

  • Last visited

Posts posted by toss

  1. Hey guys,

     

    i'm updating my mod (Magic Crusade), and im looking for developpers to work with me

     

    im seeking passionnate people; who know how to works properly and safely. I really want the mod to be the most stable as possible, with the same content as it use to have.

    However, if the updating goes well, we could also add some extra content to it

    We will probably work on a git repository, so merging will be easier. It would be great if you know how to use it, however i can spend 30 minutes on skype, teamspeak or whatever, to teach you how to use it

     

    Actually:

    The main system is made; so loading blocks, items, spells, classes, achievements; or whatever, and make it compatible multiplayer is really simple

    (spell example: https://github.com/toss-dev/Magic_Crusade_1_8/blob/master/main/java/fr/toss/magiccrusade/common/classes/spell/champion/SpellShockwave.java)

     

    Thank you; send me your skype / teamspeak / mail in private message if you are interested  (in comment or p.m), and with your experience in programming

     

    PS: Sorry, my english isnt really good, I hope that wasnt too fuzzy

     

    EDIT: the repo: https://github.com/toss-dev/Magic_Crusade_1_8.git

  2. Hey, i know you must have much work with 1.8 updates, but i have a small suggestion to make

     

    Do you think adding a "Explosion" event would be possible? It would be useful because actually i can't handle the wither skull or firebal griefing

     

    In the World class:

        /**
         * returns a new explosion. Does initiation (at time of writing Explosion is not finished)
         */
        public Explosion newExplosion(Entity entity, double x, double y, double z, float power, boolean isFlaming, boolean griefing_world)
        {
            Explosion explosion = new Explosion(this, entity, x, y, z, flame);
    
            MinecraftForge.EVENT_BUS.post(new WorldEvent.Explosion(explosion )); // Thing like this
    
    
            explosion.isFlaming = flame;
            explosion.isSmoking = griefing_world;
            explosion.doExplosionA();
            explosion.doExplosionB(true);
            return explosion;
        }
    

  3. Hey guys, mod update (same download link) + editing the main topic

     

    - Adding a new dungeon system (portal are generated in worlds, only 2 dungeons for now) Only players in the same group can play in a Dungeon

    - Adding 2 new musics, which are played in the new dimension

    - Adding sound for mobs which didn't have before

    - Adding message system, which show on game screen when an update is available

    - Fixing some crash issues

    - Adding commands: /level [uSERNAME] [LEVEL] et /uhc (ultra hardcore event manager)

     

    More dungeons will be added in the future (for Arkavon asap)

     

    Orc dungeon was made by Gelbar, and the Graveyard was taken from:

    http://www.minecraft-schematics.com/

     

    As this is a quite huge update, please, report buuuugs! Thx

     

    Screens:

     

     

    1411584853-2014-09-24-20-51-37.png

    1411584864-2014-09-24-20-52-06.png

     

     

     

     

     

     

     

  4. Hey, i would like to play a background music on my mod

     

    It works great with these following method:

    this.mc.thePlayer.playSound("magiccrusade:luan_hong", 1, 1);
    ...
    this.mc.theWorld.playSound(...)
    this.mc.theWorld.playSoundAtEntity(...)
    ...
    

     

    ... but the sound is play only at the given location, and not "in background"

    I don't find how to play "in background" (just like minecraft vanilla musics), does anyone has a solution?

     

    I've also searched on LWJGL library but i can't make it work

     

    Thank you (i hope my english wasn't too bad)

  5. @diesieben07 i'm sorry but i think you didn't understand what DannieXD asked, he would like to know if the current game screen is the main menu, SoundEvents have nothing to do with this

     

    And i think (i didn't verify every events yet), that there's no event which are called as long as the user didn't join a world

    EDIT: That's why i'm purposing this hardcodded solution

     

    (I hope my english wasn't too bad ^^" )

  6. Create a new thread when your mod is loading (init function for example)

     

    You can code a thing like this (sry i can't try it now):

     

    void run() //Make a thread that run as long as the player didn't join the GuiMainMenu or exit the game
    {
         while (Minecraft.getMinecraft() != null && !(Minecraft.getMinecraft().currentScreen instanceof GuiMainMenu))
        {
              try {
                   Thread.sleep(100);
              } catch (Exception e) { }
        }
         if (Minecraft.getMinecraft() != null)
               (new My_Shound()).play;
    }
    

     

    That's kinda hardcodded but i can't see any other way

  7. public Item[] armor = new Item[4];
    
    
    public void updateArmor()
    {
    	 for (int i = 0; i < 4; i++)
    	 {
    		 ItemStack is = this.player.inventory.armorInventory[i];
    		 if (is != null)
    		 {
    			 Item item = is.getItem();
    			 if (item != this.armor[i])
    			 {
    				 if (item instanceof ItemArmorM)
    				 {
                                                      //the player equipped my item
    				 }
    				 this.armor[i] = item;
    			 }	 
    		 }
    		 else if (is == null && this.armor[i] != null)
    		 {
    			 if (this.armor[i] instanceof ItemArmorM)
    			 {
                                            //The player unequipped my item
    			 }
    			 this.armor[i] = null;
    		 }
    	 }		
    }
    

     

    I never said this code was hard to made...

     

    I'm just suggesting to create this event, which would necessarily improve game performance

     

    EDIT: i mean, if a player install 10 armor mods, it is non sense checking this 10 differents times :(

  8. Hey I was thinking that it could be great if forge can handle these 2 events

     

    They would be called when a slot from the player inventory or armor inventory changed

     

    Because actually, the only way I found to check armor changes is to check the player stuff every tick, which is quite hardcodded

     

    (I hope my English wasn't too awful)

  9. Yep that's what I meant, I guess forge should handle it

     

    As a result, I created a new thread which will allow me to check this without adding too much code into the main game loop and make it laggy

     

    It basically registers the player stuff into variables, and then I compare it every half-seconds with the current player stuff and apply modification if there was changes, it works great but kinda hardcodded

     

    (I meant, 10 or 20 conditions multiply by 100 players online, 20 times par seconds (ticks) would probably make the server slower)

  10. Hey, i would like to know if minecraft forge has an event which is called when the Player equips an ItemArmor

     

    I can't find it... and i don't really want to hardcode conditions into the tick update function

     

    Can anyone tell me if there's an alternative event, or anything which could allow me to check an item when it is equipped?

     

    Thank you

  11. Hey guys, i just followed the tutorial based on Packet handling with netty, but i'm having a problem.

     

    I copy / pasted PacketPipeline / AbstactPacket (and modified it properly i guess)

     

    So i created a Packet to send an int to the player when it joins the game:

    package fr.toss.network.packet;
    
    import io.netty.buffer.ByteBuf;
    import io.netty.channel.ChannelHandlerContext;
    import net.minecraft.entity.player.EntityPlayer;
    
    public class PacketLogIn extends AbstractPacket {
    
    public int id;
    
    public PacketLogIn(int p_id)
    {
    	this.id = p_id;
    }
    
    @Override
    public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) 
    {
    	buffer.writeInt(this.id);
    }
    
    @Override
    public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) 
    {
    	this.id = buffer.readInt();
    }
    
    @Override
    public void handleClientSide(EntityPlayer player) 
    {
    	System.out.println("Client");
    }
    
    @Override
    public void handleServerSide(EntityPlayer player)
    {
    	System.out.println("Server");
    }
    
    }
    

     

    + The join event:

    	
    @SubscribeEvent
        public void onPlayerLog(PlayerEvent.PlayerLoggedInEvent event)
        {
    	System.out.println("PLAYER LOG");
    	Main.packetPipeline.sendToServer(new PacketLogIn(1));
        }
    

     

    Main class:

        @EventHandler
        public void initialise(FMLPostInitializationEvent evt) 
        {
            packetPipeline.initialise();
        }
    
        @EventHandler
        public void postInitialise(FMLPostInitializationEvent evt) 
        {
            packetPipeline.postInitialise();
            packetPipeline.registerPacket(PacketLogIn.class);
        }
    

     

    So when a player join the game, the only message appearing in the console is: "PLAYER LOG"

    Which mean nor handleClientSide() or handleServerSide() is called...

     

    Thanks you :)

     

  12. Hi everyone, i'm porting my vanilla mod to forge, and i'm having a problem...

     

    With Vanilla, i register a new ParticleFX in the "RenderGlobal" class and i use the method:

    String particle = "myParticle";
    this.worldObj.spawnParticle(particle, this.posX, this.posY, this.posZ,a,-b,c);
    

     

    Everything works fine.

     

    With forge, i use this way (without modifying RenderGlobal.java then):

     

            
    EntityFX particle = new EntitySpellFXDamage(w, player.posX, player.posY, player.posZ,a,-b,c);
    FMLClientHandler.instance().getClient().effectRenderer.addEffect(particle);
    

     

    With forge, my game crash when i spawn this particles and i have a NullPointer error on :

    moveEntity(motionX, motionY, motionZ);

    (inside my EntitySpellFXDamage class)

     

    Here's my class:

    package MagicCrusade.particles;
    
    import java.util.List;
    
    import net.minecraft.client.particle.EntityFX;
    import net.minecraft.client.renderer.Tessellator;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.passive.EntityWolf;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.server.MinecraftServer;
    import net.minecraft.world.World;
    
    
    public class EntitySpellFXDamage extends EntityFX
    {
        float smokeParticleScale;
    
        public EntitySpellFXDamage(World par1World, double par2, double par4, double par6, double par8, double par10, double par12)
        {
            this(par1World, par2, par4, par6, par8, par10, par12, 1.0F);
        }
    
        public EntitySpellFXDamage(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14)
        {
            super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D);
            motionX *= 0.10000000149011612D;
            motionY *= 0.10000000149011612D;
            motionZ *= 0.10000000149011612D;
            motionX += par8;
            motionY += par10;
            motionZ += par12;
            particleRed = particleGreen = particleBlue = /*(float)(Math.random() * 0.30000001192092896D)*/0;
            particleRed = 255;
            particleGreen = (float)Math.random();
            particleScale *= 0.75F;
            particleScale *= par14;
            smokeParticleScale = particleScale;
            particleMaxAge = (int)(8D / (Math.random() * 0.80000000000000004D + 0.20000000000000001D));
            particleMaxAge *= par14;
            noClip = false;
        }
    
        public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
        {
            float f = (((float)particleAge + par2) / (float)particleMaxAge) * 32F;
    
            if (f < 0.0F)
            {
                f = 0.0F;
            }
    
            if (f > 1.0F)
            {
                f = 1.0F;
            }
    
            particleScale = smokeParticleScale * f;
            super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
        }
    
        /**
         * Called to update the entity's position/logic.
         */
        public void onUpdate()
        {
            prevPosX = posX;
            prevPosY = posY;
            prevPosZ = posZ;
    
            if (particleAge++ >= particleMaxAge)
            {
                setDead();
            }
    
            setParticleTextureIndex(7 - (particleAge *  / particleMaxAge);
            //motionY += 0.0040000000000000001D;
            
    
            moveEntity(motionX, motionY, motionZ);
    
            if (posY == prevPosY)
            {
                motionX *= 1.1000000000000001D;
                motionZ *= 1.1000000000000001D;
            }
    
            motionX *= 0.95999997854232788D;
            motionY *= 0.95999997854232788D;
            motionZ *= 0.95999997854232788D;
    
            if (onGround)
            {
                motionX *= 0.69999998807907104D;
                motionZ *= 0.69999998807907104D;
            }
            
            List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.expand(0.25D, 1.0D, 0.25D));
    
            if (list != null)
            {
                for (int i = 0; i < list.size(); i++)
                {
                    Entity entity = (Entity)list.get(i);
    
                    if (!entity.isDead)
                    {
                 	   if(entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer))
                 	   {
                 		  entity.setFire(4);
                 		  this.setDead();
                 	   }
    
                    }
                }
            }
        }
    }
    
    

     

     

     

    Thank for help! Maybe i have to register particles somewhere on thing like this... ?

     

×
×
  • Create New...

Important Information

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