Jump to content

perromercenary00

Members
  • Posts

    832
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by perromercenary00

  1. good days gues am i not the only one whith the swollen balls for the tink whit the json for the textures for blocks and items google dont give a clear answr i been reading and interpreting code from diferents sources but no working texture yet soo long i been reading lot of post about this but is something missing http://www.minecraftforge.net/forum/index.php/topic,24263.0.html the mod name is MODID = "modmercenario" , the folder is in /home/tenchi/Modding/forge-1.8-11.14.0.1251-1.8-src/src/main/java/modMercenario/mercenarymod the item is a steelIngot i steal the json from the iron ingot. and i like to set everything in folders public static Item aceroMercenario; aceroMercenario = new modMercenario.mercenarymod.items.materiales.aceroMercenario(); the texture is in /home/tenchi/Modding/forge-1.8-11.14.0.1251-1.8-src/src/main/resources/assets/modmercenario/textures/items/materiales/aceromercenario.png is a 64b texture but i alredy chage it to 16 soo thas was not the problem mi json is in /home/tenchi/Modding/forge-1.8-11.14.0.1251-1.8-src/src/main/resources/assets/modmercenario/models/item/aceromercenario.json and inside looks identicaly to the one of the torch example in http://minecraft.gamepedia.com/Block_models whith only diference is the route to the texture //aceromercenario.json _____________________ { "parent": "builtin/generated", "textures": { "layer0": "modmercenario:/items/materiales/aceromercenario" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } } ________________________________________ there is no errors in the console output mi item acero mercenario is in the CreativeTabs.tabMisc but just and ugly purple black square in tghe steve hand is black purpole square and something rare happend in 3 view is a full 1M cubic block purple and black swalow the steve arm. https://www.dropbox.com/s/rxg25rx0i5zbac1/Captura%20de%20pantalla%20de%202014-12-02%2020%3A21%3A24.png?dl=0 nop i dont any have idea what im missing //aceroMercenario.java //__________________________________ package modMercenario.mercenarymod.items.materiales; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fml.common.registry.GameRegistry; import modMercenario.mercenarymod.items.MercenaryModItems; import modMercenario.mercenarymod.items.materiales.materialesMercenarios; import modmercenario.mercenarymod.Mercenary; public class aceroMercenario extends Item{ public static String name="aceromercenario"; public aceroMercenario(){ setUnlocalizedName(Mercenary.MODID + "_" + name); GameRegistry.registerItem(this, name); setCreativeTab(CreativeTabs.tabMisc); //setTextureName(Mercenary.MODID + ":" + "materiales/" + name); this.maxStackSize = 64; // this.setMaxDamage(500); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.aceroMercenario, 0, new ModelResourceLocation("modmercenario:/items/materiales/aceromercenario", "inventory")); } public static ToolMaterial material(){ return materialesMercenarios.aceromadera(); } public static ArmorMaterial materialArmadura(){ return materialesMercenarios.acero(); } } //_______________________________________________ //MercenaryModItems.java //_______________________________________________ package modMercenario.mercenarymod.items; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import modMercenario.mercenarymod.blocks.MercenaryModBlocks; import modmercenario.mercenarymod.Mercenary; public final class MercenaryModItems{ public static Item aceroMercenario; public static void init(){ aceroMercenario = new modMercenario.mercenarymod.items.materiales.aceroMercenario(); } //################################################################################################################################################################################################ }//fin de la classe
  2. yap you are lossin the second new ItemStack i t must be like GameRegistry.addShapelessRecipe(new ItemStack(modItems.suspensionderedstone,1,2), new Object[] {new ItemStack(modItems.suspensionderedstone,1,0), new ItemStack(Items.redstone ), new ItemStack(Items.redstone )});
  3. Be aware my friend teh penguin has his own ways i work absolutly on debian and never touch the window in the other partition but you must know to install the oracle java and set it in the path or nothing you read in the guides wil work
  4. goog days puzleed im about this, i create like 6 diferent swords in a metaItem each of has a diferent texture and thats working. but i cant get to set diferent Atackdamage values for each metaSword, the damage value in a item is defined by the material declaret in the constructor. and when i atack whit the first sword it converts automatically to the second and then to the 3 sword how do you define diferents materials based on the meta(Itemdamage) ? codigo aqui https://github.com/perromercenary00/perro-codigo-/blob/master/metaespadamercenaria is way to declare meta items whit something else not Itemdamage ?
  5. realized the problem is well if you consume a item soposed to add another item to inventory before it has chance to add the second item there would be not secund item in the inventory soo fuck rigth over. but his add another trouble, if there is no free space in inventory where it would go the secund item i gonna do other thread for that
  6. this is a question who evoluted from other post , i feel it must have another thread in the forum original http://www.minecraftforge.net/forum/index.php/topic,25307.0.html realizing what the trouble is whith what i pretend to do gets a lot of time cos something simply easy or little is harder to spot than the biggest trouble well if you consume a item soposed to add another item to inventory before it has chance to add the second item there would be not secund item in the inventory soo fuck rigth over. soo then lets doo this you first add the secund item to inventory then consume the first, and now wath happen if there is no space free in the inventory to locate the second item . well then you fuckit again. soo then lets do this you have the first item that would be consume then you check if thereis free space in inventory if it is space throw the secund item to inventory consume the first. but if it is not space in inventory drop it to the world close to steve or over his hea or wath ever get more chance the item dont get stuuk in a wall. sooo the code cuestion ,i know there is a steve.inventory.getFirstEmptyStack(); //returns a int of the empy slot number if it is < 36 there is space free in inventory trouble whit this is adont see a method saiying add this item or itemstack to this especific slot(x) in inventory the secund trouble is idont see in the world.methods something like world.dropItemOrItemStack(world, itemOrItemStack, x, y, z ); couldyou please tell me if there exist methods to do this two things in minecraft ?? the other tink i have in mind is to add another threat.time to the class just to wait 200 or 300ms to add the secund item in inventory once the first is consume
  7. goods im doing something little complicated i have create a potion "solucionderedstone0" if i shake this potion for 10 sec it become another diferent potion "solucionderedstoneActivada0" to do this i have to consume the item potion "solucionderedstone0" and replace it in the inventory whit the secund potion "solucionderedstoneActivada0" here is a video the piece of code on charge is if (execu){ System.out.println("### consumiendo suspensionderedstone0"); steve.inventory.consumeInventoryItem(modItems.suspensionderedstone0); steve.inventory.addItemStackToInventory(new ItemStack(modItems.suspensionderedstoneActivada0, 1)); steve.inventory.markDirty(); if (world.isRemote){remot=true;} else{local=true;} // steve.inventory.getStackInSlot(0) }
  8. more or less the thing is that i have a multi meta item //item //meta suspencionderedstone 0 suspencionderedstone 1 suspencionderedstone 2 suspencionderedstone 3 suspencionderedstone 4 suspencionderedstone 5 suspencionderedstone 6 suspencionderedstone 7 i need to know if it is in the inventory at least one of the especific meta for example: i wanna know if there is suspencionderedstone 4 exactly the 4 and whit this in mind consume "suspencionderedstone 4" and based on that add to the inventory suspencionderedstoneActivate 4 if there is "suspencionderedstone 4" in inventory replace it whith "suspencionderedstoneActivate 4" but the methods i found only work with items whitout metadata steve.inventory.hasItem() steve.inventory.consumeInventoryItem() but steve.inventory.addItemStackToInventory(new ItemStack(modItems.suspensionderedstoneActivada, 1, 2); this one leftme define the metadata
  9. good days i need little help whith itemStacks, two little commands i have made two meta items: suspencionderedstone y suspencionderedstoneActivada each of whith 8 meta subitems wath i wana doo is first check if player has in his inventory the especific meta item (1) and it it has change it for other meta item (1) more or lest i have this public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer steve){ if (steve.inventory.hasItem(modItems.varaMercenaria)){ //here i need someting like // steve.inventory.hasItemStack(modItems.suspencionderedstone,1, 2)//(item ,cuantity, meta) steve.inventory.consumeInventoryItem(modItems.suspensionderedstone);//here i need something like //steve.inventory.consumeInventoryItemStack(modItems.suspensionderedstone,1 ,2); steve.inventory.addItemStackToInventory(new ItemStack(modItems.suspensionderedstoneActivada, 1, 2));//this works pretty well } }
  10. ñaa don't found it in the item class PlayerInteractEvent is used in what item or is something external to minecraft in the google they speak about butkit idont get it is abutkit plugin
  11. maeby silly question some keylistener from java could do the job, but it alredy exist, could get the things whit ease a have done a custome item is a stick i wanna this stick behave based on the mouse clicks, rigth click is the easy just a onItemRightClick() and is done this morning i wass plundering on the minecraft code lookin for something suitable in the sword class and the stick and i found in the pickaxe func_150897_b that method work only when i hit some block whit mi custome item but i need something to work even when aiming nothing public boolean func_150897_b(Block p_150897_1_) { System.out.println("### func_150897_b"); return true; } i think the methods exist in minecraft but have unexpecific names like func_xxxx do you know this methods ??
  12. little confused but block are objets and lists are objets the original trouble is how to save the block object . lets say that a make no just one but 5 list ArrayList<Integer> x = new ArrayList<Integer>(); ArrayList<Integer> y = new ArrayList<Integer>(); ArrayList<Integer> z = new ArrayList<Integer>(); ArrayList<Block> bloke = new ArrayList<Block>(); ArrayList<Integer> meta = new ArrayList<Integer>(); well the coordinates an meta are Integers not trouble whith that but blocke is an object i cant't write that to a txt file but i must convert it toString() and it returns something like and return that to string to block objetc later on the read the list Method toString() = mercenary00.mercenarymod.blocks.MetaBlockeMercenario@4a31c294 getLocalizedName() = tile.modmercenario_metablockemercenario.name getUnlocalizedName() = tile.modmercenario_metablockemercenario that was the reason i discard the block object and for i chose to work only the block id's it shall save me from a major crash when some custom block from other mod get caugth in the list Block.getIdFromBlock(blk) = 179 == no troubles NBTtags just save strings it gona be a pain it shall need to done a method to get the Array list and make it a whole String separated by colons for later write it to a txt or an NBT the list Could have easily 200 blocks String ListadeBlockes = "x0, y0, z0, id0, meta0 ,x1, y1, z1, id1, meta1, x2, y2, z2, id2, meta2"; then another method must read this line chopit and organizate it again in a ArrayList<Integer> Unless tee worldSave could save objects thats woulbe very nice
  13. i have i wiss to create a folder to store the config files of my mod but im a penguin user soo i know very well the re is a diferent file system whith a diferent route for every diferent operate system soo if a i create the mine white file carpeta = new file("~/.minecraft/config/mercenaryMods/esteModEspecifico"); file carpeta = new file("%appdata%.minecraft\config\mercenaryMods\esteModEspecifico"); // not know where on mak it will only work on linux and for eclipse propourses i get complicated to test. but i have the impresion that there is alredy a class in minecraft for this and a class to read and write txt files dont know how is called is rigth? or better begin hard coding mi thing.
  14. well wath i need to do ? i have a litle structure of a type of custom blocks and i store all the coordenadas an types of blocks in a ArrayList <Integer> someting like ArrayList <Integer> l=new ArrayList <Integer>(); //l0 ,l1 ,l2 ,l3 ,l4 ,l5 ,l6 ,l7 , 8l ,l9 ,l10 ,l11,l12,l13,l14 x0, y0, z0, id0, meta0 ,x1, y1, z1, id1, meta1, x2, y2, z2, id2, meta2; on rigth click over any of the blocks the code must search the list of blocks and move all the blocks to another coordinates and return then again afther 10s is abridge that have a time to be cross like i have in mind soo a need to store this list idoo research on WorldData i get this https://github.com/perromercenary00/perro-codigo-/issues/1 but idont understend how do you do to create tag ArrayList and store mi data
  15. you leve me a lot of code to read can you be a little more especific ?
  16. good days i been working in something more or less complicated. i need a way to store a list of blocks coordinates and store this list in a spefic block way of i could get the list from the block using something like public static ArrayList<Integer> getListFromThisBlock(int x,int y,int z){ } and the data dont qet loss wen minecraft close nbt data look not able to fulfuill mi desires. i was tinking in create a class to read and write data in a text file inside mi mods folder but soon i remember the shiti it is to do something like that whith java ------------------ sooo ¿there is a way to use sql internali in minecraft to create a custom database in mi mods folder for mi blocks way it could be automatic ported and usable when i close mi mod to redistribut it on the web whiout causing a major mess?
  17. sometingh like hasbeen done before [redacted - please use proper links to the mods, not scam sites like 9minecraft] in my head i have a vision of how to doid but you need to make code to detec the biome bounds and borders and create the wall
  18. The cake is a lie, Nop This time the Cake knows the true in the cake class i found like diesieben says using world.getBlockMetadata(x,y,z); to get the meta direct here a video the block is the one whith oak texture there is some weirdiness whit the icons in hotbar they start to change but for now i dont care now is more easy to get done the rest of the code im gona do dat in a few days. public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { int l = world.getBlockMetadata(x,y,z); System.out.println("//################# ################ meta2="+l); if (l==0){ this.setBlockBounds(0F,0.5F,0F, 1.0F,1.0F,1.0F);}//cara 0 else if (l==1){ this.setBlockBounds(0F,0F,0F, 1.0F,0.5F,1.0F);}//cara 1 else if (l==2){ this.setBlockBounds(0F,0F,0.5F, 1.0F,1.0F,1.0F);}//cara 2 else if (l==3){ this.setBlockBounds(0F,0F,0F, 1.0F,1.0F,0.5F);}//cara 3 else if (l==4){ this.setBlockBounds(0.5F,0F,0F,1.0F,1.0F,1.0F);}//cara 4 else if (l==5){ this.setBlockBounds(0.0F,0F,0F,0.5F,1.0F,1.0F);}//cara 5 else { this.setBlockBounds(0F,0F,0F, 1.0F,1.0F,1.0F);}//full blocke } // all the code for the block package mercenary00.mercenarymod.blocks; import java.util.List; import mercenary00.mercenarymod.items.ItemBlockMultiBlock; import mercenary00.mercenarymod.Mercenary; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import mercenary00.mercenarymod.utilidades.util; import mercenary00.mercenarymod.blocks.puertaMercenaria; //################################################################################################################ public class puertaMercenaria extends Block{ private int maxMeta = 6; IIcon[] icons = new IIcon[36]; private final String name = "puertamercenaria"; //################################################################################################################ public puertaMercenaria() { super(Material.rock); setBlockName(Mercenary.MODID + "_" + name); // setCreativeTab(CreativeTabs.tabBlock); this.setHardness(4.0F); this.setResistance(6.0F); this.setStepSound(soundTypeWood); GameRegistry.registerBlock(this, ItemBlockMultiBlock.class, name); }//fin del contructor //################################################################################################################ @Override public void registerBlockIcons(IIconRegister iconRegister) { for(int ic = 0; ic < icons.length; ic++) { icons[ic] = iconRegister.registerIcon(Mercenary.MODID + ":"+"puertas/" + name + ic); } } //################################################################################################################ @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { int tex=(meta*6)+(side); if (tex < icons.length ){return icons[tex];} else{return icons[0];} } // fin de IIcon getIcon //################################################################################################################ @Override public int damageDropped(int meta) { return meta; } //################################################################################################################ @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) { for(int i = 0; i < maxMeta; i++){ list.add(new ItemStack(item, 1, i)); } } //################################################################################################################ //@Override public int getMetadata(int meta) { return meta; } //################################################################################################################ public boolean isOpaqueCube() { return false; } //################################################################################################################ /** * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ public boolean renderAsNormalBlock() { return false; } //################################################################################################################ public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase steve, ItemStack p_149689_6_){ int meta=util.meta(world, steve); System.out.println("util.meta(world, steve)="+meta); world.setBlock(x, y, z, modBlocks.puertaMercenaria , meta, 4); } //################################################################################################################ public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { int l = world.getBlockMetadata(x,y,z); System.out.println("//################# ################ meta2="+l); if (l==0){ this.setBlockBounds(0F,0.5F,0F, 1.0F,1.0F,1.0F);}//cara 0 else if (l==1){ this.setBlockBounds(0F,0F,0F, 1.0F,0.5F,1.0F);}//cara 1 else if (l==2){ this.setBlockBounds(0F,0F,0.5F, 1.0F,1.0F,1.0F);}//cara 2 else if (l==3){ this.setBlockBounds(0F,0F,0F, 1.0F,1.0F,0.5F);}//cara 3 else if (l==4){ this.setBlockBounds(0.5F,0F,0F,1.0F,1.0F,1.0F);}//cara 4 else if (l==5){ this.setBlockBounds(0.0F,0F,0F,0.5F,1.0F,1.0F);}//cara 5 else { this.setBlockBounds(0F,0F,0F, 1.0F,1.0F,1.0F);}//full blocke } //################################################################################################################ }
  19. ñaaa i been triying before the public void setBlockBoundsBasedOnState(IBlockAccess p_149719_1_, int p_149719_2_, int p_149719_3_, int p_149719_4_) the trouble whit tath metod is, well there is no metadata data in the parameters entry so a have to generated or take it from other method like public IIcon getIcon(int side, int meta) { but hass the same trouble like when i put it in getIcon i must put this if else metada bounds cicle in the method who generates the metadata data and that is //############################################################## public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase steve, ItemStack p_149689_6_){ int meta=util.meta(world, steve); System.out.println("util.meta(world, steve)="+meta); //x if (meta==5){this.setBlockBounds(0.0F,0F,0F,0.5F,1.0F,1.0F);}//cara 5 if (meta==4){this.setBlockBounds(0.5F,0F,0F,1.0F,1.0F,1.0F);}//cara 4 //y if (meta==1){this.setBlockBounds(0F,0F,0F, 1.0F,0.5F,1.0F);}//cara 1 if (meta==0){this.setBlockBounds(0F,0.5F,0F, 1.0F,1.0F,1.0F);}//cara 0 //z if (meta==2){this.setBlockBounds(0F,0F,0.5F, 1.0F,1.0F,1.0F);}//cara 2 if (meta==3){this.setBlockBounds(0F,0F,0F, 1.0F,1.0F,0.5F);}//cara 3 world.setBlock(x, y, z, modBlocks.puertaMercenaria , meta, 4); } //############################################################## and Nop it dont fix the issue when i put a block in the world all the metablocks change bounds ending exactly the same actualy i think this dont gona work I'll gonna end up creating 6 different metablocks each with a different setbounds and a very long piece of code to define their behavior
  20. Do not know thah methods i dont find it in eclipse. what block use this method Exmple please?
  21. Good days I'm new to modding and I been experimenting with meta blocks I have this Metablock with 6 subBlocks and want each subBlock to have different Bounds. so far and done so is to place the bounds in the constructor creating a public variable with the metadata then defines the bounds whit a if else chain, works but the limits of the subBlocks get mixed and change wen i put a new block on the world. then i place the bounds if else in public iicon getIcon (int side, int meta) using the meta value for the icons i get the same trouble that whith the contructor. copy the method from the Block wall.class and put there the if else meta ending whith the same results //################################################################## @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta) { Meta=meta; //System.out.println("Block bounds meta="+Meta); // x y z x y z //this.setBlockBounds(0F,0F,0F,1.0F,1.0F,1.0F); //full block if (Meta==0){this.setBlockBounds(0F,0F,0F, 1.0F,0.5F,1.0F);} if (Meta==1){this.setBlockBounds(0F,0.5F,0F, 1.0F,1.0F,1.0F);} if (Meta==2){this.setBlockBounds(0F,0F,0.5F, 1.0F,1.0F,1.0F);} if (Meta==3){this.setBlockBounds(0F,0F,0F, 1.0F,1.0F,0.5F);} if (Meta==4){this.setBlockBounds(0.5F,0F,0F,1.0F,1.0F,1.0F);} if (Meta==5){this.setBlockBounds(0F,0.5F,0F,0.5F,1.0F,1.0F);} if (Meta >5){this.setBlockBounds(0F,0F,0F,1.0F,1.0F,1.0F);} //System.out.println("side="+side+" meta="+meta); int tex=(meta*6)+(side); //System.out.println("side="+side+" meta="+meta+" tex="+tex); if (tex < icons.length ){return icons[tex];} else{return icons[0];} } // fin de IIcon getIcon //################################################################## public void setBlockBoundsBasedOnState (IBlockAccess p_149719_1_, p_149719_2_ int, int p_149719_3_, int p_149719_4_){ //System.out.println("Block bounds meta="+Meta); // x y z x y z //this.setBlockBounds(0F,0F,0F,1.0F,1.0F,1.0F); //full block if (Meta==0){this.setBlockBounds(0F,0F,0F, 1.0F,0.5F,1.0F);} if (Meta==1){this.setBlockBounds(0F,0.5F,0F, 1.0F,1.0F,1.0F);} if (Meta==2){this.setBlockBounds(0F,0F,0.5F, 1.0F,1.0F,1.0F);} if (Meta==3){this.setBlockBounds(0F,0F,0F, 1.0F,1.0F,0.5F);} if (Meta==4){this.setBlockBounds(0.5F,0F,0F,1.0F,1.0F,1.0F);} if (Meta==5){this.setBlockBounds(0F,0.5F,0F,0.5F,1.0F,1.0F);} if (Meta >5){this.setBlockBounds(0F,0F,0F,1.0F,1.0F,1.0F);} } //##################################################################
  22. i solve this making something complicated meta return 0 when looking up meta return 1 when looking down meta return 2 when looking south meta return 3 when looking north meta return 4 when looking east meta return 5 when looking west meta return 6 when error first get the block xyz coordinates sum steve xyz coordinates and whit results set face of block steve is looking at mi methods starts like //block class public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase steve, ItemStack p_149689_6_){ int meta=util.meta(world, steve); System.out.println("util.meta(world, steve)="+meta); } //################################################## //class util public static int meta(World world, EntityLivingBase steve){ // Position de steve , pocision del blocke ArrayList<Integer> lia = new ArrayList<Integer>(); ArrayList<Integer> lib = new ArrayList<Integer>(); lia.clear(); lib.clear(); lib=util.coordenadaDeBlockeEnFocol(world, 10); lia.add((int) steve.posX); lia.add((int) steve.posY); lia.add((int) steve.posZ); int x=lib.get(0)-lia.get(0); int y=lib.get(1)-lia.get(1)-1; int z=lib.get(2)-lia.get(2); System.out.println("x="+x+" y="+y+" z="+z); if ((x>0)&&(z<0)){return 4;}//return 10;} if ((x<0)&&(z<0)){return 3;}//return 9;} if ((x<0)&&(z>0)){return 5;}//return 8;} if ((x>0)&&(z>0)){return 2;}//return 7;} if ((x<0)&&(z==0)){return 5;} if ((x>0)&&(z==0)){return 4;} if ((x==0)&&(z<0)){return 3;} if ((x==0)&&(z>0)){return 2;} if ((y<0)){return 1;} if ((y>0)){return 0;} return 6; } //################################################## public static ArrayList<Integer> coordenadaDeBlockeEnFocol(World world,int distancia){ //System.out.println("###coordenadaDeBlockeEnFocoL"); ArrayList<Integer> lin =new ArrayList<Integer>(); // x y z //lin.add(0);lin.add(0);lin.add(0); MovingObjectPosition mop = Minecraft.getMinecraft().renderViewEntity.rayTrace(distancia, 1.0F); //System.out.println("###mop="+mop); if(mop != null) { int blockHitSide = mop.sideHit; Block blockLookingAt = world.getBlock(mop.blockX, mop.blockY, mop.blockZ) ; int fx=(int)mop.blockX; int fy=(int)mop.blockY; int fz=(int)mop.blockZ; // System.out.println("fx="+fx+" fy="+fy+" fz="+fz); lin.add(0,fx); lin.add(1,fy); lin.add(2,fz); } // // int x=lin.get(0); // int y=lin.get(1); // int z=lin.get(2); // if (world.isAirBlock(x,y,z)) {System.out.println(">>>>>### el blocke x="+x+" y="+y+" z="+z+" es aire");} // System.out.println("x="+lin.get(0)+" y="+lin.get(1)+" z="+lin.get(2)); return lin; } //
  23. i dont get this I been creating a 6 blocks Metablock using the guide from orange http://www.orangetutorial.com/metadata-blocks/#sthash.gsgIqbPj.dpbs and I followed all the steps in the guide. all blocks are in the creative block tab each block with their textures correctly located meta 0 transparent block meta 1 brown block meta 2 red block meta 3 orange block meta 4 yellow block meta 5 green block but when I put any of these meta blocks becomes the transparent block 0 whit all the sides correctly located and i dunnat know why. the other thing I want to know is how to set meta blocks in the world with the method world.setBlock (x, y, z, modBlocks.MetaBlockeMercenario); // create meta 0 at the given xyz world.setBlock (x, y, z, modBlocks.MetaBlockeMercenario: 2); // error world.setBlock (x, y, z, modBlocks.MetaBlockeMercenario / 2); // error world.setBlock (x, y, z, modBlocks.MetaBlockeMercenario \ 2); // error very tankfull.
  24. I just realized in which consist the problem when one uses the method onItemRightClick() validates several times runs several times interleaving the worlds first remote then the local remote again and again the local performance obsessed me as I wrote the code so that it will only accept a cycle by sending the coordinates and the parameters only once so sending only the first world the remote world that is always first, ignoring the local world. change the code to just send the variables only when the world is local and only do it once until the coordinates change now looks like this if ((coor1)&&(coor2)&&(!world.isRemote)){ util.romper(world,util.circulo( coordenadas1,coordenadas2)); } there in a one more cuestion but it goes in another treat
  25. public ItemStack onItemRightClick(ItemStack p_77659_1_, World world, EntityPlayer steve){ // System.out.println("### presss"); conteo++; System.out.println("is "+conteo+" times onItemRightClick is execute"); System.out.println("world.isRemote="+world.isRemote); return p_77659_1_; } //stoudout [20:52:32] [Client thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:89]: is 1 times onItemRightClick is execute [20:52:32] [Client thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:90]: world.isRemote=true [20:52:32] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:89]: is 2 times onItemRightClick is execute [20:52:32] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:90]: world.isRemote=false [20:52:32] [Client thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:89]: is 3 times onItemRightClick is execute [20:52:32] [Client thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:90]: world.isRemote=true [20:52:32] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:89]: is 4 times onItemRightClick is execute [20:52:32] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:90]: world.isRemote=false [20:52:33] [Client thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:89]: is 5 times onItemRightClick is execute [20:52:33] [Client thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:90]: world.isRemote=true [20:52:33] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:89]: is 6 times onItemRightClick is execute [20:52:33] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:90]: world.isRemote=false [20:52:39] [Client thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:89]: is 7 times onItemRightClick is execute [20:52:39] [Client thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:90]: world.isRemote=true [20:52:39] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:89]: is 8 times onItemRightClick is execute [20:52:39] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.items.varaMercenaria00:onItemRightClick:90]: world.isRemote=false
×
×
  • Create New...

Important Information

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