Fabio
Fabio
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
after adding this kinda ugly solution its working even outside of debug wow
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
i noticed that if i set my breakpoint on the GetStream method and continue after the integer was sent it will always work
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
ill try to fix it later today its 3 am for me, anyways thanks alot for your help 🤗
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
yeah i didnt think it through so far i just wanted it to work when sending first time then handle that problem
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
and when im done it sends the tooltips
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
and im going from index 0 to 19
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
yes its a chest for example
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
not sure about that
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
should probably filter them here before sending i guess
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
yeah i filter them on the server
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
inside a minecraftevent in its own thread, i had to delete some checks tho
@SubscribeEvent
public void onInventoryRendering(GuiScreenEvent.DrawScreenEvent.Post post) {
try {
//basically check if in the right menu

List<List<String>> tooltipList = new ArrayList<>();

thread = new Thread(() -> {
try {
while (true) {
isrunning = true;
for (int i = 0; i < 20; i++) {
final int index = i;
ItemStack stack = chest.getSlot(i).getStack();
if (stack != null) {
tooltipList.add(stack.getTooltip(Minecraft.getMinecraft().thePlayer, false));
}
Thread.sleep(1);
}
}
if (tooltipList.size() > 0) {
socketSender.SendTooltips(tooltipList);
}
}
} catch (Exception e) {
e.printStackTrace();
}

});
if (!isrunning) {
thread.start();
}

}
}
}
} catch (Exception e) {
}
}
@SubscribeEvent
public void onInventoryRendering(GuiScreenEvent.DrawScreenEvent.Post post) {
try {
//basically check if in the right menu

List<List<String>> tooltipList = new ArrayList<>();

thread = new Thread(() -> {
try {
while (true) {
isrunning = true;
for (int i = 0; i < 20; i++) {
final int index = i;
ItemStack stack = chest.getSlot(i).getStack();
if (stack != null) {
tooltipList.add(stack.getTooltip(Minecraft.getMinecraft().thePlayer, false));
}
Thread.sleep(1);
}
}
if (tooltipList.size() > 0) {
socketSender.SendTooltips(tooltipList);
}
}
} catch (Exception e) {
e.printStackTrace();
}

});
if (!isrunning) {
thread.start();
}

}
}
}
} catch (Exception e) {
}
}
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
it goes through the tooltip list and when its done
if (tooltipList.size() > 0) {
socketSender.SendTooltips(tooltipList);
}
if (tooltipList.size() > 0) {
socketSender.SendTooltips(tooltipList);
}
` and on init it just initalizes the socketSender
@EventHandler
public void Init(FMLPreInitializationEvent event){
socketSender = new SocketSender("127.0.0.1", 5020);
MinecraftForge.EVENT_BUS.register(this);
}
@EventHandler
public void Init(FMLPreInitializationEvent event){
socketSender = new SocketSender("127.0.0.1", 5020);
MinecraftForge.EVENT_BUS.register(this);
}
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
the while wont block because they are both 0 i just realised
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
i dont know how its getting through the while either
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
when i debug it do it step by step it works and the tooltips are as expected
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
its just always empty
146 replies
CC#
Created by Fabio on 4/20/2023 in #help
✅ Send Integer over TCP from Java to C#
and run the code
146 replies