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


  • Posts

  • Joined

Everything posted by trollworkout

  1. generally mc uses setRotationAngles to control motion and setLivingAnimations to control body parts positioning when say is sitting or sprinting jumping etc and sometimes the renderer has more fine tuned connecting entity class with the model most mobs have a repetitive motion for limbs set rotation angles
  2. Furnace is a carry over from earlier more badly coded Minecraft that did things the weird way. Furnace i think is in fact 2 different blocks : normal and burning . It switches over to a new burning blockstate and copies inventory over the keepInventory boolean tells it to do that. You don't have to do this and can in fact just one multipart block some extra properties and TE variables + nbt . The second burning block has burning particles built in the model but you can just call then in a multipart add them as a separate burning particles model. If burning property is on spawn burning particles. etc
  3. package net.minecraft.client.renderer.entity; look for RenderChicken.class As I said you copypasta the model but not the whole renderer. Most of the specific motions and animations are done outside the model in the renderer EDIT : when i made my custom wolf the tail would spin in a circle helicopter style forever . I had to spend a bit of time with code try to understand how is actually done then I realize I was missing some code cause I made the renderer myself instead of looking what was already there
  4. right . so if you check the vanilla chicken renderer it has this function protected float handleRotationFloat(EntityChicken livingBase, float partialTicks) { float f = livingBase.oFlap + (livingBase.wingRotation - livingBase.oFlap) * partialTicks; float f1 = livingBase.oFlapSpeed + (livingBase.destPos - livingBase.oFlapSpeed) * partialTicks; return (MathHelper.sin(f) + 1.0F) * f1; } which looks to me like it handles wing flapping
  5. this is no easy task because you may get false positives say for ex someone builds 2 log and puts 1 leaves block nearby cause it looks cool. trees are generally minimum 3 logs high . however modded trees or jungle bushes may be only 1-2 block high but those would be bushes not trees all trees have leaves near all around the log. but sometimes they may be completely removed by players but then again that's a dead tree so it doesn't really count anymore x2 most trees spawn above a certain height say 64 blocks and higher best tree like thing you can check is 1 leaves block and 3 adjacent log blocks down like an inverted L . it may still produce false positives but is the best approximation. this would work on tall trees, wide trees, short trees because they will all have an inverted L shape with 1 leaves and 3 logs in them at the top of the tree. most houses would not have that pattern. once you find such a shape then just move over say 4 blocks and start counting again to make sure you don't count the same tree once more. 4 blocks (2x2) is the widest vanilla trees get so from any side over 1 (L shape) + 3 blocks over will never have another tree trunk nearby esentially you wanna do this by scanning the environment for leaves block. if leaves block found then see if say N side S E W has a log. if say N has then check N -1 and N -2 to see thos are logs. If true then you got a tree. mark the leaf location as a tree then skip over 4 units and do it again. keep doing this every random tick the OTHER way is to tap into worldgen or chunkgen or sapling custom world gen events by subscribing to events of that kind and figure out what's being spawned that's a tree and keep a track of all the trees you got in some txt file in your save then you would keep updating it. since this system would be based on gen then it will always run when something multiblock is being spawned in the world so is perpetually running checking things that are spawned for tree purpose. you can also save this data in an NBT tag in the TileEntity of the tree counter
  6. I am guessing the chicken flapping is controlled from chicken renderer. So when you copypasta'd the chicken code you didn't copypasta the renderer code.
  7. sorry to resurrect this but I just wanted to say I have tried this and at this time is not possible to do both multipart (using subblocks) and multi-layer at the same time. Translucent models get deleted by subblocks. When subblocks are not present then it works.
  8. Pretty sure your issue is what I said above. Putting 2 blocks one inside the other with overlapping faces should cause tex flickering. Maybe your card makes the decision to put both in order in lighter environments and to blend the two textures in darker environments. On my system the texture flickers between the two whenever i have overlapping faces. Rule of thumb is you cannot have 2 textures occupying the same space. Which you still do even after it works now. . You may still get reports from people that your ore tex is flickering when you release it. Hopefully not.
  9. I think for now I'm gonna make a custom villager model with a hood part of the model. Thanks guys
  10. What about forge's own blockstate json. Can it do that? It has some nifty things . Otherwise you can deff do this using an entity model custom renderer stuff like that.
  11. Well I tried making the model have an extra hood element using addBox but gave that up in favour of a layer. I know how to make a model now but I just don't know how to make layers yet so I decided to try and do a layer instead. Haven't done any work on that atm. Got distracted with making a golem. But I am going back to work on it. I jsut wonder how I can produce a cube and take the hood from vilalger type texture then render that hood as a layer over a villager model type head.
  12. perf thank you i know but i can't do it that way because i am making a CUSTOM golem . pumpkin can only make vanilla iron and snow golem what larsgerrits said is the only proper way to do this
  13. I made a golem but I wanna spawn it like normal BLOCK BLOCK + PUMPKIN like Snow man is done. Is melon instead of snow block. I just don't know how that's done. So I managed to make my golem work but now how do i set him face me when I spawn him? here is what i got so far. works okay except he doesn't face me MelonGolem melonGolem = new MelonGolem(e.getWorld()); melonGolem.moveToBlockPosAndAngles(e.getPos().down().down(), 0.0F, 1.0F); e.getWorld().spawnEntityInWorld(melonGolem);
  14. That didn't work for me when idid it. I think you also need to clear cache and referesh dependencies maybe I dunno.
  15. ...You know that vanilla already does that for you, right? public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (hasTileEntity(state) && !(this instanceof BlockContainer)) { worldIn.removeTileEntity(pos); } }
  16. Maybe the NBT method you can probably save it to player NBT since is a gui is gonna be personal then if you need it on server side you can send packets to some array on server to update all the boolean gui settings for all clients. Maybe someone knows better. Writing to a file seems much more easy but I don't know how to do that. The file will be kept in the save folder and you can access it at will.
  17. Some more ideas you could build built-in-obsolescence in your TEs so they don't become rogue. Every so often check if they are still attached to a block. If the block is gone make it self destruct. I tell my blocks to always kill their own TE just before they get destroyed.
  18. try this in your constructor this.useNeighborBrightness = true;
  19. yeah true i updated my comment . you cannot use config that way i misunderstood what you meant . you need to use NBT or save to a file
  20. Oh ahah ok ok that's actually a good point. maybe config is not for you then You need to save stuff to config . config only does it the other way around takes it out of config from what the user changed. you need to save to a file your booleans or save to NBT data or something like that.
  21. To override them in gui constructor you do something like Gui MyGui { Boolean boolean1 Boolean boolean2 public MyGui() { boolean1 = Config.getmyBoolean1 boolean2 = Config.getmyBoolean2 } all other gui code here } of course how to set up boolean or what type of boolean you use changes how you assign it. but essentially that's how you do it. So when you boot up the game again your gui is set to your variables saved from last time. Everytime the Gui is constructred it will first populate all your variables. Ideally you wanna do Config load/write before everything then do construction. ALL in preInit()
  22. If your GUI is something you made for a block then use TileEntity and store your booleans as NBT tags. However you do this you must realize that ALL variables in the game are reset to 0 every time you restart the game unless you store them periodically such as a file, config, NBT or meta. To get them back you need to set properties at object construction time with the data you get from all those areas you saved them to. All of this requires extra code to make them restore data . For ex to restore meta in a block you need to actually have a functions get state from meta and meta from state. To restore NBT you need to read and write NBT . In short Nothing you place there stays placed there unless you save it.
  23. You can simply add the library in the compile path i think. But I don't know how is setup so I can't help you with that. I just did it all over let forge do the hard work for me. I only mod i don't dev forge so I don't know how is setup. good luck edit: if my adv doesn't work maybe someone else has a better idea
  • Create New...

Important Information

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