MFMods
Members-
Posts
370 -
Joined
-
Days Won
13
Everything posted by MFMods
-
I'm looking for a a program or an export plugin that will render a model i have in blender or xnalara into a list of cubes. it doesn't have to be free. to explain a bit more, i'd start with a model (with textures and everything set up) of a structure or a part of it (column, pillar) or a humanoid figure, then, instead of rendering to a 2d image, i need rendering into a readable list of colored cubes, given max size in cubes (like pixelating a 2d image, except everything would be 3d). afterwards, i can convert easily the output list to what i need for minecraft, that's not an issue. what i need is the rendering step. ----------- so, does anyone have any experience with what i need? i saw on youtube that some japanese guy made a map with huge statues of hatsune miku (frames of her dancing animation). unfortunately, the forum post is in moonspeak so i don't know how he did it.
-
[1.8] [SOLVED] Problems generating custom block in village
MFMods replied to Cleverpanda's topic in Modder Support
if you get an empty field, then you're almost there. just find the bug. check the max height in debugger - if it's 1 you get an empty field. i see a weird line with maxY in it (copied from the torches class), maybe you should rework that. next thing to try is using world.setblockstate instead of component.func_175804_a i had problems with those methods - clipping logic in there is weird. also, try replacing corn with carrots in one row, just to see if it's about corn. -
if it says it works, than sometimes it actually works. not always where you want it though. playerPosZ has a bad value. **imagines slapping the guy over the head**
-
isRemote does opposite of what you think (and initially anyone else). illogical, but rename probably won't happen. switch that and work from there (i honestly can't tell what else is wrong).
-
what ernio said would work. frankly i wouldn't write it that way (create 49 BlockPos objects for the loop variable and 6 for bounds), but it would work. calling getAllInBoxMutable instead eliminates object creation for iterations. anyway, relax about blockstates, they are a good thing (even if they are bothersome sometimes). if you have the state of a wooden log block, you can just ask "is its type a birch?" instead of "is meta & 3 equal to 2?". serious difference, don't you agree?
-
ladders don't work as you might expect. what you need to do is to override isLadder method on the block and return true, and then your block will behave like vanilla ladder.... if it is so small that the player is inside the block space. that lame thing is hardcoded into mc code. by inside i mean player's x,z coordinate being the same as the block's. you said "this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.4F);"... that's almost half the block. maybe that's small enough, i don't know... but you can't climb from sides... you can even do full side ladder - i made a 0.8 wide tree log climbable from all 4 sides with no code except the isLadder override - but the thing is, user needs to enable that behavior in forge settings (it can be done in game (from the main menu -> mods button), no need to edit config files). oh well.
-
[1.7.10] [SOLVED] How to make a block that is not 1x1x1?
MFMods replied to kauan99's topic in Modder Support
http://www.minecraftforge.net/forum/index.php/topic,34977.msg184433.html#msg184433 you're welcome. -
in the Mod annotation above your main class, add useMetadata = true
-
you guys are great really - i though i was gonna get some "no can do" comments... i wasn't kidding about the cookies. address in pm and you get a box. the colors are working - all i had to do is save with utf8 bom mark and § started working. nice. newlines are working too: this.A05UnderTheSea.setStatStringFormatter(new IStatStringFormat() { public String formatString(String input) { return input.replace("{NL}", " " + '\n'); } }); i'm happily off to work now. thanks guys.
-
i said i did. i called it the "paragraph sign"; i should have inputted the sign too to make the post more readable.
-
did anyone have any success formatting achievement description? what i need is newline and colors. is is even possible? i'm talking about the text you write in en_US.lang and the rest of language files. you have the title line and the description line. the description in the lang file is what i'm asking about. here's what i know myself: \u00A75 has no effect. percent, pipe and ampersand don't seem to have a special meaning either. paragraph sign is printed as a box with a question mark inside. \n also doesn't work. :'( any help? i'm willing to send cookies.
-
well, we need some more. those out there weren't very useful when i needed them. i made a custom block a month ago (1.7.10) - simple non-cubic block, no inventory, no animation, not a single reason to use a tile entity. let me tell you it was a nightmare. a long one. there's a bunch of tutorials on youtube telling you to use a tile entity special renderer (TESR). i didn't want to go that way because the block is as simple as can be. although it seemed like those youngsters that recorded TESR tutorials didn't have too much concern for potential lag, at least those things seemed to work at the end of the tutorial. the right way to go was simple block rendering handler interface (ISBRH).... but, there was no usable tutorial. just a few that make some intro about what calls what, and what the order of things is. --------- so - back to topic (original posters problem): 1: don't bother with techne; you need neither the model file nor the texture. you will use vanilla textures so your hedge will look good with any resource pack. 2: you need the renderer. make a class GloriousHedgeRenderer that implements ISimpleBlockRenderingHandler. have the eclipse insert method headers for you. 3a: the main thing here is the renderWorldBlock method. we'll write it now. you need this one line before anything. renderer.renderAllFaces = true; 3c: start with a center column: renderer.setRenderBounds(4/16D, 0D, 4/16D, 12/16D, 12/16D, 12/16D); renderer.renderStandardBlock(Blocks.leavesOrWhatever, x, y, z); ---------x,y,z are the parameters, leave those alone here, i went from 25% (4/16) to 75% (12/16) on the X-axis (parameters 1 and 4), same for Z-axis (parameters 3 and 6) and from the bottom to 75% for Y axis. now you do four more pairs of those two calls, if there is an adjacent block: 3d: *check if there is a hedge block in negative-X direction (world.getBlock call). if there is, draw another leaf block from 0 to 25% on X and 25 to 75% on Z. 3e: *similar for positive X 3f: *similar for negative Z 3g: *check if there is a hedge block in positive-Z direction. if there is, draw another leaf block from 75 to 100% on Z and 25 to 75% on X. 3b: before everything check for a hedge block above - set the Y top variable to either 100% or 80%. use that variable in setRenderBounds as a fifth parameter. 3h: that's it. end the function with: renderer.setRenderBounds(0, 0, 0, 1, 1, 1); renderer.renderAllFaces = false; return true; 15: when you see that it works, consider drawing it using 2 calls instead of 5. a simple optimization that you should definitely do. 4: ok, we have the rendering method - now, we need to connect the block to the renderer. for that we use an integer number called renderer id. you get if from a call to RenderingRegistry.getNextAvailableRenderId(), which you will do once and only once. i'll show you how i did it. in the renderer class add: @Override public int getRenderId() { return getRenderIdInternal(); } public static int getRenderIdInternal() { if (rendererId == 0) { rendererId = RenderingRegistry.getNextAvailableRenderId(); } return rendererId; } and in the block class, you add: public int getRenderType() { return PlateRenderer.getRenderIdInternal(); } part of it already exists in renderer class, just overwrite existing getRenderId part. that's it. as long as block.getRenderType and renderer.getRenderId always return the same value, this will work. most people get the renderer id on the block instead of renderer, it doesn't matter really. 5: in the block constructor, i have the code this.setBlockTextureName("minecraft:dirt"); you might not need it, i don't remember 100% but i think you do. 6 we need to register the renderer. in the client proxy, add this method: public void RegisterRenderers() { RenderingRegistry.registerBlockHandler(ErfurtsHedgeRenderer.getInstance()); } in the common proxy, add the same thing, except empty. and in the Initialization method of the main mod class, call proxy.RegisterRenderers(); that's it. you got the oak leaf hedge. you need to change the drawing above to use your block's metadata, which hopefully matches leaf metadata (by now you have already made the item that places the 6 variations of hedge blocks) troubleshooting: if you see nothing rendered, you messed up something with the renderer ids. if you get a crash saying "already tesselating" or "not tesselating", you weren't listening and added some code from other examples.
-
i finally managed to render my new block ingame by composing it from vanilla blocks (calling RenderBlocks.setRenderBounds + RenderBlocks.renderStandardBlock a few times). it works okay, plus i don't have to worry how it would look if someone uses a hi-res texture pack. now, is there a way to make one of those parts brighter? there are some brightness fields on RenderBlocks but they don't seem to do anything...
-
that is not going to work well for those larger oak trees with branches, let alone for dark oak (2x2 + irregular log parts on sides) or jungle trees. or acacia. basically the solution is birch/spruce only. what others have done (there are a few existing mods that make axes do what you want) is do a backtracking search up and sideways to find all logs that comprise a tree. reason one is that that way they break all those logs for a complete effect. reason two is that they are then able to damage the axe for a number of logs broken instead of just one. but that is actually a simple task (even though the branch-logs sometimes don't touch the base (vertical) logs; you can allow for one leaf block between logs). the hard task would be taking down the leaves. because if you write a bad algorithm, you could clean up entire forest with one swing of that axe.
-
hi guys. i'm new to minecraft modding and a have a ton of questions. luckily, i need zero help with java itself. i decided to make a set of small mods that modify the earliest stage of the game. i'll target both 1.8 and 1.7. some things went easily (like changing tool durability and making sticks drop from leaves), some things failed horribly (messing with achievements for example)... the one task that caused the most frustration to me was making the player unable to break logs by hand. this will sound like venting/ranting (it is mostly venting) but i'll underline the actual questions: first thing i tried was the BreakEvent; it is cancellable so the thing basically works... but the block visually disappears, the sound is played, and only then it is returned. am i wrong to see this as a bug in forge? why not fire the event earlier? then i tried BreakSpeed; all sources on the net said - this is the thing. did anyone try to put a call that outputs a line into chat in there? (or into standard output, doesn't matter) not only is the message spammed several times per second while the block is being damaged (in gameplay sense), but spamming continues long after the block being broken. what's with that? wouldn't it be enough to set the mining/digging/chopping speed just once per attempt? and a natural question: why doesn't it stop when the player is done with the block and off to do something unrelated? back to topic, my initial test (the plan was newSpeed = original speed / 5000;) didn't work (why didn't it work? i placed "not remote" check at start, is that why it didn't work?) . anyway, i didn't dwell on why that event didn't work for me - i don't want to slow the game a single bit so i decided to skip the BreakSpeed event. not touching it with a stick. but while you're here, how much would using those "rapid fire" events slow the game down? then i tried HarvestCheck. apparently not meant for what i need, moving on. the PlayerInteractEvent also detects chopping logs with LEFT_CLICK_BLOCK action, and repeats many times until the block is broken, then stops. it is cancellable, but cancelling it doesn't stop or reset the chopping progress. maybe it works for right-clicking so let's skip this. at that point i gave up on events. next thing i tried was iterating through GameData.getBlockRegistry()... that seemed like a good idea. checked harvest tool, compared harvest level to 0... and the loop found zero blocks in total. apparently i was doing it too early. i don't see how FMLPostInitializationEvent is too early, but none of the blocks in the collection had harvest tool and harvest level set. fine, i tried WorldEvent.Load event - i managed to detect logs and stone there, called block.setHarvestLevel(tool, 1), launched the game and... it didn't work. this question is a bit vague but... is there a way that could've worked here? because i really wanted that to work - to set a few values on initialization instead of dealing with those events that seem to hate me. i have a few more ideas to try but i think this is a point where i need to ask you guys for some pointers. i already wasted a few evenings (and i need to get to work each morning). current plan is to detect chopping attempt in PlayerInteractEvent, save the block hardness in an internal collection, along with a number of ticks (40/20, don't know yet) and coordinates, then i'd set the hardness to -1. then, each tick, i would decrease tick counters throughout my list and when one hits 0, i set the hardness back to original because the player will eventually try a proper tool and delete from the list. repeated PlayerInteractEvent hits for a block with coordinates in the list would reset the counter. and setting the hardness to -1 shouldn't mess up resistance like a large number would. i expect that it would work, but that seems a bit complicated for the task at hand, and i feel i may have missed something with those events... also, for performance reasons, i wish to avoid doing things each tick. so, what do you guys suggest i do? and i don't want to do things like damage the player to reset chopping or kick the player away from the tree - that is unintuitive and in case of knockback - a magnet for bugs. i have considered a simpler alternative to the plan above - i could just set the hardness to -1 any time a block is hit by a bad tool or no tool and set the hardness to default value when hit by a proper tool (i can get defaults at game load); no ticking this way... the reason why i don't want to do this is that i'd leave around blocks with hardness of -1 and i'm worried about mod compatibility. yes the block can still be harvested (with proper tool), and it can still be blown up (i wouldn't touch resistance), but this would cause conflicts with any mod that checks block hardness. what do you guys think - am i right to worry here? how would you guys solve my task?