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

bxzsj

Members
  • Posts

    27
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

bxzsj's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thank you! I use GlStateManager.disableCull(); and rectangle is correctly rendered.
  2. Try to use GL11.glRect to draw rectangles. But it don't work. @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { super.drawScreen(mouseX, mouseY, partialTicks); GlStateManager.disableTexture2D(); GL11.glColor4f(1.0f,0,0,1.0f); GL11.glRecti(10,10,50,50); GL11.glPushMatrix(); GL11.glLoadIdentity(); GL11.glRectf(-0.5f, -0.5f, 0.5f, 0.5f); GL11.glPopMatrix(); GlStateManager.enableTexture2D(); GL11.glRecti(10,10,50,50); GL11.glPushMatrix(); GL11.glLoadIdentity(); GL11.glRectf(-0.5f, -0.5f, 0.5f, 0.5f); GL11.glPopMatrix(); } But if I try this: glBegin(GL_POLYGON); glVertex2i(10,10); glVertex2i(10,50); glVertex2i(50,50); glVertex2i(50,10); glEnd(); It works. I find that the difference between GL11.glRect and the above code is glRect(x1, y1, x2, y2) equal glBegin(GL_POLYGON); glVertex2(x1, y1); glVertex2(x2, y1); glVertex2(x2, y2); glVertex2(x1, y2); glEnd( ); but the work one is: glBegin(GL_POLYGON); glVertex2(x1, y1); glVertex2(x1, y2); glVertex2(x2, y2); glVertex2(x2, y1); glEnd( ); The difference between them is that the order of the vertices is different. I don't understand why this is happening. I hope someone can answer. Thank you!
  3. I made a stupid mistake. this.setDefaultState(this.createBlockState().getBaseState().withProperty(FACING, EnumFacing.NORTH)); That makes the state in game never equal state in BlockModelShapes.blockStateMapper Sorry to waste your time.
  4. what you mean, I'm using vanilla "cube" model
  5. I understand, if I don't need to load blockstate json from separated files, it's no need to register block state mapper. Now I removed register block state mapper, but it still don't work. new log
  6. Sorry, I don't know what is a right way to register block state mapper,can you give me some document or tutorials about it? This is the only way I learned from a tutorial. I still haven't figured out how this part works.
  7. the full log is here, nothing about "energy_block"
  8. I'm trying to define a block use vanilla cube model to render with 7 variant,but got some problem that block not be right render. No error show in log(here).(block registry name is "energy_block") Item renders well, but block got wrong. block state in the following picture are correct. no error "Exception loading model for variant" about this block(energy_block). I'm sorry, I don't understand how json to model and connect with block state. I'm not sure if I've done the wrong thing that use a wrong register Block State Mapper(here) source code: block(here) blockstate json(here)
  9. Thank you, I defind a method : public void drawZoomTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height, float textureAreaWidth, float textureAreaHeight, float textureWidth, float textureHeight) { float f = 1.0F / textureWidth; float f1 = 1.0F / textureHeight; Tessellator tessellator = Tessellator.getInstance(); VertexBuffer vertexbuffer = tessellator.getBuffer(); vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX); vertexbuffer.pos((double) x, (double) (y + height), (double) this.zLevel).tex((double) (textureX * f), (double) ((textureY + textureAreaHeight) * f1)).endVertex(); vertexbuffer.pos((double) (x + width), (double) (y + height), (double) this.zLevel).tex((double) ((textureX + textureAreaWidth) * f), (double) ((textureY + textureAreaHeight) * f1)).endVertex(); vertexbuffer.pos((double) (x + width), (double) y, (double) this.zLevel).tex((double) ((textureX + textureAreaWidth) * f), (double) (textureY * f1)).endVertex(); vertexbuffer.pos((double) x, (double) y, (double) this.zLevel).tex((double) (textureX * f), (double) (textureY * f1)).endVertex(); tessellator.draw(); } it works.
  10. Do this defind the location: (double)(x + 0), (double)(y + height), (double)this.zLevel and this defind texture area to display: ? .tex(((textureX + 0) * 0.00390625F), ((textureY + height) * 0.00390625F))
  11. I just tried it , but this method zoom a whole texture(256*256) to 10*10
  12. I want to draw a texture that 40*20 to 10*10,tried to use GlStateManager.scale but got a wrong display,and then I found this drawScaledCustomSizeModalRect(int x, int y, float u, float v, int uWidth, int vHeight, int width, int height, float tileWidth, float tileHeight) but I don't know what those parameters mean. Could some one tell me how to use it? My texture(png) is 256*256 and texture offsetX is 0,offsetY is 20, width and height to display is 40 * 20 and zoom to 10*10.
  13. I enabled UniversalBucket, but it not solve. How can I replace vanilla bucket with UniversalBucket?
  14. I changed the max stack of the bucket, when more than one bucket water place water ,it always return to one bucket. I found that ItemBucket.onItemRightClick cause this. So,I want to modify it.
×
×
  • Create New...

Important Information

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