Jump to content

Player131

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by Player131

  1. So, i got an error from my IDE when trying to use SimpleNetworkWrapper... My Packet Registry class : package net.yuri6037.AncientAddinMod.packet; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.relauncher.Side; public class PacketManager { public static final SimpleNetworkWrapper networkSystem; static { networkSystem = NetworkRegistry.INSTANCE.newSimpleChannel("AncientAddinMod"); networkSystem.registerMessage(MessageHeavyArmorJet.class, MessageHeavyArmorJet.class, 0, Side.CLIENT); } } My packet code package net.yuri6037.AncientAddinMod.packet; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import io.netty.buffer.ByteBuf; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; public class MessageHeavyArmorJet implements IMessage, IMessageHandler { public MessageHeavyArmorJet(){} public void fromBytes(ByteBuf buf) { } public void toBytes(ByteBuf buf) { } public IMessage onMessage(IMessage message, MessageContext ctx) { ctx.getServerHandler().playerEntity.motionY += 0.1D; ctx.getServerHandler().playerEntity.addPotionEffect(new PotionEffect(Potion.moveSpeed.getId(), 20, 5)); return null; } } This packet is normaly used to activate speed effect when you're actioning your jets on my "Future" armor... The crash from my IDE : H:\Dev_MC1.7.10\IntelliJdevWorkspace\build\sources\java\net\yuri6037\AncientAddinMod\packet\PacketManager.java:13: cannot find symbol symbol : method registerMessage(java.lang.Class<net.yuri6037.AncientAddinMod.packet.MessageHeavyArmorJet>,java.lang.Class<net.yuri6037.AncientAddinMod.packet.MessageHeavyArmorJet>,int,cpw.mods.fml.relauncher.Side) location: class cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper networkSystem.registerMessage(MessageHeavyArmorJet.class, MessageHeavyArmorJet.class, 0, Side.CLIENT); ^ Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error Thanks by advance
  2. Oh ok, i didn't know that... In all cases the method wasn't working.
  3. I don't know it's just that when you use the method EntityRegistry.findGlobalUniqueEntityId() it's giving same entity ids for each entity i'm trying to add, so i managed the class on previous post to make the registration system to work.
  4. Hello, So i'm trying to make a "future" armor that allow you to fly, but the problem is that i can't add particles effects to right position. Indead i want them to spawn under each player foots, but unable to find correct positions... The code is called each ticks when a player is wearing the complete armor (Helmet, Body, Legs, Boots) //Spawning jet particles if (!player.onGround) { double x = (player.posX + 0.5); double y = player.posY - 1.5; double z = (player.posZ + 0.5); double x1 = player.motionX; double z1 = player.motionZ; for (int i = 0; i < 10; i++) { world.spawnParticle("smoke", x, y, z, x1, -0.1D, z1); } } Thanks by advance.
  5. I know the problem, i already get that when added the EntityAncientRayon after the EntityDrone. Indead, the two entities where using exactly the same EntityID, this is a Forge bug i think, so i found a way, using a custom registration function to register Entities with different ID each. /** * Made by Yuri6037 */ public class EntityList { private static int usingID = 128; private static void registerEntity(String id, Class<? extends Entity> entityClass){ EntityRegistry.registerModEntity(entityClass, "modid." + id, usingID, ModMainClass.modInstance, 10, 1, true); usingID++; } static { registerEntity("YourEntityID(String one)", YourEntityClass.class); } } Be sure to do new EntityList() in your main mod class, in the init function.
  6. Oh !! Thank you so much i didn't think of that !! I'll try to do it, after i arrive to make GitHub Working correctly ! When my GitHub app will be back, the mod source code will be available here : https://github.com/Yuri6037/AncientAddinMod EDIT : GitHub repo complete ! Everyone can view source code now ! The project is free and opensource !
  7. I don't even know myself. Maybe because when i made this entity i had the idea of destroying water blocks. But i think i'll remove this ability, and create another weapon that will generate a laser to fire everything, then it will remove blocks of water until you change the direction of the laser. But for the moment i'm not realy sure how i can make a laser to render. I think it will need some advanced stuff using GL11.glVertex3f or using Mojang's Tesselator. If you have any idea to solve the original problem, removing water blocks whith explosion, then post here, i'll be happy to include it in my code !
  8. Because when I designed my entity, I'd liked to get it destroying water block in plus of standard blocks.
  9. Ok but that's also defigning the bug as "can't be solved", isn't it ? Anyway, i made a workaround : instead of exploding my EntityDrone whe it hits the ocean, i made it traveling under water by removing blocks of water ! It looks prety good at my eyes ! I'll try to make a video ; i'm sure i can using my NVIDIA GeForce Experience Software. I'll post it here soon. EDIT : Here is the video i just made EDIT 2 : I'll upload source code on GitHub when I'll solve Intellij's problem !
  10. Have you any idea to solve the problem ? Because normaly, the two source block think should work only if there's 1 layer of water, but it's realy strange ! Because sometimes, the entity is completely working destroying water, it's just on oceans that the bug is happening...
  11. Hi all, I need help to finish my EntityDrone... Indead, i'm trying to make a drone that is able to destroy blocks as well as water ! The problem is that sometimes on oceans, it works, water dissapear, but 1 second after, the game began to re-add water blocks at their original place ! Here is my code (i gave you the complete onImpact function witch gets called everytime entity hit something) /** * Called when this EntityDrone hits a block or entity. */ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { if (!this.worldObj.isRemote) { if (par1MovingObjectPosition != null && par1MovingObjectPosition.entityHit != null) { par1MovingObjectPosition.entityHit.attackEntityFrom(new DamageSource("AncientDamage"), 99F); } this.worldObj.newExplosion(null, this.posX, this.posY, this.posZ, 2.0F, true, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); this.worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ, Blocks.flowing_lava); List l = worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX - 3, this.motionY - 3, this.motionZ - 3).expand(3.0D, 3.0D, 3.0D)); for (Object e : l){ if (e instanceof EntityItem){ ((EntityItem) e).setDead(); } else if (e instanceof EntityPlayer){ ((EntityPlayer) e).attackEntityFrom(new EntityDamageSourceIndirect("AncientDamage", this, shootingEntity), 99F); } } for (int x = (int) (posX - 3) ; x < posX + 3 ; x++){ for (int z = (int) (posZ - 3); z < posZ + 3 ; z++){ for (int y = (int) (posY - 3); y < posY + 3 ; y++){ Block b = worldObj.getBlock(x, y, z); Block b1 = worldObj.getBlock(x, y - 1, z); if (b != Blocks.air && b == Blocks.bedrock) { worldObj.removeTileEntity(x, y, z); worldObj.setBlock(x, y, z, Blocks.air); } else if (b == Blocks.air && b1 != Blocks.air){ worldObj.removeTileEntity(x, y, z); worldObj.setBlock(x, y, z, Blocks.fire); } else if (b != Blocks.air && b == Blocks.water){ worldObj.removeTileEntity(x, y, z); worldObj.setBlock(x, y, z, Blocks.air); } else if (b != Blocks.air && b == Blocks.flowing_water){ worldObj.removeTileEntity(x, y, z); worldObj.setBlock(x, y, z, Blocks.air); } } } } this.setDead(); } } Thanks by advance
×
×
  • Create New...

Important Information

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