Jump to content

Recommended Posts

Posted

Can you show the class in which this line of code is in? That makes it much easier to resolve and help you.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

Here's the code I have.  It's not more involved, there's just some error handling.

 

	    	ByteArrayOutputStream bt = new ByteArrayOutputStream();
    	DataOutputStream out = new DataOutputStream(bt);
    	try {
    		out.writeInt(1);
    		out.writeInt(x);
    		out.writeInt(y);
    		out.writeInt(z);
    		Packet250CustomPayload packet = new Packet250CustomPayload("Mosaic", bt.toByteArray());
    		PacketDispatcher.sendPacketToServer(packet);  //the line you're asking about
    	} catch (IOException ex) {
    		System.out.println("couldnt send packet!");
    	}

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Thanks!

 

And this is the line of code

    public void sendPacketwithID(byte[] var1)

    {

        ArrayList var2 = new ArrayList();

        int var3 = Integer.valueOf(this.entityId).intValue();

        var2.add(Byte.valueOf((byte)0));

        var2.add(Byte.valueOf((byte)(var3 & 255)));

        var2.add(Byte.valueOf((byte)(var3 >> 8 & 255)));

        var2.add(Byte.valueOf((byte)(var3 >> 16 & 255)));

        var2.add(Byte.valueOf((byte)(var3 >> 24 & 255)));

        byte[] var7 = var1;

        int var8 = var1.length;

 

        for (int var9 = 0; var9 < var8; ++var9)

        {

            byte var10 = var7[var9];

            var2.add(Byte.valueOf(var10));

        }

 

        var7 = new byte[var2.size()];

 

        for (var8 = 0; var8 < var2.size(); ++var8)

        {

            var7[var8] = ((Byte)var2.get(var8)).byteValue();

        }

 

        Packet250CustomPayload packet = new Packet250CustomPayload("Cars", var7);

 

    }

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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