[CraftBukkit - NOT SPIGOT THIS TIME] My Client Keeps On Crashing

Discussion in 'Plugin Development' started by BungeeTheCookie, Jun 7, 2014.

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

    BungeeTheCookie

    Alright Iroh I have switched to CraftBukkit and it still does not work. The error is even harder to understand, but atleast it is CraftBukkit - sorry about posting a thread about Spigot.
    Same code as the last thread.
    PHP:
    [11:56:14 INFO]: Client> [11:56:14] [Client thread/FATAL]: Reported exception thrown!
    [
    11:56:14 INFO]: ClientsTicking screen
    [11:56:14 INFO]: Client>    at ban.p(SourceFile:1353) ~[1.7.9.jar:?]
    [
    11:56:14 INFO]: Client>    at ban.ak(SourceFile:774) ~[1.7.9.jar:?]
    [
    11:56:14 INFO]: Client>    at ban.f(SourceFile:728) [1.7.9.jar:?]
    [
    11:56:14 INFO]: Client>    at net.minecraft.client.main.Main.main(SourceFile:148) [1.7.9.jar:?]
    [
    11:56:14 INFO]: ClientCaused byjava.lang.NullPointerException
    [11:56:14 INFO]: Client>    at bln.a(SourceFile:508) ~[1.7.9.jar:?]
    [
    11:56:14 INFO]: Client>    at fz.a(SourceFile:97) ~[1.7.9.jar:?]
    [
    11:56:14 INFO]: Client>    at fz.a(SourceFile:15) ~[1.7.9.jar:?]
    [
    11:56:14 INFO]: Client>    at ej.a(SourceFile:174) ~[1.7.9.jar:?]
    [
    11:56:14 INFO]: Client>    at bct.c(SourceFile:78) ~[1.7.9.jar:?]
    [
    11:56:14 INFO]: Client>    at ban.p(SourceFile:1343) ~[1.7.9.jar:?]
    [
    11:56:14 INFO]: Client>    ... 3 more
    [11:56:14 INFO]: Client> ---- Minecraft Crash Report ----
    [
    11:56:14 INFO]: Client// Shall we play a game?
    [11:56:14 INFO]: Client>
    [
    11:56:14 INFO]: ClientTime6/7/14 11:56 AM
    [11:56:14 INFO]: ClientDescriptionTicking screen
    [11:56:14 INFO]: Client>
    [
    11:56:14 INFO]: Clientjava.lang.NullPointerExceptionTicking screen
    [11:56:14 INFO]: Client>    at bln.a(SourceFile:508)
    [
    11:56:14 INFO]: Client>    at fz.a(SourceFile:97)
    [
    11:56:14 INFO]: Client>    at fz.a(SourceFile:15)
    [
    11:56:14 INFO]: Client>    at ej.a(SourceFile:174)
    [
    11:56:14 INFO]: Client>    at bct.c(SourceFile:78)
    [
    11:56:14 INFO]: Client>    at ban.p(SourceFile:1343)
    [
    11:56:14 INFO]: Client>    at ban.ak(SourceFile:774)
    [
    11:56:14 INFO]: Client>    at ban.f(SourceFile:728)
    [
    11:56:14 INFO]: Client>    at net.minecraft.client.main.Main.main(SourceFile:148)
    [
    11:56:14 INFO]: Client>
    [
    11:56:14 INFO]: Client>
    [
    11:56:14 INFO]: ClientA detailed walkthrough of the errorits code path and all known details is as follows:
    [
    11:56:14 INFO]: Client> ---------------------------------------------------------------------------------------
    [
    11:56:14 INFO]: Client>
    [
    11:56:14 INFO]: Client> -- Head --
    [
    11:56:14 INFO]: ClientStacktrace:
    [
    11:56:14 INFO]: Client>    at bln.a(SourceFile:508)
    [
    11:56:14 INFO]: Client>    at fz.a(SourceFile:97)
    [
    11:56:14 INFO]: Client>    at fz.a(SourceFile:15)
    [
    11:56:14 INFO]: Client>    at ej.a(SourceFile:174)
    [
    11:56:14 INFO]: Client>    at bct.c(SourceFile:78)
    [
    11:56:14 INFO]: Client>
    [
    11:56:14 INFO]: Client> -- Affected screen --
    [
    11:56:14 INFO]: ClientDetails:
    [
    11:56:14 INFO]: Client>    Screen name: ~~ERROR~~ NullPointerExceptionnull
    [11:56:14 INFO]: Client>
    [
    11:56:14 INFO]: Client> -- Affected level --
    [
    11:56:14 INFO]: ClientDetails:
    [
    11:56:14 INFO]: Client>    Level nameMpServer
    [11:56:14 INFO]: Client>    All players1 total; [blw['Bungeecookie'/245l='MpServer'x=183.06y=76.62z=253.70]]
    [
    11:56:14 INFO]: Client>    Chunk statsMultiplayerChunkCache55
    [11:56:14 INFO]: Client>    Level seed0
    [11:56:14 INFO]: Client>    Level generatorID 00 - default, ver 1. Features enabledfalse
    [11:56:14 INFO]: Client>    Level generator options:
    [
    11:56:14 INFO]: Client>    Level spawn locationWorld: (200,64,256), Chunk: (at 8,4,0 in 12,16contains blocks 192,0,256 to 207,255,271), Region: (0,0contains chunks 0,0 to 31,31blocks 0,0,0 to 511,255,511)
    [
    11:56:14 INFO]: Client>    Level time150119 game time150119 day time
    [11:56:14 INFO]: Client>    Level dimension0
    [11:56:14 INFO]: Client>    Level storage version0x00000 Unknown?
    [
    11:56:14 INFO]: Client>    Level weatherRain time(nowfalse), thunder time(nowfalse)
    [
    11:56:14 INFO]: Client>    Level game modeGame modecreative (ID 1). HardcorefalseCheatsfalse
    [11:56:14 INFO]: Client>    Forced entities3 total; [blw['Bungeecookie'/245l='MpServer'x=183.06y=76.62z=253.70], wu['Wolf'/53l='MpServer'x=181.50y=75.00z=252.50], wu['Wolf'/54l='MpServer'x=187.75y=72.00z=245.66]]
    [
    11:56:14 INFO]: Client>    Retry entities0 total; []
    [
    11:56:14 INFO]: Client>    Server brandCraftBukkit
    [11:56:14 INFO]: Client>    Server typeNon-integrated multiplayer server
    [11:56:14 INFO]: ClientStacktrace:
    [
    11:56:14 INFO]: Client>    at blr.a(SourceFile:289)
    [
    11:56:14 INFO]: Client>    at ban.b(SourceFile:1972)
    [
    11:56:14 INFO]: Client>    at ban.f(SourceFile:737)
    [
    11:56:14 INFO]: Client>    at net.minecraft.client.main.Main.main(SourceFile:148)
    [
    11:56:14 INFO]: Client>
    [
    11:56:14 INFO]: Client> -- System Details --
    [
    11:56:14 INFO]: ClientDetails:
    [
    11:56:14 INFO]: Client>    Minecraft Version1.7.9
    [11:56:14 INFO]: Client>    Operating SystemWindows 8.1 (amd64version 6.3
    [11:56:14 INFO]: Client>    Java Version1.8.0Oracle Corporation
    [11:56:14 INFO]: Client>    Java VM VersionJava HotSpot(TM64-Bit Server VM (mixed mode), Oracle Corporation
    [11:56:14 INFO]: Client>    Memory119200560 bytes (113 MB) / 174587904 bytes (166 MBup to 3817865216 bytes (3641 MB)
    [
    11:56:14 INFO]: Client>    JVM Flags2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx4G
    [11:56:14 INFO]: Client>    AABB Pool Size(0 bytes0 MBallocated(0 bytes0 MBused
    [11:56:14 INFO]: Client>    IntCachecache0tcache0allocated0tallocated0
    [11:56:14 INFO]: Client>    Launched Version1.7.9
    [11:56:14 INFO]: Client>    LWJGL2.9.1
    [11:56:14 INFO]: Client>    OpenGLGeForce GT 650M/PCIe/SSE2 GL version 4.4.0NVIDIA Corporation
    [11:56:14 INFO]: Client>    GL CapsUsing GL 1.3 multitexturing.
    [
    11:56:14 INFO]: ClientUsing framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
    [
    11:56:14 INFO]: ClientAnisotropic filtering is supported and maximum anisotropy is 16.
    [11:56:14 INFO]: ClientShaders are available because OpenGL 2.1 is supported.
    [
    11:56:14 INFO]: Client>
    [
    11:56:14 INFO]: Client>    Is ModdedProbably notJar signature remains and client brand is untouched.
    [
    11:56:14 INFO]: Client>    TypeClient (map_client.txt)
    [
    11:56:14 INFO]: Client>    Resource Packs: []
    [
    11:56:14 INFO]: Client>    Current LanguageEnglish (US)
    [
    11:56:14 INFO]: Client>    Profiler PositionN/(disabled)
    [
    11:56:14 INFO]: Client>    Vec3 Pool Size(0 bytes0 MBallocated(0 bytes0 MBused
    [11:56:14 INFO]: Client>    Anisotropic FilteringOff (1)
    thepaperboy99 How do you register the entity? I am using bigteddy98 's library, using the same entity id and name as the Chicken entity, 93 and "Chicken," but it still crashes... Any ideas?
     
  2. Offline

    thepaperboy99

  3. Offline

    Necrodoom

    Unofficial builds will have unexpected results when using plugins, and thus we cannot provide support for them.
    Please seek support else where instead of reposting your threads asking for help with problems caused by said unofficial builds.
     
  4. Offline

    Jake0oo0

    He changed the software he is using, there is no reason not to repost.
     
  5. Offline

    Double0negative

    Necrodoom
    Its not a repost if its different right?
     
    KingFaris11 likes this.
  6. Offline

    Jake0oo0

    of course not, this kid is just dumb.
     
  7. Offline

    codename_B

    You need to register the entity, if you're trying to do what I think you're trying to do.

    EDIT: seems like you realise that, ok, add that into your spawning code!
     
  8. Offline

    Necrodoom

    Claiming his unofficial build problems are caused by craftbukkit, you mean?
     
  9. Offline

    Double0negative

    It says clearly in the title and the op post its craftbukkit. I'm not sure how thats unofficial.
     
  10. Offline

    Necrodoom

    Doesn't mean he actually changed the jar, or actually planning to use craftbukkit. Error here started while using an unofficial build, and all information given from him before was based on unofficial builds and a forge client.
     
  11. Offline

    BungeeTheCookie

    Necrodoom
    I am just wondering if you are absolutely oblivious to the title and description of this thread or just want to get my thread locked. First of all, Spigot barely changes CraftBukkit's core code: it just adds support optimizations and is obviously a lot better because it is multiple version support, I don't know why Bukkit just immediately locks your thread instead of giving people a chance to solve it - but that is beside the point. The point is that before posting on a thread, you must at least read the thread. This is apparently CraftBukkit and not a stupid programming error caused by md_5. I obviously am requesting help and for you to just come to my thread, not read it and even make an attempt to help me, ask it to be locked for using CraftBukkit is absolutely ridiculous, absurd, and stupid. I am not going to re-post and lie and say it was CraftBukkit if I was using Spigot. If I want to see if it is really CraftBukkit, I am going to use CraftBukkit and test out my plugin before even thinking about re-posting. Now unless you cannot read or dyslexic (I don't see why you would be on this forum) I don't know why you would consider CraftBukkit is "unofficial."

    That is the problem you and a couple of others have, you think your "oh, so greater than everyone else" and automatically assume from past experiences that this is just a repost so you can just get help, even though you don't switch jars. You don't know if they switched jars or not, and you have no right to hold them accountable unless you have proof. You probably don't even know how to use Forge, because anyone who has common sense knows that error is Minecraft code, because Forge deobsufcates everything. It does not work with CraftBukkit, and you have no right to judge whether that statement is incorrect. Next time before posting an absolutely outrageous thing like that, try to actually assert your brain power to read the thread. I am not trying to start a flame war out of this. I am just stating the obvious.

    Jake0oo0 Double0negative Thank you for pointing out his ridiculous remark.

    codename_B thepaperboy99
    NMSHandler.getInstance().registerEntity("Display Chicken", 93, DisplayChicken.class);

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 2, 2016
  12. Offline

    thepaperboy99

    Not how you register, how you spawn it.
     
  13. Offline

    BungeeTheCookie

    Code:
    public void spawnDisplayChicken(ClassDisplay display, final Location l){
            final DisplayChicken chicken = new DisplayChicken(l.getWorld(), display);
            chicken.setLocation(l.getX(), l.getY(), l.getZ(), 0F, 0F);
            ((CraftWorld) l.getWorld()).getHandle().addEntity(chicken);
        }
     
  14. Offline

    thepaperboy99

  15. Offline

    Double0negative

    *facepalm* Who are you to decide whether or not he actually changed it? If he said he did we can assume he did, any issues he has if he didn't is his own fault, not your job to make assumptions based on nothing.

    Also, if you actually bothered to read, you would notice the part where the logs say

    "[11:56:14 INFO]: Client> Server brand: CraftBukkit"
    and
    [11:56:14 INFO]: Client> Is Modded: Probably not. Jar signature remains and client brand is untouched.
     
  16. Having dyslexia doesn't prevent someone from using a forum, programming, or helping - even if it makes it more difficult. This part of your post seems to suggest otherwise. I know that you probably didn't mean it like that or anything, but it's best to avoid statements like that as not only does it sound a bit ignorant, it can cause offence needlessly. I'd just like to politely ask that you show a little consideration when posting :)

    As for your problem: The more (relevant) code you can provide, the easier it will be to solve. :)
     
  17. Offline

    BungeeTheCookie

    Double0negative
    He is just being stupid. :)
    AdamQpzm
    I was being sarcastic, I was pointing out how ridiculous his post is. I was not trying to offend anyone through that post and I know it seems wrong that I said that, but what Necrodoom said is even worse...

    thepaperboy99
    Code:
    import bungeecookie.flappybirds.classes.ClassDisplay;
    import net.minecraft.server.v1_7_R3.*;
    import org.bukkit.craftbukkit.v1_7_R3.CraftWorld;
     
    import java.lang.reflect.Field;
    import java.util.List;
     
    public class DisplayChicken extends EntityChicken {
     
    private ClassDisplay display;
     
        public DisplayChicken(org.bukkit.World world, ClassDisplay display){
            super(((CraftWorld)world).getHandle());
            List goalB = (List)getPrivateField("b", PathfinderGoalSelector.class, goalSelector); goalB.clear();
            List goalC = (List)getPrivateField("c", PathfinderGoalSelector.class, goalSelector); goalC.clear();
            List targetB = (List)getPrivateField("b", PathfinderGoalSelector.class, targetSelector); targetB.clear();
            List targetC = (List)getPrivateField("c", PathfinderGoalSelector.class, targetSelector); targetC.clear();
            this.display = display;
            this.goalSelector.a(6, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 6.0F));
            this.goalSelector.a(7, new PathfinderGoalRandomLookaround(this));
            this.fireProof = true;
        }
     
        public ClassDisplay getDisplay(){
            return display;
        }
     
        public static Object getPrivateField(String fieldName, Class clazz, Object object){
            Field field;
            Object o = null;
            try{
                field = clazz.getDeclaredField(fieldName);
                field.setAccessible(true);
                o = field.get(object);
            }
            catch(NoSuchFieldException e){
                e.printStackTrace();
            }
            catch(IllegalAccessException e){
                e.printStackTrace();
            }
            return o;
        }
     
        @Override
        protected void aC(){
            super.aC();
            this.getAttributeInstance(GenericAttributes.a).setValue(100000.0D);
            this.getAttributeInstance(GenericAttributes.b).setValue(0.000D);
            this.getAttributeInstance(GenericAttributes.c).setValue(100000.D);
            this.getAttributeInstance(GenericAttributes.d).setValue(0.000D);
        }
     
        @Override
        public void collide(Entity entity){
     
        }
     
        @Override
        public void g(double d0, double d1, double d2){
     
        }
    }
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 2, 2016
  18. Personally I think it's worse that you imply (whether being sarcastic or not) that people with a certain learning difficulty shouldn't do certain activities, than Necrodoom implies that you don't want to/can't be bothered to change your server jar, but hey! Maybe that's just me. :)

    Either way I'll let this matter drop as I don't like where it's going; would just reiterate that a little consideration is a good way to reduce chances of offending people. :)
     
    AoH_Ruthless likes this.
  19. Offline

    BungeeTheCookie

    I never was trying to imply that in the first place, but thank you for your insight and I will try to do a better job at criticizing people. I appreciate it! :D
     
    AdamQpzm likes this.
  20. Offline

    Cirno

    Is there proof that he is using Spigot right now? OP has declared, in all caps, that he is not using Spigot. We should put some trust in his words and believe him until he either a) solves his problem or b) admits that he forgot to swap the jars around/something to the effect that he was still using Spigot.

    I get that unofficial builds are difficult to give assistance with since the core developer team does not manage their source and therefore, it is not their responsibility, but automatically accusing someone of using Spigot just because they used it in the past is irrational. Maybe they just wanted to dab themselves into something more complex, or maybe they got curious as to what Spigot has to offer over CraftBukkit. What ever the case may be, usage of Spigot isn't and shouldn't be put down as a criminal record entry.

    I realize that I might have been a little stupid in that whole tantrum, so feel free to either edit out that part of my post or whatnot.

    Back on topic; normally when I get NPE's, I would write a small function that loops through every field and checks if they're null. This might work as to what I'm talking about:

    Code:java
    1. public void checkNullFields(Object obj, Object parent) throws Throwable{
    2. List<Field> fields = new ArrayList<Field>();
    3.  
    4. for(Field field : obj.getClass().getFields()){
    5. fields.add(field);
    6. }
    7.  
    8. for(Field field : obj.getClass().getDeclaredFields()){
    9. if(!fields.contains(field)){
    10. fields.add(field);
    11. }
    12. }
    13.  
    14. for(Field field : fields){
    15. Object fget = field.get(obj);
    16. if(fget == null){
    17. System.out.println("Field " + field.getName() + " for object " + obj + (parent == null ? " with parent " + parent : "") + " was null.");
    18. continue;
    19. }
    20.  
    21. if(!fget.getClass().isPrimitive()){
    22. checkNullFields(fget, obj);
    23. }
    24. }
    25. }


    No idea if this code works.
     
    justcool393 likes this.
  21. Offline

    BungeeTheCookie

    What you said was beautiful. But, do you want me to run that code through the constructor? I am getting a NullPointer client-side, and there are no errors server-side..?
     
  22. Offline

    Cirno

    Yes, run it when you want to create a chicken. If anything is null, try prodding it by setting it to new objects and what not.
     
  23. Offline

    BungeeTheCookie

    Ugh, now I am getting an error with DisguiseCraft... so the class can't be instantiated. Hold on, Ima test in a sec.

    Cirno
    It just spams this in the console and I can't execute the command to spawn the display chicken...
    Code:
    checkNullFields(java:77)
    My Code:
    Code:
        @SuppressWarnings("unchecked")
        public void registerEntity(String name, int id, Class<? extends EntityInsentient> customClass) {
            try {
                List<Map<?, ?>> dataMaps = new ArrayList<Map<?, ?>>();
                for (Field f : EntityTypes.class.getDeclaredFields()) {
                    if (f.getType().getSimpleName().equals(Map.class.getSimpleName())) {
                        f.setAccessible(true);
                        dataMaps.add((Map<?, ?>) f.get(null));
                    }
                }
     
                ((Map<Class<? extends EntityInsentient>, String>) dataMaps.get(1)).put(customClass, name);
                ((Map<Class<? extends EntityInsentient>, Integer>) dataMaps.get(3)).put(customClass, id);
     
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
     
        public void spawnDisplayChicken(ClassDisplay display, final Location l)  {
            final DisplayChicken chicken = new DisplayChicken(l.getWorld(), display);
            try{
                checkNullFields(chicken);
                chicken.setLocation(l.getX(), l.getY(), l.getZ(), 0F, 0F);
                ((CraftWorld) l.getWorld()).getHandle().addEntity(chicken);
            }catch(Exception e){
                e.printStackTrace();
            }
        }
     
        public void checkNullFields(Object obj) {
            checkNullFields(obj, null);
        }
     
        public void checkNullFields(Object obj, Object parent) {
            try{
                List<Field> fields = new ArrayList<Field>();
     
                for(Field field : obj.getClass().getFields()){
                    fields.add(field);
                }
     
                for(Field field : obj.getClass().getDeclaredFields()){
                    if(!fields.contains(field)){
                        fields.add(field);
                    }
                }
     
                for(Field field : fields){
                    Object fget = field.get(obj);
                    if(fget == null){
                        System.out.println("Field " + field.getName() + " for object " + obj + (parent == null ? " with parent " + parent : "") + " was null.");
                    }
     
                    if(!fget.getClass().isPrimitive()){
                        checkNullFields(fget, obj);
                    }
                }
            }catch(Exception e){
     
            }
        }
    }
    
    Probably because of that recursive call.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 2, 2016
  24. Offline

    TnT

    Locked. Unofficial build may have long lasting effects that we cannot possibly know about or assist in fixing. We do not support switching back to CraftBukkit just to get support.
     
    AoH_Ruthless, AdamQpzm and Necrodoom like this.
Thread Status:
Not open for further replies.

Share This Page