Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/14/17 in all areas

  1. A whole cube is 6 more faces. You would add them just after the 4 vertices definitions for your up face - add 4 more for 1 more face and so on. You might need to experiment a bit with UVs/positions to make your face render the correct way but is it quite easy once you get used to vertexbuffer
    1 point
  2. It does not. It just takes a blockstate and returns a texture of that blockstate. Different blockstates can have different textures This is not the case for a water block, thus you do not have to do anything with it. A lightmap is... kinda obscure but it just controls the 'final' brightness of your texture, it's exposure to light and light's color(you know how in vanilla torches, sun and moon slightly vary in color of light they cast? That is your lightmap coordinates.) You can see how lightmap is normally calculated at Particle::renderParticle. To be precise, the int i = this.getBrightnessForRender(partialTicks); int j = i >> 16 & 65535; int k = i & 65535; j and k are the lightmap coordinates here and getBrightnessForRender simply returns the combined light value for a specified block position(in particle's case the position the particle is at)
    1 point
  3. Depends on what exactly do you want to acheve here and how do you want it to look. For a fluid tank I would use either a cusom IBakedModel (if I do not need the client to see smooth water level transitions in real time as the fluid level raises/loweres through say a pipe) or a FastTESR, and I think that you want the later. Register your TESR using ClientRegistry::bindTileEntitySpecialRenderer. In the renderer itself use water texture UVs and render your desired image at desired positions with Tessellator(or rather put your vertex data in Tessellator's buffer). You can get the water texture using BlockModelShapes::getTexture(state). BlockModelShapes can be obtained through BlockRendererDispatcher::getBlockModelShapes and BlockRendererDispatcher lies at Minecraft::getBlockRendererDispatcher. You can see how exactly to use tessellator in vanilla TESRs. Or you might ask here for more clarification Just remember that with FastTESR you do not need to bind your textures or call neither begin nor draw methods.
    1 point
  4. I'm a n00b, and these might be really stupid suggestions. Tell me so, please, because I'd like to learn why these wouldn't work. (Also, Java is not my native programming language, so forgive my logo-ish pseudo-code.) 1.a. You wouldn't have to check every inventory at every tick. You only need to check when you open that inventory. You'd need to keep track of what tick the inventory was last opened at and subtract it from the current tick to figure out how likely the food inside is to be rotten. You could also choose whether or not to run the more specific "is it rotten?" check at all, based on how long it's been. 1.b. Even more specifically (and may be overkill/over complication), you don't have to add an inventory to the list of "needs food-rot-checking" if you don't put any food in a particular chest. When you add food to a chest, add the chest to the list; when you open a chest, check it against that list. When you close the chest, check if it should still be on that list (which should return false if there is no fresh food). 2. Each food item doesn't need to keep track of its own ticks. Just give it a probability to run for each tick (or bunch of ticks) since the last time it was checked. ie: set (days_variable) ((time since last check) / 24000) if days_variable >= 1 ( repeat * (days_variable) ( if random 100 < 33 (set food_freshness (rotten)) )) 3. Whittling down the things you need to check even more, you only need to check if food has gone rotten if its last known state was fresh. You probably don't need to go so far as making this it's own sub-list, but maybe you do. (Thanks, Schrodinger.)
    1 point
  5. If you're developing a mod and you have a class that extends ItemAxe, you need to use the ItemAxe(ToolMaterial, float, float) constructor for non-vanilla ToolMaterials. The ItemAxe(ToolMaterial) constructor only works for vanilla ToolMaterials because it uses the ordinal as an array index.
    1 point
×
×
  • Create New...

Important Information

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