Jump to content

NorthWestWind

Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by NorthWestWind

  1. I have these lines of code in my custom TileEntityRenderer: public void render(MyTileEntity tile, float partialTicks, MatrixStack matrix, IRenderTypeBuffer buffer, int light, int overlay) { ItemStack stack = tile.getWantingItem(); if (!stack.isEmpty()) { matrix.pushPose(); matrix.translate(0.5D, 1.6D, 0.5D); matrix.scale(0.9f, 0.9f, 0.9f); matrix.mulPose(Vector3f.YP.rotationDegrees(degrees++ / 2)); renderItem(stack, matrix, buffer, light); matrix.popPose(); } } private void renderItem(ItemStack stack, MatrixStack matrix, IRenderTypeBuffer bufferIn, int combinedLightIn) { Minecraft.getInstance().getItemRenderer().renderStatic(stack, ItemCameraTransforms.TransformType.FIXED, combinedLightIn, OverlayTexture.NO_OVERLAY, matrix, bufferIn); } The `tile.getWantingItem()` creates an ItemStack from Item. The code above renders the item on top of the block, rotating, but very dark. However, I also have another TileEntityRenderer that renders item correctly, with lights, and the same code except the `tile.getWantingItem()` part. It instead gets ItemStack from its inventory. I think the problem might be the creation of ItemStack, but I don't really know. Can anyone tell me how to fix this?
  2. I actually tried FogColors before FogDensity. Still no luck.
  3. I found the problem. It turns out to be an external library I declared in build.gradle. When I removed the dependency and compile, the mod finally runs in client.
  4. I'm still trying to fix it. I duped my project and now trying to run/compile with minimal modification.
  5. I just went to search for more and I came across this Although it is for 1.8, I'm suspecting this is causing the issue.
  6. I make my mod with IntelliJ and runClient didn't tell me any issue. However, after I build the mod using gradlew build and run it on Forge 36.1.0, it cannot load into world with the mod as it says datapack error. I looked at the log, and the error originates from RecipeManager.fromJson and it's an AbstractMethodError. I noticed that it is about my recipe serializer, so I tried a lot of stuff with it. It runs well on IntelliJ without any error or datapack warning, but when it comes to a Forge profile (36.1.0), it just emits error when loading into worlds, including world creation. I have no idea what's going on, but here are the things I'm going to try, Use an updated version of Forge (in Minecraft launcher) Run in another clean profile (Just tried both. They failed.)
  7. After looking around a little more, I found the way to use custom chunk generator in the nether. It turns out ForgeWorldType.IChunkGeneratorFactory has a method like this (Note: I'm using official mappings): default DimensionGeneratorSettings createSettings(DynamicRegistries dynamicRegistries, long seed, boolean generateStructures, boolean bonusChest, String generatorSettings) { Registry<Biome> biomeRegistry = dynamicRegistries.registryOrThrow(Registry.BIOME_REGISTRY); Registry<DimensionType> dimensionTypeRegistry = dynamicRegistries.registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY); Registry<DimensionSettings> dimensionSettingsRegistry = dynamicRegistries.registryOrThrow(Registry.NOISE_GENERATOR_SETTINGS_REGISTRY); return new DimensionGeneratorSettings(seed, generateStructures, bonusChest, DimensionGeneratorSettings.withOverworld(dimensionTypeRegistry, DimensionType.defaultDimensions(dimensionTypeRegistry, biomeRegistry, dimensionSettingsRegistry, seed), createChunkGenerator(biomeRegistry, dimensionSettingsRegistry, seed, generatorSettings))); } DimensionType.defaultDimensions actually handles the nether and end chunk generators. So, what I did was copy their entire method, which originally looks like this: private static ChunkGenerator defaultEndGenerator(Registry < Biome > p_242717_0_, Registry < DimensionSettings > p_242717_1_, long p_242717_2_) { return new NoiseChunkGenerator(new EndBiomeProvider(p_242717_0_, p_242717_2_), p_242717_2_, () - > { return p_242717_1_.getOrThrow(DimensionSettings.END); }); } private static ChunkGenerator defaultNetherGenerator(Registry < Biome > p_242720_0_, Registry < DimensionSettings > p_242720_1_, long p_242720_2_) { return new NoiseChunkGenerator(NetherBiomeProvider.Preset.NETHER.biomeSource(p_242720_0_, p_242720_2_), p_242720_2_, () - > { return p_242720_1_.getOrThrow(DimensionSettings.NETHER); }); } public static SimpleRegistry < Dimension > defaultDimensions(Registry < DimensionType > p_242718_0_, Registry < Biome > p_242718_1_, Registry < DimensionSettings > p_242718_2_, long p_242718_3_) { SimpleRegistry < Dimension > simpleregistry = new SimpleRegistry < > (Registry.LEVEL_STEM_REGISTRY, Lifecycle.experimental()); simpleregistry.register(Dimension.NETHER, new Dimension(() - > { return p_242718_0_.getOrThrow(NETHER_LOCATION); }, defaultNetherGenerator(p_242718_1_, p_242718_2_, p_242718_3_)), Lifecycle.stable()); simpleregistry.register(Dimension.END, new Dimension(() - > { return p_242718_0_.getOrThrow(END_LOCATION); }, defaultEndGenerator(p_242718_1_, p_242718_2_, p_242718_3_)), Lifecycle.stable()); return simpleregistry; } And changed simpleregistry.register(Dimension.NETHER, new Dimension(() - > { return p_242718_0_.getOrThrow(NETHER_LOCATION); }, defaultNetherGenerator(p_242718_1_, p_242718_2_, p_242718_3_)), Lifecycle.stable()); into simpleregistry.register(Dimension.NETHER, new Dimension(() -> dimensionTypes.getOrThrow(DimensionType.NETHER_LOCATION), new SkyblockNetherChunkGenerator(NetherBiomeProvider.Preset.NETHER.biomeSource(biomeRegistry, seed), seed, () -> settings.getOrThrow(DimensionSettings.NETHER))), Lifecycle.stable()); Now I have full control about how the nether generates.
  8. Thank you for giving me examples, will definitely try it very soon. And by "remove all other terrains", I mean I want nether biomes to generate on islands, like in the end (but smaller). Also about the DimensionSettings thing, I would actually like to override the chunk generator of the nether instead so I can take full control about the nether generation. Is there any way to achieve this?
  9. I want to make the nether only generates features like fortresses, bastions but not bones, and remove all other terrains and the bedrock roof while still keeping the biomes and lava. The problem is that I don't even know how I can edit them.
  10. The latter. My world type generates a Skyblock world with overworld biome provider and custom chunk generator that generates nothing except the island.
  11. I have created a custom world type extending ForgeWorldType. It shows up in the create world screen, and it generates properly. However, I would like to override the nether generation. How can I do that?
  12. Here's my current code: @SubscribeEvent public static void renderFogDensity(final EntityViewRenderEvent.FogDensity event) { PlayerEntity player = Minecraft.getInstance().player; if (player == null) return; event.setCanceled(true); event.setDensity(0); RenderSystem.fogMode(GlStateManager.FogMode.EXP2); } Tested with/without fogMode, setting density between 0-1 and the bottom half of the sky is still black (when 0). When set to 1, I can't see a thing.
  13. Cancelled it: @SubscribeEvent public static void renderFogDensity(final EntityViewRenderEvent.FogDensity event) { PlayerEntity player = Minecraft.getInstance().player; if (player == null) return; event.setCanceled(true); } And it didn't disappear
  14. When going under y63 or something, the bottom half of the sky turns black. Is there a way to disable that?
  15. Thank you. I think this may actually help me to find out what to do.
  16. Well actually Twilight Forest IS on 1.16 in GitHub and they release dev versions on Discord. https://github.com/TeamTwilight/twilightforest
  17. I'm trying to make a custom dimension, but I have no idea about what to do in 1.16. I read another topic another day and was told that it is now data driven, but I still need an example. I tried to look at other mods' source (Twilight Forest) and I saw nothing like what I saw in Minecraft Wiki.
  18. I have been searching for solution for the last few hours and I came across IBakedModels. It seems very likely to be the solution, but I don't really know how to dynamically rotate an item.
  19. Yes, I'm looking for such behaviour. However, I want my item to have such behaviour even without right-click.
  20. Holding right-click with a bow in thirdperson will make the bow aim at whereever you are looking at (i.e. follows the player's head rotation). I want my items to be able to do the same but I have no idea. What should I do?
  21. Alright thank you!
  22. When the durability of an item changes, it goes down and up again in firstperson mode. How can I remove this feature?
  23. Well that's bad. Now that I think about it, maybe I should add a block that constantly emit redstone signal when the player is having the item near it. Would it work?
  24. I want to make an item that when the user holds it, it powers a redstone wire or piston under the player (which means 2 blocks under). Here is my approach in LivingUpdateEvent when the player have the item: Vector3d pos = entity.getPositionVec(); BlockPos blockPos = new BlockPos(pos); BlockState state = entity.world.getBlockState(blockPos); BlockState understate = entity.world.getBlockState(blockPos.down()); if (state.func_235901_b_(BlockStateProperties.POWERED)) entity.world.setBlockState(blockPos, state.with(BlockStateProperties.POWERED, true), 3); if (understate.func_235901_b_(BlockStateProperties.POWERED)) entity.world.setBlockState(blockPos, understate.with(BlockStateProperties.POWERED, true), 3); if (state.func_235901_b_(BlockStateProperties.POWER_0_15)) entity.world.setBlockState(blockPos, state.with(BlockStateProperties.POWER_0_15, 15), 3); if (understate.func_235901_b_(BlockStateProperties.POWER_0_15)) entity.world.setBlockState(blockPos, understate.with(BlockStateProperties.POWER_0_15, 15), 3); if (state.func_235901_b_(BlockStateProperties.LIT)) entity.world.setBlockState(blockPos, state.with(BlockStateProperties.LIT, true), 3); if (understate.func_235901_b_(BlockStateProperties.LIT)) entity.world.setBlockState(blockPos, understate.with(BlockStateProperties.LIT, true), 3); if (state.func_235901_b_(BlockStateProperties.EXTENDED)) entity.world.setBlockState(blockPos, state.with(BlockStateProperties.EXTENDED, true), 3); if (understate.func_235901_b_(BlockStateProperties.EXTENDED)) entity.world.setBlockState(blockPos, understate.with(BlockStateProperties.EXTENDED, true), 3); And it is just very buggy.
  25. Alright, I clearly misunderstood everything. I just swapped `MinecraftForge.EVENT_BUS` with `FMLJavaModLoadingContext.get().getModEventBus()` and then everything works again. Sorry for being dumb.
×
×
  • Create New...

Important Information

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