MFMods
Members-
Posts
370 -
Joined
-
Days Won
13
Everything posted by MFMods
-
[1.12.2] Prevent sand/gravel blocks from falling
MFMods replied to kevinmd88's topic in Modder Support
well, true, but that example is a bit extreme isn't it? what if one mod wants to make horses faster, second wants to make them avoid players when untamed, third wants to add more variation in stats, fourth wants to change the way they graze grass...? good mods will do their thing without replacing the horse, thus allowing us to have all four changes. lousy mod will block other changes for the sake of their own. hold on... i would support replacement of an object which itself holds the behavior - you're making a "better fishing" mod? you need to replace the fishing rod and the bobber. i don't have a problem with that. but sand doesn't contain the falling behavior. if he replaces sand and gravel, what about mystical sand? tropical sand? fairyland sand (i'm making them up)? end-sand? they'll keep falling down (maybe up in case of end-sand). he needs to go for the falling behavior, not just the sand - if possible of course, and i very much believe that in this case it is. @kevinmd88: just be sure that the x and z-motion are zero. if there is a non-vertical component, leave it be, it's not a falling block. -
[1.12.2] Prevent sand/gravel blocks from falling
MFMods replied to kevinmd88's topic in Modder Support
even if it were the only way, never do that. how would you make more than 5 mods work together (even as a player, not just modder) if they liberally replaced original stuff with their own? investigate EntityFallingBlock a little. consider subscribing to event bus and reacting to entity update (or, even better, entity join world or entity enter chunk). i can not test things now (at work) but i believe one or two simple solutions exist, which rely on tripping the falling entity before it actually gets moving. -
after the line: if (worldIn.getBlockState(new BlockPos(hitLocation)).getBlock() == Blocks.WATER) try adding a trace call (output a string into a console). keep the trace call there until you get the condition right. use the trace call to see the values of method parameters.
-
[1.12.2] Attempting to store meta data inside TileEntity
MFMods replied to tomtomtom09's topic in Modder Support
if you make a custom recipe (like fireworks, banners, dying recipes), you make the output ItemStack yourself. you can add any number of things into the ItemStack's nbt. then, react to the player placing that block (actually to using the item on the ground), get the data from held item and create the block state and the tile entity. but if you only have two or three sizes, i'd likely go with separate simple recipes instead of a custom recipe type. -
create an invisible entity with the correct location and rotation, then have the player mount it (sit on top of it). that's how "sitting" works (there are mods that allow you to sit on solid blocks or just stars). don't forget to remove your entity.
-
well you picked a bothersome (and not too easy) task to start with. you may consider actually doing a few simple things to get a handle of things. to make the dandelion obey the biome grass color, you need to do the following: 1) separate the texture into two textures - stem and yellow part. desaturate the stem (make it grayscale). 2) make a new model based on cross - duplicate the two elements that the model is composed of (there should be four now). set two to use one texture (you may call it cross_fixed or something like that); set the other two to use the other texture (call it cross_green or something like that); for the later two elements set tintindex to 0 (compare cross and tinted cross models that come with vanilla) 3) now the part Choonster tried to explain - you have two elements that will be given one texture (the non-green part of the flower) and two elements that will be given another texture (the stem) and then these two elements will be tinted and they have a tint index of 0. now what does 0 mean? nothing yet. you will add one call in your client proxy class which will say "for block X and the index 0, apply this color multiplier". you are giving a meaning to each tint index you use in your model file. for example i have a block where tint index 0 is water color (so that the block looks ok in swamps where the water is greenish) and index 1 is the grass color (so that the plant looks ok in biomes where the grass is paler or yellowish or whatever. 4) you need plenty of blockstates of course, to make use of the new flower model you made (luckily you only need to make one model). in blockstates (for each block), specify your new cross model and two textures.
-
not that i know of. you can try mods that offer that functionality (library mods). i'm using guidebook (https://mods.curse.com/mc-mods/minecraft/253874-guidebook) on 1.10.2 and i can recommend it. i also tried guidebook (the other one) but i gave up on it and wouldn't recommend it. i didn't try mantle (the thing used for tinker's construct books), so i can't say anything.
-
[1.11.2](SOLVED) Help with scaling items in json!
MFMods replied to BlockExpert's topic in Modder Support
if it's a "normal" item (ie. you would expect the game to receive just a 2d texture and do the same thing it does with vanilla items), you should not specify rotation, scale and translation. if it's not a "normal" item (which it probably isn't), there are two things to do: 1) use itemtransformhelper to get correct values for displaying the item (left/right hand, 1st/3rd person, on the ground, in inventory screens...), and 2) buy grey ghost a beer. https://github.com/TheGreyGhost/ItemTransformHelper http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2342078-item-transform-helper-interactively-rotate-scale -
i truly wish we had a repository of information how to connect to all those apis out there... now, if you make a simple block, you're facing a nightmare if you want to register it with crusher machines for example.
-
what a mess. i'd just start over. bad news - throwing in mc1.7 mods in forge 1.10 mod directory can't work. 1.10 mods for 1.10. versions aren't compatible. sorry, no chocobos for you. but before you add mods, see that you can start mc with forge without any mods (there will be 3 or 4 things in mods list automatically). then, add mods.... ...but don't add 50 at once and then come crying here. two by two.
-
you cannot compare an existing ItemStack to the one you just created like that... you're asking if it's the very same object. it is not. ItemStack has GetItem method. compare results of those (items are singletons, you can do that). then do something with entire stack or just one item and reduce the count.
-
i trust you'll fix the method signature so let me note some other details: isRemote means client. just return true on client (invert the condition). create and spawn your item on the server side; call setBlockState on the server side. you're clearly someone who knows this programming trade and appreciates elegance. but inheritance isn't always the way to go. you used two block ids for something that could be easily done with one block and a few states. be economical with those ids, at least for a while.
-
Very New to mc modding, want to create a very basic mod.
MFMods replied to Bluethefox's topic in Modder Support
close the eclipse. there's a gradle task that will create an eclipse project for you. you didn't run it, it seems. once you do, open eclipse and point it to a proper directory. you'll have examplemod class. click inside the code editor and click "run" button. the game should start. never mind the game now, look at the console. there should be a line saying "dirt"; that's what the mod does. not much, but at least you know you're set up fine. setup should be simple: run the forge setup jar, run gradlew setupDecompWorkspace, run gradlew eclipse -
well that was easy. thank you choonster for making an effort even though i did not.
-
to conclude the thread (for those who need the same thing): jay's model works (mostly) - thanks again, man. as to what else needs to be done, that kinda depends on modder's plans for the plant: * biome tinting does not work... for now, i don't care (i wasn't going to allow either worlgen or seed planting in swamps either way), but if mystcraft gets updated to 1.10+, then i would really care. so, if anyone knows what to do, by all means, share... * bottom ("down") part of the top surface is needed so that we can properly see through the plant upwards diagonally (add a line to the model file). * sides (water texture) are needed if you want plants too look ok in a big glass tank. if you don't care about glass, you can just omit sides and in can-block-stay method disallow it to stay next to non-solid surface blocks (ie. anyting except water material, full cubes and farmland/paths).
-
hmm, that would solve my problem; more than one actually. though i might have to bother with states regarding block above. oh well... it's not a perfect solution - you should have used "minecraft:blocks/water_still" instead of your own png because of resource packs. also, i'm concerned as to how it would look in a biome with tinted water (we'll know tomorrow). thanks a lot, friend! you most likely lost many hours on that block. btw, a rice plant that looks like actual rice? i salute thee. (i know, it sounds obvious that it should look like rice, but these days, rice blocks that i find in mods look like peas or kale).
-
and do not override getSubBlocks. that's for when you want separate independent variants of the same block (like sandstone for example). *sigh* i'd make a horrible teacher.... go to http://minecraft.gamepedia.com/Wood do you understand how two information pieces are encoded into 16 possible values of metadata? on the Bed page you will see three information pieces encoded. is the storing part clear clear to you?
-
you get 4 bits total (16 values). no discussion there. if you spend 1 bit on half (2 values) that leaves 3 bits for growth stages, meaning a maximum of 8 values. if you need more than 8 stages, then you need to make top and bottom half separate blocks and maintain that multiblock structure.
-
exactly. meta is what gets saved on the disk. except you are to code two properties into 4 bits - a maximum of 8 growth stages and 2 half variants.
-
i'm making a few water plants. checklist (for others that want to do the same): * material set to water * add LEVEL property (mandatory), you can just ignore it (i have variants too, that one gets saved) * in client proxy, call ModelLoader.setCustomStateMapper to ignore the level property (one line there makes you not worry about level in the blockstate file; solution by choonster) problem: plants look fine when deeper underwater (when there is at least one water source block above it). but when the plant is right below surface, i don't have the surface part (see image). for the model i used the "cross" model. does anyone know what to do? some other modders solved worked around the issue by insisting on one or more water blocks above and breaking the plant if water is for example picked up by a bucket. i would prefer to allow plants to grow right below surface if possible.
-
likely the inherited grow method. try replacing it with your own code.
-
since you're asking about automatic digger/drill/excavator/farmer, let me give you a piece of advice (even if you know it, it could be useful to others)... there are right ways to do it and wrong ways to do it. wrong ways... let's take gravel block for example (doesn't matter could have been something else)... one wrong thing to do is get a block instance from the world instance and ask the block "what do you drop?". now, when you read that, it doesn't sound wrong but it's wrong. the gravel block object would answer that it drops 1 gravel block and depending on a dice roll and the fortune level, zero or more flint items. but what if a player has a mod that replaces flint pieces with smaller flint chips as a drop? or a mod that adds copper pieces as a possible drop? or what if some mod wants to prevent breaking of blocks under some conditions? you are supposed to play nice with all of these cases. right ways... one way to do it would be to invoke forge events (just as these calls are inserted into vanilla code) and if the event chain says that it's ok that you break a block, you take a list of items from it. another way would be to create a FakePlayer (yes, that's a thing) and tell it to break blocks at given coordinates, one by one. that way, you can give the FakePlayer an iron pickaxe if your machine has an iron drill, etc. and you get correct times for breaking block with whatever tool you gave him. edit: to clarify, doesn't matter if it's a mining machine or a farming machine; same principle applies.
-
you can not modify a collection while you are iterating over it. make a local boolean variable hasStoneOrWhatever and fill it if you find whatever. then, outside the loop, use it to decide how to edit the list of item stacks.
-
Looking for a way to render/export a model into a list of cubes
MFMods replied to MFMods's topic in Minecraft General
no, i would use existing (vanilla) blocks only. i need a way to slice up (basically render) a model (raw, unrendered) into cubes. -
there's nothing in the text you posted. start slowly, don't get ahead of yourself. step 1: do a System.out.PrintLn("-----------some text") in your mod's init method. just that - no blocks, no extra classes, no events, nothing. and see if you get a line in console when the game starts. only after that start adding stuff. and do it one by one. there is no reason to introduce your own creative page until you can take a working block from existing page or via give command.