-
Posts
852 -
Joined
-
Last visited
Everything posted by Bektor
-
Ok, thx. Just a small question, where do I have to put all of this code in so that my field updates when the original value switches from false to true? And can I make this code even better and smoother and more performant? private Field canSetAsBlockField; private boolean canSetAsBlockRef = false; try { this.canSetAsBlockField = EntityFallingBlock.class.getDeclaredField("canSetAsBlock"); } catch (NoSuchFieldException | SecurityException e) { e.printStackTrace(); } if(this.canSetAsBlockField == null) throw new NullPointerException(); else this.canSetAsBlockField.setAccessible(true); try { this.canSetAsBlockRef = this.canSetAsBlockField.getBoolean(this); } catch (IllegalArgumentException | IllegalAccessException e) { e.printStackTrace(); }
-
So now I'm getting an error: My code: Field canSetAsBlockRef = EntityFallingBlock.class.getDeclaredField("canSetAsBlock"); if(!canSetAsBlockRef.getBoolean(this)) { [code] Error: [code] java.lang.IllegalAccessException: Class minecraftplaye.primevalforest.common.entities.EntityModFallingBlock can not access a member of class net.minecraft.entity.item.EntityFallingBlock with modifiers "private" [19:12:11] [server thread/INFO] [sTDERR]: [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at sun.reflect.Reflection.ensureMemberAccess(Unknown Source) [19:12:11] [server thread/INFO] [sTDERR]: [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(Unknown Source) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at java.lang.reflect.AccessibleObject.checkAccess(Unknown Source) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at java.lang.reflect.Field.getBoolean(Unknown Source) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at minecraftplaye.primevalforest.common.entities.EntityModFallingBlock.onUpdate(EntityModFallingBlock.java:78) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2085) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:871) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at net.minecraft.world.World.updateEntity(World.java:2051) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at net.minecraft.world.World.updateEntities(World.java:1882) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:645) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:779) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532) [minecraftplaye.primevalforest.common.entities.EntityModFallingBlock:onUpdate:116]: at java.lang.Thread.run(Unknown Source) So what am I doing wrong?
-
What's that?
-
Hi, I have to make a custom EntityBlockFalling to allow it to do what I want it to do. Now I've got a problem there: I need access to the "private boolean canSetAsBlock;". So how can I do this without creating my own value, because that would require to also implement the writeNBTData and readNBTData and fall methods which I don't want because I don't need to modify there stuff for my own falling entity. My class extends from "EntityFallingBlock" and I'm using Minecraft Forge 1.9-12.16.0.1867. Thx in advance. Bektor
-
Already tested it back in 1.8.9, does not work. They do it with entity.setInPortal or so, but that's teleports you in the vanilla dimension. And this method just sets a boolean to true and the rest is done in the Entity itself.
-
Hi, I'm wondering how I can let an entity (player, animal, monster etc.) travel through dimensions in 1.9. Thx in advance. Bektor
-
Hi, I'm wondering how can I get the UUID from the player when a second player [*]clicks on the first player while holding a special item in his hand [*]clicks on the bed the first player was sleeping in some time ago (doesn't matter how long ago) [*]walks over a block [*]opens a special chest [*]opens a special furnace I hope someone can help me with this. Thx in advance. Bektor
-
[1.8] [1.7] Rendering glitches in some areas [Unsolved]
Bektor replied to Raycoms's topic in Modder Support
Anyone with an idea? -
Oh, yeah, totally forgot about this. Thx.
-
Hi, I've got some problems with the block rendering. It renders all find in the inventory, but when I place the block I'm getting only the missing texture textures on the block. Thats what the start-up log shows me: [FML]: Model definition for location minecolonies:blockHutTownhall#normal not found Here are my json files: blockstates { "variants": { "facing=up": { "model": "minecolonies:blockHutTownhall" }, "facing=east": { "model": "minecolonies:blockHutTownhall", "y": 0}, "facing=south": { "model": "minecolonies:blockHutTownhall", "y": 90 }, "facing=west": { "model": "minecolonies:blockHutTownhall", "y": 180 }, "facing=north": { "model": "minecolonies:blockHutTownhall", "y": 270 } } } models.block { "parent": "block/cube_all", "textures": { "particle": "blocks/planks_oak", "down": "blocks/planks_oak", "up": "minecolonies:blocks/blockHutTownhallTop", "north": "minecolonies:blocks/sideChest", "east": "minecolonies:blocks/sideChest", "south": "minecolonies:blocks/sideChest", "west": "minecolonies:blocks/sideChest" } } models.item { "parent":"minecolonies:block/blockHutTownhall", "display": { "thirdperson": { "rotation": [ 10, -45, 170 ], "translation": [ 0, 1.5, -2.75 ], "scale": [ 0.375, 0.375, 0.375 ] } } } I hope someone can help me with this. Bektor
-
Bump
-
I might be using obj's in the future, but this problem got my interest and I want to know what's wrong there at any price. ^^ Why do I want to fix this problem at any cost: because of all the OpenGL error's I'm getting and to fix them might help me also to better understand what's going on and how to fix it if I might get such errors outside of Minecraft, too. So I tracked down the issue yet a bit: // Make the call list for the inside of the sphere sphere.setOrientation(GLU.GLU_INSIDE); TileEntityPortalRenderer.sphereIDInside = GL11.glGenLists(1); // Create a new list to hold our sphere data GL11.glNewList(TileEntityPortalRenderer.sphereIDInside, GLU.GLU_INSIDE); Minecraft.getMinecraft().getTextureManager().bindTexture(resource); sphere.draw(1.2f, 32, 32); GL11.glEndList(); So, as seen above, removing this lines of code for the inner sphere removes the issue: [Client thread/ERROR]: @ Post render [Client thread/ERROR]: 1280: Invalid enum [Client thread/ERROR]: ########## GL ERROR ########## Now I've got only this code left in the createSphere method. I also removed the GlStateManager.color and GlStateManager.resetColor calls in renderTileEntityAt. public static void createSphere() { Sphere sphere = new Sphere(); sphere.setDrawStyle(GLU.GLU_FILL); // fill as a solid sphere.setTextureFlag(true); sphere.setNormals(GLU.GLU_SMOOTH); // smooth everything // First make the call list for the outside of the sphere sphere.setOrientation(GLU.GLU_OUTSIDE); TileEntityPortalRenderer.sphereIDOutside = GL11.glGenLists(1); // Create a new list to hold our sphere data GL11.glNewList(TileEntityPortalRenderer.sphereIDOutside, GL11.GL_COMPILE); // binds the texture ResourceLocation resource = new ResourceLocation(Constants.MOD_ID + ":" + "textures/entities/sphere.png"); Minecraft.getMinecraft().getTextureManager().bindTexture(resource); sphere.draw(1.2f, 32, 32); GL11.glEndList(); } So now I'm getting a new error. This error does not happen on start up, it happens only when the block is drawn: [Client thread/ERROR]: ########## GL ERROR ########## [Client thread/ERROR]: @ Post render [Client thread/ERROR]: 1281: Invalid value So something I did or a class I'm using for it is heavily broken. Any ideas what the error could be? Thx in advance. Bektor
-
Hi, I'm currently having some problems with my render code for my block. I'm using Minecraft Forge 1.8.9. The renderer draws sometimes blocks like the water in a different colour when I'm coming near to my own block and moving there a bit around. Here is a picture of the problem: And a picture which shows how everything is rendered when I'm a bit farer away. (just moved a bit away from my block) The next point would be, when you are about 20 blocks from my block away it turns invisible, same goes when you are over the block (directly over it or farer away). It does not turn complete invisible at once, it's goes more that part of part of the block are turning invisible. Here is my TileEntityPortalRenderer: @SideOnly(Side.CLIENT) public class TileEntityPortalRenderer extends TileEntitySpecialRenderer<TileEntityPortal> { public static int sphereIDOutside; public static int sphereIDInside; @Override public void renderTileEntityAt(TileEntityPortal tileEntity, double posX, double posY, double posZ, float partialTicks, int destroyStage) { GlStateManager.pushMatrix(); // store the transformation GlStateManager.translate(posX, posY, posZ); // set viewport to tile entity position to render it /* ============ Rendering Code goes here ============ */ GlStateManager.translate(posX + 1f, posY - .6f, posZ + 1f); GlStateManager.enableBlend(); // enable rendering for transparency GlStateManager.depthMask(false); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.color(1.f, 1.f, 1.f, 1.f); GlStateManager.callList(TileEntityPortalRenderer.sphereIDOutside); GlStateManager.callList(TileEntityPortalRenderer.sphereIDInside); //renderLight(posX, posY, posZ); GlStateManager.resetColor(); GlStateManager.disableBlend(); /* ============ Rendering Code stops here =========== */ GlStateManager.popMatrix(); // restore the transformation, so other renderer's are not messed up } public static void createSphere() { Sphere sphere = new Sphere(); sphere.setDrawStyle(GLU.GLU_FILL); // fill as a solid sphere.setTextureFlag(true); sphere.setNormals(GLU.GLU_SMOOTH); // smooth everything // First make the call list for the outside of the sphere sphere.setOrientation(GLU.GLU_OUTSIDE); TileEntityPortalRenderer.sphereIDOutside = GL11.glGenLists(1); // Create a new list to hold our sphere data GL11.glNewList(TileEntityPortalRenderer.sphereIDOutside, GL11.GL_COMPILE); // binds the texture ResourceLocation resource = new ResourceLocation(Constants.MOD_ID + ":" + "textures/entities/sphere.png"); Minecraft.getMinecraft().getTextureManager().bindTexture(resource); sphere.draw(1.2f, 32, 32); GL11.glEndList(); // Make the call list for the inside of the sphere sphere.setOrientation(GLU.GLU_INSIDE); TileEntityPortalRenderer.sphereIDInside = GL11.glGenLists(1); // Create a new list to hold our sphere data GL11.glNewList(TileEntityPortalRenderer.sphereIDInside, GLU.GLU_INSIDE); Minecraft.getMinecraft().getTextureManager().bindTexture(resource); sphere.draw(1.2f, 32, 32); GL11.glEndList(); } } My init method in the ClientProxy which get's called at the end of the init method in the main class: @Override public void init() { super.init(); TileEntityPortalRenderer.createSphere(); } Here are my json files: blockstates { "variants": { "normal": { "model": "primevalforest:portal" } } } block { "parent": "block/generated", "textures": { "cross": "primevalforest:blocks/portal" } } item { "parent": "builtin/generated", "textures": { "layer0": "primevalforest:blocks/portal" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } } I hope someone can help me. Thx in advance. Bektor
-
[1.8.9] [SOLVED] Buggy sphere's or buggy Minecraft GL?
Bektor replied to Bektor's topic in Modder Support
Ok, I've finally found a solution for it. sphere.setTextureFlag(true); This line of code fixed nearly all bugs with this sphere. Just asking, got anyone an idea why the sphere is disappearing/not drawn when I'm over the sphere? -
[1.8.9] [SOLVED] Buggy sphere's or buggy Minecraft GL?
Bektor replied to Bektor's topic in Modder Support
Hm, I've copied an pasted now the complete tutorial code in and replaced my complete code with it and I'm still getting the same problems. I'm really out of ideas what's wrong... -
[1.7.10] Custom leave textures not working correctly
Bektor replied to TristanvO's topic in Modder Support
Hm, weird problem. I currently can't find the problem. Maybe someone else knows more about this problem then I do. -
[1.8.9] [SOLVED] Buggy sphere's or buggy Minecraft GL?
Bektor replied to Bektor's topic in Modder Support
Now it worked with the break point. ^^ So, rendering code is executed. Seems to be it was this stupid windows which thought yeah, program isn't reacting, so it's dead..... But I don't know how to fix the problem now, I'm not that OpenGL pro, I know more OpenGL 3.3 with GLSL fragment shader files etc. then OpenGL 2.1 (and I don't even know much about OpenGL 3.3 ^^) -
[1.8.9] [SOLVED] Buggy sphere's or buggy Minecraft GL?
Bektor replied to Bektor's topic in Modder Support
Well, the idea with the breakpoints was a very bad idea. The first project I crashed with break points. ^^ But actually, it's still calling the rendering method, I can't see if it's actually rendered then because I have to press F8 to resume the process and go to the next break point (same position, so next tick) and then Minecraft automatically opens the ESC menu. But the render code will be called each tick. -
[1.8.9] [SOLVED] Buggy sphere's or buggy Minecraft GL?
Bektor replied to Bektor's topic in Modder Support
I think I should read it up from the xyz coordinates if I'm moving or not. So if I move and then stop moving, the xyz coordinates don't change anymore, the pixels are still changing for a few seconds. Everything disappears at once. How can I check if the rendering code is still running? -
[1.8.9] [SOLVED] Buggy sphere's or buggy Minecraft GL?
Bektor replied to Bektor's topic in Modder Support
I may be wrong, but I believe 3D models are better for framerate. I don't know for certain, but TESRs seem to be discouraged, given that they update on every frame. Also, models are easier. But if you need anything custom then TESR is kinda necessary. I am probably wrong. I usually am. I don't think that 3D models are better for framerate. I mean while rendering a 3d object you just render points and lines which connect the lines together and that's what you do when you don't have a model and want to render a sphere. At least from that what I know it's working so. Oh and here are some pics how my sphere looks now: http://i.imgur.com/JXtNTnJ.png First sphere is totally incorrect drawn, the sphere above doesn't look nice but at least it's a sphere. If I'm farer away both sphere's disappear and when I'm looking from a other side it looks like there is no sphere. So the sphere is just from ONE side visible. When I start moving, doesn't matter how much I move all pixels of the sphere begin to move, too. When I stop moving the sphere pixels are still moving around which really looks horrible. After a few seconds where I don't move the sphere pixels finally stop moving, too and it looks like in the pic above. And here is the code: @SideOnly(Side.CLIENT) public class TileEntityPortalRenderer extends TileEntitySpecialRenderer<TileEntityPortal> { public static int sphereIDOutside; public static int sphereIDInside; @Override public void renderTileEntityAt(TileEntityPortal tileEntity, double posX, double posY, double posZ, float partialTicks, int destroyStage) { GlStateManager.pushMatrix(); // store the transformation GlStateManager.translate(posX, posY, posZ); // set viewport to tile entity position to render it /* ============ Rendering Code goes here ============ */ GlStateManager.translate(posX + 1f, posY - .6f, posZ + 1f); GlStateManager.enableBlend(); // enable rendering for transparency GlStateManager.depthMask(false); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.color(1.f, 1.f, 1.f, .5f); GlStateManager.callList(TileEntityPortalRenderer.sphereIDOutside); GlStateManager.callList(TileEntityPortalRenderer.sphereIDInside); //renderLight(posX, posY, posZ); GlStateManager.resetColor(); GlStateManager.disableBlend(); /* ============ Rendering Code stops here =========== */ GlStateManager.popMatrix(); // restore the transformation, so other renderer's are not messed up } public static void createSphere() { Sphere sphere = new Sphere(); sphere.setDrawStyle(GLU.GLU_FILL); // fill as a solid sphere.setNormals(GLU.GLU_SMOOTH); // smooth everything // First make the call list for the outside of the sphere sphere.setOrientation(GLU.GLU_OUTSIDE); TileEntityPortalRenderer.sphereIDOutside = GL11.glGenLists(1); // Create a new list to hold our sphere data GL11.glNewList(TileEntityPortalRenderer.sphereIDOutside, GL11.GL_COMPILE); // binds the texture ResourceLocation resource = new ResourceLocation(Constants.MOD_ID + ":" + "textures/blocks/sapling_golden.png"); Minecraft.getMinecraft().getTextureManager().bindTexture(resource); sphere.draw(1.2f, 32, 32); GL11.glEndList(); // Make the call list for the inside of the sphere sphere.setOrientation(GLU.GLU_INSIDE); TileEntityPortalRenderer.sphereIDInside = GL11.glGenLists(1); // Create a new list to hold our sphere data GL11.glNewList(TileEntityPortalRenderer.sphereIDInside, GLU.GLU_INSIDE); Minecraft.getMinecraft().getTextureManager().bindTexture(resource); sphere.draw(1.2f, 32, 32); GL11.glEndList(); } } @Override public void init() { super.init(); TileEntityPortalRenderer.createSphere(); } @Mod.EventHandler public void init(FMLInitializationEvent event) { PrimevalForest.proxy.init(); } Any idea how to fix it? -
Custom sapling spawning oak tree instead of custom tree.
Bektor replied to TristanvO's topic in Modder Support
So the problem is a java.lang.ClassCastException. Here (WorldGenMangoTree.java:102) you are trying to cast your mangoSapling into a BlockSapling, but this is not possible so the Game is crashing. Your mangoSapling is a sub class from BlockBush because you extend from BlockBush. You can try to change the casting to your mangoSapling, BlockBush or you change the extends. So that mangoSapling becomes a sub class for the super class BlockSapling. That should work. It's ok that you was not able to find everywhere understandable names, it comes with the experience and time and in Minecraft versions like 1.8.9 it's easier, because there it's already mostly done for you. Just a few more tipps: func_149853_b(World world, Random random, int par3, int par4, int par5) --> for this example, even if you know how the method name would be, don't change it if the method is overriden in your class. Second: use over overriden methods this annotation: @Override It gives you an error when the method changes for example with Minecraft 1.8.x. Bektor -
Custom sapling spawning oak tree instead of custom tree.
Bektor replied to TristanvO's topic in Modder Support
Then there are some errors in your code. Could you please upload your code with syntax highlighting for Java. And change this: generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_) growVines(World p_76529_1_, int p_76529_2_, int p_76529_3_, int p_76529_4_, int p_76529_5_) colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) removeLeaves(World p_150126_1_, int p_150126_2_, int p_150126_3_, int p_150126_4_) quantityDropped(Random p_149745_1_) getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) func_150124_c(World p_150124_1_, int p_150124_2_, int p_150124_3_, int p_150124_4_, int p_150124_5_, int p_150124_6_) {} harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) damageDropped(int p_149692_1_) etc. to more usefull names. This means also you have to change the parameter names in the method body. (if you are using eclipse there is a function to replace names) Here is an example: generate(World world, Random random, int posX, int posY, int posZ) growVines(World world, int posX, int posY, int posZ, int whatIsThis) colorMultiplier(IBlockAccess blockAccess, int posX, int posY, int posZ) breakBlock(World world, int posX, int posY, int posZ, Block block, int whatIsThis) updateTick(World world, int posX, int posY, int posZ, Random random) randomDisplayTick(World world, int posX, int posY, int posZ, Random random) removeLeaves(World world, int posX, int posY, int posZ) quantityDropped(Random random) getItemDropped(int whatIsThis, Random random, int whatIsThis2) This makes it possible to easily read your code and find the problem and helps everyone who wants to help you alot and helps you also while programming. Then add informations like Minecraft version, Forge version, full crash log (use pastebin for this). Without this it will be really hard or impossible to find your problem. Bektor -
Custom sapling spawning oak tree instead of custom tree.
Bektor replied to TristanvO's topic in Modder Support
First, please enable Syntax Highlighting "Java" when posting your code on pastebin. Secondly: Java name conventions: http://www.oracle.com/technetwork/java/codeconventions-135099.html Third: I would suggest to update your mappings in the build.gradle because there are so many func_ methods. To your problem: Object object = p_149878_5_.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true); You are using "WorldGenBigTree" and "WorldGenTrees" in your sapling class instead of your own Tree: "WorldGenMangoTree". That's why the vanilla oak tree is spawning. I hope this helps you. Bektor -
[1.8.9] [SOLVED] Buggy sphere's or buggy Minecraft GL?
Bektor replied to Bektor's topic in Modder Support
Well, I want to first test if it's working without a 3d model, because why should I use a 3d model when it can be done without one. Maybe there is a option in the GLStateManager but because I'm not familiar with it I don't know. I just know that my light source already crashed it with an ArrayOutOfBoundsException. The code below is not working. (not sure why) private void renderLight(double posX, double posY, double posZ) { GlStateManager.enableLighting(); GL11.glEnable(GL11.GL_LIGHT0); // don't use there GlStateManager .... crashed my game float ambientLight[] = { .2f, .2f, .2f, 1.f }; float diffuseLight[] = { .8f, .8f, .8f, 1.f }; float specularLight[] = { .5f, .5f, .5f, 1.f }; float position[] = { (float) posX, (float) posY, (float) posZ, 2.f }; // 4 floats for a position..... o..k... ByteBuffer temp = ByteBuffer.allocateDirect(16); temp.order(ByteOrder.nativeOrder()); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, (FloatBuffer)temp.asFloatBuffer().put(ambientLight).flip()); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, (FloatBuffer)temp.asFloatBuffer().put(diffuseLight).flip()); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_SPECULAR, (FloatBuffer)temp.asFloatBuffer().put(specularLight).flip()); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, (FloatBuffer)temp.asFloatBuffer().put(position).flip()); GL11.glDisable(GL11.GL_LIGHT0); GlStateManager.disableLighting(); } So any idea how to get the tile entity sphere rendering with this shiny light method above working without using models? There must be a way, I know it. No change, expect for it that it now renders also when I've got the block not in the hand. But when I move around it disappears again. private static int sphereIDOutside; private static int sphereIDInside; @Override public void renderTileEntityAt(TileEntityPortal tileEntity, double posX, double posY, double posZ, float partialTicks, int destroyStage) { GlStateManager.pushMatrix(); // store the transformation GlStateManager.translate(posX, posY, posZ); // set viewport to tile entity position to render it /* ============ Rendering Code goes here ============ */ GlStateManager.translate(posX + 1f, posY - .6f, posZ + 1f); GlStateManager.color(1.f, 1.f, 1.f, .5f); GlStateManager.enableBlend(); // enable rendering for transparency GlStateManager.depthMask(false); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glCallList(TileEntityPortalRenderer.sphereIDOutside); GL11.glCallList(TileEntityPortalRenderer.sphereIDInside); //renderLight(posX, posY, posZ); GlStateManager.resetColor(); GlStateManager.disableBlend(); /* ============ Rendering Code stops here =========== */ GlStateManager.popMatrix(); // restore the transformation, so other renderer's are not messed up } public static void createSphere() { Sphere sphere = new Sphere(); sphere.setDrawStyle(GLU.GLU_FILL); // fill as a solid sphere.setNormals(GLU.GLU_SMOOTH); // smooth everything // First make the call list for the outside of the sphere sphere.setOrientation(GLU.GLU_OUTSIDE); TileEntityPortalRenderer.sphereIDOutside = GL11.glGenLists(1); // Create a new list to hold our sphere data GL11.glNewList(TileEntityPortalRenderer.sphereIDOutside, GL11.GL_COMPILE); // binds the texture ResourceLocation resource = new ResourceLocation(Constants.MOD_ID + ":" + "textures/blocks/sapling_golden.png"); Minecraft.getMinecraft().getTextureManager().bindTexture(resource); sphere.draw(1.2f, 32, 32); GL11.glEndList(); // Make the call list for the inside of the sphere sphere.setOrientation(GLU.GLU_INSIDE); TileEntityPortalRenderer.sphereIDInside = GL11.glGenLists(1); // Create a new list to hold our sphere data GL11.glNewList(TileEntityPortalRenderer.sphereIDInside, GLU.GLU_INSIDE); Minecraft.getMinecraft().getTextureManager().bindTexture(resource); sphere.draw(1.2f, 32, 32); GL11.glEndList(); } The createSphere() method is called in the client proxy in a method which is called in the init method of the main class. The texture which was set there is still not used for some reason and the complete thing itself renders like before. You can see that it's based on pixels and it's flickering. It looks a bit like this: Only difference, all pixels are green and it's a sphere and the flickering. (sometimes I also noticed the pixels are chaning colours, not sure if it happens with the new code from above). So this didn't solve my problems. It looks like before. (the light source code from above isn't implemented because it's also not working) EDIT: Oh and I'm getting now this thing. Could be that I got it before, too, but before I never saw it or I overlooked it.: [19:01:13] [Client thread/ERROR] [FML]: Suppressed additional 40 model loading errors for domain primevalforest [19:01:13] [Client thread/ERROR]: ########## GL ERROR ########## [19:01:13] [Client thread/ERROR]: @ Post startup [19:01:13] [Client thread/ERROR]: 1280: Invalid enum -
Hi, I'm currently working on rendering a sphere in Minecraft (as a tile entity). But it's not working well. Here are some pics how my sphere looks now: http://i.imgur.com/JXtNTnJ.png First sphere is totally incorrect drawn, the sphere above doesn't look nice but at least it's a sphere. If I'm farer away both sphere's disappear and when I'm looking from a other side it looks like there is no sphere. So the sphere is just from ONE side visible. When I start moving, doesn't matter how much I move all pixels of the sphere begin to move, too. When I stop moving the sphere pixels are still moving around which really looks horrible. After a few seconds where I don't move the sphere pixels finally stop moving, too and it looks like in the pic above. And here is the code: @SideOnly(Side.CLIENT) public class TileEntityPortalRenderer extends TileEntitySpecialRenderer<TileEntityPortal> { public static int sphereIDOutside; public static int sphereIDInside; @Override public void renderTileEntityAt(TileEntityPortal tileEntity, double posX, double posY, double posZ, float partialTicks, int destroyStage) { GlStateManager.pushMatrix(); // store the transformation GlStateManager.translate(posX, posY, posZ); // set viewport to tile entity position to render it /* ============ Rendering Code goes here ============ */ GlStateManager.translate(posX + 1f, posY - .6f, posZ + 1f); GlStateManager.enableBlend(); // enable rendering for transparency GlStateManager.depthMask(false); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.color(1.f, 1.f, 1.f, .5f); GlStateManager.callList(TileEntityPortalRenderer.sphereIDOutside); GlStateManager.callList(TileEntityPortalRenderer.sphereIDInside); //renderLight(posX, posY, posZ); GlStateManager.resetColor(); GlStateManager.disableBlend(); /* ============ Rendering Code stops here =========== */ GlStateManager.popMatrix(); // restore the transformation, so other renderer's are not messed up } public static void createSphere() { Sphere sphere = new Sphere(); sphere.setDrawStyle(GLU.GLU_FILL); // fill as a solid sphere.setNormals(GLU.GLU_SMOOTH); // smooth everything // First make the call list for the outside of the sphere sphere.setOrientation(GLU.GLU_OUTSIDE); TileEntityPortalRenderer.sphereIDOutside = GL11.glGenLists(1); // Create a new list to hold our sphere data GL11.glNewList(TileEntityPortalRenderer.sphereIDOutside, GL11.GL_COMPILE); // binds the texture ResourceLocation resource = new ResourceLocation(Constants.MOD_ID + ":" + "textures/blocks/sapling_golden.png"); Minecraft.getMinecraft().getTextureManager().bindTexture(resource); sphere.draw(1.2f, 32, 32); GL11.glEndList(); // Make the call list for the inside of the sphere sphere.setOrientation(GLU.GLU_INSIDE); TileEntityPortalRenderer.sphereIDInside = GL11.glGenLists(1); // Create a new list to hold our sphere data GL11.glNewList(TileEntityPortalRenderer.sphereIDInside, GLU.GLU_INSIDE); Minecraft.getMinecraft().getTextureManager().bindTexture(resource); sphere.draw(1.2f, 32, 32); GL11.glEndList(); } } @Override public void init() { super.init(); TileEntityPortalRenderer.createSphere(); } @Mod.EventHandler public void init(FMLInitializationEvent event) { PrimevalForest.proxy.init(); } Any ideas? Thx in advance. Bektor Old message: