I'm having trouble with NetSend for GlobalItem on servers, as a client.
Every time I pick up an item, I'll constantly start getting duplicates of said item in my inventory until I exit the game of my inventory gets full.
And as far as I could test, it only happens when ItemInfo is referenced, regardless if it actually contains anything.
I'm also compiling it in game in case that has any effect what so ever.
Here's some very small example code that causes my problems, and yes, I've tested this piece of code multiple times. Every time, I'll keep getting constant duplicate items.
And yes, I have absolutely no other mods loaded.
Code:
using Terraria;
using Terraria.ModLoader;
using System.IO;
namespace TestMod {
public class TestMod : Mod {
public TestMod() {
this.Properties = new ModProperties() {
Autoload = true,
AutoloadGores = true,
AutoloadSounds = true
};
}
}
public class GItem : GlobalItem {
public override void NetSend(Item item, BinaryWriter writer) {
IInfo info = item.GetModInfo<IInfo>(this.mod); // As long as this is here, I keep getting duplicate items constantly
writer.Write("DERP");
}
}
public class IInfo : ItemInfo {}
}
I've tried asking for help on Discord, but it's either at a bad time (someone else gets more priority help or the time of day), or there's nobody who can really help me.