Solved Weird minecraft crash from my plugin

Discussion in 'Plugin Development' started by OneBillionAndOne, Nov 12, 2013.

Thread Status:
Not open for further replies.
  1. So, my plugin, wmd, im working on a new type of destruction. Basically it creates somewhat of an explosion with blocks from the targeted area flying everywhere. But, every now and then (actually quite often) when im testing it, the game crashes and gives me this error:
    Code:
    ---- Minecraft Crash Report ----
    // Don't be sad. I'll do better next time, I promise!
     
    Time: 11/12/13 7:18 PM
    Description: Rendering entity in world
     
    java.lang.NullPointerException
        at bgo.a(SourceFile:44)
        at bgo.a(SourceFile:16)
        at bgl.a(SourceFile:204)
        at bgl.a(SourceFile:184)
        at bfl.a(SourceFile:326)
        at bfe.a(SourceFile:845)
        at bfe.b(SourceFile:695)
        at atv.S(SourceFile:686)
        at atv.d(SourceFile:619)
        at net.minecraft.client.main.Main.main(SourceFile:101)
     
     
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
     
    -- Head --
    Stacktrace:
        at bgo.a(SourceFile:44)
        at bgo.a(SourceFile:16)
     
    -- Entity being rendered --
    Details:
        Entity Type: FallingSand (sr)
        Entity ID: 1422
        Entity Name: Falling Block
        Entity's Exact location: -317.50, 4.50, 1262.50
        Entity's Block location: World: (-318,4,1262), Chunk: (at 2,0,14 in -20,78; contains blocks -320,0,1248 to -305,255,1263), Region: (-1,2; contains chunks -32,64 to -1,95, blocks -512,0,1024 to -1,255,1535)
        Entity's Momentum: 0.00, 0.00, 0.00
        Immitating block ID: 0
        Immitating block data: 0
     
    -- Renderer details --
    Details:
        Assigned renderer: bgo@332c70b4
        Location: -8.97,-1.12,-10.08 - World: (-9,-2,-11), Chunk: (at 7,-1,5 in -1,-1; contains blocks -16,0,-16 to -1,255,-1), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
        Rotation: 0.0
        Delta: 0.96587074
    Stacktrace:
        at bgl.a(SourceFile:204)
        at bgl.a(SourceFile:184)
        at bfl.a(SourceFile:326)
        at bfe.a(SourceFile:845)
     
    -- Affected level --
    Details:
        Level name: MpServer
        All players: 1 total; [bdi['firework4lj'/346, l='MpServer', x=-308.53, y=5.62, z=1272.58]]
        Chunk stats: MultiplayerChunkCache: 441
        Level seed: 0
        Level generator: ID 01 - flat, ver 0. Features enabled: false
        Level generator options:
        Level spawn location: World: (-338,4,1245), Chunk: (at 14,0,13 in -22,77; contains blocks -352,0,1232 to -337,255,1247), Region: (-1,2; contains chunks -32,64 to -1,95, blocks -512,0,1024 to -1,255,1535)
        Level time: 36323540 game time, 39129734 day time
        Level dimension: 0
        Level storage version: 0x00000 - Unknown?
        Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
        Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false
        Forced entities: 396 total; [bdi['firework4lj'/346, l='MpServer', x=-308.53, y=5.62, z=1272.58], tr['Skeleton'/30, l='MpServer', x=-370.44, y=4.00, z=1199.09], tf['Creeper'/34, l='MpServer', x=-370.41, y=4.00, z=1233.97], sr['Falling Block'/1134, l='MpServer', x=-310.50, y=8.12, z=1260.73], tr['Skeleton'/35, l='MpServer', x=-369.50, y=4.00, z=1262.50], sr['Falling Block'/1135, l='MpServer', x=-320.02, y=13.45, z=1264.50], tw['Zombie'/32, l='MpServer', x=-370.50, y=4.00, z=1222.25], tw['Zombie'/33, l='MpServer', x=-369.50, y=4.00, z=1228.97], sr['Falling Block'/1133, l='MpServer', x=-309.49, y=8.11, z=1265.78], tf['Creeper'/38, l='MpServer', x=-372.50, y=8.00, z=1282.50], sr['Falling Block'/1130, l='MpServer', x=-310.50, y=13.67, z=1268.50], sr['Falling Block'/1131, l='MpServer', x=-310.50, y=13.17, z=1266.33], tw['Zombie'/36, l='MpServer', x=-370.50, y=5.00, z=1282.50], tr['Skeleton'/37, l='MpServer', x=-371.50, y=5.00, z=1281.50], sr['Falling Block'/1125, l='MpServer', x=-310.50, y=8.85, z=1260.20], sr['Falling Block'/1123, l='MpServer', x=-309.49, y=1.49, z=1261.51], tw['Zombie'/50, l='MpServer', x=-362.06, y=4.00, z=1278.50], sr['Falling Block'/1150, l='MpServer', x=-320.32, y=14.41, z=1266.43], tf['Creeper'/49, l='MpServer', x=-356.75, y=4.00, z=1278.31], tf['Creeper'/48, l='MpServer', x=-362.03, y=4.00, z=1279.50], ry['Pig'/59, l='MpServer', x=-350.53, y=18.00, z=1236.34], ss['item.tile.dirt'/58, l='MpServer', x=-338.56, y=4.13, z=1246.34], sr['Falling Block'/1141, l='MpServer', x=-310.51, y=9.80, z=1260.97], tr['Skeleton'/63, l='MpServer', x=-340.13, y=4.00, z=1279.53], 
        Retry entities: 0 total; []
        Server brand: craftbukkit
        Server type: Non-integrated multiplayer server
    Stacktrace:
        at bdd.a(SourceFile:284)
        at atv.b(SourceFile:1761)
        at atv.d(SourceFile:628)
        at net.minecraft.client.main.Main.main(SourceFile:101)
     
    -- System Details --
    Details:
        Minecraft Version: 1.6.4
        Operating System: Windows 7 (amd64) version 6.1
        Java Version: 1.7.0_25, Oracle Corporation
        Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
        Memory: 278157328 bytes (265 MB) / 372113408 bytes (354 MB) up to 1908932608 bytes (1820 MB)
        JVM Flags: 2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx2G
        AABB Pool Size: 23705 (1327480 bytes; 1 MB) allocated, 1977 (110712 bytes; 0 MB) used
        Suspicious classes: No suspicious classes found.
        IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
        Launched Version: 1.6.4
        LWJGL: 2.9.0
        OpenGL: Intel(R) HD Graphics 3000 GL version 3.1.0 - Build 9.17.10.3062, Intel
        Is Modded: Probably not. Jar signature remains and client brand is untouched.
        Type: Client (map_client.txt)
        Resource Pack: Default
        Current Language: English (US)
        Profiler Position: N/A (disabled)
        Vec3 Pool Size: 1927 (107912 bytes; 0 MB) allocated, 245 (13720 bytes; 0 MB) used
    So, yea. Its confusing me and i cannot release an updated version of my plugin until that is fixed.
    Also i took out some entity info in the crash cause it was too big of a post :p So, here is my code for my block explosion... thing... lol:
    Code:java
    1. package org.gmail.firework4lj;
    2.  
    3. import org.bukkit.Location;
    4. import org.bukkit.Material;
    5. import org.bukkit.entity.Player;
    6. import org.bukkit.event.EventHandler;
    7. import org.bukkit.event.Listener;
    8. import org.bukkit.event.block.Action;
    9. import org.bukkit.event.player.PlayerInteractEvent;
    10. import org.bukkit.util.Vector;
    11.  
    12. public class Gravitygun implements Listener{
    13.  
    14. private OrbitalStrike ostrike;
    15. public Gravitygun(OrbitalStrike orbitalStrike) {
    16. this.ostrike= orbitalStrike;
    17. }
    18.  
    19. @EventHandler
    20. public void onShoot(PlayerInteractEvent e){
    21. Player p = e.getPlayer();
    22. if(e.getAction().equals(Action.RIGHT_CLICK_AIR)){
    23. for(int x=p.getTargetBlock(null, 200).getLocation().getBlockX()-3;x<p.getTargetBlock(null, 200).getLocation().getBlockX()+6;x++){
    24. for(int y=p.getTargetBlock(null, 200).getLocation().getBlockY()-3;y<p.getTargetBlock(null, 200).getLocation().getBlockY()+6;y++){
    25. for(int z=p.getTargetBlock(null, 200).getLocation().getBlockZ()-3;z<p.getTargetBlock(null, 200).getLocation().getBlockZ()+6;z++){
    26. if(y > 0 && y <= 256){
    27. Location location = new Location(p.getWorld(),x,y,z);
    28. location.getWorld().spawnFallingBlock(location, location.getBlock().getType(), (byte) 0).setVelocity(new Vector(Math.random()*(2-(-2))+-2, Math.random()*(2-(-2))+-2, Math.random()*(2-(-2))+-2));
    29. location.getBlock().setType(Material.AIR);
    30. }
    31. }
    32. }
    33. }
    34. }
    35. }
    36. }
    37.  

    Any help from this would be much appreciated :)
     
  2. Offline

    qhenckel

    It's minecraft crashing from a rendering error. No idea how to fix it. but... thats all I got. interesting problem though.
     
  3. Offline

    The_Doctor_123

    I think it's crashing because of falling air blocks. You should check if the block is air before spawning the FallingBlock.
     
  4. I will try that...
     
  5. OneBillionAndOne Falling air + a too high vector will cause the client to crash. (I had the same when I was creating a wasted-like explosion system, I fixed it by lowering the vector)
     
  6. CaptainBern I do have math.random() for the vector amounts but I've given it parameters so it doesent go to high. But the falling air definitely makes sense. When I get home I will try doing that. Thanks for all the help everyone!
     
  7. Offline

    MrSparkzz

    THE SKY IS FALLING! D:
     
  8. Offline

    The_Doctor_123

    MrSparkzz
    Yeah, for some reason, Minecraft doesn't support that. J:
     
    MrSparkzz likes this.
  9. Alright, checking if its an air block seems to have fixed it. although it still crashes when i click to fast, ill just add in a delay. Thanks for the help everyone!
     
Thread Status:
Not open for further replies.

Share This Page