Jump to content

[1.7.10][semi-solved] Constructing a list of subItems on the server


Recommended Posts

Posted

Hello everyone, I am having yet another problem with packets, but since this problem isn't like my previous ones i decided to make a new topic.

 

In my mod, the first time any client joins a new server, I need to send quite a lot of data from the server to that client and from that client back to the server.

If you want to know why I am doing this you can read the old topic here:

http://www.minecraftforge.net/forum/index.php/topic,32902.0.html

 

The thing diesieben07 had warned me for in the previous topic has happened, the payload of the packet I am sending to the server is too high.

To resolve this issue I want to pre-calculate the payload of my packet, and if it is too high i will send an early packet and start constructing a new one (if that makes any sense, but i feel like i'm failing at explaining what i mean here)

 

I am currently using the following code to calculate the payload:

public int getPayload(List<ItemStack> itemStacks){
	int payload = 1;

	if(itemStacks.size() <= Byte.MAX_VALUE){
		payload += 1;
	}else if(itemStacks.size() <= Short.MAX_VALUE){
		payload += 2;
	}else{
		payload += 4;
	}

	payload += itemStacks.size() * 5;

	for(int i = 0; i < itemStacks.size(); i++){
		if (itemStacks.get(i).getItem().isDamageable() || itemStacks.get(i).getItem().getShareTag()){
			payload += 3;
                NBTTagCompound compound = itemStacks.get(i).stackTagCompound;
                if(compound != null){
                	payload += compound.func_150296_c().size() * 6;
                }
            }
	}

	return payload;
}

 

from what i've seen i figure that the payload of a packet is equal to the amount of bytes in the byteBuffer.

keeping this in mind i calculated the values to use in the calculations, but if i am wrong somewhere please correct me, I am not very familiar with packets and bytebuffers.

 

In my packet I am first sending a byte, this is why i start with payload = 1.

Then, depending on the size of the value, i am sending a byte, a short or an integer. This is what the if statement is for.

After that is done i am sending an array of itemStacks, i found that two shorts and a byte are used to write an itemStack, and this is why i am using *5.

 

For some itemStacks NBTTagCompounds are written, the if statement i am using in the for-loop is the same one vanilla uses to determine if the compound should be written or not.

However, i feel like my calculations for the payload size of a compound are not right. I wrote that code yesterday before i went to bed, and i really don't know anymore where i got the +3 and the *6 from...

 

I am using 23767 as the max payload value, i found this value in the C17PacketCustomPayload class, but if this is wrong be sure to correct me  ;)

 

I assume my calculations are right up until the point of the NBTTagCompound, so my question is if someone knows how i can properly calculate the payload of an NBTTagCompound, or if there is a better way to go about splitting up my packets.

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

Posted

Sorry but I read your other thread this can be done with more simple payloads. The server already knows all the items, and yes you're right that it is easier to pick sub-type on the client. But you can still get a list on the server by going through the item list once and querying a client to get info on the subtypes.

 

The only code you should have following logic:

1) server goes through the item registry and sends packet to client indicating which item (the payload can simply be the integer ID from the registry)

3) client checks whether the item has subtypes and if it does it does the getSubItems() and finds the size of sub-type list.

4) client sends packet to server indicating the number of subtypes.

5) server updates a mapping of items and number of subtypes.

 

So two very small packets are required.

 

Now if you really want to continue in the way you were, I'm surprised that the packet is large. You only need to have the client send a list of item ids that have subtypes and how many there are. Server can assume that remaining items don't have subtypes. So it should only be several dozen bytes long I think -- for example all 16 dyes would just be represented by three bytes (two for id and one for number of subtypes).

 

In either case you get the best situation -- server gets complete list and therefore prevents hacking and can control the probability of selection to ensure all items have equal chance (or some other distribution if you want).

 

By the way, to answer your specific question about large payloads: for the logic in creating large payloads, the protocols are usually simple -- in the first bytes of the payload you simply send a boolean to indicate whether this packet is the last packet or not. If not, the receiver will continue to concatenate incoming packets. You don't need to send anything about the actual size, just whether you're finished or more is coming.

 

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted
  On 8/13/2015 at 4:03 PM, jabelar said:

The only code you should have following logic:

1) server goes through the item registry and sends packet to client indicating which item (the payload can simply be the integer ID from the registry)

3) client checks whether the item has subtypes and if it does it does the getSubItems() and finds the size of sub-type list.

4) client sends packet to server indicating the number of subtypes.

5) server updates a mapping of items and number of subtypes.

 

You're system would indeed be way more efficient, but it doesn't fully cover my needs. There are however some key-components which i might be able to integrate into my system to make it more efficient.

 

The biggest problem is a check that i am using which can only be done on the clientSide, i check if getCreativeTab() != null to exclude placeholder blocks/items (such as water_still, commandBlocks, monster spawners, etc...) from the list, since these are usually not obtainable anyway. But the getCreativeTab() method is clientSide only, and this makes it so that i am currently sending almost every item in the game to the client which of course is a bad thing.

 

I am currently using Itemregistry.getNameForObject(item) to identify the items and i am sending these Strings to the client. the payload of an integer is way less, so it would probably be better to send the ID's instead of the names. Only one question would come to mind, are the ID's constant on the server and on the client? for vanilla minecraft this is probably the case, but what if other mods add items, would those id's be the same on the client and on the server? and what if the client has more mods installed than the server has, the client would still be able to join, but would the id's be the same?

 

  Quote

Now if you really want to continue in the way you were, I'm surprised that the packet is large. You only need to have the client send a list of item ids that have subtypes and how many there are. Server can assume that remaining items don't have subtypes. So it should only be several dozen bytes long I think -- for example all 16 dyes would just be represented by three bytes (two for id and one for number of subtypes).

 

This would be, if i would implement such a system, which would probably be better to be honest. However the system that i am using at the moment sends the itemStacks of the subitems to the server, for vanilla only this works fine, however if i start adding other mods, the list of items becomes longer and as a result the payload of the packet becomes larger.

 

  Quote

By the way, to answer your specific question about large payloads: for the logic in creating large payloads, the protocols are usually simple -- in the first bytes of the payload you simply send a boolean to indicate whether this packet is the last packet or not. If not, the receiver will continue to concatenate incoming packets. You don't need to send anything about the actual size, just whether you're finished or more is coming.

 

The problem currently is not so much how many packets i need to send, but more how many itemStacks i can write to a single packet. Since it's better to send one big packet than multiple smaller packets i am currently trying to fit as many itemStacks as i can into every packet i send. so my question is how i can calculate the payload (specifically of an NBTTagCompound) so i can send the packet away if the payload get's too large, and start writing the rest of the itemStacks to a new packet.

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

Posted

I fixed it!

I have been looking at the write methods within the subclasses of NBTBase, and calculated the payload per type of NBT. I am iterating through the keys of the NBTTagCompound and adding the payload of every key together to calculate the payload of the full compound.

 

I was interested to see how many packets it would get split up into, and the payload of these packets. this is what i found:

 

http://pastebin.com/bavmL5ds

 

I was quite shocked by the result.

previously i was able to send all itemStacks in one packet (which is probably the first packet containing 841 items).

I have added a single mod, and now i need 27 packets (most of which only contain 19 items...)

I am almost certain now that I am going to rewrite this system sometime in the future, I don't want to think about the amount of packets needed for a small modpack...

 

It makes me wonder though, why would you ever need that much data in an itemStack........ :o

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

Posted

I don't think you understand how easy it is to do what you want. All you need is the client to send information about those few items that have more than one type.

 

I wrote some code to do this, and this was the result (item id and number of subtypes):

{1=7, 322=2, 3=3, 5=6, 6=6, 263=2, 139=2, 12=2, 397=5, 17=4, 145=3, 18=4, 19=2, 24=3, 155=3, 349=4, 350=2, 31=2, 95=16, 159=16, 351=16, 160=16, 97=6, 161=2, 98=4, 162=2, 35=16, 38=9, 168=3, 425=16, 171=16, 44=7, 175=6, 179=3, 373=61, 126=6, 383=27}

 

You can double check the accuracy here: http://minecraft-ids.grahamedgecombe.com/

 

For example, it says iD#1 has 7 sub-types, which is correct (it is various types of stone block).

 

So you just need to pack that info into a packet and send it.

 

Here is my code. I run it in the client proxy since there are some client-only methods. Note you must do this in the post-init stage since you want to make sure all mods have registered their items as well.

 

 

  Reveal hidden contents

 

 

I just run each method during post-init. I have two map fields, one that holds all items and another that is "sparse" meaning only containing those items that have more than one sub-type.

 

Then if you send this info to the server in a packet, it would go create a list of ItemStack by through the list of items but also accounting for the number of sub-types the client said there were.

 

 

 

 

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted
  On 8/13/2015 at 8:33 PM, jabelar said:

I don't think you understand how easy it is to do what you want. All you need is the client to send information about those few items that have more than one type.

 

I wrote some code to do this, and this was the result (item id and number of subtypes):

{1=7, 322=2, 3=3, 5=6, 6=6, 263=2, 139=2, 12=2, 397=5, 17=4, 145=3, 18=4, 19=2, 24=3, 155=3, 349=4, 350=2, 31=2, 95=16, 159=16, 351=16, 160=16, 97=6, 161=2, 98=4, 162=2, 35=16, 38=9, 168=3, 425=16, 171=16, 44=7, 175=6, 179=3, 373=61, 126=6, 383=27}

 

You can double check the accuracy here: http://minecraft-ids.grahamedgecombe.com/

 

For example, it says iD#1 has 7 sub-types, which is correct (it is various types of stone block).

 

So you just need to pack that info into a packet and send it.were.

 

The biggest problem i have with this, is more a question than a problem. as i said earlier, i have no doubt that the id's are the same on the client and on the sever when using only vanila, however, will the id's be the same if more mods are installed? and what happens if the client has more mods installed than the server?

 

second problem: the rest of my mod is fully based around having a list of itemStacks on the server, if i change this out to a map of id's to subItems, i basically have to rewrite my whole mod, which i don't feel like doing right now, this is why i said i will probably change the system later.

 

  Quote

Then if you send this info to the server in a packet, it would go create a list of ItemStack by through the list of items but also accounting for the number of sub-types the client said there were.

 

this is interesting, if there is a way to convert this map to a list of ItemStacks i could easily integrate it into the rest of the mod, and i would happily change my current system to this system.

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

Posted

If the ID's on the client and server are different, you will have much bigger problems that your worry.

Long time Bukkit & Forge Programmer

Happy to try and help

Posted
  On 8/13/2015 at 9:07 PM, delpi said:

If the ID's on the client and server are different, you will have much bigger problems that your worry.

 

I am not entirely sure how the new ID system works, but since minecraft stopped using id's i have tried to avoid them...

but from your answer i assume it's safe to say ID's will be constant on the client and the server?

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

Posted
  On 8/13/2015 at 9:23 PM, diesieben07 said:

Minecraft does use IDs, just like it did before. They are just dynamically assigned. Yes, they are consistent between client & server.

 

Thank you! might have to look into using ID's then, since the payload of an integer is way less than that of a String.

could probably even convert most of them to bytes/shorts for even more efficiency  :)

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

Posted
  On 8/13/2015 at 9:01 PM, wesserboy said:

The biggest problem i have with this, is more a question than a problem. as i said earlier, i have no doubt that the id's are the same on the client and on the sever when using only vanila, however, will the id's be the same if more mods are installed? and what happens if the client has more mods installed than the server?

 

second problem: the rest of my mod is fully based around having a list of itemStacks on the server, if i change this out to a map of id's to subItems, i basically have to rewrite my whole mod, which i don't feel like doing right now, this is why i said i will probably change the system later.

 

is is interesting, if there is a way to convert this map to a list of ItemStacks i could easily integrate it into the rest of the mod, and i would happily change my current system to this system.

 

Like mentioned, the IDs must match as that is how the server communicates. If you don't trust that, I suppose you could use unlocalized name strings which should also provide a unique way to look up things.

 

Yes, the server can create an actual list of ItemStacks using this information from the client. Basically the server would receive the packet from the client and then it would go through the Item.itemRegistry and would create a list of ItemStacks that would have metadata=0 if there was no match in the packet payload, otherwise would use the value from the packet payload and create multiple ItemStacks (one for each metadata value).

 

So steps would be like this:

  1) have a field on server to contain the List of ItemStacks

  2) when receiving the client packet, the server should iterate or loop through the Item.itemRegistry and check if the item has an id that matches a key in the map sent in the packet. If yes, then use the map value, otherwise use 0.

  3) For the number you get in Step #2, you'd loop and create a new ItemStack that contains the item. Like if the packet said there were 2 values, then you'd create one stack with metadata 0 and one with metadata 1. You'd add each stack to the List from Step #1.

 

After that the server would permanently have a list of all items and subtypes that you could use to do what you want.

 

This was actually an interesting topic. It does indeed suck that the getSubTypes() method is only client-side. It does seem useful to have an easy way to access all items including subtypes. I think I'll write this up as a utility as it might be useful sometime.

 

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

One note to watch out for. The example I give has the client indicate the number of different subtypes there are. In almost every case, the metadata values all start at 0 and go up with no gaps. However, I realized that in vanilla items, that spawn eggs (id = 383) actually start at 50. So my code will correctly say there are 27 spawn eggs but you won't know what the starting metadata value is. For vanilla you could just handle that special case, but other mods could have any scheme they wanted.

 

So to be really safe you probably have to send more information. I see two options:

1) if you just want to use this for random item generation, then the server could use messages to get the mapping to actual metadata after it chooses the item. In other words, if server knew there was 27 spawn eggs and it chose spawn egg 14, then it could send a message to the client asking what the actual metadata value should be.

2) You could create the initial list with a bit of extra information. For example, you could have something in the payload that flags any item that doesn't have regular pattern of metadata. Like the payload data could be a boolean (for whether it is normal), the item id, and the number of subtypes, then if it isn't normal you would provide the additional info (like start at 50).

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted
  On 8/13/2015 at 9:46 PM, jabelar said:

Yes, the server can create an actual list of ItemStacks using this information from the client. Basically the server would receive the packet from the client and then it would go through the Item.itemRegistry and would create a list of ItemStacks that would have metadata=0 if there was no match in the packet payload, otherwise would use the value from the packet payload and create multiple ItemStacks (one for each metadata value).

 

So steps would be like this:

  1) have a field on server to contain the List of ItemStacks

  2) when receiving the client packet, the server should iterate or loop through the Item.itemRegistry and check if the item has an id that matches a key in the map sent in the packet. If yes, then use the map value, otherwise use 0.

  3) For the number you get in Step #2, you'd loop and create a new ItemStack that contains the item. Like if the packet said there were 2 values, then you'd create one stack with metadata 0 and one with metadata 1. You'd add each stack to the List from Step #1.

 

After that the server would permanently have a list of all items and subtypes that you could use to do what you want.

 

This system is not able to check if the item has a creativeTab, and as a result placeholder blocks like water_still, lava_flowing and piston_head would end up in the list.

however, this is easily fixable by making another map of the id's to booleans (creativetab == null) and combine the data of the two lists to construct the final list on the server.

 

There is still another problem with this system: it assumes the itemDamage of the subItems will increase as the amount of subItems does. While this is the case most of the time, even in vanilla there are cases where this is not true, look for instance at the spawn_egg.

This could however be solved by sending the damageValues of the subItems (in response to a requester packet from the server or something).

but as you can see the amount of data transferring is already rising.

 

Then there is a final problem: This system will not work with subItems that have nbtData.

I don't think in vanilla there are any items that use this, but in other mods it is used sometimes.

 

Here are two examples of it in Tconstruct:

https://github.com/SlimeKnights/TinkersConstruct/blob/a7405a3d10318bb5c486ec75fb62897a8149d1a6/src/main/java/tconstruct/tools/items/CreativeModifier.java

https://github.com/SlimeKnights/TinkersConstruct/blob/a7405a3d10318bb5c486ec75fb62897a8149d1a6/src/main/java/tconstruct/items/tools/FryingPan.java

 

The server would have itemStacks without nbtData, and possibly even with damageValues that are not used in that item.

There is no way for the server to reconstruct the nbtData, so the ItemStack must be sent to the server. (or at least it's nbtData).

There is no way for the server to 'know' if a subItem has nbtData, and because of this you will have to send the itemStacks of all subItems.

 

Unless... You want to use hasTagCompound() on the client on the subItems, and make a list of ID's that have subItems with nbt, and also send this list to the server to take into account.

But at this point you are sending so much data to the server that you might as well just send the itemStacks to the server.

 

If there are any mistakes in my thought process, be sure to tell me about them ;)

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

Posted
  On 8/13/2015 at 10:03 PM, jabelar said:

One note to watch out for. The example I give has the client indicate the number of different subtypes there are. In almost every case, the metadata values all start at 0 and go up with no gaps. However, I realized that in vanilla items, that spawn eggs (id = 383) actually start at 50. So my code will correctly say there are 27 spawn eggs but you won't know what the starting metadata value is. For vanilla you could just handle that special case, but other mods could have any scheme they wanted.

 

So to be really safe you probably have to send more information. I see two options:

1) if you just want to use this for random item generation, then the server could use messages to get the mapping to actual metadata after it chooses the item. In other words, if server knew there was 27 spawn eggs and it chose spawn egg 14, then it could send a message to the client asking what the actual metadata value should be.

2) You could create the initial list with a bit of extra information. For example, you could have something in the payload that flags any item that doesn't have regular pattern of metadata. Like the payload data could be a boolean (for whether it is normal), the item id, and the number of subtypes, then if it isn't normal you would provide the additional info (like start at 50).

 

When i wrote my previous post, i hadn't read this yet: you can scrape problem n. 2 off the list  :)

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

Posted

The NBT shouldn't be a big issue, I don't think. The getSubItems() method will get a List of ItemStacks based on whatever the mod author wanted, but the result is the same -- a list of ItemStacks with Item and metadata value. My code above will still properly count the number of subtypes. Then when you tell the client you're interested in the 5th sub-type, you can just look that up by taking that element from the list.

 

Otherwise, you're on the right track -- I can tell you understand the basic idea: you just need client to give information to server about the number of subtypes, and the Item itself can be referenced by ID. The server doesn't actually need to know the metadata value, it just needs to know the sub-types' index in the List that is returned by the client-side getSubItems(). So you shouldn't need to send that much data.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted
  On 8/14/2015 at 1:02 AM, jabelar said:

The NBT shouldn't be a big issue, I don't think. The getSubItems() method will get a List of ItemStacks based on whatever the mod author wanted, but the result is the same -- a list of ItemStacks with Item and metadata value. My code above will still properly count the number of subtypes. Then when you tell the client you're interested in the 5th sub-type, you can just look that up by taking that element from the list.

 

Otherwise, you're on the right track -- I can tell you understand the basic idea: you just need client to give information to server about the number of subtypes, and the Item itself can be referenced by ID. The server doesn't actually need to know the metadata value, it just needs to know the sub-types' index in the List that is returned by the client-side getSubItems(). So you shouldn't need to send that much data.

 

ahh, i see what you're saying, this would totally work.

It is however not a system that constructs a list of itemStacks on the server, this is a system that gives the server all the information it needs to request any itemStack from the client.

But with this system, if you need the actual itemStack on the server you still need to send it from the client. (probably as a respond to a requester packet containing the ID and the subItem index)

 

however, if optimized correctly the respond packet would most of the time only contain two shorts/ a short and an int. (ID and dmgValue)

Unless the itemStack has nbt, I think there's no way to avoid a big packet in that case...

 

This would probably be a really fun project to write and try to optimize it as best as possible.

I will probably try to write it in a separate project, and when it's fully working and optimized integrate it in the mod.

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

Posted
  On 8/14/2015 at 1:30 AM, wesserboy said:

 

ahh, i see what you're saying, this would totally work.

It is however not a system that constructs a list of itemStacks on the server, this is a system that gives the server all the information it needs to request any itemStack from the client.

But with this system, if you need the actual itemStack on the server you still need to send it from the client. (probably as a respond to a requester packet containing the ID and the subItem index)

 

however, if optimized correctly the respond packet would most of the time only contain two shorts/ a short and an int. (ID and dmgValue)

Unless the itemStack has nbt, I think there's no way to avoid a big packet in that case...

 

This would probably be a really fun project to write and try to optimize it as best as possible.

I will probably try to write it in a separate project, and when it's fully working and optimized integrate it in the mod.

 

I agree it is a fun project.

 

It got me interested when I confirmed your point that server doesn't really have full concept of the sub-types. But every Item sub-type can be represented ultimately by the metadata. It's just that the server doesn't know the full list of possible metadata values.

 

I think ultimately you could create an List of ItemStacks on the server if you wanted to, you just have to do the work of transferring the actual metadata values from client to server. You can do that in a number of ways, and I think you have some ideas on how to do that. It would take a bit of thought, but seems quite doable. Good luck!

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

I couldn't let the topic go and kept working on it. I think I have success -- I can create a list from a byte buffer (which could be payload of a packet from client) that contains one of every item variant.

 

Here is what the output of the resulting List toString() looks like:

 

  Reveal hidden contents

 

 

You can see for example that the spawn eggs (called monster placers) start at metadata value of 50 like they're supposed to, etc.

 

Here is the code I run to create the byte buffer (you need to run each method in a row on client side). You need to put this code in the client proxy because it calls the client-side only methods:

 

  Reveal hidden contents

 

 

And here is the code that can receive the byte buffer on the server side and create the list:

 

  Reveal hidden contents

 

 

Note that the code probably needs some exception handling in case the byte buffer doesn't come in in the expected format. The expected format is:

  1) int for item ID

  2) byte for number of subtypes

  3) if the subtypes is more than 1, then each of the metadata values as integers.

 

Since the third part can be variable, you need to use loops to create and retrieve the values based on the number of subtypes.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted
  On 8/14/2015 at 3:11 PM, wesserboy said:

Nice! this system only doesn't support nbtdata yet, right? I'll have some time later today and than i will start on my system :)

 

It does support NBT data. The getSubTypes() method returns an ItemStack of items with different metadata. That metadata might have been generated by NBT, but the result is the same and that is what I'm passing back and forth.

 

Remember that there is a difference between the NBT used to make variants and item NBT used for further player customization. This whole scheme is about giving player's fresh items, not copying specific items that are customized by the player. The server already has the default NBT. You just need to pass the metadata mapping and the server can re-create the same item stack.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

For the normal use of getSubItems this is true, it should return itemStacks with different damageValues, but other mods use it differently.

If you have a look at this implementation for instance:

https://github.com/SlimeKnights/TinkersConstruct/blob/a7405a3d10318bb5c486ec75fb62897a8149d1a6/src/main/java/tconstruct/tools/items/CreativeModifier.java

 

The only difference between the itemStacks created in the for loop is the "TargetLock" tag in their nbt, and this would not get picked up by your current system.

 

You are however right that getSubItems is not intended for such an implementation, since it's description says that it should return a list of items with different damagevalues ;)

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

Posted
  On 8/14/2015 at 3:43 PM, jabelar said:

It does support NBT data. The getSubTypes() method returns an ItemStack of items with different metadata. That metadata might have been generated by NBT, but the result is the same and that is what I'm passing back and forth.

 

I am currently working on my system, and i am writing a system that maps the amount of data needed to reconstruct the subItems on the server.

I ran into something to think about, and it made me think of what you said earlier (the quote): can an itemStack have default nbtdata?

and if so, can this nbtdata be requested on the server?

 

My system is not functional yet, if it produces actually useful results i will post the code.

 

Also, if you don't mind i will change the title to something that fits the current discussion better ;)

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

Posted

The system is coming along quite nicely, I have figured out how i want to go about doing things, and it just produced the first useful results.

My system tries to find a pattern in the subItems, and maps this pattern to every id. this way i only have to send the pattern to the server to reconstruct the subItems.

 

This is the id system i am currently using (There are two front slashes since i copied it from the comments within my class :P)

//Using an id system to visualize the amount of data needed to reconstruct on the server
//id 0: no subItems
//id 1: dmg subItems, starting at 0, incrementing by 1 for every subItem
//id 2: dmg subitems, starting at another value, incrementing by 1 for every subItem
//id 3: dmg subitems, starting at 0, incrementing by another value for every subItem
//id 4: dmg subItems, starting at another value, incrementing with another value for every subItem, but with regular pattern
//id 5: dmg subItems, with irregular pattern
//id 6: nbt subItems...? (still need to figure this mapping out...)
//
//How to send this to the server?
//First send the id of the needed data
//
//id 0: Item id
//id 1: Item id, amount of subItems
//id 2: Item id, amount of subItems, start value
//id 3: Item id, amount of subItems, increment value
//id 4: Item id, amount of subItems, start value, increment value
//id 5: Item id, amount of subItems, dmg values
//id 6: not sure how to map this yet, as a result not sure how to send it yet 
//
//variable formats:
//data id --> byte
//item id --> short will probably do (don't think id's go higher than 32767)
//amount of subItems --> byte (if you have more than 127 subItems you're doing something wrong...)
//start value --> byte? haven't encountered a startValue higher than 127
//increment value --> byte
//dmg value --> not sure yet, maybe a scaling system with a header byte indicating the format

 

There were some interesting results there, every id has been mapped at least once, except 4 (and 6 obviously), which i thought was pretty interesting.

It generated the following mapping:

http://pastebin.com/uYCirVy8

(I generated this list in minecraft 1.7.10, this is why the 1.8 items are missing from the list)

 

The code i used to generate this can be found here:

https://gist.github.com/wesserboy/b05aa0129d3079083ac8

 

This is what i am planning on implementing next:

--> write a method that optimizes the amount of data needed by remapping some id's

--> make a system that transfers the data to the server

--> make a system that constructs a list of itemStacks on the server, based on the data received from the client

----- at this point it should be fully functional for vanilla minecraft -----

--> figure out how to map the nbtData as efficient as possible

 

Since I am not quite sure yet how to efficiently map the nbtData, any idea's are welcome :)

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

Posted

Just use ByteBufUtils to write NBT and read NBT into your packet payload.

 

I've gone ahead and think I have a full working implementation now to make the list, put it into a ByteBuf suitable to be a packet payload and then take that payload and convert it back to a list of ItemStacks, including both metadata and NBT.

 

Here is my code for initializing a public field to contain an "ItemStack registry" and then creating and reading the ByteBuf packet payload. This must go in your client proxy since it calls some client side only methods:

 

  Reveal hidden contents

 

 

I put a lot of console statements to help trace the execution (this is really important in packet payloads because if you make any mismatch in the type or order of data in the payload it will screw up. The results show that it indeed creates a full list (I'm using 1.8 so you'll see multiple variants of stone and such) including a custom item ("sheep skin") that has NBT data. You can see that the final list finds the item with NBT and includes it in the list.

 

First here is the ItemStack list on the sending side:

 

 

  Reveal hidden contents

 

 

Here you can see it recognizes my item has NBT and what the contents of the NBT are:

 

  Reveal hidden contents

 

 

Here is the contents of the packet payload:

 

  Reveal hidden contents

 

 

Here you can see that the receiving side recognizes my item with NBT and gets the correct NBT content:

 

  Reveal hidden contents

 

 

And finally here is the reconstructed ItemStack list, which you can see perfectly matches the one that was sent:

 

  Reveal hidden contents

 

 

Overall you can see that the code is really quite simple. The main thing is to come up with a mapping into the payload that can be decoded in the far end. The format I used was:

a) the Item ID as an int

b) the Item metadata as an int

c) a boolean for whether or not there is NBT

d) the NBT if any

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

My system is functional for vanilla now :)

 

It doesn't handle nbt data yet, but this is the next thing i am going to work on.

 

This is the itemStack list it generated on the server:

http://pastebin.com/KZ78zkhE

 

the 2048 indicates the amount of bytes used to transfer the data to the server (I found this number using buf.array().length, which i am guessing is the amount of bytes... but 2048 almost seems too perfect ;))

 

I am using the same mapping system i posted earlier, i just wrote a system to increase efficiency after the first mapping, and to send it all to the server, if you're interested in any of those i will happily post them, but i think they're quite generic.

 

Now i will implement nbt support.

I did know about ByteBufUtils, but i want to look for patterns in the nbtData before i send it to make sure i send the least amount of data needed.

I made the Mob Particles mod, you can check it out here: http://www.minecraftforum.net/topic/2709242-172-forge-mob-particles/

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I'm trying to create split out some common code from my current mod project into a new library. For dependency management, I'm attempting to use AWS S3 as a Maven repo. I've done this successfully with other projects in the past, but ForgeGradle doesn't seem to like the s3:// URL for my repository. Specifically, it's throwing the following exception when trying to resolve the net.minecraftforge:forge:1.21.1-52.1.0:userdev dependency:   My understanding is that modern versions of Gradle support this use case. Does ForgeGradle not? Is there a way that I can make this work? Thank you for any help you can offer.
    • Codice Sconto Temu 100$ DI SCONTO → [acu639380] per Clienti Esistenti   Ottieni  100$ di sconto con il Codice Promozionale Temu (acu639380) Temu continua a dominare il mondo dell’e-commerce con sconti imbattibili e prodotti di tendenza – e giugno 2025 non fa eccezione. Con il codice sconto Temu (acu639380), puoi ottenere fino a  100$ di sconto, sia che tu sia un nuovo cliente sia che tu stia tornando a fare acquisti. Grazie alla consegna ultra-rapida, spedizione gratuita in 67 paesi e sconti fino al 90%, Temu propone pacchetti esclusivi e codici promozionali imperdibili questo giugno. Ecco come sfruttare al meglio il codice (acu639380) e iniziare subito a risparmiare. Perché Giugno 2025 è il Momento Migliore per Acquistare su Temu Giugno è ricco di offerte a tempo limitato, nuovi arrivi di tendenza e sconti nascosti in tutte le categorie. Dalla moda all’elettronica, dalla bellezza agli articoli per la casa, Temu offre prodotti indispensabili a prezzi imbattibili. Usa il codice (acu639380) per accedere a:  100$ di sconto per nuovi utenti  100$ di sconto per clienti esistenti 40% di sconto extra su categorie selezionate Pacchetto di buoni da  100$ per nuovi e vecchi clienti Regalo di benvenuto gratuito per chi acquista per la prima volta Vantaggi Esclusivi dei Codici Sconto Temu Questi sconti sono pensati per ogni tipo di acquirente. Ottieni il massimo con: Codice Temu (acu639380)  100$ di sconto – Riduci il totale sui tuoi acquisti in blocco Codice Temu per utenti esistenti – Offerte premium riservate ai clienti fedeli Codice Temu per nuovi utenti – Grandi risparmi sul primo ordine Codice Temu 40% di sconto – Perfetto per moda e prodotti stagionali Pacchetto coupon da  100$ Temu – Risparmia su più ordini Coupon per nuovi utenti Temu – Inizia con un regalo + sconto Offerte Localizzate con il Codice Temu (acu639380) Grazie alla presenza globale di Temu, puoi accedere a offerte personalizzate ovunque ti trovi: Codice Temu  100$ di sconto – USA Codice Temu  100$ di sconto – Canada Codice Temu  100$ di sconto – Regno Unito Codice Temu  100$ di sconto – Giappone Codice Temu 40% di sconto – Messico Codice Temu 40% di sconto – Brasile Codice Temu  100$ di sconto – Germania Codice Temu  100$ di sconto – Francia Codice Temu per nuovi utenti – Argentina Coupon Temu per utenti esistenti – Italia Codice promozionale Temu (acu639380) – Spagna, giugno 2025 Cosa Comprare su Temu a Giugno 2025 L’ampio catalogo Temu include migliaia di categorie. Ecco alcuni articoli su cui usare il codice sconto (acu639380): Gadget intelligenti e accessori Moda per tutte le età Decorazioni per la casa e soluzioni salvaspazio Prodotti per il benessere, fitness e bellezza Utensili da cucina e pentolame Articoli per ufficio, giochi e regali La Mia Esperienza Risparmiando  100$ con il Codice Temu (acu639380) Quando ho usato il codice (acu639380) da cliente abituale, ho ricevuto immediatamente  100$ di sconto. Combinandolo con la promozione del 40% e il pacchetto da  100$, ho ottenuto oltre 200 $ di valore per meno di 80 $. Anche tu puoi farlo. Ti basta inserire (acu639380) al checkout, e lo sconto si applica automaticamente – con spedizione gratuita in tutto il mondo inclusa. Altri Sconti Temu per Giugno 2025 Questo mese è pieno di offerte a rotazione, pacchetti a sorpresa e vendite flash giornaliere. Resta aggiornato su: Nuove uscite con il coupon per nuovi utenti Temu Aggiornamenti settimanali dei codici per clienti esistenti Promozioni regionali con il codice (acu639380) per giugno 2025 Conclusione Ovunque ti trovi – in Nord America, Europa o Sud America – il codice Temu (acu639380) è la chiave per risparmiare alla grande. Con offerte per nuovi utenti e clienti fedeli, questo è il momento perfetto per approfittare dei prezzi imbattibili di Temu. Usa il codice acu639380 oggi stesso per ottenere vantaggi esclusivi e trasformare il tuo shopping in un’esperienza smart e conveniente.      
    • Temu  Coupon Code $100 Off [acu639380] For Existing Customers + New Users Unlock Massive Savings with  Temu  Coupon Codes: Save Big with $100 OFF and More!  Temu  is a revolutionary online marketplace that offers a huge collection of trending items at unbeatable prices. Whether you're looking for gadgets, home décor, fashion, or beauty products,  Temu  has something for everyone. By using the  Temu  coupon code $100 OFF → [acu639380] for existing customers, you can unlock incredible discounts, save up to 90%, and even enjoy free shipping to over 67 countries. In this blog, we will explore the latest  Temu  coupon code offerings, including $100 off for new and existing users, a special 40% discount on select items, and the incredible  Temu  coupon bundle. Read on to discover how you can make the most of these discounts and enjoy amazing deals with  Temu  this June! What is  Temu  and Why Should You Shop There?  Temu  is a one-stop online shopping destination that offers a vast selection of products at prices that are hard to beat. Whether you're purchasing for yourself or looking for gifts,  Temu  delivers a wide variety of high-quality products across different categories. From clothing to electronics, home essentials, beauty products, and much more,  Temu  has something for everyone. With its fast delivery, free shipping in over 67 countries, and discounts of up to 90% off, it’s no wonder why shoppers worldwide love this platform. Not only does  Temu  offer competitive prices, but their frequent promotions and coupon codes make shopping even more affordable. In this blog, we’ll focus on how you can save even more with  Temu  coupon codes, including the highly sought-after $100 OFF and 40% OFF codes. The Power of  Temu  Coupon Code $100 OFF → [acu639380] for Existing Customers If you're a  Temu  existing customer, you can unlock a fantastic $100 OFF by using the code [acu639380]. This coupon code provides a generous discount, allowing you to save big on your next purchase, whether it’s electronics, fashion, or home décor. Here’s why you should take advantage of this offer: Flat $100 off: This code gives you a flat $100 discount on your order. Available for Existing Users: If you've shopped with  Temu  before, this coupon code is for you! Unbeatable Deals: Use this coupon in combination with other ongoing sales for even bigger savings. Huge Selection: Apply the code across  Temu ’s massive inventory, from tech gadgets to everyday essentials.  Temu  Coupon Code $100 OFF → [acu639380] for New Users Are you new to  Temu ? You’re in luck!  Temu  has a special $100 off coupon code just for you. By using [acu639380], new users can enjoy a $100 discount on their first purchase. This is an excellent way to try out the platform without breaking the bank. Here’s how to make the most of your  Temu  coupon code as a new user: $100 Off Your First Order: If you’ve never shopped with  Temu  before, the [acu639380] code gets you $100 off your first purchase. Great for First-Time Shoppers: Explore  Temu 's range of trending items while saving money right from the start. Free Gifts: As a new user, you June also receive a special gift with your order as part of the ongoing promotions.  Temu  Coupon Code 40% Off → [acu639380] for Extra Savings Looking for even more savings? The 40% off coupon is an amazing deal that’s available for a limited time. By using the code [acu639380], you can enjoy an extra 40% off on selected items. Whether you're shopping for electronics, home goods, or fashion, this coupon code allows you to grab even better deals on top of existing discounts. 40% Extra Off: This discount can be applied to select categories and items, giving you incredible savings. Stack with Other Offers: Combine it with other promotions for unbeatable prices. Popular Items: Use the 40% off code to save on some of  Temu ’s hottest items of the season.  Temu  Coupon Bundle: Unlock Even More Savings When you use the  Temu  coupon bundle, you get even more benefits.  Temu  offers a $100 coupon bundle, which allows both new and existing users to save even more on a variety of products. Whether you're shopping for yourself or buying gifts for others, this bundle can help you save big. $100 Coupon Bundle: The  Temu  coupon bundle lets you apply multiple discounts at once, ensuring maximum savings. Available to All Users: Whether you’re a first-time shopper or a returning customer, the bundle is available for you to enjoy. Stacked Savings: When combined with other codes like the 40% off or the $100 off, you can save up to 90%.  Temu  Coupon Code June 2025: New Offers and Promotions If you're shopping in June 2025, you're in for a treat!  Temu  is offering a range of new offers and discount codes for the month. Whether you're shopping for electronics, clothing, or home décor, you’ll find discounts that will help you save a ton. Don’t miss out on the  Temu  promo code and  Temu  discount code that are available only for a limited time this month.  Temu  New User Coupon: New users can save up to $100 off their first order with the [acu639380] code.  Temu  Existing User Coupon: Existing users can unlock $100 off using the [acu639380] code.  Temu  Coupon Code for June 2025: Get discounts on select items with up to 40% off this June.  Temu  Coupon Code for Different Countries No matter where you live,  Temu  has something special for you! You can use  Temu  coupon codes tailored to your country to unlock great savings. Here’s a breakdown of how you can apply the [acu639380] coupon code in different regions:  Temu  Coupon Code $100 Off for USA: Use the [acu639380] code in the USA to save $100 off your order.  Temu  Coupon Code $100 Off for Canada: Canadians can enjoy $100 off using the [acu639380] code.  Temu  Coupon Code $100 Off for UK: British shoppers can save $100 with the [acu639380] code.  Temu  Coupon Code $100 Off for Japan: If you’re in Japan, apply the [acu639380] code to get $100 off.  Temu  Coupon Code 40% Off for Mexico: Mexican shoppers can get 40% off with the [acu639380] code.  Temu  Coupon Code 40% Off for Brazil: Brazil residents can save 40% by using the [acu639380] code. Why Shop with  Temu ?  Temu  isn’t just about the discounts; it’s about providing you with an exceptional shopping experience. Here’s why you should choose  Temu  for your next shopping spree: Huge Selection of Trending Items: From the latest tech gadgets to fashion and home essentials,  Temu  offers everything you need at amazing prices. Unbeatable Prices: With  Temu , you can shop for quality items at prices that are hard to match elsewhere. Fast Delivery: Enjoy fast and reliable delivery on all your orders. Free Shipping in Over 67 Countries: No matter where you are,  Temu  ensures you get your products without any extra shipping fees. Up to 90% Off: Take advantage of massive discounts on selected products, so you can get more for less. Conclusion: Maximize Your Savings with  Temu  Coupon Codes If you're looking for incredible deals, there’s no better time to shop at  Temu . With  Temu  coupon code $100 OFF for existing and new users, an extra 40% off, and amazing coupon bundles, there are plenty of ways to save big. Don’t forget to check out the  Temu  promo code for June 2025 and other exciting offers throughout the month. By using [acu639380], you can make the most of your shopping experience and enjoy unbeatable prices on all your favorite products. So, what are you waiting for? Start shopping with  Temu  today, and enjoy massive savings with the $100 off and 40% off coupon codes. Happy shopping!  Temu  Coupon Code Summary:  Temu  Coupon Code $100 Off → [acu639380]: Save $100 on your purchase.  Temu  Coupon Code $100 Off for New Users → [acu639380]: New users can get $100 off.  Temu  Coupon Code $100 Off for Existing Users → [acu639380]: Existing users can save $100.  Temu  Coupon Code 40% Off → [acu639380]: Enjoy 40% off select items.  Temu  Coupon Bundle: Access a $100 coupon bundle for even more savings.  Temu  Promo Code for June 2025: Latest deals for June 2025.  
    • Ultimate Guide to Temu Coupon Code $100 Off [acu639380] – June 2025 Deals Get ready to unlock massive savings with Temu coupon code (acu639380) this June 2025. Whether you're a new or existing user, this exclusive code delivers an incredible Temu coupon $100 off and much more. Temu has rapidly grown into a global favorite, offering unbeatable prices, trending items, free shipping in 67 countries, and discounts of up to 90%. With the Temu coupon for June 2025, you’re in for exclusive deals, exciting bonuses, and incredible bundles that transform the way you shop. Why Temu Is a Shopper’s Paradise Temu boasts a vast and frequently updated catalog, ranging from home essentials to tech gadgets and fashion. This June, Temu's latest offers bring deeper discounts and irresistible incentives for both new and returning users. What sets Temu apart is the blend of value, variety, and verified discounts. Whether you’re shopping for back-to-school supplies, seasonal fashion, or must-have gadgets, Temu has a curated collection just for you. Benefits of Using Temu Coupon Code (acu639380) Take advantage of these powerful benefits when you apply Temu coupon code (acu639380): $100 off for new users $100 off for existing users 40% extra off select products Free gift for new users $100 coupon bundle available to all users Highlighted Offers: Temu Promo Codes and Discounts Temu Coupon Code (acu639380) $100 Off Perfect for big-ticket items. This gives new users a direct $100 discount on their very first order. Temu Coupon Code (acu639380) 40% Off Score an additional 40% off eligible categories—from fashion and electronics to decor and more. Temu $100 Coupon Bundle Get a series of coupons totaling $100 to use across multiple purchases. Great for consistent shoppers looking to save more. Temu First-Time User Coupon Unlock generous discounts and enjoy a free surprise gift when you make your first purchase on Temu. Real Shopping, Real Savings: Why Customers Love Temu Customers don’t just visit Temu—they buy, save, and come back for more. Here’s why: Smart Savings: With coupon code (acu639380), users save up to $100 instantly. Huge Selection: Daily updates bring new trending products in every category. Verified Quality: Positive reviews praise product quality, delivery speed, and easy returns. Stackable Deals: Combine flash sales with Temu discount code (acu639380) for unmatched savings. Regional Benefits: Temu Coupons by Country Temu coupon code $100 off for USA – Use (acu639380) and save big on tech and lifestyle buys. Temu coupon code $100 off for Canada – Ideal for fashion, home, and gadgets. Temu coupon code $100 off for UK – New and existing users benefit in June 2025. Temu coupon code $100 off for Japan – Access regional deals and bundles. Temu coupon code 40% off for Mexico – Get deeper discounts with code (acu639380). Temu coupon code 40% off for Brazil – Slash prices even further on trending products. Temu promo code (acu639380) for June 2025 – Valid worldwide with universal perks. Temu discount code (acu639380) for June 2025 – Makes global shopping even more affordable. Why Use Temu Promo Code (acu639380) in June 2025? This isn’t just a promo code—it’s your gateway to smarter spending. As someone who’s always looking for value, I can tell you that Temu coupon code (acu639380) brings unbeatable deals. Here's what you unlock: Flat $100 off Up to 40% off select categories Exclusive $100 coupon bundle Free gifts for new users Free worldwide shipping What Makes Temu Stand Out? Enormous Catalog: From tech to beauty, thousands of items updated regularly Huge Savings: Prices reduced by up to 90% Fast Delivery: Ships quickly to 67+ countries Global Trust: Popular across North America, South America, Europe, and Asia How to Use Temu Coupon Code (acu639380) Visit Temu.com Browse and add your favorite items to your cart Proceed to checkout Enter acu639380 in the coupon field Confirm your discount and complete your order Explore additional keywords and deals: Temu coupon for June 2025 Temu coupons for new users Temu coupons for existing users Temu promo code (acu639380) for June 2025 Temu new offers in June 2025 Temu coupon code (acu639380) $100 off for new users Temu coupon code (acu639380) $100 off for existing users Temu has revolutionized online shopping with its incredible deals and generous coupons. Don’t miss the chance to apply Temu coupon code (acu639380) this month and make your shopping more rewarding than ever. Stay tuned—more insider deals and coupon secrets are on the way! Top-Ranked Temu Coupon Codes for June 2025 Temu coupon code (acu639380) $100 off for new users – Best overall for first-time shoppers Temu coupon code (acu639380) $100 off for existing users – Big savings for returning customers Temu coupon code (acu639380) 40% off – Great for everyday essentials Temu $100 coupon bundle – Ideal for those making multiple purchases Temu first-time user coupon – Save more and get a free gift Temu promo code (acu639380) for June 2025 – Verified, sitewide discount
    • Working $200 Off  Temu  Coupon Code [acu639380] First Order Exclusive  Temu  Coupon Code (acu639380) – Save Big on Your Shopping! Temu  has become a go-to online marketplace for shoppers looking for high-quality products at unbeatable prices. With millions of trending items, fast delivery, and free shipping available in 67 countries,  Temu  ensures a seamless shopping experience for its users. Now, you can make your purchases even more rewarding by using the  Temu  coupon code (acu639380) to unlock huge discounts of up to $200 and exclusive deals. Why Use the  Temu  Coupon Code (acu639380)? By applying the  Temu  discount code (acu639380) at checkout, you can enjoy massive savings of up to $200 on a wide range of categories, including electronics, fashion, home essentials, beauty products, and more. This special offer is available to both new and existing users, ensuring that everyone gets a chance to save big on their favorite items What Discounts Can You Get with  Temu  Coupon Code (acu639380)? Here’s what you can unlock with the  Temu  promo code (acu639380): $200 Off for New Users – First-time shoppers can enjoy a flat $200 discount on their initial order. $200 Off for Existing Users – Loyal customers can also claim $200 off their purchases with the same code. Extra 40% Off – The  Temu  discount code (acu639380) provides an additional 40% off on select items, maximizing your savings. $200 Coupon Bundle – Both new and existing users can receive a $200 coupon bundle, perfect for future purchases. Free Gifts for New Users – If you’re shopping on  Temu  for the first time, you June receive free gifts with your order.  Temu  Coupons for Different Countries  Temu  caters to shoppers worldwide, offering incredible discounts based on your location. Here’s how the  Temu  coupon code (acu639380) benefits users across different regions: United States – Get $200 off your first order using the  Temu  coupon code (acu639380). Canada – Enjoy $200 off on your first-time purchase. United Kingdom – Use the  Temu  promo code (acu639380) to get $200 off your first order. Japan – Japanese shoppers can claim $200 off their initial purchase. Mexico – Get an extra 40% discount on select products with the  Temu  coupon (acu639380). Brazil – Shoppers in Brazil can also save 40% on select items. Germany – Receive a 40% discount on eligible products with the  Temu  promo code (acu639380). How to Use the  Temu  Coupon Code (acu639380)? Applying the  Temu  discount code (acu639380) is simple and hassle-free. Follow these easy steps to redeem your discount: Sign Up or Log In – Create a new account or log in to your existing  Temu  account. Shop for Your Favorite Items – Browse through  Temu ’s vast collection and add products to your cart. Enter the Coupon Code – At checkout, apply the  Temu  promo code (acu639380) in the designated field. Enjoy Your Discount – See the discount applied to your order and proceed with payment. Why Shop on  Temu ? Apart from huge discounts,  Temu  offers several benefits that make shopping more exciting and budget-friendly: Up to 90% Off on Select Products –  Temu  regularly offers massive discounts on top-selling items. Fast & Free Shipping – Get your products delivered quickly with free shipping to 67 countries. Wide Product Selection – Shop from a vast range of categories, including electronics, fashion, home essentials, and more. Safe & Secure Payments –  Temu  ensures a secure checkout process for a smooth shopping experience. Exclusive App Deals – Download the  Temu  app for extra discounts and app-only promotions. Final Thoughts With  Temu ’s exclusive coupon code (acu639380), you can unlock huge savings and enjoy a premium shopping experience at an affordable price. Whether you are a new user looking for a $200 discount or an existing customer wanting an extra 40% off,  Temu  has something for everyone. Don't forget to claim your $200 coupon bundle and free gifts before these amazing deals expire! Start shopping today on  Temu  and use the  Temu  coupon code (acu639380) to maximize your savings!  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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