-
Posts
266 -
Joined
-
Last visited
Everything posted by Kinniken
-
[1.12.2] Rending entity in GUI + exporting it to PNG?
Kinniken replied to Kinniken's topic in Modder Support
I feared as much. I had thought of the "mock world" idea but it seems like a lot of complexity and probably resource usage to add some pictures in a UI. Ah well, thanks for the info. -
[1.12.2] Rending entity in GUI + exporting it to PNG?
Kinniken replied to Kinniken's topic in Modder Support
That drawEntityOnScreen() is great, exactly what I needed and simple to use too! Bonus question: is there a similar way to render a set of blocks, outside of any world context? Say I have a method that creates a structure made of X blocks, I would like to be able to render it in a UI on a transparent background. Is that doable? -
[1.12.2] Rending entity in GUI + exporting it to PNG?
Kinniken replied to Kinniken's topic in Modder Support
Thanks, much appreciated! As the author of a fairly large and complicated mod I normally want to understand everything that's going on, but indeed OpenGL is so specific and so "niche" for a mod like mine that I never bothered. I'll try your code, thanks for documenting it so cleanly. -
[1.12.2] Rending entity in GUI + exporting it to PNG?
Kinniken replied to Kinniken's topic in Modder Support
Oh, lol. I've seen it so often I don't notice it anymore. Indeed seems like what I'm looking forward, thanks. For the export, I meant the render of the entity, on its own. I'll start by working my way through createScreenshot and work from there, good idea. -
Hi, Could anyone give me pointers on how to render entities for use as a 2D picture in a GUI? I.e. say a way to get a render of a sheep or any other mob to display in a custom GUI? I believe some mods can do this. Bonus question, is there a way to export the render in question to a PNG file? Thanks
-
[1.12.2] Block with an overlay conditional on nearby blocks
Kinniken replied to Kinniken's topic in Modder Support
Ok, what I had in mind would have looked neat but it's not important enough for that. I think I'll limit my "borders" to the top and bottom edges. -
[1.12.2] Block with an overlay conditional on nearby blocks
Kinniken replied to Kinniken's topic in Modder Support
@Draco18s Thanks for the infos. I get the 43 cases, indeed with corners it would come to that much, and while I had not mentioned it I'd ideally want that. I guess I could do that, but that's a lot more work than I had "budgeted"... I have no problems with the creation of the actual state BTW, that part is simple and I've already done it in fact. @jabelar This is intended for an "ordinary" construction block, and it would be used on a large scale so a tile entity isn't an option. Customising BlockModelRenderer is an interesting option, but if I change it Minecraft-wide that's going to be incompatible with anybody else attempting to do the same thing. I feel like I really have two options, either I script something to generate those 42 overlay models or I give up on the idea and do something simpler... Thanks for all the infos. -
[1.12.2] Block with an overlay conditional on nearby blocks
Kinniken replied to Kinniken's topic in Modder Support
Great... any tutorials around? Otherwise I was looking at BlockFence which actually changes its model based on nearby blocks, but that's actually applying multiple separate models, not just textures. And in my case, in the "worst case" of an isolated block, I'd have to apply one base model plus four models per block side to add up all the overlays if I understand things correctly. Even if it works I'm guessing the rendering of 25 models for a single block is going to hit rendering performance... -
Hi all, I'm trying to design a decorative block with a somewhat unusual display: it would show a "border" on every side where it does not connect to a similar block. A picture would make it clearer: if the blue blocks are my blocks and the green blocks are a different type of blocks, I want the overlays for each of those red lines displayed as in the picture above. In order to do that, I've set up properties in my class file: public static final PropertyBool NORTH = PropertyBool.create("north"); public static final PropertyBool EAST = PropertyBool.create("east"); public static final PropertyBool SOUTH = PropertyBool.create("south"); public static final PropertyBool WEST = PropertyBool.create("west"); public static final PropertyBool UP = PropertyBool.create("up"); public static final PropertyBool DOWN = PropertyBool.create("down"); @Override public IBlockState getActualState(final IBlockState state, final IBlockAccess worldIn, final BlockPos pos) { IBlockState actualState = state.withProperty(NORTH, Boolean.valueOf(this.connectsTo(state, worldIn.getBlockState(pos.north())))); actualState = actualState.withProperty(EAST, Boolean.valueOf(this.connectsTo(state, worldIn.getBlockState(pos.east())))); actualState = actualState.withProperty(SOUTH, Boolean.valueOf(this.connectsTo(state, worldIn.getBlockState(pos.south())))); actualState = actualState.withProperty(WEST, Boolean.valueOf(this.connectsTo(state, worldIn.getBlockState(pos.west())))); actualState = actualState.withProperty(UP, Boolean.valueOf(this.connectsTo(state, worldIn.getBlockState(pos.up())))); actualState = actualState.withProperty(DOWN, Boolean.valueOf(this.connectsTo(state, worldIn.getBlockState(pos.down())))); return actualState; } public final boolean connectsTo(final IBlockState ourState, final IBlockState otherState) { return ((otherState.getBlock() instanceof BlockPaintedBricks) && (otherState.getValue(COLOR) == ourState.getValue(COLOR))); } And I now need to setup my blockstate and my model so that the appropriate overlay is display on every face where one of my property is false, so each face having multiple textures overlaid on top of each others based on the face it is and the properties I've set in my blockstate. Is that even possible? I've worked with multipart blockstates files before, but only to point to different models. I've used overlays in models, but not conditionality. Any help would be welcomed.
-
Right! I don't use vanilla structures, but that's fine, it's the rendering/OpenGL part I need info on. Thanks, I'll check their code and see what I can learn from it. I'll check that too.
-
Hi all, I have a need to render "phantom blocks", to provide feedback as to where a structure would go. I know some mods to do this, and Minecraft.getMinecraft().getBlockRendererDispatcher() seems to support rendering blocks independently of whether they exist in the world or not. Is there any decent tutorial on this? Thanks
-
[1.12.2] Stopping Optifine from mirroring a glass texture?
Kinniken replied to Kinniken's topic in Modder Support
Unfortunately it's also used by half the players... I created a ticket on their GitHub. -
[1.12.2] Stopping Optifine from mirroring a glass texture?
Kinniken replied to Kinniken's topic in Modder Support
Here it is. Thanks. rosette.json -
[1.12.2] Stopping Optifine from mirroring a glass texture?
Kinniken posted a topic in Modder Support
Hi, I have a custom glass pane-like block with a pattern. The model files are the same as the pane's ones save for the texture to be used. When playing without Optifine, it works fine, the pattern has the same "orientation" no matter which side I look it from. When playing with Optifine, it gets mirrored. The pictures below (taken using Optifine) makes it clearer. The first is the intended effect. Is there anyway to prevent Optifine doing this? Thanks -
[1.12.2] Recommanded way of accessing the mods folder?
Kinniken replied to Kinniken's topic in Modder Support
Thanks, Loader#getConfigDir seems like a good solution. And if I use that I assume I can use it both for clients and servers, right? No reason to keep using Minecraft.getMinecraft().mcDataDir ? -
Hi, My mod requires access to some content files that are stored in the mods/ folder. Client-side, I access that folder this way: new File(Minecraft.getMinecraft().mcDataDir, "mods") This seems to work fine even for people with customised setup. For servers however I currently do this: new File(new File("."), "mods") Which works fine with a default install but apparently cause issues for people with customized setups. Is there a cleaner way to do this on servers? An equivalent to Minecraft.getMinecraft().mcDataDir? It seems a little odd to me that this method only exists client-side. Otherwise I suppose I could instead check the location of the jar my mod is running from, that feels hacky. Thanks K.
-
Thanks, looks promising! For my use that last requirement is not an issue, one a recipe is unlocked it would stay unlocked. However isn't replacing the recipe book like that very invasive? Unless I'm missing something two mods that attempted your solution would clash, right?
-
I will try it out. To be a little clearer as to what I want, it's basically the ability to "unlock" recipes. So for a specific recipe, when the player starts a world it's not available (whether in the recipe book or for actual usage); when the player reaches a mod-specific milestone (being taught by an NPC, reaching some kind of goal, whatever), it becomes available to him and he can both see it in the book and use it. I do not need alternate recipes for the same inputs however.
-
I saw this, but the last post claims that the solution given isn't advisable and instead refers to a tutorial from 2014 - is that really still valid? And the TestMod3 link isn't what I want either as it seems to apply at loading time, unless I misunderstood something.
-
Hi, I would like to know if there is a way in 1.12.2 to make (new, mod-provided) recipes conditional per-player? With a custom condition that could be triggered by my mod's code? Ideally I would like both the recipe to be unusable before that trigger, and to make it be "discovered" when the trigger is reached. Thanks!
-
[1.12.2] Simple way of exporting block icons?
Kinniken replied to Kinniken's topic in Modder Support
I had seen that, but assumed that Minecraft just rendered it once and then stored it as a raster image somewhere. Never mind then. -
[1.12.2] Simple way of exporting block icons?
Kinniken replied to Kinniken's topic in Modder Support
Ah, didn't know that last part. A screenshot sounds easier at this point... -
[1.12.2] Simple way of exporting block icons?
Kinniken replied to Kinniken's topic in Modder Support
A steam-like advancement page on my mod's site, with the advancement completion rate for each advancement. Since the icons for advancements are items or blocks in Minecraft, I'd like to be able to display the same on my site. If there's no cleaner way I'll just do a screenshot of my advancement screen and cut out the block icons. -
Hi, Is there a simple way of exporting the icons of blocks as rendered internally by Minecraft? Something more elegant than using screenshots or re-rendering them outside the game? Thanks
-
[1.12.2] Recommanded way of adding custom advancements?
Kinniken replied to Kinniken's topic in Modder Support
On this page: http://jabelarminecraft.blogspot.fr/p/minecraft-modding-custom-triggers-aka.html I'm using the latest version of Firefox.