#mod-dev-talk Wednesday 12 January 2022
147 messages4 people
- J
- E
- J01:59Namely, the current version of Minecraft only allows 64 different map colors. And it's currently using 62 of them02:00The map colors also must be numbered from 0 to 63, and if any two map colors have the same ID, bad stuff happens02:00This project lets you make any number of maps that you want, with any ID you want, to prevent conflicts with other mods adding map colors02:00I might take it public but I haven't decided on that yet. It's mostly just for fun
- E
- G03:19I seem to be having some memory coherence issues.
- J
- G
- J03:26Do you know what's up with my mixin though?
- G
- J03:27
fillExplorationMap - G
- J
- G
- J03:29
@Inject(method = "fillExplorationMap", locals = LocalCapture.CAPTURE_FAILHARD, at = @At( value = "INVOKE", target = "Lnet/minecraft/item/map/MapState;setColor(IIB)V" ) ) private static void overrideWithColor(ServerWorld world, ItemStack map, CallbackInfo ci, MapState mapState, int i, boolean[] bls, int l, int m, int category, MapColor.Brightness brightness, MapColor mapColor, MapState mapState, int i, boolean[] bls, int l, int m, int category, MapColor.Brightness brightness, MapColor mapColor, MapState mapState, int i, boolean[] bls, int l, int m, int category, MapColor.Brightness brightness, MapColor mapColor, MapState mapState, int i, int j, int k, boolean[] bls, int l, int m, int category, MapColor.Brightness brightness, MapColor mapColor) { ((MapStateExtensions) mapState).setColor(l, m, mapColor.getRenderColor(brightness)); }03:29Here's after the plugin "fixing" it - G03:29It grabs all the locals it can then.
- J03:29It grabs more than that exist
- G
- J
- G
- J
- G
- J
- G
- J
- J
Replying togudenauLooks like it wants int, boolean[], int, int, int, etc..
This is what my parameters look like03:33But mixin says otherwise - G03:33Did you print it before?
- J03:33Oh like local capture print?
- G
- J
- G
- J
Replying togudenaufound is what you wrote, expected is what it can access, available I don't know.
it got the found section wrong btw. I wroteprivate static void overrideWithColor(ServerWorld world, ItemStack map, CallbackInfo ci, MapState mapState, int i, boolean[] bls, int l, int m, int category, MapColor.Brightness brightness, MapColor mapColor) { ((MapStateExtensions) mapState).setColor(l, m, mapColor.getRenderColor(brightness)); } - G
- J
- J
Replying togudenauI don't know.
I read this in the voice of the little guy from kung fu panda03:36I don't remember his name03:36Master something(edited) - G03:36Or whatever.
- J
- G
- J
- G
- J
- G
- J
- G
- J03:45Yeah
- G03:45Do you know anything about C?
- J
- GI have something like this:
This is printing#include <cstdio> extern "C" { # include <pthread.h> # include <semaphore.h> } sem_t semaphore; pthread_t thread; bool shouldRun; int main(int argc, char** argv){ sem_init(&semaphore); shouldRun = true; pthread_create(&thread, nullptr, [](void* user)->void*{ sem_wait(&semaphore); while(shouldRun){ printf("Thread work\n"); sem_wait(&semaphore); } return nullptr; }, nullptr; sleep(4); shouldRun = false; sem_post(&semaphore); pthread_join(thread, nullptr); return 0; }Thread workin my program.03:46:V03:47Nand::Nand(void){ INFO("Nand was called"); shouldRun = true; sem_init(&threadSemaphore, 0, 1); pthread_create(&threadHandle, nullptr, [](void* user)->void*{ ((Nand*)user)->thread(); return nullptr; }, this); } Nand::~Nand(void){ INFO("~Nand was called"); shouldRun = false; notifyThread(); pthread_join(threadHandle, nullptr); sem_destroy(&threadSemaphore); } void Nand::notifyThread(void){ sem_post(&threadSemaphore); } void Nand::thread(void){ sem_wait(&threadSemaphore); while(shouldRun){ DEBUG("Nand \"work\""); nandAddress = 0; for(int i = 0; i < 5; i++){ nandAddress |= addressEnable[i] ? (addressParts[i] << (i * 8)) : 0; } sem_wait(&threadSemaphore); } }03:48[INFO ][Nand][ 67] Nand was called [DEBUG][thread][230] Nand "work" [INFO ][~Nand][ 79] ~Nand was calledauto nand = new starlet::hardware::Nand(); sleep(2); delete nand;03:49I don't know how to do the Javavolatilehere. - J
- G
- J03:51I didn't read past the first sentence though
- G
- J
- G
- J04:19Maybe04:19It's super ass backwards though04:20So I think it reads what you have, and then tries to figure out if that's correct. So expected is what you have, and it expects the original method to have that. Found is what the original method offers, and available is something else I guess04:21So it's like from the perspective of the mixin. Seems super counterintuitive(edited)04:22Got map packets working
- G04:23I'm stupid.
- J04:30The map code is spread across
\render,\item,\block,\network, you name it04:30Chances are, if you can think of a directory, there's map code there04:32Oh wait hold on I can just unzip it04:33Nevermind, IntelliJ is stupid04:34mp4Map-Unfucker_MapState.class_Gradle__net.minecraft_minecraft-project--mapped_1.18.1_net.fabricmc.yarn.1_18_1.1.18.1build.1-v2_2022-01-11_20-34-28.mp4Video, 6.8 MB. Not stored in the archive.04:35Can't find a block in the blocks folder04:35Oh the popup isn't recorded04:36(The project name is temporary) - G
- J
- G
- J
- G
- J
- J05:02This should now be possible with my changes05:03That would be a fun challenge to add05:06According to this, if I add this in my mod mojang will not implement it as a feature in java(edited)05:07What how do you do links05:08Oh discord doesn't have support for them05:08Well whatever, you get the joke
- A
Replying toJack Papel(The project name is temporary)
tf you mean temporary? Map Unfucker is blessed - J
- G
- G
Replying toJack PapelAccording to this, if I add this in my mod mojang will not implement it as a feature in…
They still take mod ideas, they just don't credit anymore. - A
Replying toJack PapelHm... My original concerns were due to profanity and children, but come to think of it…
I will eternally love the dichotomy that sometimes forms here, you are worried about saying fuck in the name of a library almost nobody will ever read, meanwhile I have an item named
05:49Also I am pretty sure there is bee porn in a mod I've worked on somewhere





