Jump to content

Abastro

Forge Modder
  • Posts

    1075
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Abastro

  1. 31 minutes ago, splatterdodge said:

    I tried to do that with numForOres by checking for a random number between 0-99, and if it is 0, 1, 2, 3, 4, or 5 generate ores in that chunk. Is that bad? Is there a better way?

    I didn't notice that =P

     

    Then you'll find an ore vain in a chunk with probability of 6/100, since each ore has generation probability of 1/100 in a chunk, and they are mutually exclusive.

    Do you get more than that?

     

    Also there is a minor issue: you need to use 100 instead of 99, as Random::nextInt(x) gives 0~x-1.

     

  2. Using capability system for the inventory (Hence ItemStackHandler) is highly recommended, but not required.

     

    Please post the relevant code. (Block, TileEntity, probably the inventory as well)

    + here's the explanation on capability system; https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/

    There are many utility classes in net.minecraftforge.items package which are useful for setting up inventory as capability.

  3. 5 hours ago, grand_gibus said:

    I made a TESR that renders stuff in a large area. The thing is, that if you look away from the tile entity block, the render disepears where I'd like to still be able to see the render. How could I fix that?

    Override TileEntity::getRenderBoundingBox to return appropriate size of the rendered object.

    2 hours ago, grand_gibus said:

    But it the problem seemed that the server wasnt updating the client tile entities

    If it's about rendering, you are not marking the TE as updated for rendering. I think you should call World#markAndNotifyBlock. (The flag parameter is explained on World#setBlockState)

    • Like 2
  4. 20 minutes ago, Tschipp said:

    Thanks. One more thing:

    This doesn't seem to drain the bucket:

    
    FluidUtil.getFluidHandler(heldItem).drain(1000, true);

    the FluidHandler isn't null, i do that check beforehand. What am I missing?

    If I recall correctly, the second parameter of the drain method is about whether it'll be simulated(to check the validity) or the change is actually applied. So it should be false in your csse.

  5. 1. You should not reference Minecraft on the event like that, especially when it could be called from both client and server. Create an event handler dedicated for client, and register it on the client proxy.

    2. The event is called whenever an entity is created. You should check if the entity is a player, and cast the entity as EntityPlayer.(or EntityPlayerSP)

    3. What kind of behavior do you want with it? This approach does not look fine.

  6. There are overwhelming amounts of great documentations on opengl lut there, so I guess you won't have much problem with it.

     

    I found this post from quick Google search on FastTESR.

    Based on the answers, you can specify the vertex positions, uvs and colors on FastTESR.

    (There are more props but these are basically what you would need)

     

    Figure out the math for your case, i.e. calculating the positions of each vertice of the block. Then it's just matter of notifying vertexbuffer about the vertices in right order. (Give every information -pos,uv,color- for a vertex and move over to the next one)

    Don't forget to stitch textures on the texture map.

     

    As far as I know, you can't overlap TESR(or FastTESR) and normal model. So I guess you should render other 3 parts with FastTESR as well.

  7. It's usually a bad idea to set the base value of health. Is there a reason you can't do this with multiplier attribute modifier?

    If you can't to it, setting the event priority to LOWEST might work. It marks the event subscribing method to get called on the last pass.

    • Like 1
  8. You only need tint(color), right? Then it is feasible only with Json model and Block#getColor(Or something similar). Look at the model code of vanilla spawn egg to figure out the tint, and wool code for specifying the color. (As far as I know you can reference world and position there)

  9. We get an error now!

    Caused by: java.lang.IllegalStateException: Already building!
    at net.minecraft.client.renderer.VertexBuffer.begin(VertexBuffer.java:188) ~[VertexBuffer.class:?]
    at net.minecraft.client.renderer.BlockModelRenderer.renderModelBrightnessColorQuads(BlockModelRenderer.java:373) ~[blockModelRenderer.class:?]
    at net.minecraft.client.renderer.BlockModelRenderer.renderModelBrightnessColor(BlockModelRenderer.java:338) ~[blockModelRenderer.class:?]
    at net.minecraft.client.renderer.BlockModelRenderer.renderModelBrightness(BlockModelRenderer.java:361) ~[blockModelRenderer.class:?]
    at keegan.labstuff.render.RenderSolenoid.renderHandles(RenderSolenoid.java:86) ~[RenderSolenoid.class:?]
    at keegan.labstuff.render.RenderSolenoid.renderTileEntityAt(RenderSolenoid.java:52) ~[RenderSolenoid.class:?]
    at keegan.labstuff.render.RenderSolenoid.renderTileEntityAt(RenderSolenoid.java:1) ~[RenderSolenoid.class:?]
    at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntityAt(TileEntityRendererDispatcher.java:153) ~[TileEntityRendererDispatcher.class:?]
    ... 20 more

    That one is obvious, since BlockModelRenderer#renderModelBrightness will call VertexBuffer#begin() in its own, you shouldn't call the begin method yourself. Same will apply for Tessellator#draw().

    It seems that there's problem with lighting texture settings while in the TESR.

×
×
  • Create New...

Important Information

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