Jump to content

Dylem

Members
  • Posts

    51
  • Joined

  • Last visited

Posts posted by Dylem

  1. 2 minutes ago, Draco18s said:

    Why are you using the ModelMesher?

    If you're going to do it this way (and not the Registry events) then you should be using ModelLoader.setCustomModelResourceLocation

    Well, I made it this way and it worked so I didn't look further, but it's probably better using the events anyway, you are right.

  2. Hey, I hope this will help you :

     

    @SideOnly(Side.CLIENT)
    public static void initClient(ItemModelMesher mesher) {
    	
    	Item item = Item.getItemFromBlock(YOUR_BLOCK);
    	ModelResourceLocation model = new ModelResourceLocation("modName:" + "blockName", "inventory");
    	ModelLoader.registerItemVariants(item, model);
    	mesher.register(item, 0, model);
    }

     

    Note : this needs to be called from your ClientProxy class, from the FMLInitializationEvent event.

  3. On 6/16/2017 at 0:06 PM, diesieben07 said:

    I... what? What are you trying to achieve exactly?

    I'm trying to embellish the well structure, and I didn't find an other way to achieve that than extending village to spawn my blocks on village spawn, then find the well and modify it.

    This is how I get X and Z :

    public static Welllus createPiece(StructureVillagePieces.Start start, int type, Random rand) {
            int x = start.getBoundingBox().minX;
            int z = start.getBoundingBox().minZ;
            
            EnumFacing facing = EnumFacing.EAST;
            
            StructureBoundingBox sbb = StructureBoundingBox.getComponentToAddBoundingBox(x, 64, z, 0, 0, 0, 4, 3, 4, facing);
            return new WellPlus(start, type, rand, sbb, facing);
        }

    I hope it is more clear now. The problem is I can get the Y position in addComponentParts, but it means I need to modify the bounding box previously created and it's not working properly that way (and not optimized either).

     

    I call createPiece from my handler there :

    @Override
        public Village buildComponent(PieceWeight villagePiece, Start startPiece, List<StructureComponent> pieces, Random random, int p1, int p2, int p3, EnumFacing facing, int p5) {
            
            return WellPlus.createPiece(startPiece, p5, random);
        }

     

    Note : Sorry if I'm not clear, english is my 3rd language

  4. 1 hour ago, diesieben07 said:

    There is no way to get the height without having the world. How would you specify which dimension you want? What function are you talking about?

    Well, if I could understand how it spawns, I could get it without world. I'm searching mostly for a function about villages (the well is the village start point but when i request start height it also tells me 64).. I found an other method to get it without world, with average ground level of village and then check for blocks but its a bit too tricky

  5. Let me precise that my goal is to find the height without having access to world, because I need it in a function that doesn't take World as argument.

     

    For now I do it like that (but as I said this does only work in functions that take World as parameter):

    worldIn.getHeight(X, Z)

     

  6. 2 hours ago, fcelon said:

    I am sorry, I dn't know how could I overlook it so many times, it realy is there.

    Next time just type "Ctrl + Maj + T" then "ItemBow" to open the class, and type "Ctrl + F" then "event" to find it, takes 2 seconds ! :)

  7. Hello, I was wondering how Minecraft spawns well on ground level, as it is just spawned with minY = 64 and maxY = 78

    Source from StructureVillagePieces.Well :

    this.boundingBox = new StructureBoundingBox(x, 64, z, x + 6 - 1, 78, z + 6 - 1);

     

    Does anyone have any idea about it ?

  8. New problem, it works only if my texture is full color :/

    I had a red cube and it works fine, but now that I put a real blood-like texture it doesn't work anymore

     

    EDIT : To be exact, it takes the color of the pixels in the center of my texture

    EDIT 2 : Maybe I should make a model file and set the size of the texture there ?

  9. What does your BLOOD_SPHERE_TEXTURE look like? It's possible that the uv layout could be incorrect.

    Personally, I prefer to draw the model in a program like Blender and import that and its uv layout to the mod, but whatever you feel comfortable with is fine.

     

    Oh my god. My texture just didn't have the good size. Thank you so much, and fuck me searching for hours when it was just that.

×
×
  • Create New...

Important Information

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