Jump to content

Liahim

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by Liahim

  1. O! Thank you so much! I think that this will help me )
  2. Guys, guys! Thanks for the help, but the custom trigger will not help me. I need to look for a Universal Bucket in the vanilla trigger minecraft:inventory_changed. Custom trigger will require a custom call. And this is a bit stupid. Perhaps, all the same, will you help me register my own ItemPredicate? P.S. I know the custom trigger system.
  3. Is there any example?
  4. How can I use a universal bucket in custom advancements? I need "inventory_changed" trigger with filled universal bucket. An example from Choonster does not work: https://github.com/Choonster-Minecraft-Mods/TestMod3/blob/1.12.1/src/main/resources/assets/testmod3/recipes/_factories.json Trigger: "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "type": "mist:filled_universal_bucket", "fluid": "mist_acid" } ] } The console writes the following: "There is no ItemPredicate of type mist:filled_universal_bucket..." I think this is because the factory returns an ingredient, not an item. Help!
  5. You're right, my goal is not clouds. Sorry if I express myself is not clear. I need to render a translucent plane under the player's feet. The plane should be visible regardless of the clouds ON/OFF settings. That's why I do not use the WorldProvider#setCloudRenderer. Could you tell me about the GL states? Maybe it will help me to implement its plans.
  6. My problem is that the horizon line is at a height of 160. Duplicated clouds are located under your feet, at a height of about 140. At this height clouds transparency settings are changed and the clouds become transparent. You can check it yourself. Under such conditions, a translucent blocks are not visible. This happens if the use WorldProvider#setCloudRenderer or RenderWorldLastEvent. However, if you use DrawBlockHighlightEvent, for example, transparent blocks before clouds become visible, but they disappear behind the clouds. My code: @SideOnly(Side.CLIENT) @SubscribeEvent public void renderEvent(DrawBlockHighlightEvent e) { World world = this.mc.thePlayer.worldObj; if (world.isRemote && world.provider.dimensionId == CommonProxy.dimensionId) { cloudRender(e.partialTicks, (WorldClient)world, this.mc); } } public static void cloudRender(float partialTicks, WorldClient world, Minecraft mc) { float playerHeight = (float)(mc.renderViewEntity.lastTickPosY + (mc.renderViewEntity.posY - mc.renderViewEntity.lastTickPosY) * (double)partialTicks); byte i = 4; int r = mc.gameSettings.renderDistanceChunks * 16; int e = r / i; int d = r * 2; Tessellator tessellator = Tessellator.instance; Last Edit: Yesterday at 04:35:53 pm mc.getTextureManager().bindTexture(locationCloudPng); GL11.glEnable(GL11.GL_BLEND); GL11.glAlphaFunc(GL11.GL_GREATER, 0.0F); GL11.glEnable(GL11.GL_FOG); OpenGlHelper.glBlendFunc(770, 771, 1, 0); Vec3 vec3 = world.getCloudColour(partialTicks); float f2 = (float)vec3.xCoord; float f3 = (float)vec3.yCoord; float f4 = (float)vec3.zCoord; float colorOffset = 0.64F; float height = 140; tessellator.startDrawingQuads(); tessellator.setColorRGBA_F(f2 + colorOffset, f3 + colorOffset, f4 + colorOffset, 0.05F); for (int x = -e * i; x < e * i; x += e) { for (int y = -e * i; y < e * i; y += e) { tessellator.addVertexWithUV(x, height, y, (float)(r+y)/d, (float)(r-x)/d); tessellator.addVertexWithUV(x, height, y+e, (float)(r+y+e)/d, (float)(r-x)/d); tessellator.addVertexWithUV(x+e, height, y+e, (float)(r+y+e)/d, (float)(r-x-e)/d); tessellator.addVertexWithUV(x+e, height, y, (float)(r+y)/d, (float)(r-x-e)/d); } } tessellator.draw(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_FOG); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glDisable(GL11.GL_BLEND); }
  7. Yes, I tried it. But the glass blocks are still not visible. But I've been thinking. Water and colored glass using renderPass = 1 and they can see through each other. How can I render a transparent plane (my clouds) using a renderPass = 1?
  8. Hello everybody! I'm trying to duplicate the standard cloud. Is the following code (90% vanila): private Minecraft mc = Minecraft.getMinecraft(); private TextureManager renderEngine; private WorldClient theWorld; private static final ResourceLocation locationCloudsPng = new ResourceLocation("mod:textures/environment/cloud.png"); @SideOnly(Side.CLIENT) @SubscribeEvent public void renderCloudEvent(RenderWorldLastEvent e) { layerCloudRender(e.partialTicks); } private void layerCloudRender(float partialTicks) { this.renderEngine = mc.getTextureManager(); this.theWorld = mc.theWorld; float p_72718_1_ = partialTicks; IRenderHandler renderer = null; if ((renderer = theWorld.provider.getCloudRenderer()) != null) { renderer.render(p_72718_1_, theWorld, mc); return; } if (this.mc.theWorld.provider.isSurfaceWorld()) { GL11.glDisable(GL11.GL_CULL_FACE); float f1 = (float)(this.mc.renderViewEntity.lastTickPosY + (this.mc.renderViewEntity.posY - this.mc.renderViewEntity.lastTickPosY) * (double)p_72718_1_); byte b0 = 32; int i = 256 / b0; Tessellator tessellator = Tessellator.instance; this.renderEngine.bindTexture(locationCloudsPng); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); Vec3 vec3 = this.theWorld.getCloudColour(p_72718_1_); float f2 = (float)vec3.xCoord; float f3 = (float)vec3.yCoord; float f4 = (float)vec3.zCoord; float f5; if (this.mc.gameSettings.anaglyph) { f5 = (f2 * 30.0F + f3 * 59.0F + f4 * 11.0F) / 100.0F; float f6 = (f2 * 30.0F + f3 * 70.0F) / 100.0F; float f7 = (f2 * 30.0F + f4 * 70.0F) / 100.0F; f2 = f5; f3 = f6; f4 = f7; } f5 = 4.8828125E-4F; double d2 = (double)((float)50 + p_72718_1_); double d0 = this.mc.renderViewEntity.prevPosX + (this.mc.renderViewEntity.posX - this.mc.renderViewEntity.prevPosX) * (double)p_72718_1_ + d2 * 0.029999999329447746D; double d1 = this.mc.renderViewEntity.prevPosZ + (this.mc.renderViewEntity.posZ - this.mc.renderViewEntity.prevPosZ) * (double)p_72718_1_; int j = MathHelper.floor_double(d0 / 2048.0D); int k = MathHelper.floor_double(d1 / 2048.0D); d0 -= (double)(j * 2048); d1 -= (double)(k * 2048); float f8 = this.theWorld.provider.getCloudHeight() - f1 - 16.33F; float f9 = (float)(d0 * (double)f5); float f10 = (float)(d1 * (double)f5); tessellator.startDrawingQuads(); tessellator.setColorRGBA_F(f2, f3, f4, 0.8F); for (int l = -b0 * i; l < b0 * i; l += b0) { for (int i1 = -b0 * i; i1 < b0 * i; i1 += b0) { tessellator.addVertexWithUV((double)(l + 0), (double)f8, (double)(i1 + b0), (double)((float)(l + 0) * f5 + f9), (double)((float)(i1 + b0) * f5 + f10)); tessellator.addVertexWithUV((double)(l + b0), (double)f8, (double)(i1 + b0), (double)((float)(l + b0) * f5 + f9), (double)((float)(i1 + b0) * f5 + f10)); tessellator.addVertexWithUV((double)(l + b0), (double)f8, (double)(i1 + 0), (double)((float)(l + b0) * f5 + f9), (double)((float)(i1 + 0) * f5 + f10)); tessellator.addVertexWithUV((double)(l + 0), (double)f8, (double)(i1 + 0), (double)((float)(l + 0) * f5 + f9), (double)((float)(i1 + 0) * f5 + f10)); } } tessellator.draw(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_CULL_FACE); } } However, my cloud do not disappear in the distance. Moreover, translucent blocks in the foreground are not visible. The picture shows the both problems: How can I fix it?
  9. @ShetiPhian Sorry. How can I change the colorMultiplier method for these purposes? I do not quite understand. Now it looks like this: @SideOnly(Side.CLIENT) public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) { return BiomeColorHelper.getGrassColorAtPos(worldIn, pos); } O! I did it! Thanks for help ) @SideOnly(Side.CLIENT) public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) { return renderPass == 1 ? BiomeColorHelper.getGrassColorAtPos(worldIn, pos) : 16777215; }
  10. No, I need a full grass block. First, I created a model. my_grass_model: { "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#down", "cullface": "down" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#up", "cullface": "up", "tintindex": 0 }, "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#north", "cullface": "north" }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#south", "cullface": "south" }, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#west", "cullface": "west" }, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#east", "cullface": "east" } } }, { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "north" }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "south" }, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "west" }, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#overlay", "tintindex": 0, "cullface": "east" } } } ] } Then, based on it created a model for my block. my_grass_block { "parent": "mymod:block/my_grass_model", "textures": { "particle": "blocks/dirt", "down": "mymod:blocks/MyGrass_Bottom", "up": "blocks/grass_top", "north": "mymod:blocks/MyGrass", "east": "mymod:blocks/MyGrass", "south": "mymod:blocks/MyGrass", "west": "mymod:blocks/MyGrass", "overlay": "blocks/grass_side_overlay" } } And particles from the block have no color of the dirt. They are painted in green. How can I fix it? https://file-up.net/big_748f23757e8c8371e820151209082645.jpg[/img]
  11. Hi. I made a custom grass block model of this example. But the particles from the block also colored in the biome color. How can I fix it?
×
×
  • Create New...

Important Information

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