Jump to content

Anarchysage

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by Anarchysage

  1. True but regardless i do this for fun, not money otherwise i would learn full java List, thanks ill look into that
  2. Probbally but i have no interest in java outside of mc modding. Ok then explain better, i understand the first point, its just resetting over it, so how do i fix it, give each block its own generate block?
  3. Learning, two, i need to split the files up dont i then, its gonna use the same varible of WorldGenMineable cause thats a base mc class no?
  4. so what? each one should have its own class to generate from? oh god, i get it, its from me using WorldGenMinable repeated over and over
  5. So i have made marble generate in the world, which does fine. I wanted to add granite, andesite and diorite to 1.7.10, but its not behaving right... My marble generates in stone, and when i had these set to stone only, they didnt spawn much(compared to marble) package com.vanityblocks.WorldGen; import java.util.Random; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import com.vanityblocks.Storageprops; import com.vanityblocks.Registrations.VanityBlocksRegistration; import cpw.mods.fml.common.IWorldGenerator; public class GADWorldGen implements IWorldGenerator { public GADWorldGen(int par1) { Granite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldGraniteblock, 0, (Storageprops.gadvein), Blocks.stone); Granite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldGraniteblock, 0, (Storageprops.gadvein), Blocks.dirt); Granite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldGraniteblock, 0, (Storageprops.gadvein), Blocks.gravel); Diorite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldDioriteblock, 0, (Storageprops.gadvein), Blocks.stone); Diorite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldDioriteblock, 0, (Storageprops.gadvein), Blocks.dirt); Diorite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldDioriteblock, 0, (Storageprops.gadvein), Blocks.sand); Andesite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldAndesiteblock, 0, (Storageprops.gadvein), Blocks.stone); Andesite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldAndesiteblock, 0, (Storageprops.gadvein), Blocks.dirt); Andesite = new WorldGenMinable( VanityBlocksRegistration.VanityWorldAndesiteblock, 0, (Storageprops.gadvein), Blocks.gravel); } public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { if (Storageprops.enablediorite) { if (world.provider.dimensionId == 0) generateGraniteSurface(random, chunkX * 16, chunkZ * 16, world); generateDioriteSurface(random, chunkX * 16, chunkZ * 16, world); generateAndesiteSurface(random, chunkX * 16, chunkZ * 16, world); } } void generateGraniteSurface(Random random, int xChunk, int zChunk, World world) { int heightBand; int xPos, yPos, zPos; if (Storageprops.enablediorite) { for (int q = 0; q < (Storageprops.gadrarity); q++) { xPos = xChunk + random.nextInt(16); yPos = (Storageprops.gadheight) + random.nextInt(Storageprops.gadrange); zPos = zChunk + random.nextInt(16); Granite.generate(world, random, xPos, yPos, zPos); } } } void generateDioriteSurface(Random random, int xChunk, int zChunk, World world) { int heightBand; int xPos, yPos, zPos; if (Storageprops.enablediorite) { for (int q = 0; q < (Storageprops.gadrarity); q++) { xPos = xChunk + random.nextInt(16); yPos = (Storageprops.gadheight) + random.nextInt(Storageprops.gadrange); zPos = zChunk + random.nextInt(16); Diorite.generate(world, random, xPos, yPos, zPos); } } } void generateAndesiteSurface(Random random, int xChunk, int zChunk, World world) { int heightBand; int xPos, yPos, zPos; if (Storageprops.enablediorite) { for (int q = 0; q < (Storageprops.gadrarity); q++) { xPos = xChunk + random.nextInt(16); yPos = (Storageprops.gadheight) + random.nextInt(Storageprops.gadrange); zPos = zChunk + random.nextInt(16); Andesite.generate(world, random, xPos, yPos, zPos); } } } WorldGenMinable Granite; WorldGenMinable Diorite; WorldGenMinable Andesite; } // } So i thought to make them spawn in the other blocks(sand, stone, gravel, dirt). Is there something im doing wrong with it, cause they dont spawn much
  6. Thanks, that worked, thanks for not being rude and helping, #minecraftforge tends to be rude package com.vanityblocks.Registrations; import com.vanityblocks.Storageprops; import com.vanityblocks.Items.oredictionarybook; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import cpw.mods.fml.common.registry.GameRegistry; public class OreDictionaryBypass { public static Item oredictionarybook; public static void bypassrecipes() { // Registers the Item itself and recipe for item oredictionarybook = new oredictionarybook(Storageprops.oredictionarybook - 256); GameRegistry.registerItem(oredictionarybook, "oredictionarybook"); GameRegistry.addRecipe(new ItemStack(oredictionarybook, 1), "xyx", "yzy", "xyx", 'x', Items.iron_ingot, 'y', Items.emerald, 'z', Items.book); //Attempt to fix this..... // testing purposes //OreDictionary.registerOre("ingotTin", new ItemStack( // Items.paper)); if (!OreDictionary.getOres("ingotTin").isEmpty()) { ItemStack tiningot; tiningot = OreDictionary.getOres("ingotTin").get(0); ItemStack result = tiningot.copy(); result.stackSize = 1; //GameRegistry.addRecipe(new ShapedOreRecipe(result, " x ", "xyx", " x ", 'x', // "ingotTin", 'y', oredictionarybook )); GameRegistry.addRecipe(new ShapelessOreRecipe(result, "ingotTin", oredictionarybook )); } } } So for anyone who needs it, theres the code, it uses "result" to define itemstack count, and shapeless and shaped recipe
  7. think i may have got it, gonna build it and see, off topic question, is it possible to have another prebuilt mod in my dev enviroment so i can test this without building?
  8. if (!OreDictionary.getOres("ingotTin").isEmpty()) { // testing purposes OreDictionary.registerOre("ingotTin", new ItemStack( Items.paper)); ItemStack tiningot; tiningot = OreDictionary.getOres("ingotTin").get(0); ItemStack result = tiningot.copy(); result.stackSize = 1; GameRegistry.addRecipe(new ShapedOreRecipe(tiningot)); GameRegistry.addShapedRecipe(tiningot, " x ", "xyx", " x ", 'x', "ingotTin", 'y', oredictionarybook ); } Thats what i did, no errors but doesnt work so i changed to this if (!OreDictionary.getOres("ingotTin").isEmpty()) { // testing purposes OreDictionary.registerOre("ingotTin", new ItemStack( Items.paper)); ItemStack tiningot; tiningot = OreDictionary.getOres("ingotTin").get(0); ItemStack result = tiningot.copy(); result.stackSize = 1; //GameRegistry.addRecipe(new ShapedOreRecipe(tiningot)); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(tiningot)," x ", "xyx", " x ", 'x', "ingotTin", 'y', oredictionarybook )); GameRegistry.addRecipe(new ShapedOreRecipe(tiningot)); //GameRegistry.addShapedRecipe(tiningot, " x ", "xyx", " x ", 'x', // "ingotTin", 'y', oredictionarybook ); } and i get this error Description Resource Path Location Type The constructor ItemStack(ItemStack) is undefined OreDictionaryBypass.java /Minecraft/src/main/java/com/vanityblocks/Registrations line 33 Java Problem
  9. Thanks for the answer, but do you mind showing me an example, i tend to learn easier when i can read it and see how it works
  10. So way back in the days of 1.4.X, freind helped me with this code, however i need to alter it and i cant get it to work. So basically making an item when crafting with a "ingotTin"(intend to do this code for all the ingots(modpack i use and know alot of people use, spawns different ingots in dungeons)), and it wont resolve and im not a perfect modder but im trying. Anyways, its 1.7.10(yes i know old, dont care, not updating till all favorite mods come out, plus, slowly converting blocks to 1.9 in different dev). This is the original code that allows any ingotTin to craft into my blockTin and back into first registered ingotTin if (Storageprops.enabletin) { if (!OreDictionary.getOres("ingotTin").isEmpty()) { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack( StorageBlockMod, 1, 0), "xxx", "xxx", "xxx", 'x', "ingotTin")); ItemStack tiningot; tiningot = OreDictionary.getOres("ingotTin").get(0); ItemStack result = tiningot.copy(); result.stackSize = 9; GameRegistry.addShapelessRecipe(result, new ItemStack( StorageBlockMod, 1, 0)); if (Storageprops.gregtechcompat) { OreDictionary.registerOre("blockTin", new ItemStack( StorageBlockMod, 1, 0)); } } } This is the one im trying to make work. public static void bypassrecipes() { // Registers the Item itself and recipe for item oredictionarybook = new oredictionarybook(Storageprops.oredictionarybook - 256); GameRegistry.registerItem(oredictionarybook, "oredictionarybook"); GameRegistry.addRecipe(new ItemStack(oredictionarybook, 1), "xxx", "xyx", "xxx", 'x', Items.iron_ingot, 'y', Items.emerald); //Attempt to fix this..... if (!OreDictionary.getOres("ingotTin").isEmpty()) { //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack( // StorageBlockMod, 1, 0), "xxx", "xxx", "xxx", 'x', // "ingotTin")); ItemStack tiningot; tiningot = OreDictionary.getOres("ingotTin").get(0); ItemStack result = tiningot.copy(); result.stackSize = 1; GameRegistry.addRecipe(new ShapedOreRecipe(result), " x ", "xyx", " x ", 'x', "ingotTin", 'y', oredictionarybook ); //GameRegistry.addShapelessRecipe(result, new ItemStack( // StorageBlockMod, 1, 0)); //GameRegistry.addShapelessRecipe(new ShapedOreRecipe(result), // new ItemStack(result), new ItemStack(oredictionarybook, 1, // OreDictionary.WILDCARD_VALUE)); } } And it gives me this error Description Resource Path Location Type The method addRecipe(ItemStack, Object...) in the type GameRegistry is not applicable for the arguments (ShapedOreRecipe, String, String, String, char, String, char, Item) OreDictionaryBypass.java /Minecraft/src/main/java/com/vanityblocks/Registrations line 32 Java Problem I, cant figure it out for the life of me.
  11. Oh i can garrentee its a mod doing it, it doesnt happen in my dev or non forge vannila, which log would you like?
  12. so, im having an error sometimes when i maximise my window on mc. And when this happens, it spams the crap out of the console, and the client wont respond, any help is appreciated. Thanks
  13. As the title says, im trying to do blockbounds on a render. my mod is a vanity block/item and i wanted to add a curtain designed like so.... Overhead view, well i started playing around with blockbounds and i dont understand it, so starting to try and find a tool, no avail. Was told to try techne, did my best and got this.. Which i thought to be right, but ingame it turns into these if i use the export to java So, if you know a easy way to make this shape (below), or a tool that can help me do so, please tell me note 16x^ texture. Thanks for the reading and possible help... tired of pulling my hair out for 5 hours now oh and source code if itll help, https://github.com/AnarchySage/VanityblocksDev/blob/master/Source/vanityblocks/Renders/BlockCurtainRender.java atm that appears as
  14. Still looking for an answer if anyone knows
  15. Still looking an answer to this if anyone knows, thanks
  16. Another way, in your mainmod file, have this in preinit(eventhandler), LanguageRegistry.instance().addStringLocalization( "itemGroup.nameoftabhere", "en_US", "Name of tabhere"); and this in the main file, anywhere works, i put it right under init personally, public static CreativeTabs tabCustom = new CreativeTabs("nameoftabhere") { public ItemStack getIconItemStack() { return new ItemStack( block/itemnamehere; //such as Block.cobbleStone or myblockhere } }; small difference from Ernios way, either is up to you.
  17. package vanityblocks; import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class VanityDesignblock extends Block { public VanityDesignblock(int id) { super(id, Material.rock); setCreativeTab(vanityblocks.VanityBlocks.tabCustom); } /* * public int getLightValue(IBlockAccess world, int x, int y, int z, int * metadata) { if (metadata == 0) { return * !isActive(world.getBlockMetadata(x, y, z)) ? 1 : 15; } return 0; } * * private boolean isActive(int blockMetadata) { return true; } old way ^ */ /* * @Override public int getLightValue (IBlockAccess world, int x, int y, int * z) { if (world.getBlockMetadata(x, y, z) == 0) { return lightValue[15]; } * return super.getLightValue(world, x, y, z); } */ /* * @Override public int getLightValue(IBlockAccess iba, int x, int y, int z) * { int meta = iba.getBlockMetadata(x, y, z); if (meta == 0) { return 15; } * if (meta == 1) { return 0; } return 0; } */ @Override public int getLightValue(IBlockAccess world, int x, int y, int z) { if (world.getBlockMetadata(x, y, z) == 0) { return 15; } else { return 0; } } @Override public float getBlockHardness(World par1World, int par2, int par3, int par4) { int metadata = par1World.getBlockMetadata(par2, par3, par4); if (metadata == 0) return 1.5f; return 2f; } private Icon[] iconBuffer; @Override public void registerIcons(IconRegister par1IconRegister) { iconBuffer = new Icon[2]; iconBuffer[0] = par1IconRegister.registerIcon("vanityblocks:lavaanim"); iconBuffer[1] = par1IconRegister.registerIcon("vanityblocks:claybrick"); } @Override public Icon getIcon(int side, int metadata) { if (metadata == 0) { return iconBuffer[0]; } if (metadata == 1) { return iconBuffer[1]; } return blockIcon; } @Override public int damageDropped(int metadata) { return metadata; } @SideOnly(Side.CLIENT) public void getSubBlocks(int par1, CreativeTabs tab, List subItems) { for (int ix = 0; ix < 2; ix++) { subItems.add(new ItemStack(this, 1, ix)); } } }
  18. yes the meta is correct, thats not the problem lol, good though
  19. no, no recipes, only thing that has been done is, i added the itemblock, languageregistry and subblocks, thats all, thats why this confuses me
  20. neither, the block is naturally supposed to be the darkened texture(like the texture is with the levers). But what happens is, when adding a value of light to the 0 meta, the brick at 1 meta, gets that brightend effect, another screen to show what i mean See how the brick clay bricks are different than the others(binded another block's texture to the brick texture), see the problem? I want the brick of clay in the meta not to be bright like that
  21. Im trying to have a lightvalue on a block meta, but its not going as well as i had hoped. The first block in the meta works well, but when i try to add a second block, the texture is really bright, like its got false light. /* * @Override public int getLightValue (IBlockAccess world, int x, int y, int * z) { if (world.getBlockMetadata(x, y, z) == 0) { return lightValue[15]; } * return super.getLightValue(world, x, y, z); } */ /* * @Override public int getLightValue(IBlockAccess iba, int x, int y, int z) * { int meta = iba.getBlockMetadata(x, y, z); if (meta == 0) { return 15; } * if (meta == 1) { return 0; } return 0; } */ @Override public int getLightValue(IBlockAccess world, int x, int y, int z) { if (world.getBlockMetadata(x, y, z) == 0) { return 15; } else { return 0; } } the /* */ areas is old previous attempts, they all turn out like this. The bricks are the block im refering to, if i place something on it, fence, wall, lever etc, it turns dark like its supposed to, i tryed binding same texture to another block with a different block, and it doesnt do it, so it aint the texture. Any thoughts?
  22. Atm my code(as follows), when i use the editable items(non unfired or ceramic), will delete the original, give you the original back, plus 2 cups(its supposed to delete the one you eat, and remove it, and give you single cup) and when i try to craft the unfired mug and stack them, it doesnt, it deletes them, however in creative, if i spawn them in, they can be seperated and combined. package vanityblocks.Items; import java.util.Collection; import java.util.Iterator; import java.util.List; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.Icon; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import vanityblocks.Registrations.GeneralFoodItemsRegistration; /* * To do, fix the duping crap upon eating one, figure out stack size problem */ public class ClayMugItem extends ItemFood { public Icon[] icons; public String[] textureNames = new String[] { "unfired", "ceramic", "mugwithwater", "hotchocowater", "hotchocowatersweet", "mugwithmilk", "hotchocomilk" }; public ClayMugItem(int id, int heal) { super(id, heal, 0.0F, false); setHasSubtypes(true); setMaxDamage(0); this.maxStackSize = 16; setCreativeTab(vanityblocks.VanityBlocks.tabCustom); //this.setAlwaysEdible(); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { switch (par1ItemStack.getItemDamage()) { case 0: break; case 1: break; case 2: par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); break; case 3: par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); break; case 4: par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); break; case 5: par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); break; case 6: par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); break; } return par1ItemStack; } protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player) { if (!world.isRemote) { int duration = 0; PotionEffect potion; if (!player.capabilities.isCreativeMode) { --stack.stackSize; } switch (stack.getItemDamage()) { case 0: player.inventory.addItemStackToInventory(new ItemStack(vanityblocks.Registrations.GeneralFoodItemsRegistration.claymugitem,1,1)); break; case 1: player.inventory.addItemStackToInventory(new ItemStack(vanityblocks.Registrations.GeneralFoodItemsRegistration.claymugitem,1,1)); break; case 2: player.inventory.addItemStackToInventory(new ItemStack(vanityblocks.Registrations.GeneralFoodItemsRegistration.claymugitem,1,1)); break; case 3: potion = player.getActivePotionEffect(Potion.regeneration); if (potion != null) duration = potion.duration; player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 8*20, 0)); player.inventory.addItemStackToInventory(new ItemStack(vanityblocks.Registrations.GeneralFoodItemsRegistration.claymugitem,1,1)); break; case 4: potion = player.getActivePotionEffect(Potion.regeneration); if (potion != null) duration = potion.duration; player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 8*20, 0)); player.inventory.addItemStackToInventory(new ItemStack(vanityblocks.Registrations.GeneralFoodItemsRegistration.claymugitem,1,1)); potion = player.getActivePotionEffect(Potion.moveSpeed); if (potion != null) duration = potion.duration; player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, duration + 8*20, 0)); player.inventory.addItemStackToInventory(new ItemStack(vanityblocks.Registrations.GeneralFoodItemsRegistration.claymugitem,1,1)); break; case 5: player.removePotionEffect(19); // potion = player.getActivePotionEffect(Potion.regeneration); // if (potion != null) // duration = potion.duration; // player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 3*20, 0)); player.inventory.addItemStackToInventory(new ItemStack(vanityblocks.Registrations.GeneralFoodItemsRegistration.claymugitem,1,1)); break; //"unfired"0, "ceramic"1, "mugwithwater"2, "hotchocowater"3, "hotchocowatersweet"4, //"mugwithmilk5", "hotchocomilk6" }; case 6: player.removePotionEffect(19); potion = player.getActivePotionEffect(Potion.regeneration); if (potion != null) duration = potion.duration; player.addPotionEffect(new PotionEffect(Potion.regeneration.id, duration + 3*20, 0)); player.inventory.addItemStackToInventory(new ItemStack(vanityblocks.Registrations.GeneralFoodItemsRegistration.claymugitem,1,1)); break; } } } public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.drink; } @Override public int getMaxItemUseDuration(ItemStack itemstack) { return 24; } @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) { //"unfired"0, "ceramic"1, "mugwithwater"2, "hotchocowater"3, "hotchocowatersweet"4, //"mugwithmilk5", "hotchocomilk6" }; // list.add("A little bit evil"); switch (stack.getItemDamage()) { case 0: break; case 1: break; case 2: break; case 3: break; case 4: list.add("Gives you speed"); break; case 5: list.add("Removes Poison"); break; case 6: list.add("Removes Poison"); break; } } @SideOnly(Side.CLIENT) @Override public void registerIcons(IconRegister iconRegister) { this.icons = new Icon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { this.icons[i] = iconRegister.registerIcon("vanityblocks:mug_"+textureNames[i]); } } /** * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) */ @SideOnly(Side.CLIENT) @Override public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { for (int var4 = 0; var4 < 7; ++var4) { par3List.add(new ItemStack(par1, 1, var4)); } } @Override public String getUnlocalizedName(ItemStack itemstack) { return (new StringBuilder()).append("item.mug.").append(textureNames[itemstack.getItemDamage()]).toString(); } /*public boolean isPotionIngredient() { return true; }*/ }
×
×
  • Create New...

Important Information

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