Bugs

Discussion in 'Plugin Development' started by mkezar, Nov 16, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    mkezar

    Hi. I am working on a particle cape plugin. When you type the command, it spawns these particles behind your back in a cape shape. Ive been using slikeys particle guide
    Code:java
    1. package plugins.mkezar;
    2.  
    3. import org.bukkit.Location;
    4. import org.bukkit.entity.Entity;
    5. import de.slikey.effectlib.EffectManager;
    6. import de.slikey.effectlib.EffectType;
    7. import de.slikey.effectlib.effect.EntityEffect;
    8. import de.slikey.effectlib.particle.ParticlePacket.ParticleType;
    9. import de.slikey.effectlib.util.RandomUtils;
    10.  
    11. public class FlameEntityEffect extends EntityEffect {
    12.  
    13. public FlameEntityEffect(EffectManager effectManager, Entity entity) {
    14. super(effectManager, entity);
    15. type = EffectType.REPEATING;
    16. period = 1;
    17. iterations = 600;
    18. }
    19.  
    20. @Override
    21. public void onRun() {
    22. // Create 10 particles per iteration
    23. for (int i = 0; i < 10; i++) {
    24. // Location of effect
    25. Location location = entity.getLocation();
    26. // Randomize the location within a circle from 0 to 0.6 radius
    27. location.add(RandomUtil.getRandomCircleVector().multiply(RandomUtil.random.nextDouble() * 0.6d));
    28. // Randomize height
    29. location.add(0, RandomUtil.random.nextFloat() * 2, 0);
    30. // Create packet, to send to the player
    31. PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(ParticleType.FLAME.getParticleName(), (float) location.getX(), (float) location.getY(), (float) location.getZ(), 0, 0, 0, 0, 0);
    32. // Sends the effect to every player within "visibleRadiusSquared" radius
    33. sendPacket(packet, location, visibleRadiusSquared);
    34. }
    35. }


    And i get a lot of bugs. like at PacketPlayOutWorldParticles and a lot of RandomUtil telling me to change to RandomUtils. Plz Help! :D Thanks <3
     
  2. Offline

    Skionz

    Then change it to RandomUtils? If your getting syntax errors your IDE should tell you exactly whats wrong. You have to import classes or you will get an error.
     
  3. Offline

    mkezar

    so i replaced it with RandomUtils and if i do import net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles; it makes other things not work. heres just an overall view of whats happening:

    #mce_temp_url#
     
  4. Offline

    Skionz

    mkezar You have to import every class your using lol and what is visibleRadiusSquared? I don't see you declaring it anywhere
     
  5. Offline

    mkezar

  6. Offline

    Skionz

    mkezar Did you just expect the compiler to read your mind and magically know what visibleRadiusSquared equals?
    First off you should probably go back to basic java before touching an API. Secondly you have to initialize visibleRadiusSquared before using it anywhere.
     
Thread Status:
Not open for further replies.

Share This Page