Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi Please show your spin code. It sounds like whatever you're using to update 'angle' is not right. -TGG
  2. Hi You can store information like that in the Tile Entity NBT A working example is here https://github.com/TheGreyGhost/MinecraftByExample see mbe30 NUMBER_OF_SLOTS is a final int in this example, but you can load it from NBT like any other setting (see also mbe20 - TileEntityData for more examples of how to use NBT properly). From memory, Vanilla does something similar when two side-by-side chests are combined together. -TGG
  3. Hi I generally find the fastest way is to find a place in the code where it was used before, then look in the same class for the new name. It's nearly always very obvious from the code. I don't think there's any changelog with that level of detail for vanilla, because the MCP mappings (the database that replace func_174903_a with a readable name) are updated automatically with each new revision. If you do find one please let me know -TGG
  4. Hi I think the best way is for you to start putting some breakpoints in your code and using the debugger to trace through and see what is happening. You could also add logging statements which are useful for showing what's happening without disrupting the code (especially important with item use / block breaking because a breakpoint interferes with user input and stops breaking the block) for example public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, EntityPlayer player) { World world = player.worldObj; System.out.println("onBlockStartBreak:" + (world.isRemote ? "client" : "server")); -TGG
  5. Hi Unfortunately there's no real robust answer to this problem - translucent (alpha blending) rendering is sensitive to the order you draw the objects in. https://www.opengl.org/wiki/Transparency_Sorting and http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-10-transparency/ You could try turn off writing to the depth mask- currently, when the front particle renders first, it completely hides the one behind it, i.e. the one behind it never draws at all because it is behind the depth mask of the front particle. But this will cause some weird other effects - the appearance may change depending on whether the front particle renders first, or the back particle renders first, and whether the particles are behind another translucent block (eg water or stained glass). The OpenGL commands you could try are glDepthMask for writing to the depth mask (stops your particle from hiding anything that is drawn afterwards) glDepthFunc for ignoring the depth mask when rendering (makes your particle always render even if it's behind other objects Try them one at a time - you don't need them both. I'm pretty sure glDepthFunc is not what you want to achieve but just in case. This is a good info source on OpenGL http://www.glprogramming.com/red/ and especially http://www.glprogramming.com/red/chapter06.html and http://www.glprogramming.com/red/chapter10.html#name7 -TGG
  6. Hi I'm pretty sure you can only specify a vanilla rotation on any one axis, i.e. x or y or z. You can't rotate on two axes. I'd suggest to use a wavefront model as lars said. You could use eg blender, or you could just write it out by hand. The format is very simple https://en.wikipedia.org/wiki/Wavefront_.obj_file and if your object only has around 20 faces, it might be the fastest way. -TGG
  7. Yes, it's possible - I think you're talking about blocks with animated textures, which are used by the likes of flowing water or fire. Basically, the quad stays the same but the texture is changed every few frames, so it is very fast. Check out the vanilla for water, fire, lava for more clues. -TGG
  8. Hi You'll need to make a custom renderer for your particle that has two layers, like Lars says. There is a working example of a particle with a custom renderer here https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe50_particle/FlameParticle.java -TGG
  9. Hi This example project might be of use https://github.com/TheGreyGhost/MinecraftByExample see example mbe60 which shows how to send messages back and forth between client and server Also this page explaining it in a bit more detail http://greyminecraftcoder.blogspot.com.au/2015/01/thread-safety-with-network-messages.html -TGG
  10. Hi Yes items can be translucent too, for example try holding the block of Ice in your hand (ice, not packed ice). Admittedly, I've never tried to make a translucent item so there may be a trick to it I don't know about. It might be as simple as making sure your item texture has an alpha channel with reasonable values in it (i.e. alpha blending may be enabled for all items) - to be honest I'm not sure. -TGG
  11. Hi The new Tessellator and WorldRenderer (now VertexBuffer) are nearly identical to the old ones, the methods have just moved around a bit. Vanilla code in TileEntityRenderers will show you the new syntax. Draco's code will show you how to translate correctly and draw the line. -TGG
  12. Hi Do you mean transparent as in "it has holes I can see through" - like glass pane, or as in "I can see other things through my textures" - like ice? In general the answer is 'no' except in some special cases. You could consider using a dynamic item model to assemble your item from pieces, depending on what type of item it is. This tutorial project has some examples of that, which you could adapt with a bit of effort. https://github.com/TheGreyGhost/MinecraftByExample see MBE15 - you could modify the quads on one of the layers to have a different texture depending on which item is being rendered. see also MBE05 for a similar approach combining models together. -TGG
  13. Hi ^^What Lars said ^^^ Also- some potentially useful recipe examples here https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe35_recipes/StartupCommon.java with pictures http://greyminecraftcoder.blogspot.com/2015/02/recipes.html -TGG
  14. Hi. I started reading up about Capabilities at this page but even after a few readings I'm still struggling to understand the big picture let alone the details. http://mcforge.readthedocs.io/en/latest/datastorage/capabilities/ Before I try to reverse engineer it from the forge code, does anyone have some good example code showing Capabilities they have used and/or implemented? Preferably one I could patch into MinecraftByExample as well? -TGG
  15. Hi Not sure, but some ideas to try: - is texturing on for the drawing (purple and black implies yes) - perhaps the texture coordinates on your model quads don't line up with the texture- so (eg) a single texel of your texture is being stretched to cover the entire model - try changing your texture to a different colour? BakedQuads usually use a texture that has been stitched into a much larger texture sheet, so the BakedQuad u,v values are usually very close to each other, whereas your entity texture probably uses the entire uv space 0 -> 1. BakedQuadRetextured might be worth checking out. You could also inspect the BakedQuads to make sure the texture coordinates look right. -TGG
  16. Hi Although I don't really understand what problems you're having, the general symptoms make me think you are probably messing up the client-server synchronisation. If you need an example of working containers and/or tile entity synchronisation, this tutorial project might help https://github.com/TheGreyGhost/MinecraftByExample (mbe20, mbe30, mbe31 in particular) -TGG
  17. Hi This example project has something very similar to what you've described https://github.com/TheGreyGhost/MinecraftByExample See mbe11 It's also possible to dynamically create textures, give them a ResourceLocation, and assign them to your item (I last tested that in 1.8 but I think it's still the same). Vanilla examples are with DynamicTexture and in particular in MapItemRenderer for generating a texture, which you can then stitch into the texture sheet using TextureStitchEvent. mbe50 has an example of stitching, used for Particles. -TGG
  18. Howdy all Twice in the last couple of days I've tried to respond to a newbie's PM and it's given me the error message "PM could not be sent to '{username here}' as their inbox is full!" Is this bug in the website code or just a coincidence? -TGG
  19. Hi Like the previous answers said, programming a circular motion is easy if you use a bit of trigonometry; look up the "unit circle" for more information. Your object needs to store the angle, the radius, then convert these to x and z using trig. Every tick, you just increase the angle. There is a way to make an object circle around a point without using trig, it's based on the fact that the derivative of sine and cosine are also cosine and sine; so if the object is circling around a point at a constant height (constant y) then you can calculate x_velocity_object = A.(z_position_object - z_position_point) z_velocity_object = A.(x_position_object - x_position_point). Just choose a suitable value for the constant A (the speed), initialise the x_position_object and the z_position_object at the desired starting location (radius from the centre point), and then every tick update the velocity using those calculations. It will perform a circular paths for quite a few rotations, although it may drift eventually due to roundoff errors. -TGG
  20. Hi I don't think there is an event that fires every time a block is drawn. What I'd suggest you try instead: 1) Create your own MyBlockRedFlower that extends BlockRedFlower, with an extra unlisted property called "AboveHalfSlab" or similar 2) Overwrite BlockRedFlower in the registry with your MyBlockRedFlower. (see Block class - registerBlock(38, "red_flower", (new BlockRedFlower()).setHardness(0.0F).setSoundType(SoundType.PLANT).setUnlocalizedName("flower2")); 3) In the ModelBakeEvent, replace the red flower block model(s) with your own IBakedModel. 4) In the getActualState of your MyBlockRedFlower, check for whether the flower is above your half slab or not 5) In your IBakedModel getQuads, translate the quads depending on whether AboveHalfSlab is true or not. It's pretty complicated and you would need some experience and persistence to make it work. I think it's possible and I've done all of the individual steps but I haven't ever tried all of them working together like that. This tutorial project has similar examples of the steps above - except step 2. https://github.com/TheGreyGhost/MinecraftByExample in particular look at mbe04 -TGG
  21. Yes Have a look at this example project https://github.com/TheGreyGhost/MinecraftByExample MBE20 is very similar to what you want. -TGG
  22. Hi It might help to dig around in this folder, it's part of a mod I wrote which performs backups of the saved game. Might give you some clues. https://github.com/TheGreyGhost/SpeedyTools/tree/master/src/main/java/speedytools/serverside/backup -TGG
  23. Hi This looks odd to me [mcp, FML, , mci] at CLIENT Looks like there is a mod with a blank id. Have you put something extra in the mod directory? Alternatively it might perhaps be a static initialisation order problem. Try replacing the modid = Reference.MODID with something hardcoded eg modid = "mci"; or alternatively move the Reference.MODID into MCI-MOD class. -TG
  24. Hi show your item.json? as Lars said, in your item json you should use item/generated instead of builtin/generated You could also copy the relevant transform from vanilla pickaxe. note that the transform names have changed since 1.8 because of lefthand / righthand eg firstperson_righthand Or if you want to tweak the position you could use this tool http://www.planetminecraft.com/mod/item-transform-helper---interactively-rotate-scale-translate/ -TGG
  25. Hi yes there is This example project might help https://github.com/TheGreyGhost/MinecraftByExample See mbe60 Also this tutorial page (for 1.8 but still valid) http://greyminecraftcoder.blogspot.com.au/2015/01/the-client-server-division.html -TGG
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.