FlenixCityes Core en 1.8.9 (depuis la 1.7.10)



  • Bonjour, j'ai récement pris le code source de flenix citie core pour le transformé en mods 1.8.9, le problème, c'est que je n'arrive pas a faire le rendercore en 1.8.9, 'jai beau cherché custom render block, ou RenderBlocks on 1.8.9 sur google, mais j ne trouve rien, voici le code que j'ai commencé a faire :
    :::

    [font=Courier Newpackage ]com.silvaniastudios.cities.core.client.renders%(#cc7832)[;
    ]
    import net.minecraft.client.renderer.WorldRenderer%(#cc7832)[;
    ]import net.minecraft.client.renderer.block.model.BakedQuad%(#cc7832)[;
    ]import net.minecraft.client.renderer.block.model.ItemCameraTransforms%(#cc7832)[;
    ]import net.minecraft.client.renderer.texture.TextureAtlasSprite%(#cc7832)[;
    ]import net.minecraft.client.renderer.vertex.DefaultVertexFormats%(#cc7832)[;
    ]import net.minecraft.client.resources.model.IBakedModel%(#cc7832)[;
    ]import net.minecraft.util.BlockPos%(#cc7832)[;
    ]import net.minecraft.util.EnumFacing%(#cc7832)[;
    ]import org.lwjgl.opengl.GL11%(#cc7832)[;
    ]
    import net.minecraft.block.Block%(#cc7832)[;
    ]
    import net.minecraft.client.renderer.Tessellator%(#cc7832)[;
    ]import net.minecraft.init.Blocks%(#cc7832)[;
    ]
    import net.minecraft.world.IBlockAccess%(#cc7832)[;
    ]
    import java.util.List%(#cc7832)[;
    ]
    public class BlockRenderCore implements IBakedModel {
    
      WorldRenderer tess = Tessellator.*getInstance*().getWorldRenderer()%(#cc7832)[;
    ]  
       public boolean checkConnections(IBlockAccess world, BlockPos blockPos, int targetMeta, int meta, boolean checkBelow) {
         if (world.getBlockState(blockPos).getBlock().isNormalCube(world, blockPos)) {
            %(#cc7832)[return true;
    ]      }
         if ((meta <= 1 || meta == 4 || meta == 5 || meta == 8 || meta == 9) && checkBelow) {
            if ((world.getBlockState(blockPos).getBlock().isNormalCube(world, blockPos) {
               %(#cc7832)[return true;
    ]         }
         }
    
         if (targetMeta >= 0) {
    
         }
         %(#cc7832)[return false;
    ]   }
    
      public void renderBlock(double minX, double minY, double minZ, double maxX, double maxY, double maxZ, boolean existsInWorld, RenderBlocks renderer, Block block, int x, int y, int z, int meta) {
         renderer.setRenderBounds(minX, minY, minZ, maxX, maxY, maxZ)%(#cc7832)[;
    ]      if (existsInWorld) {
            renderer.renderStandardBlock(block, x, y, z)%(#cc7832)[;
    ]      } else {
            Tessellator tess = Tessellator.*instance*%(#cc7832)[;
    ]         GL11.*glTranslatef*(-0.5F, -0.5F, -0.5F)%(#cc7832)[;
    ]        
            tess.begin(0, DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.setNormal(0.0F, -1.0F, 0.0F)%(#cc7832)[;
    ]         renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, 0))%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]        
            tess.begin(0,DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.setNormal(0.0F, 1.0F, 0.0F)%(#cc7832)[;
    ]         renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, 0))%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]        
            tess.begin(0,DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.setNormal(0.0F, 0.0F, -1.0F)%(#cc7832)[;
    ]         renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, 0))%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]        
            tess.begin(0,DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.setNormal(0.0F, 0.0F, 1.0F)%(#cc7832)[;
    ]         renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, 0))%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]        
            tess.begin(0,DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.setNormal(-1.0F, 0.0F, 0.0F)%(#cc7832)[;
    ]         renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, 0))%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]        
            tess.begin(0,DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.setNormal(1.0F, 0.0F, 0.0F)%(#cc7832)[;
    ]         renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, 0))%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]        
            GL11.*glTranslatef*(0.5F, 0.5F, 0.5F)%(#cc7832)[;
    ]      }
      }
    
      public void renderOtherBlock(double minX, double minY, double minZ, double maxX, double maxY, double maxZ, boolean existsInWorld, RenderBlocks renderer, Block block, int x, int y, int z, int meta, IIcon icon) {
         renderer.setRenderBounds(minX, minY, minZ, maxX, maxY, maxZ)%(#cc7832)[;
    ]      renderer.setOverrideBlockTexture(icon)%(#cc7832)[;
    ]      if (existsInWorld) {
            renderer.renderStandardBlock(block, x, y, z)%(#cc7832)[;
    ]      } else {
            Tessellator tess = Tessellator.*instance*%(#cc7832)[;
    ]         GL11.*glTranslatef*(-0.5F, -0.5F, -0.5F)%(#cc7832)[;
    ]        
            tess.begin(0,DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.setNormal(0.0F, -1.0F, 0.0F)%(#cc7832)[;
    ]         renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, 0))%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]        
            tess.begin(0,DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.setNormal(0.0F, 1.0F, 0.0F)%(#cc7832)[;
    ]         renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, 0))%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]        
            tess.begin(0,DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.setNormal(0.0F, 0.0F, -1.0F)%(#cc7832)[;
    ]         renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, 0))%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]        
            tess.begin(0,DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.setNormal(0.0F, 0.0F, 1.0F)%(#cc7832)[;
    ]         renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, 0))%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]        
            tess.begin(0,DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.setNormal(-1.0F, 0.0F, 0.0F)%(#cc7832)[;
    ]         renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, 0))%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]        
            tess.begin(0,DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.setNormal(1.0F, 0.0F, 0.0F)%(#cc7832)[;
    ]         renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, 0))%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]        
            GL11.*glTranslatef*(0.5F, 0.5F, 0.5F)%(#cc7832)[;
    ]      }
         renderer.clearOverrideBlockTexture()%(#cc7832)[;
    ]   }
    
      public void renderLeavesBlock(double x1, double x2, double x3, double x4, double y1, double y2, double y3, double y4, double z1, double z2, double z3, double z4, boolean existsInWorld, RenderBlocks renderer, Block block, int x, int y, int z, int meta) {
         IIcon icon = Blocks.leaves.getIcon(0, 0)%(#cc7832)[;
    ]      
          double u0 = (double) icon.getMinU()%(#cc7832)[;
    ]      double u1 = (double) icon.getMaxU()%(#cc7832)[;
    ]      
          double v0 = (double) icon.getMinV()%(#cc7832)[;
    ]      double v1 = (double) icon.getMaxV()%(#cc7832)[;
    ]      
         tess.setColorOpaque_I(7979098)%(#cc7832)[;
    ]      
          if (existsInWorld) {
            tess.addVertexWithUV(x1 + x, y1 + y, z1 + z, u1, v1)%(#cc7832)[;
    ]         tess.addVertexWithUV(x2 + x, y2 + y, z2 + z, u1, v0)%(#cc7832)[;
    ]         tess.addVertexWithUV(x3 + x, y3 + y, z3 + z, u0, v0)%(#cc7832)[;
    ]         tess.addVertexWithUV(x4 + x, y4 + y, z4 + z, u0, v1)%(#cc7832)[;
    ]      } else {
            tess.begin(0,DefaultVertexFormats.*POSITION_TEX*)%(#cc7832)[;
    ]         tess.addVertexWithUV(x1, y1, z1, u1, v1)%(#cc7832)[;
    ]         tess.addVertexWithUV(x2, y2, z2, u1, v0)%(#cc7832)[;
    ]         tess.addVertexWithUV(x3, y3, z3, u0, v0)%(#cc7832)[;
    ]         tess.addVertexWithUV(x4, y4, z4, u0, v1)%(#cc7832)[;
    ]         tess.draw()%(#cc7832)[;
    ]      }
      }
    
      %(#808080)[/*public IIcon prepBlockAndGetIcon(Block block, IBlockAccess world, int x, int y, int z, RenderBlocks renderer) {
    ]%(#808080)[      int col = 255;
    ]%(#808080)[      float f = 0.8F;
    ]%(#808080)[      int c = block.colorMultiplier(world, x, y, z);
    ]%(#808080)[      float f1 = (float)(c >> 16 & 255) / 255.0F;
    ]%(#808080)[      float f2 = (float)(c >> 8 & 255) / 255.0F;
    ]%(#808080)[      float f3 = (float)(c & 255) / 255.0F;
    ]      
    %(#808080)[      tess.setBrightness(block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z));
    ]%(#808080)[      tess.setColorOpaque_F(f * f1, f * f2, f * f3);
    ]      
    %(#808080)[      return block.get(0, 0);
    ]%(#808080)[   }
    ]%(#808080)[*/
    ]   @Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {}
      @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { return false; }
      @Override public boolean shouldRender3DInInventory(int modelId) { return true; }
      @Override public int getRenderId() { return 0; }
    
      %(#629755)[*/**
    *]%(#629755)[*    * Custom shit stolen from vanilla RenderBlocks and modified. Much easier way to use Ambient Occlusion than rewriting the whole damn thing.
    *]%(#629755)[*    */
    *]   public void renderBottomFace(double x1, double x2, double x3, double x4, double y1, double y2, double y3, double y4, double z1, double z2, double z3, double z4, IIcon icon, RenderBlocks renderer, int x, int y, int z) {
           Tessellator tessellator = Tessellator.*instance*%(#cc7832)[;
    ]
            if (renderer.hasOverrideBlockTexture()) {
               icon = renderer.overrideBlockTexture%(#cc7832)[;
    ]        }
    
           double d3 = (double)icon.getInterpolatedU(renderer.renderMinX * 16.0D)%(#cc7832)[;
    ]        double d4 = (double)icon.getInterpolatedU(renderer.renderMaxX * 16.0D)%(#cc7832)[;
    ]        double d5 = (double)icon.getInterpolatedV(renderer.renderMinZ * 16.0D)%(#cc7832)[;
    ]        double d6 = (double)icon.getInterpolatedV(renderer.renderMaxZ * 16.0D)%(#cc7832)[;
    ]
            if (renderer.renderMinX < 0.0D || renderer.renderMaxX > 1.0D) {
               d3 = (double)icon.getMinU()%(#cc7832)[;
    ]            d4 = (double)icon.getMaxU()%(#cc7832)[;
    ]        }
    
           if (renderer.renderMinZ < 0.0D || renderer.renderMaxZ > 1.0D) {
               d5 = (double)icon.getMinV()%(#cc7832)[;
    ]            d6 = (double)icon.getMaxV()%(#cc7832)[;
    ]        }
    
           double d7 = d4%(#cc7832)[;
    ]        double d8 = d3%(#cc7832)[;
    ]        double d9 = d5%(#cc7832)[;
    ]        double d10 = d6%(#cc7832)[;
    ]
            if (renderer.uvRotateBottom == 2) {
               d3 = (double)icon.getInterpolatedU(renderer.renderMinZ * 16.0D)%(#cc7832)[;
    ]            d5 = (double)icon.getInterpolatedV(16.0D - renderer.renderMaxX * 16.0D)%(#cc7832)[;
    ]            d4 = (double)icon.getInterpolatedU(renderer.renderMaxZ * 16.0D)%(#cc7832)[;
    ]            d6 = (double)icon.getInterpolatedV(16.0D - renderer.renderMinX * 16.0D)%(#cc7832)[;
    ]            d9 = d5%(#cc7832)[;
    ]            d10 = d6%(#cc7832)[;
    ]            d7 = d3%(#cc7832)[;
    ]            d8 = d4%(#cc7832)[;
    ]            d5 = d6%(#cc7832)[;
    ]            d6 = d9%(#cc7832)[;
    ]        } else if (renderer.uvRotateBottom == 1) {
               d3 = (double)icon.getInterpolatedU(16.0D - renderer.renderMaxZ * 16.0D)%(#cc7832)[;
    ]            d5 = (double)icon.getInterpolatedV(renderer.renderMinX * 16.0D)%(#cc7832)[;
    ]            d4 = (double)icon.getInterpolatedU(16.0D - renderer.renderMinZ * 16.0D)%(#cc7832)[;
    ]            d6 = (double)icon.getInterpolatedV(renderer.renderMaxX * 16.0D)%(#cc7832)[;
    ]            d7 = d4%(#cc7832)[;
    ]            d8 = d3%(#cc7832)[;
    ]            d3 = d4%(#cc7832)[;
    ]            d4 = d8%(#cc7832)[;
    ]            d9 = d6%(#cc7832)[;
    ]            d10 = d5%(#cc7832)[;
    ]        } else if (renderer.uvRotateBottom == 3) {
               d3 = (double)icon.getInterpolatedU(16.0D - renderer.renderMinX * 16.0D)%(#cc7832)[;
    ]            d4 = (double)icon.getInterpolatedU(16.0D - renderer.renderMaxX * 16.0D)%(#cc7832)[;
    ]            d5 = (double)icon.getInterpolatedV(16.0D - renderer.renderMinZ * 16.0D)%(#cc7832)[;
    ]            d6 = (double)icon.getInterpolatedV(16.0D - renderer.renderMaxZ * 16.0D)%(#cc7832)[;
    ]            d7 = d4%(#cc7832)[;
    ]            d8 = d3%(#cc7832)[;
    ]            d9 = d5%(#cc7832)[;
    ]            d10 = d6%(#cc7832)[;
    ]        }
    
           double xA = x1 + renderer.renderMinX%(#cc7832)[;
    ]        double xC = x3 + renderer.renderMaxX%(#cc7832)[;
    ]        double d13 = y1 + renderer.renderMaxY%(#cc7832)[;
    ]        double d14 = z1 + renderer.renderMinZ%(#cc7832)[;
    ]        double d15 = z3 + renderer.renderMaxZ%(#cc7832)[;
    ]
            if (renderer.renderFromInside)
           {
               xA = x1 + renderer.renderMaxX%(#cc7832)[;
    ]            xC = x1 + renderer.renderMinX%(#cc7832)[;
    ]        }
    
           if (renderer.enableAO)
           {
               tessellator.setColorOpaque_F(renderer.colorRedTopLeft, renderer.colorGreenTopLeft, renderer.colorBlueTopLeft)%(#cc7832)[;
    ]            tessellator.setBrightness(renderer.brightnessTopLeft)%(#cc7832)[;
    ]            tessellator.addVertexWithUV(x+1, y+0, z+0, d4, d6)%(#cc7832)[;
    ]            tessellator.setColorOpaque_F(renderer.colorRedBottomLeft, renderer.colorGreenBottomLeft, renderer.colorBlueBottomLeft)%(#cc7832)[;
    ]            tessellator.setBrightness(renderer.brightnessBottomLeft)%(#cc7832)[;
    ]            tessellator.addVertexWithUV(x+1, y+0, z+1, d7, d9)%(#cc7832)[;
    ]            tessellator.setColorOpaque_F(renderer.colorRedBottomRight, renderer.colorGreenBottomRight, renderer.colorBlueBottomRight)%(#cc7832)[;
    ]            tessellator.setBrightness(renderer.brightnessBottomRight)%(#cc7832)[;
    ]            tessellator.addVertexWithUV(x+0, y+0, z+1, d3, d5)%(#cc7832)[;
    ]            tessellator.setColorOpaque_F(renderer.colorRedTopRight, renderer.colorGreenTopRight, renderer.colorBlueTopRight)%(#cc7832)[;
    ]            tessellator.setBrightness(renderer.brightnessTopRight)%(#cc7832)[;
    ]            tessellator.addVertexWithUV(x+0, y+0, z+0, d8, d10)%(#cc7832)[;
    ]        } else {
               tessellator.addVertexWithUV(x+1, y+0, z+0, d4, d6)%(#cc7832)[;
    ]            tessellator.addVertexWithUV(x+1, y+0, z+1, d7, d9)%(#cc7832)[;
    ]            tessellator.addVertexWithUV(x+0, y+0, z+1, d3, d5)%(#cc7832)[;
    ]            tessellator.addVertexWithUV(x+0, y+0, z+0, d8, d10)%(#cc7832)[;
    ]        }
    
           %(#808080)[/*double xA = x1 + x;
    ]%(#808080)[        double xB = x2 + x;
    ]%(#808080)[        double xC = x3 + x;
    ]%(#808080)[        double xD = x4 + x;
    ]        
    %(#808080)[        double yA = y1 + y;
    ]%(#808080)[        double yB = y2 + y;
    ]%(#808080)[        double yC = y3 + y;
    ]%(#808080)[        double yD = y4 + y;
    ]        
    %(#808080)[        double zA = z1 + z;
    ]%(#808080)[        double zB = z2 + z;
    ]%(#808080)[        double zC = z3 + z;
    ]%(#808080)[        double zD = z4 + z;
    ]
    
    %(#808080)[        if (renderer.renderFromInside) {
    ]%(#808080)[            xA = x1 + renderer.renderMaxX;
    ]%(#808080)[            xB = x1 + renderer.renderMaxX;
    ]%(#808080)[            xC = x1 + renderer.renderMinX;
    ]%(#808080)[            xD = x1 + renderer.renderMinX;
    ]%(#808080)[        }
    ]
    %(#808080)[        if (renderer.enableAO) {
    ]%(#808080)[            tessellator.setColorOpaque_F(renderer.colorRedTopLeft, renderer.colorGreenTopLeft, renderer.colorBlueTopLeft);
    ]%(#808080)[            tessellator.setBrightness(renderer.brightnessTopLeft);
    ]%(#808080)[            tessellator.addVertexWithUV(xA, yA, zA, d8, d10);
    ]%(#808080)[            tessellator.setColorOpaque_F(renderer.colorRedBottomLeft, renderer.colorGreenBottomLeft, renderer.colorBlueBottomLeft);
    ]%(#808080)[            tessellator.setBrightness(renderer.brightnessBottomLeft);
    ]%(#808080)[            tessellator.addVertexWithUV(xB, yB, zB, d3, d5);
    ]%(#808080)[            tessellator.setColorOpaque_F(renderer.colorRedBottomRight, renderer.colorGreenBottomRight, renderer.colorBlueBottomRight);
    ]%(#808080)[            tessellator.setBrightness(renderer.brightnessBottomRight);
    ]%(#808080)[            tessellator.addVertexWithUV(xC, yC, zC, d7, d9);
    ]%(#808080)[            tessellator.setColorOpaque_F(renderer.colorRedTopRight, renderer.colorGreenTopRight, renderer.colorBlueTopRight);
    ]%(#808080)[            tessellator.setBrightness(renderer.brightnessTopRight);
    ]%(#808080)[            tessellator.addVertexWithUV(xD, yD, zD, d4, d6);
    ]%(#808080)[        } else {
    ]%(#808080)[            tessellator.addVertexWithUV(xA, yA, zA, d8, d10);
    ]%(#808080)[            tessellator.addVertexWithUV(xB, yB, zB, d3, d5);
    ]%(#808080)[            tessellator.addVertexWithUV(xC, yC, zC, d7, d9);
    ]%(#808080)[            tessellator.addVertexWithUV(xD, yD, zD, d4, d6);
    ]%(#808080)[        }*/
    ]    }
    
      %(#bbb529)[@Override
    ]   public List <bakedquad>getFaceQuads(EnumFacing p_177551_1_) {
         %(#cc7832)[return null;
    ]   }
    
      %(#bbb529)[@Override
    ]   public List <bakedquad>getGeneralQuads() {
         %(#cc7832)[return null;
    ]   }
    
      %(#bbb529)[@Override
    ]   public boolean isAmbientOcclusion() {
         %(#cc7832)[return false;
    ]   }
    
      %(#bbb529)[@Override
    ]   public boolean isGui3d() {
         %(#cc7832)[return false;
    ]   }
    
      %(#bbb529)[@Override
    ]   public boolean isBuiltInRenderer() {
         %(#cc7832)[return false;
    ]   }
    
      %(#bbb529)[@Override
    ]   public TextureAtlasSprite getParticleTexture() {
         %(#cc7832)[return null;
    ]   }
    
      %(#bbb529)[@Override
    ]   public ItemCameraTransforms getItemCameraTransforms() {
         %(#cc7832)[return null;
    ]   }
    }
    

    :::, voici le code disponible sur le github : https://github.com/Flenix/FlenixCitiesCore/blob/master/src/main/java/com/silvaniastudios/cities/core/client/renders/BlockRenderCore.java merci de votre aide !</bakedquad></bakedquad>


  • Administrateurs

    ISimpleBlockRenderingHandler n'existe plus du tout maintenant, il faut passer par les blocs states + les json dans la majorité des cas.
    D'en d'autres il faut en effet IBakedModel.

    à quoi ressemble ce bloc en jeu ?



  • De tête, il rasemble  tout les block voici l'exemple de certain block :

    de plus, je ne suis plus sur mon pc fix, donc pour tout refaire en testant un par un ca va être long 😕


  • Administrateurs

    La plupart peuvent être refait via des jsons.
    Il y a juste ceux qui ont des rotations qui risques de causer problème.



  • Daccord et les escalier je peux faire le rendu avec loutil de mr crazyfish?


  • Administrateurs

    Les rotations vont causer problème (les jsons c'est 45, 90 ou 22.5). à voire si 22,5 est bon ou pas.



  • Bonjour, je reviens car j'ai un soucis avec l'escalier (gros up excuser moi j'ai pas voulue réouvrire un sujet :/), sur MrCrayfish's Model Creator il rend bien, sauf que lorsque je le met en json que je le register il ne marche pas, j'ai pourtant bien register ect.. car j'ai testé avec le RightCorner (un autre block) et la l'escalier s'afifche bien, donc j'ai copié la classe, voici ma classe ou je l'enregistre :

    [font=Courier Newpackage ]fr.ph1823.MyLife%(#cc7832)[;
    ]
    import com.silvaniastudios.cities.core.CoreBlocks%(#cc7832)[;
    ]import com.silvaniastudios.cities.core.CoreItems%(#cc7832)[;
    ]import net.minecraft.item.Item%(#cc7832)[;
    ]import net.minecraftforge.fml.common.FMLLog%(#cc7832)[;
    ]import tv.twitch.Core%(#cc7832)[;
    ]
    import static fr.ph1823.MyLife.GloryRP.*%(#cc7832)[;
    ]
    %(#629755)[*/**
    *]%(#629755)[* * Created by ph1823 - Minecraft on 29/12/2016.
    *]%(#629755)[* */
    *]public class CoreTexture {
    
       public static void registerBlock() {
    
           *itemNewLife*()%(#cc7832)[;
    ]        *itemFlenix*()%(#cc7832)[;
    ]        *blockNewLife*()%(#cc7832)[;
    ]
       }
       static void blockNewLife() {
           *proxyClient*.registerItemTexture(*cannabisSeed*, "cannabis_seed")%(#cc7832)[;
    ]        %(#808080)[//proxyClient.registerItemTexture(CoreItems.atmScreen, "atmBlock");
    ]    }
    
       static void itemNewLife() {
           *proxyClient*.registerBlockTexture(*cannabisPlant*, "cannabisb")%(#cc7832)[;
    ]        *proxyClient*.registerBlockTexture(*RightTurnsign*, "rightcorner")%(#cc7832)[;
    ]        *proxyClient*.registerBlockTexture(*stopsign*, "stopsign")%(#cc7832)[;
    ]        *proxyClient*.registerBlockTexture(*yieldsign*, "yieldsign")%(#cc7832)[;
    ]        *proxyClient*.registerBlockTexture(*trafficcone*, "trafficcone")%(#cc7832)[;
    ]
       }
    
       static  void itemFlenix() {
    
          %(#808080)[// proxyClient.registerBlockTexture(CoreBlocks.atmBlock, "atmBlock");
    ]
           *proxyClient*.registerBlockTexture(CoreBlocks.*oakWalkwayStairs*, "oakWalkwayStairs")%(#cc7832)[;
    ]    }
    
    }
    

    (la texture, et voici comme Flenix fait le rendue -> https://github.com/Flenix/FlenixCitiesCore/tree/master/src/main/java/com/silvaniastudios/cities/core/client/renders) , mais la n'es pas le problème, lorsque je le place, il ne ce place pas comme il faut, la aussi j'ai cherché et je n'ai pas trouvé, voici donc ma classe pour l'instant :

    [font=Courier Newpackage ]com.silvaniastudios.cities.core.blocks%(#cc7832)[;
    ]
    import java.util.List%(#cc7832)[;
    ]
    import com.silvaniastudios.cities.core.FlenixCities_Core%(#cc7832)[;
    ]
    import fr.ph1823.MyLife.Proxy.ClientProxy%(#cc7832)[;
    ]import net.minecraft.block.Block%(#cc7832)[;
    ]import net.minecraft.block.material.Material%(#cc7832)[;
    ]import net.minecraft.block.state.IBlockState%(#cc7832)[;
    ]import net.minecraft.entity.Entity%(#cc7832)[;
    ]import net.minecraft.entity.EntityLivingBase%(#cc7832)[;
    ]import net.minecraft.item.ItemStack%(#cc7832)[;
    ]import net.minecraft.util.*%(#cc7832)[;
    ]import net.minecraft.world.IBlockAccess%(#cc7832)[;
    ]import net.minecraft.world.World%(#cc7832)[;
    ]import net.minecraftforge.fml.relauncher.Side%(#cc7832)[;
    ]import net.minecraftforge.fml.relauncher.SideOnly%(#cc7832)[;
    ]
    import net.minecraft.block.Block.SoundType%(#cc7832)[;
    ]public class BlockWalkwayStairs extends Block {
    
      String textureName%(#cc7832)[;
    ]   String oversizeName%(#cc7832)[;
    ]   %(#808080)[//getBlockState().getBaseState()
    ]  
      public BlockWalkwayStairs(Material mat, SoundType sound, String icon, String icon2) {
         super(mat)%(#cc7832)[;
    ]      this.setCreativeTab(FlenixCities_Core.*tabCity*)%(#cc7832)[;
    ]      this.textureName = icon%(#cc7832)[;
    ]      this.oversizeName = icon2%(#cc7832)[;
    ]      this.setStepSound(sound)%(#cc7832)[;
    ]      this.setHardness(2.0F)%(#cc7832)[;
    ]      this.setResistance(12.0F)%(#cc7832)[;
    ]
      }
    
      %(#bbb529)[@Override
    ]   public void onBlockPlacedBy(World world, BlockPos blockPos, IBlockState state, EntityLivingBase entity, ItemStack stack) {
          int direction = MathHelper.*floor_double*((entity.rotationYaw * 4F) / 360F + 0.5D) & 3%(#cc7832)[;
    ]      world.setBlockState(blockPos, getBlockState().getBlock().getStateFromMeta(direction),0)%(#cc7832)[;
    ]
      %(#808080)[//    world.setBlockMetadataWithNotify(blockPos, direction, 0);
    ]   }
    
      %(#bbb529)[@Override
    ]   public void addCollisionBoxesToList(World world, BlockPos blockPos, IBlockState state, AxisAlignedBB mask, List <axisalignedbb>list, Entity entity) {
         boolean hasCollision = %(#cc7832)[false;
    ]      int meta = world.getBlockState(blockPos).getBlock().getMetaFromState(state)%(#cc7832)[;
    ]      if (!(world.getBlockState(blockPos.add(0,-1,0)).getBlock() instanceof BlockWalkwayStairs)) {
            hasCollision = %(#cc7832)[true;
    ]        
             if (meta == 0) { %(#808080)[//South-facing
    ]            setBlockBounds(0.0F, 0.0F,  0.0F,  1.0F, 0.0625F, 0.25F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]            setBlockBounds(0.0F, 0.25F, 0.25F, 1.0F, 0.3125F, 0.50F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]            setBlockBounds(0.0F, 0.50F, 0.50F, 1.0F, 0.5625F, 0.75F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]            setBlockBounds(0.0F, 0.75F, 0.75F, 1.0F, 0.8125F, 1.0F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]         } else if (meta == 1) { %(#808080)[//West-facing
    ]            setBlockBounds(0.75F, 0.0F, 0.0F,  1.00F, 0.0625F, 1.0F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]            setBlockBounds(0.50F, 0.25F, 0.0F, 0.75F, 0.3125F, 1.0F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]            setBlockBounds(0.25F, 0.50F, 0.0F, 0.50F, 0.5625F, 1.0F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]            setBlockBounds(0.0F,  0.75F, 0.0F, 0.25F, 0.8125F, 1.0F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]         } else if (meta == 2) { %(#808080)[//North-facing
    ]            setBlockBounds(0.0F, 0.0F, 0.75F,  1.0F, 0.0625F, 1.0F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]            setBlockBounds(0.0F, 0.25F, 0.50F, 1.0F, 0.3125F, 0.75F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]            setBlockBounds(0.0F, 0.50F, 0.25F, 1.0F, 0.5625F, 0.50F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]            setBlockBounds(0.0F, 0.75F, 0.0F,  1.0F, 0.8125F, 0.25F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]         } else if (meta == 3) { %(#808080)[//East-facing
    ]            setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.0625F, 1.0F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]            setBlockBounds(0.25F, 0.25F, 0.0F, 0.50F, 0.3125F, 1.0F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]            setBlockBounds(0.50F, 0.50F, 0.0F, 0.75F, 0.5625F, 1.0F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]            setBlockBounds(0.75F, 0.75F, 0.0F, 1.00F, 0.8125F, 1.0F)%(#cc7832)[;
    ]            super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]         }
         }
    
         boolean connectNorth = checkConnections(world, blockPos.add(0,0,-1), - 1); %(#808080)[//z-1
    ]      boolean connectEast  = checkConnections(world, blockPos.add(1,0,0), - 1);  %(#808080)[//x+1
    ]      boolean connectSouth = checkConnections(world, blockPos.add(0,0,1), - 1); %(#808080)[//z+1
    ]      boolean connectWest  = checkConnections(world, blockPos.add(-1,0,0), - 1);  %(#808080)[//x-1
    ]      
         boolean hitboxNorth = %(#cc7832)[false;
    ]      boolean hitboxEast  = %(#cc7832)[false;
    ]      boolean hitboxSouth = %(#cc7832)[false;
    ]      boolean hitboxWest  = %(#cc7832)[false;
    ]      
          if (meta == 0 || meta == 2) {
            if (!connectEast) { hitboxEast = true; }
            if (!connectWest) { hitboxWest = true; }
         } else if (meta == 1 || meta == 3) {
            if (!connectNorth) { hitboxNorth = true; }
            if (!connectSouth) { hitboxSouth = true; }
         }
    
         if (hitboxNorth) {
            hasCollision = %(#cc7832)[true;
    ]         setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.25F, 0.0625F)%(#cc7832)[;
    ]         super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]      }
    
         if (hitboxSouth) {
            hasCollision = %(#cc7832)[true;
    ]         setBlockBounds(0.0F, 0.0F, 0.9375F, 1.0F, 2.25F, 1.0F)%(#cc7832)[;
    ]         super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]      }
    
         if (hitboxEast) {
            hasCollision = %(#cc7832)[true;
    ]         setBlockBounds(0.9375F, 0.0F, 0.0625F, 1.0F, 2.25F, 1.0F)%(#cc7832)[;
    ]         super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]      }
    
         if (hitboxWest) {
            hasCollision = %(#cc7832)[true;
    ]         setBlockBounds(0.0F, 0.0F, 0.0F, 0.0625F, 2.25F, 1.0F)%(#cc7832)[;
    ]         super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]      }
    
         if (!hasCollision) {
            setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F)%(#cc7832)[;
    ]         super.addCollisionBoxesToList(world, blockPos,state, mask, list, entity)%(#cc7832)[;
    ]      }
    
         setBlockBoundsForItemRender()%(#cc7832)[;
    ]   }
    
      %(#bbb529)[@Override
    ]   public void setBlockBoundsForItemRender() {
         setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F)%(#cc7832)[;
    ]   }
    
      public boolean checkConnections(World world, BlockPos blockPos, int targetMeta) {
         if (world.getBlockState(blockPos).getBlock().isNormalCube(world, blockPos)) {
            %(#cc7832)[return true;
    ]      }
         if (world.getBlockState(blockPos).getBlock() instanceof BlockWalkwayStairs) {
            %(#cc7832)[return true;
    ]      }
    
         if (targetMeta >= 0) {
            if (world.getBlockState(blockPos.add(0,-1,0)).getBlock() instanceof BlockWalkwayStairs) {%(#808080)[//y-1
    ]            int meta = world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos))%(#cc7832)[;
    ]            if (meta == targetMeta || meta == (targetMeta + 2)) {
                  %(#cc7832)[return true;
    ]            }
            }
         }
         %(#cc7832)[return false;
    ]   }
    
         %(#808080)[//blockIcon = iconRegister.registerIcon(FlenixCities_Core.modid + ":" + textureName);
    ]%(#808080)[      //oversizeIcon = iconRegister.registerIcon(FlenixCities_Core.modid + ":" + oversizeName);
    ]
      @SideOnly(Side.*CLIENT*)
      public boolean shouldSideBeRendered(IBlockAccess world, BlockPos pos, EnumFacing side) {
         %(#cc7832)[return true;
    ]   }
    
    }
    

    Voila j'espère avoir expliqué clairement mon problème, a et aussi, il y a plusieurs type d'escalier, je dois donc register plus .json? Merci pour vos futur réponse, si vous avez besoin de plus de code, ou que j'espliqué mieux dite le moi =)</axisalignedbb>


Log in to reply