Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Zemelua

Members
  • Posts

    185
  • Joined

  • Last visited

Recent Profile Visitors

1645 profile views

Zemelua's Achievements

Creeper Killer

Creeper Killer (4/8)

0

Reputation

  1. I just want to draw one block state on the GUI but my code doesn't work. In the case of Either#ifLeft, it is drawn correctly..... what's wrong? https://github.com/Zemelua/UMU-Arcanum/blob/b66a48dd1018390543ebf6a5ede607bf915a508b/src/main/java/io/github/zemelua/umu_arcanum/client/renderer/gui/screen/codex/page/IndexPage.java#L63
  2. It dosent work...... @Override public void renderByItem(ItemStack itemStack, ItemTransforms.TransformType transformType, PoseStack poseStack, MultiBufferSource source, int light, int overlay) { // poseStack.pushPose(); UMUArcanum.LOGGER.info("custom model is rendered."); // Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera(); // poseStack.mulPose(Vector3f.YP.rotationDegrees(180F - camera.getYRot())); // poseStack.mulPose(Vector3f.XP.rotationDegrees(180F - camera.getXRot())); VertexConsumer consumer = source.getBuffer(RenderType.translucentNoCrumbling()); //test sprite TextureAtlasSprite sprite = Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(new ResourceLocation("minecraft", "block/water_still")); poseStack.mulPose(Minecraft.getInstance().getEntityRenderDispatcher().cameraOrientation()); Matrix4f matrix = poseStack.last().pose(); consumer.vertex(matrix, 0.0F, 1.0F, 0.0F).color(255, 255, 255, 255) .uv(sprite.getU( 0F), sprite.getV( 0F)).uv2(light).normal(0.0F, 1.0F, 0.0F).endVertex(); consumer.vertex(matrix, 0.0F, 1.0F, 1.0F).color(255, 255, 255, 255) .uv(sprite.getU(16F), sprite.getV( 0F)).uv2(light).normal(0.0F, 1.0F, 0.0F).endVertex(); consumer.vertex(matrix, 1.0F, 1.0F, 1.0F).color(255, 255, 255, 255) .uv(sprite.getU(16F), sprite.getV(16F)).uv2(light).normal(0.0F, 1.0F, 0.0F).endVertex(); consumer.vertex(matrix, 1.0F, 1.0F, 0.0F).color(255, 255, 255, 255) .uv(sprite.getU( 0F), sprite.getV(16F)).uv2(light).normal(0.0F, 1.0F, 0.0F).endVertex(); // poseStack.popPose(); // render Item model }
  3. I'm currently working on rendering a BlockEntityWithoutLevelRenderer. The custom item model is in the shape of a book and I want to draw a page-specific icon on it. This icon, like particles, always points towards the camera and is directly above the book I look from anywhere. What should I do with poseStack to draw this? public class CodexItemStackRenderer extends BlockEntityWithoutLevelRenderer { public CodexItemStackRenderer() { super(Minecraft.getInstance().getBlockEntityRenderDispatcher(), Minecraft.getInstance().getEntityModels()); } @Override public void renderByItem(ItemStack itemStack, ItemTransforms.TransformType transformType, PoseStack poseStack, MultiBufferSource source, int light, int overlay) { // poseStack.pushPose(); UMUArcanum.LOGGER.info("custom model is rendered."); // Camera camera = Minecraft.getInstance().gameRenderer.getMainCamera(); // poseStack.mulPose(Vector3f.YP.rotationDegrees(180F - camera.getYRot())); // poseStack.mulPose(Vector3f.XP.rotationDegrees(180F - camera.getXRot())); VertexConsumer consumer = source.getBuffer(RenderType.translucentNoCrumbling()); //test sprite TextureAtlasSprite sprite = Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(new ResourceLocation("minecraft", "block/water_still")); Matrix4f matrix = poseStack.last().pose(); consumer.vertex(matrix, 0.0F, 1.0F, 0.0F).color(255, 255, 255, 255) .uv(sprite.getU( 0F), sprite.getV( 0F)).uv2(light).normal(0.0F, 1.0F, 0.0F).endVertex(); consumer.vertex(matrix, 0.0F, 1.0F, 1.0F).color(255, 255, 255, 255) .uv(sprite.getU(16F), sprite.getV( 0F)).uv2(light).normal(0.0F, 1.0F, 0.0F).endVertex(); consumer.vertex(matrix, 1.0F, 1.0F, 1.0F).color(255, 255, 255, 255) .uv(sprite.getU(16F), sprite.getV(16F)).uv2(light).normal(0.0F, 1.0F, 0.0F).endVertex(); consumer.vertex(matrix, 1.0F, 1.0F, 0.0F).color(255, 255, 255, 255) .uv(sprite.getU( 0F), sprite.getV(16F)).uv2(light).normal(0.0F, 1.0F, 0.0F).endVertex(); // poseStack.popPose(); // render Item model } }
  4. I was developing on 1.16.5 until yesterday and moved it to 1.17, but I'm having two issues. 1. Crash when use custom liquid bucket. Displayed ""this.fluid" is null", but I don't think it should be null because the liquid is properly registered ... error log: custom fluid bucket is here : https://github.com/Zemelua/UMU-Arcanum/blob/main/src/main/java/io/github/zemelua/umu_arcanum/item/UMUArcanumItems.java 2. It seems that the biome is not registered. The other day, I encountered a similar error in 1.16.5, and at that time I just forgot to register the deferred register, but the error is displayed even though I registered properly this time. Also, this time the error biome id is -1 instead of 174 (the first index of the mod biome). error log: custom biome register is here : https://github.com/Zemelua/UMU-Arcanum/blob/main/src/main/java/io/github/zemelua/umu_arcanum/world/biome/UMUArcanumBiomes.java and data is here : https://github.com/Zemelua/UMU-Arcanum/blob/main/src/main/resources/data/umu_arcanum/worldgen/biome/dim_forest.json It took me a long time, but I couldn't figure out why this was happening. Help me. PS: Is this a possible 1.17 mapping issue? I'm using the official 1.17 mapping.
  5. ahhh, I was really stupid. I've used Deferred Register many times before, but forgot to register it this time. Luis, diesieben, sorry for the hassle, and thank you. Registering the Deferred Register worked perfectly.
  6. public void onFMLCommonSetup(final FMLCommonSetupEvent event) { try { Field field = BiomeRegistry.class.getDeclaredField("idToKeyMap"); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.PRIVATE & ~Modifier.FINAL); Int2ObjectMap<RegistryKey<Biome>> map = (Int2ObjectMap<RegistryKey<Biome>>) field.get(null); map.put(174, UMUArcanumBiomes.DIM_FOREST); field.set(null, map); LOGGER.warn(field.get(null).toString()); } catch (NoSuchFieldException exception) { exception.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } Is it like this? I still get the error ...
  7. public void onFMLCommonSetup(final FMLCommonSetupEvent event) { try { Field field = BiomeRegistry.class.getDeclaredField("idToKeyMap"); field.setAccessible(true); Int2ObjectMap<RegistryKey<Biome>> map = (Int2ObjectMap<RegistryKey<Biome>>) field.get(null); map.put(174, UMUArcanumBiomes.DIM_FOREST); } catch (NoSuchFieldException exception) { exception.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } I still get the same error. What's wrong......
  8. public UMUArcanum() { UMUArcanumBiomes.initialize(); UMUArcanumDimensions.initialize(); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onFMLCommonSetup); } public void onFMLCommonSetup(final FMLCommonSetupEvent event) { try { Field field = BiomeRegistry.class.getDeclaredField("idToKeyMap"); Int2ObjectMap<RegistryKey<Biome>> map = (Int2ObjectMap<RegistryKey<Biome>>) field.get(null); map.put(174, UMUArcanumBiomes.DIM_FOREST); } catch (NoSuchFieldException exception) { exception.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } Well, I still get the error. What should i do?
  9. understood. Will this be available in a future forge version or 1.17 without reflection?
  10. I found net.minecraft.world.biome.BiomeRegistry.idToKeyMap but it's private access. There are no other methods to access. According to this , registration should be done just by putting the json file. I think I'm putting the json file in the right place, but what's wrong ...
  11. I'm using Intellij IDEA's Minecraft Develoment Plugin, so I'm not sure which map I'm using. Probably mcp. WorldGenRegistrys has a static field Map <ResourceLocation, Supplier<?>> REGISTRY_NAME_TO_DEFAULT, which is private access. It looks like there are no other methods to access.
  12. What is BiomeRegistry.TO_NAME? There are no such methods or fields in the BiomeRegistry class ...
  13. full log: When I registered in data/modid/worldgen/biome/biome.json, I thought that I didn't need to use DeferredRegister, but I got the same error when I didn't use DeferredRegister. No other mods have been introduced.
  14. I implement a custom biome in a custom dimension and it crashes when I try to enter the custom dimension with /execute in umu_arcanum: the_silence run tp 0 0 0 (Unknown biome id emitted by layers: 174). I've referred to some mods that implement custom biomes in custom dimensions, but I'm not sure why this error is occurring. Here is my code: https://github.com/Zemelua/UMU-Arcanum
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.