Everything posted by ZeroNoRyouki
-
Client-Server Comm: Block States
I've checked your code in the other thread and one thing that I could say is that you should keep getStateFromMeta / getMetaFromState in sync with each other (A set of states give you A metadata value and A metadata value give you A set of states) and have them working only with states that will get saved on world data files. You should handle states that are computed at runtime (like your POWERED state) by overriding getActualState for your block. So in your particular case you should let the base class handle getStateFromMeta / getMetaFromState and inject your POWERED state using getActualState I don't know if you use it elsewere in your code but also keep in mind that world.getBlockState return an IBlockState based on actual data saved in the chunk, ie the ones rappresented by the metadata so if you also need to check for your POWERED state, you should pass the IBlockState returned by getBlockState to your implementation of getActualState (or relay only to the SIGNAL state to compute the POWERED state locally) Z
-
[1.8.9] connected textures
This is a test block of my test mod that do just that: https://github.com/ZeroNoRyouki/TestMod18/blob/master/src/main/java/zero/mods/testmod18/common/blocks/OrnatedEmeraldBlock.java The code is not production grade but for a test it work fine
-
[1.8.9] Multiblocks structures and OBJ models: is it possible?
uh right! could that be done in the blockstate / model file? after a quick read of the specs I can't find a way to do it thank you Z Edit: Solved
-
[1.8.9] connected textures
Basically you should define a block state variant for each possibile combination of connected sides (and there are a lot of possible combinations) Than, in your block getActualState, you check which sides of the block is connected to other blocks of the same type and return the correct variant
-
Compiling issues
How did you compile the mod?
-
[1.8.9] Multiblocks structures and OBJ models: is it possible?
Sorry guys for the late reply and thank you for your help! I was able to make this work using the standard blockstate tying it into my multiblock controller with getActualState and shouldSideBeRendered and delegating the "you should render the model" state to one of the block (selected when then whole machine became fully assembled) (no texture on the model right now) In the tests so far I dont' see any performance drops so all good. The next step is to animate things a bit
-
[1.8.9] Multiblocks structures and OBJ models: is it possible?
First of all thank you for your reply I'm not sure if I got it right, are the invisible blocks to be placed around the whole structure (for example, around the 5x5x5 cube that form my multiblock) or around the central block? Thank you! Z
-
[1.8.9] Multiblocks structures and OBJ models: is it possible?
Hi! I'm working on a mod and I like very much big multiblock machines and structures but I'd like to make them look a bit better than a Borg cube, something like an Arc Furnace from Immersive Engineering instead of a Steam Boiler from Railcraft to give you an idea What I'd like to do is make a 3D model for the whole multiblock in Blender or 3DS MAX and use the resulting OBJ model to render the assembled multiblock in game The question is how to do that So far I came up with the following ideas / concepts: 1) use TESR to render the whole model by delegating the job to one of the TEs of the multiblock structure This can turn ugly performance-wise and I don't know if the Minecraft rendering engine support models much bigger than 1 or 2 block spaces 2) cut the 3D model in pieces and generate an OBJ for each of the blocks in the multiblock structure Aside from the cutting nightmare, there will probably be problems regarding the orientation of the multiblock What do you think guys?
-
[1.8] Connected textures in 1.8?
Connected textures are one of the things that had me banging my head on a wall for some time... For a simple block you could check out this class of mine: https://github.com/ZeroNoRyouki/TestMod18/blob/master/src/main/java/zero/mods/testmod18/common/blocks/OrnatedEmeraldBlock.java http://s18.postimg.org/ndkwmm2ed/IMG_3012.jpg[/img] All the work is done, as stated by others before me, in getActualState. There is no actual state saved in the in-world blocks metadata The isAdjacentBlockOfMyType method is just an helper function that check if and adjacent block is of the kind of the calling block Please note that this is just a test mod I use to try stuff so the code is not, uhm, production-grade The blockstate file is an ugly mess: https://github.com/ZeroNoRyouki/TestMod18/blob/master/src/main/resources/assets/testmod18/blockstates/ornatedEmeraldBlock.json I've tried to use the forge blockstate variant when I worked on some multiblocks code but I didn't find it usefull in this situation. Hope this could be of help Z
IPS spam blocked by CleanTalk.