Blue Screen of death?

Discussion in 'Plugin Development' started by Lolmewn, Nov 16, 2011.

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

    Lolmewn

    Hmm..
    It seems this:
    Code:
    event.getBlock().setType(Material.AIR);
    crashes the client. Is that a Bukkit bug, can it be avoided, did it get fixed yet?

    Or is it me doing something wrong?

    Server is on
    Code:
    18:32:16 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-1133
    -gda4d5a1-b3jnks (MC: Beta 1.9 Prerelease 5)
    EDIT: Oh, build 3. Let me try a higher one... Nope! Also doesn't work on the latest build (58)
     
  2. Offline

    Taco

    Have you tried setTypeId(0)?
     
  3. Offline

    Lolmewn

    Just tested, same result.
     
  4. Offline

    md_5

    I do that all the time.
    Try:
    Block daBlock = event.getBlock();

    First and then set daBlock
     
  5. Offline

    Lolmewn

    That doesn't really make sense..
    I mean, in the end you're doing the same thing but with more lines of code.

    And for what it's worth, I thought it was easier to put event.getBlock() there, actually I'm using HashMaps to store blocks, and after a while get them and set them to 0.
    Code:
    BlockBreakEvent ev = new BlockBreakEvent(plugin.FBlock.get(player), player);
    			plugin.getServer().getPluginManager().callEvent(ev);
    			plugin.FBlock.get(player).setTypeId(0);
    			plugin.FBlock.get(player).getWorld().dropItem(plugin.FBlock.get(player).getLocation(), new ItemStack(Material.getMaterial(plugin.FBlock.get(player).getTypeId()), 1));
    			if (plugin.FBlock.containsKey(player))
     
  6. Offline

    md_5

    @Lolmewn But if you are running in a different thread or doing wacky concurrent access it may help.
    Where are you calling your event from and what does this plugin do?
    EDIT: Hashmaps for blocks are a no no since 1.8 Bukkit decided to destroy them.
     
  7. Offline

    Lolmewn

    This bit of code should make the block break faster (and it does), but for some reason.. well, blue screen of death.

    And if hashmaps are a no since 1.8, is there something to replace them?
     
  8. Offline

    md_5

    ArrayList

    Some bukkit dev decided destroying hashing on block would be fun.
     
  9. Offline

    Lolmewn

    Will try that.
    On a side note: This also doesn't work: player.getWorld().getBlockAt(plugin.FBlock.get(player).getLocation()).setTypeId(0);
     
  10. Offline

    md_5

    @Lolmewn
    Don't use Player as a key, use the playername as a string.
    Stack traces are nice.
     
  11. Offline

    Lolmewn

    Even if i'd change the player to the playername, it'd still crash. It only makes it somewhat easier to follow.
    Isn't there a work-around for Block.setTypeId(0) ?
    It seems to crash with WorldEdit aswell sometimes.
     
  12. Offline

    md_5

    It works for me, sounds like something is wrong with your computer.
     
  13. Offline

    Lolmewn

    Are you on the pre-release?
    Maybe it's that.
     
  14. A server plugin that causes a BSoD on the client? This can't be caused by your code, think about it:
    1. You change the block.
    2. The server sends a block change package to the client.
    3. The client receives the package.
    4. The client changes the bock like told in the package.
    5. Notch code does something horrible wrong which crashes the JVM.
    6. The JVM code does something horrible wrong which crashes windows.
    or:
    5. Notch code does something horrible wrong which
    6. Causes your graphic card driver to do something horrible wrong.
    You say WorldEdit does the same? Again a point that it's not your code.

    What exactly does the BSoD say? Are you running newest 1.6 Java? Newest driver for your graphic card?

    Linux? :D
     
  15. Offline

    md_5

    I made a plugin that did that about 2 months ago. Trust me it's you.
    Read @V10lator and his post. I follow that logic too.
     
  16. Offline

    Lolmewn

    Running Windows 7 64 Bit, Java 1.7_02 and newest drivers for Graphics Card (were needed for BF3, soo :p)

    Still, there's no logic in this. When I just fire the blockbreakevent, the event gets called but obviously the block doesn't turn to air since the client didn't really break it.
     
  17. I thought minecraft can't run with java 1.7...?
    You don't call the event with
    you call the whole procedure, so the block turns to air at the client. Enough logic?

    The question still is: What exactly does the BSoD tell?

    Are you trolling? :confused:
     
  18. Offline

    Lolmewn

    I'm not calling the event with that. See post #5.

    The BSoD doesn't tell me anything. First, it turns blue. Then for a split second it gives me the usual minecraft error screen, then gives me a black screen with nothing on it.
    I thought there was an error file somewhere, but I can't seem to find it (will look some better when back home).

    And no, I'm not trolling. Just trying to find out if there's a fix for this.

    Also, Java 7 (aka Java 1.7) works just fine with Minecraft. Why wouldn't it?
     
  19. Why did you tell it in your first post then? whenever you call setType() on a block it sends it to the client...
    So the Minecraft windows turns blue, not the whole screen? Please download the Minecraft jar version and start it from cmd. This will give you more output.
    Cause liblwjgl isn't compatible with Java 1.7. Just tested:
    Code:
    Exception in thread "Minecraft main thread" java.lang.UnsatisfiedLinkError: /usr/lib64/lwjgl-2.7/liblwjgl64.so: libjawt.so: Kann die Shared-Object-Datei nicht öffnen: Datei oder Verzeichnis nicht gefunden
    	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1928)
    	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
    	at java.lang.Runtime.load0(Runtime.java:792)
    	at java.lang.System.load(System.java:1059)
    	at org.lwjgl.Sys$1.run(Sys.java:70)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
    	at org.lwjgl.Sys.loadLibrary(Sys.java:82)
    	at org.lwjgl.Sys.<clinit>(Sys.java:99)
    	at org.lwjgl.opengl.Display.<clinit>(Display.java:130)
    	at net.minecraft.client.Minecraft.a(SourceFile:183)
    	at net.minecraft.client.Minecraft.run(SourceFile:629)
    	at java.lang.Thread.run(Thread.java:722)
     
  20. Offline

    Lolmewn

    The Minecraft screen turns blue, yes. Was I unclear in that point? Sorry if I was.

    And lwjgl.. I don't know, I'm not getting that error.
    Will start MC from cmd when I get back home though (That should give me a stacktrace, right?)
     
  21. np. :)
    And you're sure you start minecraft with java 1.7? Strage... Maybe the exe version has a own Java on-board?
    Right, like the one from my lwjgl fail. :)
     
  22. Offline

    Ahniolator

    I know for a fact that I'm running Minecraft and my Minecraft server on Java 1.7. I followed the process to the file location for both the client and the server and both are coming from the jdk1.7 directory
     
  23. Offline

    Lolmewn

    Njiegh! When doing java -jar minecraft.jar , it sais it can't find the main atribute.

    Oh, and I just checked, no crash files in the folder where my minecraft.exe is.
     
  24. Offline

    mindless728

    are you trying to start the minecraft.jar in the bin folder, if so that is not how it is done

    go to minecraft.net and get the Minecraft.jar for linux (its actually the launcher as a jar) and use that

    I also have minecraft (both server and client) working in java 7 and vista, win 7, and win 8
     
  25. What main atribute? Stacktrace?
     
  26. Offline

    halley

    $ java -jar NameOfAJar.jar

    This is going to need a "main class" (a public class with a public static main() method), and a Manifest file that explains which class is the public class.

    I think the launcher version of minecraft.jar has this set up, while the non-launcher version of minecraft.jar is just a library used by a separate launcher program (.exe or .app) and is missing that feature.
     
  27. Offline

    Lolmewn

    I remember a how-to somewhere.. Hmm.. *trying to find it*
     
  28. Offline

    nisovin

    The hash issue was fixed as of build 1345.
     
  29. Offline

    Lolmewn

    From what build did 1.9_pre-5 come?
     
  30. Offline

    md_5

    Never noticed :)
    Separate branch, not sure from when it was forked.
     
Thread Status:
Not open for further replies.

Share This Page