Jump to content

Dayo

Members
  • Posts

    18
  • Joined

  • Last visited

Recent Profile Visitors

3596 profile views

Dayo's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. When I was on lower version of MC, its free to join multiplayer MC server so I usually debug launching multiple instance of minecraft client on one laptop and execute server instance in there too(for easily investigate exception logs) From some days, it doesn't works now because of multiplayer disabled. I found this article about making authorization of development env in other post but it seems to fix username by my account. https://gist.github.com/50ap5ud5/beebcf056cbdd3c922cc8993689428f4#minecraft-authentication-in-dev-environments I want to change my username and multiple instance has not duplicated UUID. Is there any method available without purchasing multiple Minecraft as I want? Using MultiMC or third party launcher which provides offline launch support works fine but to do that, it requires unnecessary steps belong executing with IntellIJ directly
  2. Is getRotationYaw means raw data of yaw(not calculate about moduler 360)?
  3. I'm using 1.16.5 and thats not exists. I found Minecraft.getInstance().player.getHorizontalFacing.getHorizontalAngle Minecraft.getInstance().player.getRotationYaw But I have no idea how to use.
  4. How to get this value in my mod in client side?
  5. I want to render image from server so I'm going to use glTexImage2D for render the image. This is my code for GUI screen in 1.16.5 int texture = -1; void initializeGl() { texture = glGenTextures(); glBindTexture(GL_TEXTURE_2D, texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, myImagePixelArray); glBindTexture(GL_TEXTURE_2D, 0); } @override void render(MatrixStack mat, int mouseX, int mouseY, float partialTicks) { if(texture == -1) initializeGl(); glBindTexture(GL_TEXTURE_2D, texture); RenderUtil.renderRect(0, 0, 10, 10); glBindTexture(GL_TEXTURE_2D, 0); super.render(matrixStack, mouseX, mouseY, partialTicks); } Sometimes It works what I excepted but randomly it shows black texture or render only helf. What's wrong with my code? I cached array so myImagePixelArray always has same data.
  6. I want to make a mod which does initialize objects when user joined multiplayer server. Which event should I use?
  7. I'm using Discord Game SDK with forge and this requires to call getDiscord().run_callbacks() every frame of game. So, I want event that calls every time including pause screen, etc.
  8. I've solve my question. The problem is caused by size of direct buffer and I change calculation of pixels for val file: BufferedImage = ImageIO.read(File(ResourceUtil.baseDir, image)) val buf = ByteBuffer.allocateDirect(file.width * file.height * 4) for(pix in file.getRGB(0, 0, file.width, file.height, null, 0, file.width).asSequence().map{it.toUInt() and 0xFFFFFFFFu }) { buf.put((pix and 255u).toByte()) //R buf.put(((pix shr 8) and 255u).toByte()) //G buf.put(((pix shr 16) and 255u).toByte()) //B buf.put((pix shr 24).toByte()) //A } buf.flip() texture = GL11.glGenTextures() GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture) GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST) GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST) GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP) GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP) GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, file.width, file.height, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buf.asIntBuffer()) Thanks for reply
  9. I found that It has caused by stack-overflow but output of image is strange. I think this is not error about forge so I'm going to found other forum to ask
  10. This is my code about GUI and when I call this GUI screen with, Minecraft.getInstance().displayGuiScreen(ImageGui(commandContext.getArgument("message", String::class.java))) Minecraft crashes with after just one times of tick() with native error. This is error info (hs_err_pid***) Thanks
  11. I'm making resource pack to get images from extend of jar file.
  12. In my case, (I did that on 1.12.2 so I'm not sure it works on 1.13+) I make external mod for dependency with shadejar and set that mod to my dependency. This is example(1.12.2) https://github.com/dayo05/kotlinmod
  13. I want to create custom resource pack with implement of IResourcePack, I saw I need to make 8 functions. I'm migrating mod from 1.12.2 to 1.16.5, I have class OutResource(root: String): IResourcePack { override fun getInputStream(location: ResourceLocation): InputStream { return FileInputStream(File(rootDir, location.path)) } override fun resourceExists(location: ResourceLocation): Boolean { return File(rootDir, location.path).exists() } override fun getResourceDomains(): MutableSet<String> { return domains } override fun <T : IMetadataSection?> getPackMetadata( metadataSerializer: MetadataSerializer, metadataSectionName: String ): T? { return null } override fun getPackImage(): BufferedImage? { return null } override fun getPackName(): String { return name } val rootDir = File(name) companion object { val name = ImageOverlayMod.MOD_ID val domains = setOf(name).toMutableSet() } } But I have no idea how to implement getRootResourceStream, getResourceNamespaces, getMetadata. What is meaning of those functions?
×
×
  • Create New...

Important Information

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