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

Zemelua

Members
  • Posts

    190
  • Joined

  • Last visited

Recent Profile Visitors

1963 profile views

Zemelua's Achievements

Creeper Killer

Creeper Killer (4/8)

0

Reputation

  1. I was expecting to get a FluidModel with ModelBakeEvent, but apparently this isn't being used. It is the LiquidBlockRenderer class that actually renders the liquid. By rewriting the getLightColor method of this class, my goal was achieved. However, since I'm using a mixin, if anyone has an idea that can do the same within the forge, I'd appreciate it if you could tell me for other modders who saw this as well.
  2. I have implemented a custom liquid and it is working. Now, I want to make it glow like a spider's eye (I know it's not really shining, it's rendered ignoring shadows). I want to make the whole block shine, not just a part like the eyes of a spider. Here is my code. Apply ManaModel to my liquid block with ClientHanlder.onModelBake. ManaModel is an IBakedModel and I believe it can be rendered by overriding getQuads and setting the quads to the maximum light. But it doesn't work. Is it because ManaModel.putLightVertex is not passing the correct value? Or is it not possible to apply the light in the first place? Model is complicated, please help someone.
  3. I'm trying to render a shooting star on the night sky. I succeeded in actually drawing a shooting star, referring to the rendering of the vanilla stars, but for some reason it is only drawn in the northern sky. Is there anyone who can help me? My code is here: https://github.com/Zemelua/UMU-Client/blob/main/src/main/java/io/github/zemelua/umu_client/renderer/world/FallingStarRenderer.java
  4. I would like to leave a bullet hole there when my custom projectile hits a block. I can get BlockHitResult with Projectile#onHitBlock, 1. What should I use to render bullet holes? particle? But it points towards the player's camera. Should I create a bullet hole class, save it to a Map and render it directly? 2. No matter how I render, I need data of the angle of the hit surface and its angle. How do I get this? 3. When the bullet hits a block such as a stone, I would like to reflect it instead. After getting the angle of the surface in 2, how do I calculate the reflected vector from it and the delta movement of the bullet? Please let me know if you have any hints for any of 1, 2 or 3. For reference, my code is here .
  5. My custom entity is spawning, but push is moving only the server side entity. The client remains stationary at the spawned position. Are the coordinates of the entity not automatically synchronized? if (!world.isClientSide()) { WhirlwindEntity whirlwind = ModEntities.WHIRLWIND.get().spawn( (ServerLevel) world, null, null, null, player.blockPosition(), MobSpawnType.TRIGGERED, false, false ); if (whirlwind != null) { Vec3 moveVec = player.getLookAngle().scale(2.0D); whirlwind.push(moveVec.x(), moveVec.y(), moveVec.z()); } }
  6. 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
  7. 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 }
  8. 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 } }
  9. 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.
  10. 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.
  11. 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 ...
  12. 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......
  13. 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?
  14. understood. Will this be available in a future forge version or 1.17 without reflection?
×
×
  • Create New...

Important Information

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