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

Nuparu00

Members
  • Posts

    16
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Personal Text
    Maybe I will write something here one day...

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Nuparu00's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. So I am porting my mod from 1.12.2 to 1.16.5, and it seems, that some significant changes were made to how Tile Entity (Special) Renderers work - to be more specific, how textures are bound. From the vanilla code it seems, that each vanilla TE has its own texture atlas, that contains all the textures the TE uses. The renderers then pick the texture they want from the atlas and get it as RenderMaterial. The RenderMaterial instance is then used to get IVertexBuilder, which is used to render the ModelRenderers. My question is, how do I achieve the same? Should I create my own atlas? Should I stitch my texture to some existing atlas? I have read something about putting the texture into textures/block, and using the block atlas, but I could not get the UVs right (and to be fair, I am still not sure if the texture even was ever stitched to the atlas). Or is there some other way to do it? From my research online it seems, people are using TER to render only items or fluids now, and keep the rest of the model in .json , or bake the models themselves/create their own render systems. Edit: Ok, it seems I have managed to make it work. Turns out that TextureStitchEvent must be registered on the mod event bus, not the Forge one. Anyway, I stitch the texture in there and then just create the RenderMaterial just like Vanilla does.
  2. Hi. I am updating my dimensions from 1.12.2 to 1.15.1. One of the things that my dimensions have is custom sky renderer (for custom sun/moon textures, etc..). I have taken a look at how vanilla Minecraft renders the sky in WorldRenderer#func_228424_a_(). The code looks mostly the same as in 1.12.2, however, there are definitely some changes (I suppose because of the new rendering engine). One of the arguments the method takes is of type MatrixStack. I suppose it is used to calculate positions and rotations of the horizon and celestial objects. Anyway, the thing is, that I do not know where should I get an instance of MatrixStack. It seems that it is created and passed from inside a method and is not stored in any field. Do you have any tips? Or is this just something that will be solved in the stable release?
  3. Hi. In my mod, I am rendering custom first-person arms when certain items are held. I managed to do this and it works and looks quite well. However, there is one major issue - the arms and the held item can clip through blocks, mobs, etc.. So I looked at how Minecraft renders its arms, and figured out, that it "disables depth" ( using GlStateManager.disableDepth() ) so the arms are rendered on top of everything else + it also enables culling ( GlStateManager.enableCull() ). I call these before rendering the arms (and also their "opposite functions" after rendering the arms), and it works - the arms are rendered as the vanilla ones. However, it doesn't work with complex items. It seems that this disables the "depth check" even between vertices that are part of the item, so the faces that are hidden and face the camera are rendered on top. My code: https://pastebin.com/qR8kJJDF EDIT: The problem almost surely is not with my models, as I tested it with vanilla items, and the same glitch occurred, though since Minecraft items are flat it is not this much visible.
  4. Hi. I have got an issue with a custom fluid block, that I have been trying to fix for a whole night. The issue is that I am not able to get my custom fluid texture to render. The Forge bucket texture works, but the actual block texture doesn't. No matter what I do I always get one of these results: The block is not rendered at all (there you can see through, but the block is obviously here as it still affects entities, make particles, etc...) The block is rendered as the missing model placeholder The block is rendered as a vanilla fluid My code: ModFluids.java - Here I initialize the Fluid https://pastebin.com/sxUHCSXc The fluid is registered from a static block in my main class: static { FluidRegistry.enableUniversalBucket(); FluidRegistry.registerFluid(ModFluids.GASOLINE); FluidRegistry.addBucketForFluid(ModFluids.GASOLINE); } BlockGasoline.java - The block that uses the Fluid https://pastebin.com/eVDV90vr The block is initialized like this: public static final Block GASOLINE = new BlockGasoline(ModFluids.GASOLINE,Material.WATER).setRegistryName("gasoline").setUnlocalizedName("gasoline"); And registered using RegistryEvent.Register<Block> @SubscribeEvent public static void registerBlocks(final RegistryEvent.Register<Block> event) { final IForgeRegistry<Block> registry = event.getRegistry(); for (Block block : SevenDaysToMine.BLOCKS) { registry.register(block); } } And this is how I register the models @SubscribeEvent @SideOnly(Side.CLIENT) public static void onModelEvent(final ModelRegistryEvent event) { for (Block block : SevenDaysToMine.BLOCKS) { registerBlockModel(block); } registerItemBlockModels(); registerItemModels(); } @SideOnly(Side.CLIENT) public static void registerBlockModel(Block block) { if (block instanceof IBlockBase) { IBlockBase iblockbase = (IBlockBase) block; if (iblockbase.hasCustomStateMapper()) { if (iblockbase.getStateMapper() != null) { ModelLoader.setCustomStateMapper(block, iblockbase.getStateMapper()); return; } else { Utils.getLogger().warn("Trying to add a null IStateMapper to " + block.getRegistryName() + " . That is a bad thing!"); } } } registerBlockModel(block, 0); } The .json blockstate file is correctly located in the blockstates folder and looks like this: { "forge_marker": 1, "variants": { "fluid": { "model": "forge:fluid", "custom": { "fluid": "gasoline" } }, "inventory": { "model": "forge:forgebucket", "transform": "forge:default-item", "custom": { "fluid": "gasoline" } } } } If I change in the file "gasoline" to some random word, it renders the vanilla water texture (which I suppose is a placeholder), however, if I change it to "lava", it correctly renders vanilla lava. EDIT: Solved, caused by Fluid#setColor()
  5. I have issues with ContainedDeps. Based on my research, if I add this to my build.gradle, it should populate the MANIFEST.MF and allow loading of the .jar files in the ./META-INF/libraries/ folder. The file is actually populated but classes from the libraries still can't be found: jar { manifest { attributes("Implementation-Title": "Gradle", "Implementation-Version": version, "ContainedDeps": "google-api-client-1.25.0 google-api-services-youtube-v3-rev209-1.25.0 google-http-client-1.25.0 google-http-client-jackson2-1.29.0 google-oauth-client-1.25.0 jdo2-api-2.3-eb jetty-6.1.26 jetty-util-6.1.26 transaction-api-1.1",) } }
  6. Oh, sorry I forgot that. I use Eclipse (Java 2018-12).
  7. I am trying to include libraries that my mod is using in the build (these libraries are not Minecraft specific APIs but Java libraries by Google,etc..). I have tried things like putting the libraries to the jar itself, messing with the gradle shadow plugin, the "jar-in-jar" function but without any success at all. I have spent last several hours reading documentation and forum posts but I can not still figure out how to do this.
  8. Ok. So I have prevented all my code from executing (except the main class of course) and it works, so I have to figure out what exactly causes this.
  9. Thank you, but there is not basically any place I could do this, as all logic of the registration should be handled by vanilla automatically unless I register it manually. When I tried to do so, I called GameRegistry#addShapedRecipe() from FMLInitializationEvent and I can confirm that it was called as the debug message has been printed + if I passed some non-sense (like a recipe with more than 9 items) actually threw an exception. I think that the game is aware of the recipe, because the recipe shows in the recipe book, but for some reason the output slot is empty.
  10. So I just redownloaded Forge MDK and created a new workspace and tried to make a recipe work in the example mod and it worked - after adding a .json file for a new advancement. But when I tried to replicate this in my actual workspace, it gave the same result as previous attempts. I have also tried using GameRegistry#addShapedRecipe() and RegistryEvent.Register<IRecipe>, but none of these worked at all. I do not know what to do now. I will wait and while and then I guess I have to either create my own recipe system, downgrade to 1.11.x or recreate my workspace.
  11. The thing is, there seems to be nothing that could be related to this. The only warning messages that are there are about my textures and models: https://pastebin.com/4SxKXjid
  12. Hi. I have wanted to add crafting recipes to my blocks/items, but I ran into a problem. If the recipe contains my custom items as ingredients, it works exactly as it should, but when the recipe uses vanilla-only items, it cannot be crafted. The recipe still appears in the "Recipe Book", but no item appears in the output slot. My only idea is that it has something to do with the advancements system, but since nowhere is mentioned anything about that, I don't think that is the case. The game does not throw any error/warning messages to the log, so I am quite clueless. I am using Forge 1.12.2-14.23.3.2676. This does work: { "type": "minecraft:crafting_shaped", "pattern": [ "S" ], "key": { "S": { "item": "sevendaystomine:smallrock" } }, "result": { "item": "sevendaystomine:woodplank" } } But this for some reason does not: { "type": "minecraft:crafting_shaped", "pattern": [ "S" ], "key": { "S": { "item": "minecraft:stick" } }, "result": { "item": "sevendaystomine:woodplank" } } EDIT: Updating to the recommended Forge 1.12.2-14.23.5.2768 did not help. I have also tried using generated recipes from https://crafting.thedestruc7i0n.ca/ and recipes from a various tutorial on the internet, but basically, as long as some of my items is not an ingredient, the recipe does not work. EDIT 2: So I have found the origin of this all. It is because I have registered my custom IRecipe classes from code, which seems to be not needed. I have removed the code that does this and now it works!
  13. Where and how did you register the TileEntity?
×
×
  • Create New...

Important Information

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