• 1

    posted a message on Custom Generation... Villages, ores and more
    First of all I'd like to point out that I'm not asking for help in any way. Also I may not be logging in again. Being that it has been some time since I last posted here, I have noticed many aggravating changes. Any who, for those looking for answers on ore gen and things of that nature. Really anyone looking to mod. Look in the base code first. Give it a real good look through, not just in the things you wish to mod or change, but at everything. Most often you will find anything you wish to do there is example code all over the place, it really is there.In the case of adding new things, just make sure it is all properly registered.
    After looking around a bit, I still don't seen any mods involving the addition of new villages. I was working on one that did add several villages to the game, however many life altering events later and I finally have got back to finishing the mod, though its not to share, I am sorry, I will share the code that results in getting more than one village to generate. One reason I wont share the mod is I base edited the code which is frowned upon and its for personal reasons I even finished. I have lost all original portions of the code from years ago and had to start from scratch and it was for my son, whom is no longer with me.
    There was another mod at the time called Diversity, by Budd, and if you can find his code on github, it is overly complicated to do what I am about to show you. It is not my code so I can not show you the link. Also it requires more than one class to simply load several villages. In forge, during minecraft 1.6.4 and below, not sure about recent You can only replace the mapgen files, not really add to them if adding the same thing. So, I was looking for the simple solution that would result in doing just this. And it is as follows, minus the loading of the new MapGenVillage, thats up to you how you want to do this. Though once you add the code to load replace the MapGenVillage, this goes in the new class
    Create Your New MapGenVillage and copy the original changing the following bits
    [code] [code]public static class Start extends StructureStart { private boolean hasMoreThanTwoComponents; public Start() { } public Start(World worldIn, Random rand, int x, int z, int size) { super(x, z); List<StructureVillagePieces.PieceWeight> list = StructureVillagePieces.getStructureVillageWeightedPieceList(rand, size); StructureVillagePieces.Start structurevillagepieces$start = new StructureVillagePieces.Start(worldIn.getBiomeProvider(), 0, rand, (x << 4) + 2, (z << 4) + 2, list, size); this.components.add(structurevillagepieces$start); structurevillagepieces$start.buildComponent(structurevillagepieces$start, this.components, rand); List<StructureComponent> list1 = structurevillagepieces$start.pendingRoads; List<StructureComponent> list2 = structurevillagepieces$start.pendingHouses; while (!list1.isEmpty() || !list2.isEmpty()) { if (list1.isEmpty()) { int i = rand.nextInt(list2.size()); StructureComponent structurecomponent = (StructureComponent)list2.remove(i); structurecomponent.buildComponent(structurevillagepieces$start, this.components, rand); } else { int j = rand.nextInt(list1.size()); StructureComponent structurecomponent2 = (StructureComponent)list1.remove(j); structurecomponent2.buildComponent(structurevillagepieces$start, this.components, rand); } } this.updateBoundingBox(); int k = 0; for (StructureComponent structurecomponent1 : this.components) { if (!(structurecomponent1 instanceof StructureVillagePieces.Road)) { ++k; } } this.hasMoreThanTwoComponents = k > 2; }[/code]
    [/code]

    You'll notice thats comes just before the boolean method isSizeable.....
    change that to the start method from MapGenScattered Features and remove the code bits for generating the features to look like this
    [code][/p] [p]public static class Start extends StructureStart { public Start() { }[/p] [p]public Start(World worldIn, Random random, int chunkX, int chunkZ) { this(worldIn, random, chunkX, chunkZ, worldIn.getBiomeGenForCoords(new BlockPos(chunkX * 16 + 8, 0, chunkZ * 16 + 8))); }[/p] [p]public Start(World worldIn, Random random, int chunkX, int chunkZ, Biome biomeIn) { super(chunkX, chunkZ);[/p] [p]if (biomeIn != Biomes.JUNGLE && biomeIn != Biomes.JUNGLE_HILLS) { if (biomeIn == Biomes.SWAMPLAND) { } else if (biomeIn != Biomes.DESERT && biomeIn != Biomes.DESERT_HILLS) { if (biomeIn == Biomes.ICE_PLAINS || biomeIn == Biomes.COLD_TAIGA) { } } else { } } else { }[/p] [p]this.updateBoundingBox(); } }[/p] [p][/code]


    Now, where those bits were, you will replace it with this...

    [code][/p] [p]List<StructureVillagePieces.PieceWeight> list = StructureVillagePieces.getStructureVillageWeightedPieceList(rand, size); StructureVillagePieces.Start structurevillagepieces$start = new StructureVillagePieces.Start(worldIn.getBiomeProvider(), 0, rand, (x << 4) + 2, (z << 4) + 2, list, size); this.components.add(structurevillagepieces$start); structurevillagepieces$start.buildComponent(structurevillagepieces$start, this.components, rand); List<StructureComponent> list1 = structurevillagepieces$start.pendingRoads; List<StructureComponent> list2 = structurevillagepieces$start.pendingHouses;[/p] [p]while (!list1.isEmpty() || !list2.isEmpty()) { if (list1.isEmpty()) { int i = rand.nextInt(list2.size()); StructureComponent structurecomponent = (StructureComponent)list2.remove(i); structurecomponent.buildComponent(structurevillagepieces$start, this.components, rand); } else { int j = rand.nextInt(list1.size()); StructureComponent structurecomponent2 = (StructureComponent)list1.remove(j); structurecomponent2.buildComponent(structurevillagepieces$start, this.components, rand); } }[/p] [p]this.updateBoundingBox(); int k = 0;[/p] [p]for (StructureComponent structurecomponent1 : this.components) { if (!(structurecomponent1 instanceof StructureVillagePieces.Road)) { ++k; } }[/p] [p]this.hasMoreThanTwoComponents = k > 2;[/p] [p][/code]

    If you make those changes, and make sure the spawn array list at the top contains each biome represented at the start method. Using this will give you four villages total, and using the variance code for desert village you can change the same villages many times. However this will give you four distinct villages if you change the shape and style of each village structure. you can also add more than four, this just gets you started. Dont forget to resgister all the village pieces for each piece class. have fun Sorry for the messy code blocks, it wasn't like that when I was making the tread
    Posted in: Modification Development
  • 43

    posted a message on [1.5.2/1.6.2/1.6.4][FORGE][80K+DLs] Builder Mod...needs a new coder, read for details

    Due to the aggravation I have been experiencing editing this page, I have moved the mod to this new page located here at Google Sites. I have fixed the color.

    Link to the mod page....
    Downloads have been moved to the new page as well, please look for them there...Pic of some of the new structures in the new villages....


    Progress on the new update is coming nicely....lots of new features and changes coming...Sorry for the crappy

    pics....the new jungle village



    Xmas Village



    Swamp village



    Just need to make the textures for the villagers and set the trade tables if time allows...Santa at the very least.

    In the next update I have planned to start trying to code the NPC new pieces into components and generate with the villages, if this works out I will be creating a new map gen for the other villages and naturally generate them as well. Also I have a new AI set coming for all custom villagers as I will be moving them to a separate villager class to handle them differently...should be nice.

    temporary link for the new update

    I no longer have the time to develop this mod, so if you would like a chance to do so, please send me a PM for details as to how you may be able to help.....

    Posted in: Minecraft Mods
  • 1

    posted a message on [1.5.2/1.6.2/1.6.4][FORGE][80K+DLs] Builder Mod...needs a new coder, read for details
    Had some trouble with my internet recently and back online now though. Code should be up in a day or so. I have a bunch of projects I am bundling all together in a zip. Most code is 1.6.4, I will break down each project by MC version so you can see how far along each project went.
    Posted in: Minecraft Mods
  • 1

    posted a message on [1.5.2/1.6.2/1.6.4][FORGE][80K+DLs] Builder Mod...needs a new coder, read for details
    Thank you everyone who enjoyed this mod. I have recently moved to a new home and also have had some life changing events take place over the last 2 months that have made it impossible for me to continue the work on this mod. I just dont have the time anymore and my family needs me more now than ever. My father passed away from cancer early in February, my son has been diagnosed with an illness not to far off from autism. So my life is pretty well consumed and free time for coding has completely vanished.

    As soon as I have the chance I will post the code for all my projects on github and provide a link so anyone who wishes to do so can continue my work. This is my free for all permission to have and use my code as you see fit.
    Posted in: Minecraft Mods
  • 1

    posted a message on Duplicating vanilla enchanting table. HOW?
    The book, for the rotation and spinning and what not, that is in the tile class. Some of the code is in the GUI as well, but mostly the code in the GUI is related to the particles and rotation of the book depending upon player XP....this is a github link. It has a bunch of blocks I created (most of the code for) and is being updated and somewhat maintained by ShadowFrostz. Look for the spirittable stuff if you want and see how I recreated it. Basically the same code as the enchantment table. The tile will need to be registered as a special Tile though as I said before as it does different things than a basic tile.
    Posted in: Modification Development
  • 1

    posted a message on Freerunner's Mod Revival Attempt
    Player API is up to date as far as I can tell, you should see the faq's there and make sure you are doing all that correctly and then go from there...What I mean is once you have player api set up, run your eclipse environment to make sure all is well, then begin to update the mod.
    Posted in: Modification Development
  • 8

    posted a message on [FORGE] 1.6.2 Crafting Table with custom grid sizes [updating to 1.6.4] adding videos
    The 2x2 tutorial is being replaced because I need the space for something better. I am going to use this space to try and explain as much as I know about the container class for the Crafting Table and how you can change some things to make the table look and function differently.

    Lets get started....

    Container....

    In the container we have this inside the constructor and its where we will make the first changes
    //the crafting matrix is made by rows and columns
        //in this case 4 rows by 2 columns
        public InventoryCrafting craftMatrix = new InventoryCrafting(this, 4, 2);
        public IInventory craftResult = new InventoryCraftResult();
        private World worldObj;
        private int posX;
        private int posY;
        private int posZ;


    As stated in the code the crafting matrix is made by ROWS and COLUMNS. so if you simply want to redesign the table keep in mind you can move the matrix just the same as any slot.

    In the next method you will find this...
    this.addSlotToContainer(new SlotCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 124, 35));


    This is your output slot. It has coordinates that we can use to move the slot anywhere we want...in this example it is (0, 124, 35).

    Next is the matrix....
    for (l = 0; l < 4; ++l)
    	    {
    		    for (i1 = 0; i1 < 2; ++i1)
    		    {
    			    this.addSlotToContainer(new Slot(this.craftMatrix, i1 + l * 2, 30 + i1 * 18, 17 + l * 18));
    		    }
    	    }


    Remember, it is rows and columns. The matrix is also using coordinates. And as I dont really know why, (i1 + l * 2) the 2 in this instance seems to work, and 4 seems to crash it. If anyone knows why please explain.

    The next 2 are for inventory and player hotbar.
    for (l = 0; l < 3; ++l)
    	    {
    		    for (i1 = 0; i1 < 9; ++i1)
    		    {
    			    this.addSlotToContainer(new Slot(par1InventoryPlayer, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18));
    		    }
    	    }
    	    for (l = 0; l < 9; ++l)
    	    {
    		    this.addSlotToContainer(new Slot(par1InventoryPlayer, l, 8 + l * 18, 142));
    	    }


    These are there for your inventories...

    The next important method is the onContainerClosed...
    public void onContainerClosed(EntityPlayer par1EntityPlayer)
        {
    	    super.onContainerClosed(par1EntityPlayer);
    	    if (!this.worldObj.isRemote)
    	    {
    		    for (int i = 0; i < 8; ++i)
    		    {


    The 8 in the loop is a multiple of the rows and columns...so if it were 3x5, the 8 would be a 15...or say 5x5, the 8 would be 25.

    Next is this method here....the canInteractWith.
    public boolean canInteractWith(EntityPlayer par1EntityPlayer)
        {
    	    return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != ContainerTutorial.ctutorial.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
        }


    If you dont change this to your block, in this case (ContainerTutorial.ctutorial.blockID), it will not allow you to open and use you GUI...YOU MUST CHANGE THIS TO YOUR BLOCK

    Now since you changed things in the container class a bit, you must also make changes elsewhere...

    If you said recipe classes you're right...

    Recipes

    Recipe Sorter
    Here you will need to change all the Shaped and Shapeless references, like the following example I use ShapedCTRecipes and ShapelessCTRecipes
    final CraftingManagerContainerTutorial craftingManagerContainerTutorial;
        RecipeSorterContainerTutorial(CraftingManagerContainerTutorial par1CraftingManagerContainerTutorial)
        {
    	    this.craftingManagerContainerTutorial = par1CraftingManagerContainerTutorial;
        }
        public int compareRecipes(IRecipe par1IRecipe, IRecipe par2IRecipe)
        {
    	    return par1IRecipe instanceof ShapelessCTRecipes && par2IRecipe instanceof ShapedCTRecipes ? 1 : (par2IRecipe instanceof ShapelessCTRecipes && par1IRecipe instanceof ShapedCTRecipes ? -1 : (par2IRecipe.getRecipeSize() < par1IRecipe.getRecipeSize() ? -1 : (par2IRecipe.getRecipeSize() > par1IRecipe.getRecipeSize() ? 1 : 0)));
        }
        public int compare(Object par1Obj, Object par2Obj)
        {
    	    return this.compareRecipes((IRecipe)par1Obj, (IRecipe)par2Obj);
        }


    In your Shaped recipe class you will want to change the methods match and checkMatch to reflect your rows and columns like so...
    public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World)
        {
    	    for (int i = 0; i <= 4 - this.recipeWidth; ++i)
    	    {
    		    for (int j = 0; j <= 2 - this.recipeHeight; ++j)
    		    {
    
    private boolean checkMatch(InventoryCrafting par1InventoryCrafting, int par2, int par3, boolean par4)
        {
    	    for (int k = 0; k < 4; ++k)
    	    {
    		    for (int l = 0; l < 2; ++l)
    		    {


    In your Shapeless class you will also want to reflect the change in the method matches like the following...
    public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World)
        {
    	    ArrayList arraylist = new ArrayList(this.recipeItems);
    	    for (int i = 0; i < 4; ++i)
    	    {
    		    for (int j = 0; j < 2; ++j)
    		    {


    You will also need to make a few changes to your crafting manager as well.....

    In the method CraftingManager(), you will want to replace that with what ever you named your manager..., this is mine..
    private CraftingManagerContainerTutorial()
        {
    	    this.addRecipe(new ItemStack(Item.paper, 3), new Object[] {"###", '#', Item.reed});
    	   
    	    Collections.sort(this.recipes, new RecipeSorterContainerTutorial(this));
        }


    So this recipe wont work now will it?...No because it has variables for 3 slots. We have 4 rows of 2 columns. Recipes are read from left to right. The first row in the grid will have 2 columns across, or 2 slots....and then repeat this 4 times...so or recipes should look like this...

    private CraftingManagerContainerTutorial()
        {
    	    //this.addRecipe(new ItemStack(Item.paper, 3), new Object[] {"###", '#', Item.reed});
    	    this.addRecipe(new ItemStack(Item.paper, 3), new Object[] {"XX", "XX", "XX", "XX", 'X', Block.dirt});
    	    Collections.sort(this.recipes, new RecipeSorterContainerTutorial(this));
        }


    Make them however you want, but keep in mind, its from left to right, rows and columns.....so in this case no more than 2 items 4 times.

    You must also make sure that all recipes instances ShapedRecipes and ShapelessRecipes get changed to your custom classes.

    Hope this helps you understand a bit more on how this works for changing the way the grid is shaped. You can also add extra or custom slots by adding custom slot classes. Some changes may even require custom inventory classes. I do not now how to make these, please dont ask me to explain them....
    Posted in: Mapping and Modding Tutorials
  • 1

    posted a message on [forge] noteblock sounds....custom noteblock...(solved)
    Something as basic as reading through the finished code would have saved me this thread... Take this as a lesson and proof read your code.... I was missing @ForgeSubscribe, everything works fine now.
    Posted in: Modification Development
  • 1

    posted a message on generated structure block rotation
    Quote from Casual_Dutchman

    Metadata is for specific blocks like a log, planks, wool or even slabs and stairs. Metadata allows 3, 4 or 5 blocks to be stored on 1 id. wool has a metadata vlaue of 15. every colored wool has its own metadata. Can someone else please help me?


    if you are asking this, than you have no idea what metadata is and how all it is used....You can set the facing of those blocks fine by using the metadata stored in the block. Also how did you create your structure? did you build it then use mcedit to make the schematic and convert the schematic? if not, you may want to do this next time as it will store the facing direction automatically and all you need to is generate the structure.....also yes the easy way is nice and it works....are these random generated structures, or instant structures. with the method I told you about it uses arrays to make the structure instead of world.setBlock allowing you to do more than just generate the structure....should look into it.

    Quote from jcm2606
    I know what metadata is. Certain blocks store rotations in metadata for rendering. Like X block has a metadata range of 0-4, each representing what way the front face of the block is pointing at. In the rotation code, the code would check what metadata the block is and rotate it accordingly.


    Plus one for that....
    Posted in: Modification Development
  • 1

    posted a message on Lightning sword?
    There is a request section for that, perhaps someone would be willing to make you the mod...
    Posted in: Modification Development
  • To post a comment, please .