Jump to content

perromercenary00

Members
  • Posts

    849
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by perromercenary00

  1. what not aware than block metadatas can be worked as item metadatas either from the shortcut i think always you must be especific whith blank spaces anayway is solved so thanks GameRegistry.addRecipe(new ItemStack(MercenaryModBlocks.slabRoble00, 9, 0), new Object[] {"P", "P", "P", 'P', new ItemStack( Blocks.planks ,1 ,0) }); GameRegistry.addRecipe(new ItemStack(MercenaryModBlocks.slabPicea00, 9, 0), new Object[] {"P", "P", "P", 'P', new ItemStack( Blocks.planks ,1 ,1) }); GameRegistry.addRecipe(new ItemStack(MercenaryModBlocks.slabAbedul00, 9, 0), new Object[] {"P", "P", "P", 'P', new ItemStack( Blocks.planks ,1 ,2) }); GameRegistry.addRecipe(new ItemStack(MercenaryModBlocks.slabJungla00, 9, 0), new Object[] {"P", "P", "P", 'P', new ItemStack( Blocks.planks ,1 ,3) }); GameRegistry.addRecipe(new ItemStack(MercenaryModBlocks.slabAcacia00, 9, 0), new Object[] {"P", "P", "P", 'P', new ItemStack( Blocks.planks ,1 ,4) }); GameRegistry.addRecipe(new ItemStack(MercenaryModBlocks.slabRobleOscuro00, 9, 0), new Object[] {"P", "P", "P", 'P', new ItemStack( Blocks.planks ,1 ,5) });
  2. good days i have made some vertical slabs for mi structures and want to make recipes for them but i stuck whith this little detail //vertical slabs GameRegistry.addRecipe(new ItemStack(MercenaryModBlocks.slabRoble00, 9, 0), new Object[] {" P ", " P ", " P ", 'P', Blocks.planks, // planks oak ?? 'L', Blocks.wool , }); i made slabs for oak darkOak soruce birch acacia and jungle and want the recipes to go whith the maching material but in the blocks section there is only "Blocks.planks" how do this or i have to do something like Blocks.planks .withProperty(VARIANT, BlockPlanks.EnumType.DARK_OAK); thanks for reading
  3. more or less the idea a idont speak english so explain complex things like this get harder to explain or understand just reading the test but i fix it there was logic error betwing when i send the door to open or close whith reference to the state of block AireSoloido but at this i dont have to clare what wass the error. so so far solved
  4. Good days this is another post for the door 3x3 i been working on this door acuped an area of 3x3 blocks being the center Block the control block for the door the other 8 blocks are mi "aireSolido00" block just exist there refill the empty space around the door but i fond and issue, you can togle the door open | close only whith the center block and thiis undesired, it must work right clicking any of the 9 blocks soo i set "aireSolido00" whith this code so it can be opened and close // ###########################################################3 public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if (!worldIn.isRemote) { boolean open = ((Boolean) state.getValue(OPEN)).booleanValue(); boolean powered = ((Boolean) state.getValue(POWERED)).booleanValue(); if (open) { worldIn.setBlockState(pos, state.withProperty(OPEN, Boolean.valueOf(false)) ); } else { worldIn.setBlockState(pos, state.withProperty(OPEN, Boolean.valueOf(true)) ); } } // fin de (!worldIn.isRemote) return true; } and set the onNeighborBlockChange in the center Block to check the state of the sorrounded blocks and open or close based on the estate of this airesolido, if the door is close and any of the airesolido blocks togles to open the center block must register it open the door and set all the blocks to open if the door is open and any of the blocks togle to close it must close all the the door but code causes an Buccle and fuck all the door closes and open but end close for why i could test, the onNeighborBlockChange in the Center Block is being triger like 8 times per tick so end comiting changes once and more times the air block could be notify of this and create a little bucle sorry bad english this is door whithout troblesome code this is the one whith the trouble the door togle many times but end close i alredy test interchanging the toggleDoor(worldIn, pos, true); comands ########## i wanna lock the onNeighborBlockChange way it could be check neiberhood only once then lock the method until the next tick, i think this could fix the buccle and for some reasons i wanna doid whithout using tileEntityes what i could use for this thanks for reading // ###########################################################3 @Override public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { if (!worldIn.isRemote) { boolean powered = ((Boolean) state.getValue(POWERED)).booleanValue(); boolean open = ((Boolean) state.getValue(OPEN)).booleanValue(); boolean powerear = false; ////// System.out.println(" onNeighborBlockChange="+powered); BlockPos lista[] = getBlocks(worldIn, pos, state); boolean estado = open; int abi = 0; //open blocks count int cer = 0; //closest blocks count for (int l = 1; l < (lista.length - 1); l++) { BlockPos bpos = lista[l]; if (isValidBlockAirSolido(worldIn, bpos)) { boolean openb = ((Boolean) worldIn.getBlockState(bpos).getValue(OPEN)).booleanValue(); if (openb) { abi++; } else { cer++; } } } if (open & (cer > 0)) { toggleDoor(worldIn, pos, false); } if (!open & (abi > 0)) { toggleDoor(worldIn, pos, true); } } ////// System.out.println("### abi="+abi); ////// System.out.println("### cer="+cer); } // #########################################################################3 // Block allowed to ignore when set the door in the world static boolean isValidBlockAirSolido(World worldIn, BlockPos pos) { IBlockState blkst = worldIn.getBlockState(pos); Block blk = blkst.getBlock(); if (blk == MercenaryModBlocks.aireSolido00) { return true; } return false; } // #########################################################################3
  5. goo days i have i goo ridlle here if you whatch the vainilla villagers in the villages when the sun set's they run to their homes open the doors enter and close the doors i make a door from 3x3 i have alredy other post making question to add features to this door, and know i whish to make this 3x3 door be openable by the villagers and actually have some ideas but the best would use the vainilla behaveour the door is extending BlockDoor if i make a little house and put the 3x3 door the villager seems to run to the house but not sure if they are detecting mi door, may they detect the inside of the house becose they then to wander around the house, if i open the door they run inside. I know in vainilla villages there is house whithout doors and testificates run inside soo it could be they are not detecting mi door but the house i set some System.outs in the door3x3 code but anithing seems to respond when the villagers walks agains the door i wass thinking in make a tile entity whit some code to detect villagers and open the door for then , then close again, but seems unncesary complicated and probably there is some code alredy done inside the vainilla clases ##### has some one know how i could get the villager to interact whith mi custome door, or maiby a best idea than the one from the tileEntity
  6. Oo i have a lot of troubles when i made the bullets and arrows for mi mod and this one could be anything but the most is the render thing and the thing entityTracker first know if the blast exist in the local world do something like this in onUpdate method from the proyectile public void onUpdate() { super.onUpdate(); System.out.println("World="+this.worldObj.isRemote); System.out.println("ticksInGround="+ticksInGround); System.out.println("ticksInAir="+ticksInAir); System.out.println("pos="+this.posX+", "+this.posY+", "+this.posZ); System.out.println("\n\n"); shoot and whatch the console and if you dont have a "World=true" the trouble is entityTracker something fuck up whith clienProxy or entity register if it is then is the render something fuck up whith clienProxy
  7. hello here we come again whith the door of 3x3 i press f3 to show the states of the door block if look to the rigth in the video when i open the vainilla door the value of open goes from a white false to a green true but mi 3x3 door allways remain in white false no matter if open or close for unknow reason i can change the values form the block propertie Open, this one is always false no matther what i try i set it default to open=true and powered=true but still wen i set a new door in the world this cames whith the values to false this.setDefaultState(this.blockState.getBaseState() .withProperty(FACING, EnumFacing.NORTH) .withProperty(OPEN, Boolean.valueOf(true)) .withProperty(HINGE, BlockDoor.EnumHingePosition.LEFT) .withProperty(POWERED, Boolean.valueOf(true)) .withProperty(HALF, BlockDoor.EnumDoorHalf.UPPER)); ###### i think i fucket up whith blockstates but not know where or how, this is firstime i hardplay whith blocks soo somene could please tell me what the error is ?? what is preventing to change the vaules from properties full block 3x3 code package mercenarymod.blocks.multitextura; import java.util.Random; import org.apache.logging.log4j.core.config.Property; import mercenarymod.Mercenary; import mercenarymod.blocks.MercenaryModBlocks; import mercenarymod.items.MercenaryModItems; import net.minecraft.block.Block; import net.minecraft.block.BlockCauldron; import net.minecraft.block.BlockDoor; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.util.MathHelper; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import mercenarymod.utilidades.chat; import net.minecraft.entity.EntityLivingBase; public class blancoPuerta3x3 extends BlockDoor { public static final PropertyDirection FACING = PropertyDirection.create("facing"); public static final PropertyBool OPEN = PropertyBool.create("open"); public static final PropertyEnum HINGE = PropertyEnum.create("hinge", BlockDoor.EnumHingePosition.class); public static final PropertyBool POWERED = PropertyBool.create("powered"); public static final PropertyEnum HALF = PropertyEnum.create("half", BlockDoor.EnumDoorHalf.class); public blancoPuerta3x3() { // super(Material.wood); super(Material.wood); String name = "blancoPuerta3x3"; setUnlocalizedName(Mercenary.MODID + "_" + name); GameRegistry.registerBlock(this, name); setCreativeTab(Mercenary.herramientas); this.setHardness(6.0F); this.setResistance(2.0F); this.setDefaultState(this.blockState.getBaseState() .withProperty(FACING, EnumFacing.NORTH) .withProperty(OPEN, Boolean.valueOf(true)) .withProperty(HINGE, BlockDoor.EnumHingePosition.LEFT) .withProperty(POWERED, Boolean.valueOf(true)) .withProperty(HALF, BlockDoor.EnumDoorHalf.UPPER)); } // ###########################################################3 @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) { return Item.getItemFromBlock(MercenaryModBlocks.blancoPuerta3x3); } // ###########################################################3 @Override public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) { removerPuerta(worldIn, pos, worldIn.getBlockState(pos)); } // ###########################################################3 @Override public void onBlockExploded(World worldIn, BlockPos pos, Explosion explosion) { this.onBlockDestroyedByExplosion(worldIn, pos, explosion); } // #################################################################################################3 @Override public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) { removerPuerta(worldIn, pos, state); } // #################################################################################################3 public static void removerPuerta(World worldIn, BlockPos centro, IBlockState state) { BlockPos lista[] = getBlocks(worldIn, centro, state); int listal = lista.length; BlockPos dpos = centro; IBlockState dbst = state; for (int dx = 1; dx < listal; dx++) { dpos = lista[dx]; dbst = worldIn.getBlockState(dpos); if (isValidBlock(dbst)) { worldIn.setBlockToAir(dpos); } } } // #################################################################################################3 //devuelve una lista con las posiciones que conrresponden a los blockes de la puerta // list of blockPos ocuped by the door public static BlockPos[] getBlocks(World worldIn, BlockPos centro, IBlockState centroBst) { BlockPos lista[] = new BlockPos[9]; int centroFacing = -1; //IBlockState centroBst = worldIn.getBlockState(centro); if (isValidBlock(centroBst)) { EnumFacing centroEnum = (EnumFacing) centroBst.getValue(FACING); centroFacing = getFacingIfValidBlock(centroBst); } BlockPos izquier = centro; BlockPos derecha = centro; BlockPos dpos = centro; switch (centroFacing) { default: case 0: case 1: //arriba y abajo lista[0] = centro; lista[1] = centro.east(); lista[2] = centro.west(); lista[3] = centro.north(); lista[4] = centro.east().north(); lista[5] = centro.west().north(); lista[6] = centro.south(); lista[7] = centro.east().south(); lista[8] = centro.west().south(); break; case 2: case 3: // sur o norte lista[0] = centro; lista[1] = centro.east(); lista[2] = centro.west(); lista[3] = centro.up(); lista[4] = centro.east().up(); lista[5] = centro.west().up(); lista[6] = centro.down(); lista[7] = centro.east().down(); lista[8] = centro.west().down(); break; case 4: case 5: // oeste // este lista[0] = centro; lista[1] = centro.north(); lista[2] = centro.south(); lista[3] = centro.up(); lista[4] = centro.north().up(); lista[5] = centro.south().up(); lista[6] = centro.down(); lista[7] = centro.north().down(); lista[8] = centro.south().down(); break; } return lista; } // #################################################################################################3 //can be placed here public static boolean sePuedeColocar(World worldIn, BlockPos centro, IBlockState state) { boolean colocable = true; BlockPos lista[] = getBlocks(worldIn, centro, state); int listal = lista.length; BlockPos dpos = centro; IBlockState dbst = state; for (int dx = 0; dx < listal; dx++) { dpos = lista[dx]; dbst = worldIn.getBlockState(dpos); if (!isValidBlock(dbst)) { colocable = false; } } return colocable; } // #################################################################################################3 @Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { super.breakBlock(worldIn, pos, state); worldIn.removeTileEntity(pos); } // #################################################################################################3 @Override public boolean isOpaqueCube() { return false; } @Override public boolean isFullCube() { return false; } @Override @SideOnly(Side.CLIENT) public EnumWorldBlockLayer getBlockLayer() { return EnumWorldBlockLayer.CUTOUT; } @Override public boolean isPassable(IBlockAccess worldIn, BlockPos pos) { return true; } // ###########################################################3 // devuelve las posiciones correspondienetes a izquierda y derecha // left and rigth blocks of the door public static BlockPos[] getIzqYDer(int facing, BlockPos centro) { BlockPos izquier = centro; BlockPos derecha = centro; BlockPos lr[] = { centro }; switch (facing) { case 0: // up break; case 1: // down break; case 2: // sur BlockPos slr[] = { centro.east(), centro.west() }; lr = slr; break; case 3: // norte BlockPos nlr[] = { centro.west(), centro.east() }; lr = nlr; break; case 4: // este BlockPos elr[] = { centro.north(), centro.south() }; lr = elr; break; case 5: // oeste BlockPos olr[] = { centro.south(), centro.north() }; lr = olr; break; } return lr; } // ###########################################################3 // is Close public boolean estaCerrada(World worldIn, BlockPos centro) { boolean cerrada = false; IBlockState centroBst = worldIn.getBlockState(centro); int centroFacing = getFacingIfValidBlock(centroBst); if (centroFacing > -1) { BlockPos id[] = getIzqYDer(centroFacing, centro); if (id.length > 1) { BlockPos izquier = id[0]; BlockPos derecha = id[1]; int izqF = getFacingIfValidBlock(worldIn.getBlockState(izquier)); int derF = getFacingIfValidBlock(worldIn.getBlockState(derecha)); // solo es valido si las dos puertas existen y estan cerradas if ((izqF == derF) & (izqF == centroFacing)) { cerrada = true; } } } return cerrada; } // ###########################################################3 // devuelve el facing en valores de zero a cinco solo si es un blocke de la // puerta // in value from the facing public static int getFacingIfValidBlock(IBlockState Bst) // return -1 if // invalid or // null { int facing = -1; if (isValidBlock(Bst)) { EnumFacing enumF = (EnumFacing) Bst.getValue(FACING); if (enumF != null) { facing = enumF.getIndex(); } } return facing; } // ###########################################################3 @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { int hand = playerIn.inventory.currentItem; int facing = ( (EnumFacing) state.getValue(FACING)).getIndex(); boolean open = !estaCerrada(worldIn, pos); //((Boolean)state.getValue(OPEN)).booleanValue(); boolean powered = ((Boolean)state.getValue(POWERED)).booleanValue(); EnumHingePosition hinge = ( (EnumHingePosition) state.getValue(HINGE)); EnumDoorHalf half = ( (EnumDoorHalf) state.getValue(HALF)); //boolean flag = worldIn.isBlockPowered(pos) || worldIn.isBlockPowered(blockpos2); int centroFacing = getFacingIfValidBlock(state); if (centroFacing > -1 ) { //worldIn.setBlockState(pos, nstate, 2 ); BlockPos id[] = getIzqYDer(centroFacing, pos); if (id.length > 1) { BlockPos izquier = id[0]; BlockPos derecha = id[1]; /* if (powered) { cerrar(worldIn, izquier, pos, derecha); } else */ { worldIn.playAuxSFXAtEntity(playerIn, ((Boolean)state.getValue(OPEN)).booleanValue() ? 1003 : 1006, pos, 0); if (open) { cerrar(worldIn, izquier, pos, derecha); //Boolean.valueOf(true) IBlockState nstate = getDefaultState() .withProperty(FACING, state.getValue(FACING)) .withProperty(OPEN, Boolean.valueOf(false)) .withProperty(POWERED, state.getValue(POWERED)) ; worldIn.setBlockToAir(pos); worldIn.setBlockState(pos, nstate, 2 ); worldIn.markBlockRangeForRenderUpdate(pos, pos); System.out.println("####### Cerrar"+pos+nstate); return true; } else { abrir(worldIn, izquier, pos, derecha); IBlockState nstate = getDefaultState() .withProperty(FACING, state.getValue(FACING)) .withProperty(OPEN, Boolean.valueOf(true) ) .withProperty(POWERED, state.getValue(POWERED)) ; worldIn.setBlockToAir(pos); worldIn.setBlockState(pos, nstate, 2 ); System.out.println("####### Abrir"+pos+nstate); } } } } return false; } // #########################################################################3 //open the door public static void abrir(World worldIn, BlockPos izquier, BlockPos centro, BlockPos derecha) { System.out.println("####### void abrir()"); IBlockState centroBst = worldIn.getBlockState(centro); int cFacing = getFacingIfValidBlock(centroBst); removerPuerta(worldIn, centro, centroBst); switch (cFacing) { case 2: { // sur worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.EAST)); worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.WEST)); IBlockState aire = Blocks.air.getDefaultState(); IBlockState airesolidoW = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.WEST); IBlockState airesolidoE = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.EAST); worldIn.setBlockState(centro.up(), aire); worldIn.setBlockState(centro.up().west(), airesolidoE); worldIn.setBlockState(centro.up().east(), airesolidoW); worldIn.setBlockState(centro.down(), aire); worldIn.setBlockState(centro.down().west(), airesolidoE); worldIn.setBlockState(centro.down().east(), airesolidoW); } ; break; case 3: { // norte worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.WEST)); worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.EAST)); IBlockState aire = Blocks.air.getDefaultState(); IBlockState airesolidoW = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.WEST); IBlockState airesolidoE = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.EAST); worldIn.setBlockState(centro.up(), aire); worldIn.setBlockState(centro.up().west(), airesolidoE); worldIn.setBlockState(centro.up().east(), airesolidoW); worldIn.setBlockState(centro.down(), aire); worldIn.setBlockState(centro.down().west(), airesolidoE); worldIn.setBlockState(centro.down().east(), airesolidoW); } ; break; case 4: { // oeste worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.NORTH)); worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.SOUTH)); IBlockState aire = Blocks.air.getDefaultState(); IBlockState airesolidoN = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.NORTH); IBlockState airesolidoS = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); worldIn.setBlockState(centro.up(), aire); worldIn.setBlockState(centro.up().north(), airesolidoS); worldIn.setBlockState(centro.up().south(), airesolidoN); worldIn.setBlockState(centro.down(), aire); worldIn.setBlockState(centro.down().north(), airesolidoS); worldIn.setBlockState(centro.down().south(), airesolidoN); } ; break; case 5: { // este worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.SOUTH)); worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.NORTH)); IBlockState aire = Blocks.air.getDefaultState(); IBlockState airesolidoN = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.NORTH); IBlockState airesolidoS = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); worldIn.setBlockState(centro.up(), aire); worldIn.setBlockState(centro.up().north(), airesolidoS); worldIn.setBlockState(centro.up().south(), airesolidoN); worldIn.setBlockState(centro.down(), aire); worldIn.setBlockState(centro.down().north(), airesolidoS); worldIn.setBlockState(centro.down().south(), airesolidoN); } ; break; } } // #########################################################################3 //close the door public static void cerrar(World worldIn, BlockPos izquier, BlockPos centro, BlockPos derecha) { System.out.println("####### void cerrar()"); IBlockState centroBst = worldIn.getBlockState(centro); int cFacing = getFacingIfValidBlock(centroBst); removerPuerta(worldIn, centro, centroBst); //worldIn.setBlockState(centro, worldIn.getBlockState(centro).withProperty(OPEN, Boolean.valueOf(false))); switch (cFacing) { case 2: { // sur worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.NORTH)); worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.NORTH)); IBlockState airesolido = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.NORTH); worldIn.setBlockState(centro.up(), airesolido); worldIn.setBlockState(centro.up().west(), airesolido); worldIn.setBlockState(centro.up().east(), airesolido); worldIn.setBlockState(centro.down(), airesolido); worldIn.setBlockState(centro.down().west(), airesolido); worldIn.setBlockState(centro.down().east(), airesolido); } ; break; case 3: { // norte worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.SOUTH)); worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.SOUTH)); IBlockState airesolido = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); worldIn.setBlockState(centro.up(), airesolido); worldIn.setBlockState(centro.up().west(), airesolido); worldIn.setBlockState(centro.up().east(), airesolido); worldIn.setBlockState(centro.down(), airesolido); worldIn.setBlockState(centro.down().west(), airesolido); worldIn.setBlockState(centro.down().east(), airesolido); } ; break; case 4: { // oeste worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.WEST)); worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.WEST)); IBlockState airesolido = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.WEST); worldIn.setBlockState(centro.up(), airesolido); worldIn.setBlockState(centro.up().north(), airesolido); worldIn.setBlockState(centro.up().south(), airesolido); worldIn.setBlockState(centro.down(), airesolido); worldIn.setBlockState(centro.down().north(), airesolido); worldIn.setBlockState(centro.down().south(), airesolido); } ; break; case 5: { // este worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.EAST)); worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.EAST)); IBlockState airesolido = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.EAST); worldIn.setBlockState(centro.up(), airesolido); worldIn.setBlockState(centro.up().north(), airesolido); worldIn.setBlockState(centro.up().south(), airesolido); worldIn.setBlockState(centro.down(), airesolido); worldIn.setBlockState(centro.down().north(), airesolido); worldIn.setBlockState(centro.down().south(), airesolido); } ; break; } } // #########################################################################3 //Block allowed to ignore when set the door in the world static boolean isValidBlock(IBlockState blkst) { Block blk = blkst.getBlock(); if (blk == MercenaryModBlocks.puerta3x3I) { return true; } if (blk == MercenaryModBlocks.puerta3x3D) { return true; } if (blk == MercenaryModBlocks.blancoPuerta3x3) { return true; } if (blk == MercenaryModBlocks.aireSolido00) { return true; } if (blk == Blocks.air) { return true; } if (blk == Blocks.water) { return true; } if (blk == Blocks.flowing_water) { return true; } if (blk == Blocks.lava) { return true; } if (blk == Blocks.flowing_lava) { return true; } return false; } @Override public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { } @Override public void toggleDoor(World worldIn, BlockPos pos, boolean open) { } // ###########################################################3 @Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { } @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { System.out.println("############# onBlockPlacedBy="); // getFacingFromEntity(worldIn, pos, placer)); // System.out.println(" pos=" + pos); if (sePuedeColocar(worldIn, pos.up(), state)) // if (!worldIn.isRemote) { IBlockState puertaState = worldIn.getBlockState(pos); worldIn.setBlockToAir(pos); worldIn.setBlockState(pos.up(), puertaState); int centroFacing = getFacingIfValidBlock(puertaState); if (centroFacing > -1) { BlockPos id[] = getIzqYDer(centroFacing, pos.up()); if (id.length > 1) { BlockPos izquier = id[0]; BlockPos derecha = id[1]; cerrar(worldIn, izquier, pos.up(), derecha); } } } else { worldIn.setBlockToAir(pos); if (!worldIn.isRemote) { worldIn.spawnEntityInWorld(new EntityItem(worldIn, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(state.getBlock(), 1, 0))); } } } // ###########################################################3 @Override public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { System.out.println("$$$$$$$$$$ onBlockPlaced"); return this.getDefaultState().withProperty(FACING, getFacingFromEntity(worldIn, pos, placer)); } // ###########################################################3 @Override public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { IBlockState iblockstate = worldIn.getBlockState(pos); float f = 0.25F; EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); if (enumfacing != null) { switch (blancoPuerta3x3.SwitchEnumFacing.FACING_LOOKUP[enumfacing.ordinal()]) { case 1: // up this.setBlockBounds(0.0F, 0.60F, 0.0F, 1.0F, 0.9F, 1.0F); break; case 2: // down this.setBlockBounds(0.0F, 0.1F, 0.0F, 1.0F, 0.40F, 1.0F); break; case 3: // north this.setBlockBounds(0.0F, 0.0F, 0.60F, 1.0F, 1.0F, 0.9F); break; case 4: // south this.setBlockBounds(0.0F, 0.0F, 0.1F, 1.0F, 1.0F, 0.40F); break; case 5: // west this.setBlockBounds(0.60F, 0.0F, 0.0F, 0.9F, 1.0F, 1.0F); break; case 6: // east this.setBlockBounds(0.1F, 0.0F, 0.0F, 0.40F, 1.0F, 1.0F); } } else { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } // this.setBlockBounds(0.2F, 0.0F, 0.2F, 0.8F, 0.6F, 0.8F); } // ###########################################################3 @Override public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) { // boolean open = ((Boolean)state.getValue(OPEN)).booleanValue(); EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); int facing = 0; double x = (double) pos.getX(); double y = (double) pos.getY(); double z = (double) pos.getZ(); double xi = x + 1D; double yi = y + 1D; double zi = z + 1D; AxisAlignedBB bb = new AxisAlignedBB(x, y, z, xi, yi, zi); if (enumfacing != null) { facing = enumfacing.getIndex(); switch (blancoPuerta3x3.SwitchEnumFacing.FACING_LOOKUP[enumfacing.ordinal()]) // { case 1: // up bb = new AxisAlignedBB(x, y + 0.60D, z, xi, yi, zi); break; case 2: // down bb = new AxisAlignedBB(x, y, z, xi, yi - 0.6D, zi); break; case 3: // north bb = new AxisAlignedBB(x, y, z + 0.6D, xi, yi, zi); break; case 4: // sur bb = new AxisAlignedBB(x, y, z, xi, yi, zi - 0.6D); break; case 5: // oeste bb = new AxisAlignedBB(x + 0.6D, y, z, xi, yi, zi); break; case 6: // este bb = new AxisAlignedBB(x, y, z, xi - 0.6D, yi, zi); } } // i need the open property working before i could fix this return null;// bb; } // ###########################################################3 @Override public void setBlockBoundsForItemRender() { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } // ###########################################################3 // @Override public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn) { if (MathHelper.abs((float) entityIn.posX - (float) clickedBlock.getX()) < 2.0F && MathHelper.abs((float) entityIn.posZ - (float) clickedBlock.getZ()) < 2.0F) { double d0 = entityIn.posY + (double) entityIn.getEyeHeight(); /* * if (d0 - (double)clickedBlock.getY() > 2.0D) { return * EnumFacing.UP; } * * if ((double)clickedBlock.getY() - d0 > 0.0D) { return * EnumFacing.DOWN; } */ } return entityIn.getHorizontalFacing().getOpposite(); } // ###########################################################3 @SideOnly(Side.CLIENT) public IBlockState getStateForEntityRender(IBlockState state) { return this.getDefaultState().withProperty(FACING, EnumFacing.EAST); } // ###########################################################3 protected BlockState createBlockState() { // return new BlockState(this, new IProperty[] { FACING, OPEN }); return new BlockState(this, new IProperty[] { HALF, FACING, OPEN, HINGE, POWERED }); } // ###########################################################3 /** * Convert the BlockState into the correct metadata value */ @Override public int getMetaFromState(IBlockState state) { /* byte b0 = 0; int i = b0 | ((EnumFacing) state.getValue(FACING)).getIndex(); return i; */ return 0; } // #################################################################################################3 /** * Convert the given metadata into a BlockState for this Block */ @Override public IBlockState getStateFromMeta(int meta) { //return this.getDefaultState(); switch (meta) { case 1: return this.getDefaultState().withProperty(FACING, EnumFacing.UP); // up case 2: return this.getDefaultState().withProperty(FACING, EnumFacing.DOWN);// down default: return this.getDefaultState().withProperty(FACING, EnumFacing.NORTH); // norte case 4: return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH);// sur case 5: return this.getDefaultState().withProperty(FACING, EnumFacing.WEST);// oeste case 6: return this.getDefaultState().withProperty(FACING, EnumFacing.EAST);// este } } // #################################################################################################3 static final class SwitchEnumFacing { static final int[] FACING_LOOKUP = new int[EnumFacing.values().length]; private static final String __OBFID = "CL_00002037"; static { try { FACING_LOOKUP[EnumFacing.DOWN.ordinal()] = 1; } catch (NoSuchFieldError var6) { ; } try { FACING_LOOKUP[EnumFacing.UP.ordinal()] = 2; } catch (NoSuchFieldError var5) { ; } try { FACING_LOOKUP[EnumFacing.NORTH.ordinal()] = 3; } catch (NoSuchFieldError var4) { ; } try { FACING_LOOKUP[EnumFacing.SOUTH.ordinal()] = 4; } catch (NoSuchFieldError var3) { ; } try { FACING_LOOKUP[EnumFacing.WEST.ordinal()] = 5; } catch (NoSuchFieldError var2) { ; } try { FACING_LOOKUP[EnumFacing.EAST.ordinal()] = 6; } catch (NoSuchFieldError var1) { ; } } } // ###########################################################3 }// fin de la clase
  8. in teresting in mi render model a positive value in GlStateManager.translate(0.0F, alt , 0.0F); causes the entity to go down, the other thing is mi values are not so high for example mi mob of 4M //4.M case 9:{ f6 = 2.00F ; alt = -0.75F; };break; a 4 as you have in the code must set the entity very deep down in the ground so your render model must be diferent from the mine //################################################################################################################# /** * Sets the models various rotation angles then renders the model. */ @Override public void render(Entity merEntity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { //System.out.println("render()"); this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, merEntity); GlStateManager.pushMatrix(); if (this.isChild) { float f6 = 2.0F; GlStateManager.scale(1.5F / f6, 1.5F / f6, 1.5F / f6); GlStateManager.translate(0.0F, 16.0F * p_78088_7_, 0.0F); this.bipedHead.render(p_78088_7_); GlStateManager.popMatrix(); GlStateManager.pushMatrix(); GlStateManager.scale(1.0F / f6, 1.0F / f6, 1.0F / f6); GlStateManager.translate(0.0F, 24.0F * p_78088_7_, 0.0F); this.exclamacionIcon.render(p_78088_7_); this.bipedBody.render(p_78088_7_); this.bipedRightArm.render(p_78088_7_); this.bipedLeftArm.render(p_78088_7_); this.bipedRightLeg.render(p_78088_7_); this.bipedLeftLeg.render(p_78088_7_); this.bipedHeadwear.render(p_78088_7_); this.biPhalous_A00.render(p_78088_7_); this.biPhalous_B00.render(p_78088_7_); this.biPhalous_C00.render(p_78088_7_); this.biPhalous_D00.render(p_78088_7_); } else { if (merEntity instanceof aldeanoMercenario ){ aldeanoMercenario merc = (aldeanoMercenario) merEntity; //lrsb = merc.getDataWatcher().getWatchableObjectInt(23); lrsb = merc.getLrsb(); } if (merEntity instanceof zombieMercenario ){ zombieMercenario merc = (zombieMercenario) merEntity; //lrsb = merc.getDataWatcher().getWatchableObjectInt(23); lrsb = merc.getLrsb(); } if (merEntity instanceof zombieMercenarioE ){ zombieMercenarioE merc = (zombieMercenarioE) merEntity; //lrsb = merc.getDataWatcher().getWatchableObjectInt(23); lrsb = merc.getLrsb(); } tamaño = (byte) ((lrsb % 10000000 ) / 1000000 ); float f6 = 0.0F ; float alt = 0.0F; switch(tamaño) { //1.5M case 1:{ f6 = 0.75F ; alt = 0.5F ; };break; //1.624M case 2:{ f6 = 0.812F ; alt = 0.4F ; };break; //1.75M case 3:{ f6 = 0.875F ; alt = 0.2F ; };break; //1.87M case 4:{ f6 = 0.9375F; alt = 0.05F ; };break; //2.00M default:{ f6 = 1.0F ; alt = 0.00F ; };break; //2.25M case 6:{ f6 = 1.125F ; alt = -0.15F; };break; //2.5M case 7:{ f6 = 1.25F ; alt = -0.3F ; };break; //3.0M case 8:{ f6 = 1.5F ; alt = -0.5F ; };break; //4.M case 9:{ f6 = 2.00F ; alt = -0.75F; };break; //7M case 10:{ f6 = 3.5F ; alt = -1.00F; };break; } GlStateManager.scale(1.0F * f6, 1.0F * f6, 1.0F * f6); GlStateManager.translate(0.0F, alt , 0.0F); if (merEntity.isSneaking()) { GlStateManager.translate(0.0F, alt + 0.2F, 0.0F); } this.exclamacionIcon.render(p_78088_7_); this.bipedHead.render(p_78088_7_); this.bipedBody.render(p_78088_7_); this.bipedRightArm.render(p_78088_7_); this.bipedLeftArm.render(p_78088_7_); this.villagerArms.render(p_78088_7_); this.bipedRightLeg.render(p_78088_7_); this.bipedLeftLeg.render(p_78088_7_); this.bipedHeadwear.render(p_78088_7_); this.biPhalous_A00.render(p_78088_7_); this.biPhalous_B00.render(p_78088_7_); this.biPhalous_C00.render(p_78088_7_); this.biPhalous_D00.render(p_78088_7_); } GlStateManager.popMatrix();
  9. if the reder works the de same in 1.8.9 as 1.8 you must change the size and respect to dis you must change also the translation to fix your render position, in 1.8 i beeen creating zombies whith diferents sizes form 1.5M to 7M and was a pain i could'n get a formula to calculate it dinamically and end fixing every size and translation at hand f6 is the scaling factor for the render and alt is the heigth the entity must be render whith relation to the ground GlStateManager.scale(1.0F * f6, 1.0F * f6, 1.0F * f6); GlStateManager.translate(0.0F, alt , 0.0F);
  10. if ound something contradictory ut still could make it work in the BlockFenceGate they are declaring bounding from 1.5 high but this king of bounding is not visible so not know if it is working or not public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) { if (((Boolean)state.getValue(OPEN)).booleanValue()) { return null; } else { EnumFacing.Axis axis = ((EnumFacing)state.getValue(FACING)).getAxis(); return axis == EnumFacing.Axis.Z ? new AxisAlignedBB((double)pos.getX(), (double)pos.getY(), (double)((float)pos.getZ() + 0.375F), (double)(pos.getX() + 1), (double)((float)pos.getY() + 1.5F), (double)((float)pos.getZ() + 0.625F)) : new AxisAlignedBB((double)((float)pos.getX() + 0.375F), (double)pos.getY(), (double)pos.getZ(), (double)((float)pos.getX() + 0.625F), (double)((float)pos.getY() + 1.5F), (double)(pos.getZ() + 1)); } } but could be just an error from the coder let behind
  11. yap i think it could be posible coze in the block json you can make models up to 3x3x3, actualy this door is the centerBlock + leftDoorBlock +RigthDoorBlock + 6X aireSolido00 blocks fillng the space the trouble is some how mobs get througth the close door, i think coulbe solveit playing whith the bounding boxes from the blocks ### is some how some way to repeel or avoid the mobs to get trhougth the close door ?? but simple not entityes nor whitchcrafts all of the door blocks use this same setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) values the only pasable is the center Block package mercenarymod.blocks.multitextura; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Random; import org.apache.logging.log4j.core.config.Property; import com.google.common.collect.Lists; import mercenarymod.Mercenary; import mercenarymod.blocks.MercenaryModBlocks; import mercenarymod.entidades.demeUn; import mercenarymod.items.MercenaryModItems; import mercenarymod.tileentity.ModTileEntity; import mercenarymod.tileentity.simpleTileEntity; import net.minecraft.block.Block; import net.minecraft.block.BlockButton; import net.minecraft.block.BlockRedstoneWire; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import mercenarymod.utilidades.chat; import mercenarymod.utilidades.util; import net.minecraft.entity.EntityLivingBase; public class aireSolido00 extends Block { public static final PropertyDirection FACING = PropertyDirection.create("facing"); public aireSolido00() { super(Material.wood); String name = "aireSolido00"; setUnlocalizedName(Mercenary.MODID + "_" + name); GameRegistry.registerBlock(this, name); setCreativeTab(Mercenary.herramientas); this.setHardness(15.0F); this.setResistance(2.0F); } /** * Called when a neighboring block changes. */ public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { if (!worldIn.isRemote) { } } //###########################################################3 public Item getItemDropped(IBlockState state, Random rand, int fortune) { return null; //Item.getItemFromBlock(MercenaryModBlocks.C4_blocke); } //###########################################################3 public boolean isOpaqueCube() { return false; } public boolean isFullCube() { return false; } @SideOnly(Side.CLIENT) public EnumWorldBlockLayer getBlockLayer() { return EnumWorldBlockLayer.CUTOUT; } @Override public boolean isPassable(IBlockAccess worldIn, BlockPos pos) { return false; } //###########################################################3 /* public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { return false; } */ // #########################################################################3 public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { worldIn.setBlockState(pos, state.withProperty(FACING, getFacingFromEntity(worldIn, pos, placer)), 2); } //###########################################################3 public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return this.getDefaultState().withProperty(FACING, getFacingFromEntity(worldIn, pos, placer) ); } //###########################################################3 public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { IBlockState iblockstate = worldIn.getBlockState(pos); float f = 0.25F; EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(FACING); if (enumfacing != null) { switch (aireSolido00.SwitchEnumFacing.FACING_LOOKUP[enumfacing.ordinal()]) { case 1: this.setBlockBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); break; case 2: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); break; case 3: this.setBlockBounds(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F); break; case 4: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); break; case 5: this.setBlockBounds(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); break; case 6: this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); } } else { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } //this.setBlockBounds(0.2F, 0.0F, 0.2F, 0.8F, 0.6F, 0.8F); } //###########################################################3 public void setBlockBoundsForItemRender() { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } //###########################################################3 public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn) { if (MathHelper.abs((float)entityIn.posX - (float)clickedBlock.getX()) < 2.0F && MathHelper.abs((float)entityIn.posZ - (float)clickedBlock.getZ()) < 2.0F) { double d0 = entityIn.posY + (double)entityIn.getEyeHeight(); if (d0 - (double)clickedBlock.getY() > 2.0D) { return EnumFacing.UP; } if ((double)clickedBlock.getY() - d0 > 0.0D) { return EnumFacing.DOWN; } } return entityIn.getHorizontalFacing().getOpposite(); } //###########################################################3 public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { return false; } //###########################################################3 protected BlockState createBlockState() { return new BlockState(this, new IProperty[] {FACING}); } //###########################################################3 //###########################################################3 public int getMetaFromState(IBlockState state) { EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); int facing = enumfacing.getIndex(); return facing; } //#################################################################################################3 /** * Convert the given metadata into a BlockState for this Block */ public IBlockState getStateFromMeta(int meta) { switch (meta) { case 1: return this.getDefaultState().withProperty(FACING, EnumFacing.UP); //up case 2: return this.getDefaultState().withProperty(FACING, EnumFacing.DOWN);//down default: return this.getDefaultState().withProperty(FACING, EnumFacing.NORTH ); //norte case 4: return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH );//sur case 5: return this.getDefaultState().withProperty(FACING, EnumFacing.WEST );//oeste case 6: return this.getDefaultState().withProperty(FACING, EnumFacing.EAST );//este } } //#################################################################################################3 static final class SwitchEnumFacing { static final int[] FACING_LOOKUP = new int[EnumFacing.values().length]; private static final String __OBFID = "CL_00002037"; static { try { FACING_LOOKUP[EnumFacing.DOWN.ordinal()] = 1; } catch (NoSuchFieldError var6) { ; } try { FACING_LOOKUP[EnumFacing.UP.ordinal()] = 2; } catch (NoSuchFieldError var5) { ; } try { FACING_LOOKUP[EnumFacing.NORTH.ordinal()] = 3; } catch (NoSuchFieldError var4) { ; } try { FACING_LOOKUP[EnumFacing.SOUTH.ordinal()] = 4; } catch (NoSuchFieldError var3) { ; } try { FACING_LOOKUP[EnumFacing.WEST.ordinal()] = 5; } catch (NoSuchFieldError var2) { ; } try { FACING_LOOKUP[EnumFacing.EAST.ordinal()] = 6; } catch (NoSuchFieldError var1) { ; } } } //###########################################################3 }//fin de la clase
  12. ya got it i found i miss this method in mi block // ###########################################################3 protected BlockState createBlockState() { return new BlockState(this, new IProperty[] { FACING, OPEN }); } // ###########################################################3 is now, well not crashing soo i leave ths as solved
  13. good nigths i been working in a custom door from 3x3 size and alredy have it but it has some issues an as the morphy's law dictates the day of the demostration it fails in this case it works, one of the troubles is than normally zombies can pass the door after a little effort, but this time only one little zombies goes througth the closes door this door i made feels innecesary complex there is a control block in the center that open an closes the door two size door blocks draw left and rigth door and i made an invisible block to block the pass filling the empty space around the control center block but still mob get througth the door soo really is not working, and entityRayTrace methods sees througth the door soo mi mobs atack like there where not i door at all, soo this is not a fully solid block soo all this week work is wortless i wanna make it simple i wanna make this door only one center block and this block must has a CollisionBoundingBox as big as an 3x3x3 area entityRayTrace must be unabble to see througth this block, and mobs must not be able to pase througth when the door is close i read i can extend the block CollisionBoundingBox but the guide is for 1.6 and some methods are not anymore in 1.8 ore has diferent names as i try it seems not posible to extends bounding far than 1M block so there must be trick http://www.minecraftforge.net/forum/index.php?topic=9982.0 #### someone could tell me how to make a big collision bounding for this door block in 1.8 sorry for the long explanation english is not native lnguague
  14. i have done something like thath you must create a class based on the entity wolf class and if you wanna this creature to use bows and ranged weapons it must implements IRangedAttackMob
  15. good days i been trying to make a custome door fro 3x3 soo this must have two block properties Facing and Open but this two poperties dont seem to get along went set on same block it dont crash just stuck the game in the load process "Loading - Initializing mods Phase 1" whith error in th console java.lang.IllegalArgumentException: Cannot set property PropertyBool{name=open, clazz=class java.lang.Boolean, values=[true, false]} as it does not exist in BlockState{block=modmercenario:puerta3x3t00, properties=[facing]} at net.minecraft.block.state.BlockState$StateImplementation.withProperty(Unknown Source) ~[forgeSrc-1.8-11.14.3.1520.jar:?] the intersting part is i alredy have declare the two properties facing and opent in the constructor of the block, i doo this from what i see inside the vainilla doors and seems not to work as i think its works [Console output redirected to file:/home/usuario/eclipseOutput.txt] Picked up _JAVA_OPTIONS: -Xmx2g Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release [15:52:41] [main/INFO] [GradleStart]: Extra: [] [15:52:41] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, /home/usuario/.gradle/caches/minecraft/assets, --assetIndex, 1.8, --accessToken{REDACTED}, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker] [15:52:41] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [15:52:41] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [15:52:41] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker [15:52:41] [main/INFO] [FML]: Forge Mod Loader version 11.14.3.1520 for Minecraft 1.8 loading [15:52:41] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_65, running on Linux:amd64:3.16.0-4-amd64, installed at /opt/jdk1.8.0_65/jre [15:52:41] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [15:52:41] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [15:52:41] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [15:52:41] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [15:52:41] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [15:52:41] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [15:52:41] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [15:52:43] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [15:52:43] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [15:52:43] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [15:52:43] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [15:52:43] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [15:52:43] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [15:52:45] [Client thread/INFO]: Setting user: Player892 [15:52:50] [Client thread/INFO]: LWJGL Version: 2.9.1 [15:52:51] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:-1]: ---- Minecraft Crash Report ---- // Don't do that. Time: 31/01/16 03:52 PM Description: Loading screen debug info This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.8 Operating System: Linux (amd64) version 3.16.0-4-amd64 Java Version: 1.8.0_65, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 839138408 bytes (800 MB) / 1056309248 bytes (1007 MB) up to 2130051072 bytes (2031 MB) JVM Flags: 4 total; -Xincgc -Xmx1024M -Xms1024M -Xmx2g IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.4.0 NVIDIA 340.93' Renderer: 'GeForce GT 520/PCIe/SSE2' [15:52:51] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [15:52:51] [Client thread/INFO] [FML]: MinecraftForge v11.14.3.1520 Initialized [15:52:51] [Client thread/INFO] [FML]: Replaced 204 ore recipies [15:52:52] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [15:52:52] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer [15:52:52] [Client thread/INFO] [FML]: Searching /home/usuario/Modding/forge-1.8-1520-modmercenario/run/mods for mods [15:52:52] [Client thread/INFO] [modmercenario]: Mod modmercenario is missing the required element 'name'. Substituting modmercenario [15:52:57] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load [15:52:58] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, modmercenario] at CLIENT [15:52:58] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, modmercenario] at SERVER [15:52:58] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:modmercenario [15:52:59] [Client thread/INFO] [FML]: Processing ObjectHolder annotations [15:52:59] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations [15:52:59] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations [15:52:59] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations [15:52:59] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [15:53:02] [Client thread/INFO] [FML]: Applying holder lookups [15:53:02] [Client thread/INFO] [FML]: Holder lookups applied [15:53:02] [Client thread/INFO] [FML]: Injecting itemstacks [15:53:02] [Client thread/INFO] [FML]: Itemstack injection complete [15:53:02] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue [15:53:02] [Client thread/ERROR] [FML]: States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCH FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.3.1520.jar) UCH Forge{11.14.3.1520} [Minecraft Forge] (forgeSrc-1.8-11.14.3.1520.jar) UCE modmercenario{1.8} [modmercenario] (bin) [15:53:02] [Client thread/ERROR] [FML]: The following problems were captured during this phase [15:53:02] [Client thread/ERROR] [FML]: Caught exception from modmercenario java.lang.IllegalArgumentException: Cannot set property PropertyBool{name=open, clazz=class java.lang.Boolean, values=[true, false]} as it does not exist in BlockState{block=modmercenario:puerta3x3t00, properties=[facing]} at net.minecraft.block.state.BlockState$StateImplementation.withProperty(Unknown Source) ~[forgeSrc-1.8-11.14.3.1520.jar:?] at mercenarymod.blocks.multitextura.puertas.puerta3x3t00.<init>(puerta3x3t00.java:65) ~[bin/:?] at mercenarymod.blocks.MercenaryModBlocks.init(MercenaryModBlocks.java:80) ~[bin/:?] at mercenarymod.Mercenary.preInit(Mercenary.java:214) ~[bin/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_65] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_65] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_65] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_65] at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(Unknown Source) ~[forgeSrc-1.8-11.14.3.1520.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_65] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_65] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_65] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_65] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(Unknown Source) ~[forgeSrc-1.8-11.14.3.1520.jar:?] at net.minecraftforge.fml.common.LoadController.propogateStateMessage(Unknown Source) ~[forgeSrc-1.8-11.14.3.1520.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_65] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_65] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_65] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_65] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.distributeStateMessage(Unknown Source) [LoadController.class:?] at net.minecraftforge.fml.common.Loader.preinitializeMods(Unknown Source) [Loader.class:?] at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(Unknown Source) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Unknown Source) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Unknown Source) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Unknown Source) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_65] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_65] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_65] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_65] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_65] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_65] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_65] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_65] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] [15:53:02] [Client thread/ERROR] [LaunchWrapper]: Unable to launch java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_65] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_65] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_65] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_65] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_65] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_65] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_65] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_65] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] Caused by: java.lang.NullPointerException at net.minecraft.crash.CrashReportCategory.firstTwoElementsOfStackTraceMatch(Unknown Source) ~[CrashReportCategory.class:?] at net.minecraft.crash.CrashReport.makeCategoryDepth(Unknown Source) ~[CrashReport.class:?] at net.minecraft.crash.CrashReport.makeCategory(Unknown Source) ~[CrashReport.class:?] at net.minecraft.client.Minecraft.run(Unknown Source) ~[Minecraft.class:?] at net.minecraft.client.main.Main.main(Unknown Source) ~[Main.class:?] ... 12 more Exception in thread "Client thread" [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: java.lang.reflect.InvocationTargetException [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.reflect.Method.invoke(Method.java:497) [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at GradleStart.main(Unknown Source) [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: Caused by: net.minecraftforge.fml.relauncher.FMLSecurityManager$ExitTrappedException [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraftforge.fml.relauncher.FMLSecurityManager.checkPermission(Unknown Source) [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.SecurityManager.checkExit(SecurityManager.java:761) [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.Runtime.exit(Runtime.java:107) [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at java.lang.System.exit(System.java:971) [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:138) [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [15:53:02] [Client thread/INFO] [sTDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: ... 6 more this is mi door class still WIP package mercenarymod.blocks.multitextura.puertas; import java.util.Random; import org.apache.logging.log4j.core.config.Property; import mercenarymod.Mercenary; import mercenarymod.blocks.MercenaryModBlocks; import mercenarymod.items.MercenaryModItems; import net.minecraft.block.Block; import net.minecraft.block.BlockCauldron; import net.minecraft.block.BlockDirectional; import net.minecraft.block.BlockDoor; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.util.MathHelper; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import mercenarymod.utilidades.chat; import net.minecraft.entity.EntityLivingBase; public class puerta3x3t00 extends BlockDirectional //Block { public static final PropertyDirection FACING = PropertyDirection.create("facing"); public static final PropertyBool OPEN = PropertyBool.create("open"); private IBlockState defaultBlockState; public puerta3x3t00() { // super(Material.wood); super(Material.wood); String name = "puerta3x3t00"; setUnlocalizedName(Mercenary.MODID + "_" + name); GameRegistry.registerBlock(this, name); setCreativeTab(Mercenary.herramientas); this.setDefaultState(this.blockState.getBaseState().withProperty(OPEN, Boolean.valueOf(false) ).withProperty(FACING, EnumFacing.NORTH) ); //this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH) ) ; //this.setDefaultState( this.getDefaultState().withProperty(OPEN, Boolean.valueOf(true)) ); this.setHardness(6.0F); this.setResistance(2.0F); // maxStackSize = 64; } // ###########################################################3 // ###########################################################3 @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) { return Item.getItemFromBlock(MercenaryModBlocks.puerta3x3t00); } // ###########################################################3 @Override public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) { removerPuerta(worldIn, pos, worldIn.getBlockState(pos)); } // ###########################################################3 @Override public void onBlockExploded(World worldIn, BlockPos pos, Explosion explosion) { // removerPuerta(worldIn, pos, worldIn.getBlockState(pos) ); // worldIn.setBlockToAir(pos); this.onBlockDestroyedByExplosion(worldIn, pos, explosion); } // #################################################################################################3 @Override public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) { removerPuerta(worldIn, pos, state); } // #################################################################################################3 public void removerPuerta(World worldIn, BlockPos pos, IBlockState state) { int posX = pos.getX(); int posY = pos.getY(); int posZ = pos.getZ(); BlockPos dpos = pos; IBlockState dbst = state; for (int dx = (posX - 1); dx < (posX + 2); dx++) { for (int dy = (posY - 1); dy < (posY + 2); dy++) { for (int dz = (posZ - 1); dz < (posZ + 2); dz++) { dpos = new BlockPos(dx, dy, dz); dbst = worldIn.getBlockState(dpos); if (this.isValidBlock(dbst)) { worldIn.destroyBlock(dpos, false); } } } } } // #################################################################################################3 public boolean sePuedeColocar(World worldIn, BlockPos centro, IBlockState state) { boolean colocable = true; IBlockState centroBst = worldIn.getBlockState(centro); EnumFacing centroEnum = (EnumFacing) centroBst.getValue(FACING); int centroFacing = -1; if (centroEnum != null) { centroFacing = centroEnum.getIndex(); } BlockPos izquier = centro; BlockPos derecha = centro; BlockPos dpos = centro; Block bizq = MercenaryModBlocks.puerta3x3I; Block bder = MercenaryModBlocks.puerta3x3D; switch (centroFacing) { case 1: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); // up break; case 2: case 3: // sur o norte izquier = centro.east(); // up(2). derecha = centro.west(); // up(2). break; case 4: case 5: // oeste // este izquier = centro.north(); // up(2). derecha = centro.south(); // up(2). break; } //System.out.println("@@ ntroFacing=" + centroFacing); for (int i = 0; i < 3; i++) { for (int o = 0; o < 3; o++) { switch (o) { case 0: dpos = centro.add(0, i, 0); break; case 1: dpos = izquier.add(0, i, 0); break; case 2: dpos = derecha.add(0, i, 0); break; } // dpos = centro; //System.out.println("@@@ blocke=" + dpos + " " + worldIn.getBlockState(dpos).getBlock().getUnlocalizedName()); if (!(worldIn.isAirBlock(dpos))) { if (!(isValidBlock(worldIn.getBlockState(dpos)))) { colocable = false; } } } } //System.out.println("$##################$ sePuedeColocar=" + colocable); return colocable; } // #################################################################################################3 @Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { super.breakBlock(worldIn, pos, state); worldIn.removeTileEntity(pos); } // #################################################################################################3 // ###########################################################3 @Override public boolean isOpaqueCube() { return false; } @Override public boolean isFullCube() { return false; } @Override @SideOnly(Side.CLIENT) public EnumWorldBlockLayer getBlockLayer() { return EnumWorldBlockLayer.CUTOUT; } @Override public boolean isPassable(IBlockAccess worldIn, BlockPos pos) { return true; } // ###########################################################3 public boolean estaAbierta() { return true; } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { // if (!worldIn.isRemote) { int hand = playerIn.inventory.currentItem; //System.out.println("################### generarPuertas(World worldIn, boolean abiertas, BlockPos centro)"); generarPuertas(worldIn, false, false, pos); int facing = this.getMetaFromState(state); } return false; } // #########################################################################3 public static void generarPuertas(World worldIn, boolean cerrada, boolean abierta, BlockPos centro) { IBlockState centroBst = worldIn.getBlockState(centro); EnumFacing centroEnum = (EnumFacing) centroBst.getValue(FACING); int centroFacing = -1; if (centroEnum != null) { centroFacing = centroEnum.getIndex(); } BlockPos izquier = centro; BlockPos derecha = centro; Block bizq = MercenaryModBlocks.puerta3x3I; Block bder = MercenaryModBlocks.puerta3x3D; switch (centroFacing) { case 1: // up break; case 2: // sur izquier = centro.east(); // up(2). derecha = centro.west(); // up(2). break; case 3: // norte izquier = centro.west(); // up(2). derecha = centro.east(); // up(2). break; case 4: // este izquier = centro.north(); // up(2). derecha = centro.south(); // up(2). break; case 5: // oeste izquier = centro.south(); // up(2). derecha = centro.north(); // up(2). break; } IBlockState izquBst = worldIn.getBlockState(izquier); IBlockState dereBst = worldIn.getBlockState(derecha); int dereFacing = -1; int izquFacing = -1; if (isValidBlock(izquBst) & isValidBlock(dereBst)) { EnumFacing izquEnum = (EnumFacing) izquBst.getValue(FACING); EnumFacing dereEnum = (EnumFacing) dereBst.getValue(FACING); if (izquEnum != null) { izquFacing = izquEnum.getIndex(); } if (dereEnum != null) { dereFacing = dereEnum.getIndex(); } } //System.out.println("centroFacing" + centroFacing); //System.out.println("izquFacing" + izquFacing); //System.out.println("dereFacing" + dereFacing); if (cerrada) { izquFacing = 8; } switch (centroFacing) { // ################################################ case 2: // sur if (abierta) { izquFacing = 2; } switch (izquFacing) { // la puerta esta cerrada abrirla case 2: worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.EAST)); worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.WEST)); IBlockState aire = Blocks.air.getDefaultState(); IBlockState airesolidoW = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.WEST); IBlockState airesolidoE = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.EAST); worldIn.setBlockState(centro.up(), aire); worldIn.setBlockState(centro.up().west(), airesolidoE); worldIn.setBlockState(centro.up().east(), airesolidoW); worldIn.setBlockState(centro.down(), aire); worldIn.setBlockState(centro.down().west(), airesolidoE); worldIn.setBlockState(centro.down().east(), airesolidoW); ; break; // la puerta esta abierta cerrarla default: worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.NORTH)); worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.NORTH)); IBlockState airesolido = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.NORTH); worldIn.setBlockState(centro.up(), airesolido); worldIn.setBlockState(centro.up().west(), airesolido); worldIn.setBlockState(centro.up().east(), airesolido); worldIn.setBlockState(centro.down(), airesolido); worldIn.setBlockState(centro.down().west(), airesolido); worldIn.setBlockState(centro.down().east(), airesolido); ; break; } ; break; // ################################################ case 3: // norte if (abierta) { izquFacing = 3; } switch (izquFacing) { // la puerta esta cerrada abrirla case 3: worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.WEST)); worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.EAST)); IBlockState aire = Blocks.air.getDefaultState(); IBlockState airesolidoW = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.WEST); IBlockState airesolidoE = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.EAST); worldIn.setBlockState(centro.up(), aire); worldIn.setBlockState(centro.up().west(), airesolidoE); worldIn.setBlockState(centro.up().east(), airesolidoW); worldIn.setBlockState(centro.down(), aire); worldIn.setBlockState(centro.down().west(), airesolidoE); worldIn.setBlockState(centro.down().east(), airesolidoW); ; break; // la puerta esta abierta cerrarla default: worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.SOUTH)); worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.SOUTH)); IBlockState airesolido = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); worldIn.setBlockState(centro.up(), airesolido); worldIn.setBlockState(centro.up().west(), airesolido); worldIn.setBlockState(centro.up().east(), airesolido); worldIn.setBlockState(centro.down(), airesolido); worldIn.setBlockState(centro.down().west(), airesolido); worldIn.setBlockState(centro.down().east(), airesolido); ; break; } ; break; // ################################################ case 4: // este if (abierta) { izquFacing = 4; } switch (izquFacing) { // la puerta esta cerrada abrirla case 4: worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.NORTH)); worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.SOUTH)); IBlockState aire = Blocks.air.getDefaultState(); IBlockState airesolidoN = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.NORTH); IBlockState airesolidoS = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); worldIn.setBlockState(centro.up(), aire); worldIn.setBlockState(centro.up().north(), airesolidoS); worldIn.setBlockState(centro.up().south(), airesolidoN); worldIn.setBlockState(centro.down(), aire); worldIn.setBlockState(centro.down().north(), airesolidoS); worldIn.setBlockState(centro.down().south(), airesolidoN); ; break; // la puerta esta abierta cerrarla default: worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.WEST)); worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.WEST)); IBlockState airesolido = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.WEST); worldIn.setBlockState(centro.up(), airesolido); worldIn.setBlockState(centro.up().north(), airesolido); worldIn.setBlockState(centro.up().south(), airesolido); worldIn.setBlockState(centro.down(), airesolido); worldIn.setBlockState(centro.down().north(), airesolido); worldIn.setBlockState(centro.down().south(), airesolido); ; break; } ; break; // ################################################ case 5: // oeste if (abierta) { izquFacing = 5; } switch (izquFacing) { // la puerta esta cerrada abrirla case 5: worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.SOUTH)); worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.NORTH)); IBlockState aire = Blocks.air.getDefaultState(); IBlockState airesolidoN = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.NORTH); IBlockState airesolidoS = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); worldIn.setBlockState(centro.up(), aire); worldIn.setBlockState(centro.up().north(), airesolidoS); worldIn.setBlockState(centro.up().south(), airesolidoN); worldIn.setBlockState(centro.down(), aire); worldIn.setBlockState(centro.down().north(), airesolidoS); worldIn.setBlockState(centro.down().south(), airesolidoN); ; break; // la puerta esta abierta cerrarla default: worldIn.setBlockState(izquier, MercenaryModBlocks.puerta3x3I.getDefaultState().withProperty(FACING, EnumFacing.EAST)); worldIn.setBlockState(derecha, MercenaryModBlocks.puerta3x3D.getDefaultState().withProperty(FACING, EnumFacing.EAST)); IBlockState airesolido = MercenaryModBlocks.aireSolido00.getDefaultState().withProperty(FACING, EnumFacing.EAST); worldIn.setBlockState(centro.up(), airesolido); worldIn.setBlockState(centro.up().north(), airesolido); worldIn.setBlockState(centro.up().south(), airesolido); worldIn.setBlockState(centro.down(), airesolido); worldIn.setBlockState(centro.down().north(), airesolido); worldIn.setBlockState(centro.down().south(), airesolido); ; break; } ; break; } } // #########################################################################3 static boolean isValidBlock(IBlockState blkst) { Block blk = blkst.getBlock(); if (blk == MercenaryModBlocks.puerta3x3I) { return true; } if (blk == MercenaryModBlocks.puerta3x3D) { return true; } if (blk == MercenaryModBlocks.puerta3x3t00) { return true; } if (blk == MercenaryModBlocks.aireSolido00) { return true; } if (blk == Blocks.water) { return true; } if (blk == Blocks.flowing_water) { return true; } if (blk == Blocks.lava) { return true; } if (blk == Blocks.flowing_lava) { return true; } return false; } @Override public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { } // ###########################################################3 public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { } @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { //System.out.println("############# onBlockPlacedBy=" + getFacingFromEntity(worldIn, pos, placer)); //System.out.println(" pos=" + pos); if (sePuedeColocar(worldIn, pos, state)) // if (!worldIn.isRemote) { IBlockState puertaState = worldIn.getBlockState(pos); worldIn.setBlockToAir(pos); worldIn.setBlockState(pos.up(), puertaState); generarPuertas(worldIn, true, false,pos.up()); } else { worldIn.setBlockToAir(pos); if (!worldIn.isRemote) { worldIn.spawnEntityInWorld(new EntityItem(worldIn, pos.getX(), pos.getY(), pos.getZ(), new ItemStack(state.getBlock(), 1, 0))); } } } // ###########################################################3 @Override public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return this.getDefaultState().withProperty(FACING, getFacingFromEntity(worldIn, pos, placer) ).withProperty(OPEN, false); } // ###########################################################3 @Override public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { IBlockState iblockstate = worldIn.getBlockState(pos); float f = 0.25F; EnumFacing enumfacing = (EnumFacing) iblockstate.getValue(FACING); if (enumfacing != null) { switch (puerta3x3t00.SwitchEnumFacing.FACING_LOOKUP[enumfacing.ordinal()]) { case 1: this.setBlockBounds(0.0F, 0.80F, 0.0F, 1.0F, 1.0F, 0.95F); break; case 2: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); break; case 3: this.setBlockBounds(0.0F, 0.0F, 0.80F, 1.0F, 1.0F, 0.95F); break; case 4: this.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 1.0F, 0.20F); break; case 5: this.setBlockBounds(0.80F, 0.0F, 0.0F, 0.95F, 1.0F, 1.0F); break; case 6: this.setBlockBounds(0.5F, 0.0F, 0.0F, 0.20F, 1.0F, 1.0F); } } else { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } // this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } // ###########################################################3 @Override public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) { boolean open = ((Boolean)state.getValue(OPEN)).booleanValue(); EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); double x = (double)pos.getX(); double y = (double)pos.getY(); double z = (double)pos.getZ(); float f = 0.25F; AxisAlignedBB bb = new AxisAlignedBB(x, y, z, x + 1, y+ 1, z + 1 ); if (enumfacing != null) { switch (puerta3x3t00.SwitchEnumFacing.FACING_LOOKUP[enumfacing.ordinal()]) { case 1: //up // this.setBlockBounds(0.0F, 0.80F, 0.0F, 1.0F, 1.0F, 0.95F); break; case 2: //down break; case 3: //north //this.setBlockBounds(0.0F, 0.0F, 0.80F, 1.0F, 1.0F, 0.95F); bb = new AxisAlignedBB( x-1, y, z, x+2, y+1, z+1 ); break; case 4: //sur // this.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 1.0F, 0.20F); break; case 5: //oeste // this.setBlockBounds(0.80F, 0.0F, 0.0F, 0.95F, 1.0F, 1.0F); break; case 6: //este //this.setBlockBounds(0.5F, 0.0F, 0.0F, 0.20F, 1.0F, 1.0F); } } /* if (((Boolean)state.getValue(OPEN)).booleanValue()) { return null; } else { EnumFacing.Axis axis = ((EnumFacing)state.getValue(FACING)).getAxis(); return axis == EnumFacing.Axis.Z ? new AxisAlignedBB((double)pos.getX(), (double)pos.getY(), (double)((float)pos.getZ() + 0.375F), (double)(pos.getX() + 1), (double)((float)pos.getY() + 1.5F), (double)((float)pos.getZ() + 0.625F)) : new AxisAlignedBB((double)((float)pos.getX() + 0.375F), (double)pos.getY(), (double)pos.getZ(), (double)((float)pos.getX() + 0.625F), (double)((float)pos.getY() + 1.5F), (double)(pos.getZ() + 1)); } */ return bb; } // ###########################################################3 // ###########################################################3 @Override public void setBlockBoundsForItemRender() { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } // ###########################################################3 // @Override public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn) { if (MathHelper.abs((float) entityIn.posX - (float) clickedBlock.getX()) < 2.0F && MathHelper.abs((float) entityIn.posZ - (float) clickedBlock.getZ()) < 2.0F) { double d0 = entityIn.posY + (double) entityIn.getEyeHeight(); /* * if (d0 - (double)clickedBlock.getY() > 2.0D) { return * EnumFacing.UP; } * * if ((double)clickedBlock.getY() - d0 > 0.0D) { return * EnumFacing.DOWN; } */ } return entityIn.getHorizontalFacing().getOpposite(); } // ###########################################################3 @SideOnly(Side.CLIENT) public IBlockState getStateForEntityRender(IBlockState state) { return this.getDefaultState().withProperty(FACING, EnumFacing.NORTH); } // ###########################################################3 protected BlockState createBlockState() { return new BlockState(this, new IProperty[] { FACING }); } // ###########################################################3 /** * Convert the BlockState into the correct metadata value */ @Override public int getMetaFromState(IBlockState state) { byte b0 = 0; int i = b0 | ((EnumFacing) state.getValue(FACING)).getIndex(); return i; } // #################################################################################################3 /** * Convert the given metadata into a BlockState for this Block */ @Override public IBlockState getStateFromMeta(int meta) { switch (meta) { case 1: return this.getDefaultState().withProperty(FACING, EnumFacing.UP); // up case 2: return this.getDefaultState().withProperty(FACING, EnumFacing.DOWN);// down default: return this.getDefaultState().withProperty(FACING, EnumFacing.NORTH); // norte case 4: return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH);// sur case 5: return this.getDefaultState().withProperty(FACING, EnumFacing.WEST);// oeste case 6: return this.getDefaultState().withProperty(FACING, EnumFacing.EAST);// este } } // #################################################################################################3 static final class SwitchEnumFacing { static final int[] FACING_LOOKUP = new int[EnumFacing.values().length]; private static final String __OBFID = "CL_00002037"; static { try { FACING_LOOKUP[EnumFacing.DOWN.ordinal()] = 1; } catch (NoSuchFieldError var6) { ; } try { FACING_LOOKUP[EnumFacing.UP.ordinal()] = 2; } catch (NoSuchFieldError var5) { ; } try { FACING_LOOKUP[EnumFacing.NORTH.ordinal()] = 3; } catch (NoSuchFieldError var4) { ; } try { FACING_LOOKUP[EnumFacing.SOUTH.ordinal()] = 4; } catch (NoSuchFieldError var3) { ; } try { FACING_LOOKUP[EnumFacing.WEST.ordinal()] = 5; } catch (NoSuchFieldError var2) { ; } try { FACING_LOOKUP[EnumFacing.EAST.ordinal()] = 6; } catch (NoSuchFieldError var1) { ; } } } // ###########################################################3 // #########################################################################3 // ###########################################################3 }// fin de la clase
  16. i have something public boolean attackAsMob(Entity targetP_) { ItemStack weapon = this.getHeldItem(); float swordDamageDeal = 0.0F; if (weapon != null){ if (weapon.getItem() instanceof ItemSword) { ItemSword espada = (ItemSword) weapon.getItem() ; swordDamageDeal = espada.getDamageVsEntity(); } } boolean flag = targetP_.attackEntityFrom(DamageSource.causeMobDamage(this), attackDamage + swordDamageDeal); if (flag) { this.func_174815_a(this, targetP_); } this.swingItem(); return flag;// ; } this gets the damage caused but oinly if sword i dont get how to get it for axes pickaxes spades and hoes or the stick
  17. private static Configuration configFile; private static Configuration configFile00; @EventHandler public void preInit(FMLPreInitializationEvent event) { configFile = new Configuration(event.getSuggestedConfigurationFile()); configFile00 = new Configuration(event.getSuggestedConfigurationFile(), "Number10.cfg"); //"one/two/configNumber10.cfg" //"/home/usuario/one/two/configNumber10.cfg" configFile.load(); configFile00.load(); configFile00.save(); setConfigValues(false); } how i understand this must create a second config file in the config folder named Number10.cfg or modmercenarioNumber10.cfg but neither is in the folder and also i think understand if i declare some route whithe name it must create folders inside config/ so "one/two/configNumber10.cfg" must generate something like config/one/two/configNumber10.cfg and nuthing happens definitivamente i dont geit this method loosk like something to make config file backups more than a tools to add more usable config files /** * Create a configuration file for the file given in parameter with the provided config version number. */ public Configuration(File file, String configVersion) { this.file = file; this.definedConfigVersion = configVersion; String basePath = ((File)(FMLInjectionData.data()[6])).getAbsolutePath().replace(File.separatorChar, '/').replace("/.", ""); String path = file.getAbsolutePath().replace(File.separatorChar, '/').replace("/./", "/").replace(basePath, ""); if (PARENT != null) { PARENT.setChild(path, this); isChild = true; } else { fileName = path; try { load(); } catch (Throwable e) { File fileBak = new File(file.getAbsolutePath() + "_" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + ".errored"); FMLLog.severe("An exception occurred while loading config file %s. This file will be renamed to %s " + "and a new config file will be generated.", file.getName(), fileBak.getName()); e.printStackTrace(); file.renameTo(fileBak); load(); } } }
  18. hie no not getit yet ithink is net.minecraftforge.common.config; i declare a secong config file 00 private static Configuration configFile; private static Configuration configFile00; then in the preinit() @EventHandler public void preInit(FMLPreInitializationEvent event) { // you will be able to find the config file in .minecraft/config/ and it // will be named Dummy.cfg // here our Configuration has been instantiated, and saved under the // name "config" configFile = new Configuration(event.getSuggestedConfigurationFile()); configFile00 = new Configuration(event.getSuggestedConfigurationFile()); // loading the configuration from its file configFile.load(); configFile00.load(); configFile00.save(); still having only a config file modmercenario.cfg i wass looking inside config. whith eclipse and dont something usefull, can you give me an example of config folder whith config files
  19. nigths i have a custom villager and this one can atack but like it is a vainilla villager extended it has no attackDamage value in their atributes this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D); so i have to set the damage manually to 2.0F in mi own atackAsMob method the trouble whith ths method is, i dont know hot to get the damge cause by tool/weapon held by the custom villager soo a esmeral sword do same damage than bare hands, make swict whith values asigne by mi dont sounds like a good idea // ################################################################################################################# // se ejecuta cuando hace ataque fisico normal auna criatura @Override public boolean attackEntityAsMob(Entity targetP_) { float attackDamage = 2.0F; boolean flag = targetP_.attackEntityFrom(DamageSource.causeMobDamage(this), attackDamage); if (flag) { this.func_174815_a(this, targetP_); } this.swingItem(); return false;// flag; } this seams not to be what i need MercenaryModItems.espada_acero_acero.getDamage(stack); ###?? how dou you get the damage a weapons deal when atack a mob ??
  20. good days i wanna create some ramdom structures in mod houses most of then and a pair of dungeons, i wass alredy working ointhis long time ago but infortunally i lost the code, but that ode has some troubles regarding the extructure of the data of a json file soo this time i try to store the structure data as simple int[] in mi config file and its works, but then i could not use this file to manage mi mod options i was tinking how to solve this and come to this question ?? is posible to have multi config files per mod arranged in folders to keep it clean sometime like ~/.minecraft/config/modmercenario.cfg ~/.minecraft/config/mercenarymodExtructures/house00.cfg ~/.minecraft/config/mercenarymodExtructures/house01.cfg ~/.minecraft/config/mercenarymodExtructures/house02.cfg i think i see this before but not know hot to keep the reference to the file ~/.minecraft/config/mercenarymodExtructures/ no matther where this folders end in the player operativeSystem thanks for reading this is how mi config file looks whith the test extructure inside it works but # Configuration file extructura { I:casa00 < 3 3 -18 2 -508 3 3 -18 2 -507 3 3 -18 2 -506 3 3 -18 2 -505 3 3 -18 2 -504 3 3 -18 2 -503 3 3 -18 2 -502 3 3 -18 2 -501 3 3 -18 2 -500 3 3 -18 2 -499 3 3 -18 2 -498 3 3 -18 2 -497 3 3 -18 2 -496 3 3 -18 2 -495 3 3 -18 2 -494 3 3 -18 2 -493 3 3 -18 2 -492 3 3 -18 2 -491 3 3 -18 2 -490 3 3 -18 2 -489 2 2 -18 3 -508 2 2 -18 3 -507 2 2 -18 3 -506 2 2 -18 3 -505 2 2 -18 3 -504 2 2 -18 3 -503 2 2 -18 3 -502 2 2 -18 3 -501 2 2 -18 3 -500 2 2 -18 3 -499 2 2 -18 3 -498 2 2 -18 3 -497 2 2 -18 3 -496 2 2 -18 3 -495 2 2 -18 3 -494 2 2 -18 3 -493 2 2 -18 3 -492 2 2 -18 3 -491 2 2 -18 3 -490 2 2 -18 3 -489 2 2 -17 2 -508 3 3 -17 2 -507 3 3 -17 2 -506 3 3 -17 2 -505 3 3 -17 2 -504 3 3 -17 2 -503 3 3 -17 2 -502 3 3 -17 2 -501 3 3 -17 2 -500 3 3 -17 2 -499 3 3 -17 2 -498 3 3 -17 2 -497 3 3 -17 2 -496 3 3 -17 2 -495 3 3 -17 2 -494 3 3 -17 2 -493 3 3 -17 2 -492 3 3 -17 2 -491 3 3 -17 2 -490 2 2 -17 2 -489 2 2 -17 3 -507 2 2 -17 3 -506 2 2 -17 3 -505 2 2 -17 3 -504 2 2 -17 3 -503 2 2 -17 3 -502 2 2 -17 3 -501 2 2 -17 3 -500 2 2 -17 3 -499 2 2 -17 3 -498 2 2 -17 3 -497 2 2 -17 3 -496 2 2 -17 3 -495 2 2 -17 3 -494 2 2 -17 3 -493 2 2 -17 3 -492 2 2 -17 3 -491 2 2 -17 3 -490 3 3 -16 2 -508 3 3 -16 2 -507 3 3 -16 2 -506 3 3 -16 2 -505 3 3 -16 2 -504 3 3 -16 2 -503 3 3 -16 2 -502 3 3 -16 2 -501 3 3 -16 2 -500 3 3 -16 2 -499 3 3 -16 2 -498 3 3 -16 2 -497 3 3 -16 2 -496 3 3 -16 2 -495 3 3 -16 2 -494 3 3 -16 2 -493 3 3 -16 2 -492 3 3 -16 2 -491 3 3 -16 2 -490 3 3 -16 2 -489 2 2 -16 3 -508 2 2 -16 3 -507 2 2 -16 3 -506 2 2 -16 3 -505 2 2 -16 3 -504 2 2 -16 3 -503 2 2 -16 3 -502 2 2 -16 3 -501 2 2 -16 3 -500 2 2 -16 3 -499 2 2 -16 3 -498 2 2 -16 3 -497 2 2 -16 3 -496 2 2 -16 3 -495 2 2 -16 3 -494 2 2 -16 3 -493 2 2 -16 3 -492 2 2 -16 3 -491 2 2 -16 3 -490 2 2 -16 3 -489 3 3 -15 2 -508 3 3 -15 2 -507 3 3 -15 2 -506 3 3 -15 2 -505 3 3 -15 2 -504 3 3 -15 2 -503 3 3 -15 2 -502 3 3 -15 2 -501 3 3 -15 2 -500 3 3 -15 2 -499 3 3 -15 2 -498 3 3 -15 2 -497 3 3 -15 2 -496 3 3 -15 2 -495 3 3 -15 2 -494 3 3 -15 2 -493 3 3 -15 2 -492 3 3 -15 2 -491 3 3 -15 2 -490 3 3 -15 2 -489 2 2 -15 3 -508 2 2 -15 3 -507 2 2 -15 3 -506 2 2 -15 3 -505 2 2 -15 3 -504 2 2 -15 3 -503 2 2 -15 3 -502 2 2 -15 3 -501 2 2 -15 3 -500 2 2 -15 3 -499 2 2 -15 3 -498 2 2 -15 3 -497 2 2 -15 3 -496 2 2 -15 3 -495 2 2 -15 3 -494 2 2 -15 3 -493 2 2 -15 3 -492 2 2 -15 3 -491 2 2 -15 3 -490 2 2 -15 3 -489 3 3 -14 2 -508 3 3 -14 2 -507 3 3 -14 2 -506 3 3 -14 2 -505 3 3 -14 2 -504 3 3 -14 2 -503 3 3 -14 2 -502 3 3 -14 2 -501 3 3 -14 2 -500 3 3 -14 2 -499 3 3 -14 2 -498 3 3 -14 2 -497 3 3 -14 2 -496 3 3 -14 2 -495 3 3 -14 2 -494 3 3 -14 2 -493 3 3 -14 2 -492 3 3 -14 2 -491 3 3 -14 2 -490 3 3 -14 2 -489 2 2 -14 3 -508 2 2 -14 3 -507 2 2 -14 3 -506 2 2 -14 3 -505 2 2 -14 3 -504 2 2 -14 3 -503 2 2 -14 3 -502 2 2 -14 3 -501 2 2 -14 3 -500 2 2 -14 3 -499 2 2 -14 3 -498 2 2 -14 3 -497 2 2 -14 3 -496 2 2 -14 3 -495 2 2 -14 3 -494 2 2 -14 3 -493 2 2 -14 3 -492 2 2 -14 3 -491 2 2 -14 3 -490 2 2 -14 3 -489 3 3 -13 2 -508 3 3 -13 2 -507 3 3 -13 2 -506 3 3 -13 2 -505 3 3 -13 2 -504 3 3 -13 2 -503 3 3 -13 2 -502 3 3 -13 2 -501 3 3 -13 2 -500 3 3 -13 2 -499 3 3 -13 2 -498 3 3 -13 2 -497 3 3 -13 2 -496 3 3 -13 2 -495 3 3 -13 2 -494 3 3 -13 2 -493 3 3 -13 2 -492 3 3 -13 2 -491 3 3 -13 2 -490 3 3 -13 2 -489 2 2 -13 3 -508 2 2 -13 3 -507 2 2 -13 3 -506 2 2 -13 3 -505 2 2 -13 3 -504 2 2 -13 3 -503 2 2 -13 3 -502 2 2 -13 3 -501 2 2 -13 3 -500 2 2 -13 3 -499 2 2 -13 3 -498 2 2 -13 3 -497 2 2 -13 3 -496 2 2 -13 3 -495 2 2 -13 3 -494 2 2 -13 3 -493 2 2 -13 3 -492 2 2 -13 3 -491 2 2 -13 3 -490 2 2 -13 3 -489 3 3 -12 2 -508 3 3 -12 2 -507 3 3 -12 2 -506 3 3 -12 2 -505 3 3 -12 2 -504 3 3 -12 2 -503 3 3 -12 2 -502 3 3 -12 2 -501 3 3 -12 2 -500 3 3 -12 2 -499 3 3 -12 2 -498 3 3 -12 2 -497 3 3 -12 2 -496 3 3 -12 2 -495 3 3 -12 2 -494 3 3 -12 2 -493 3 3 -12 2 -492 3 3 -12 2 -491 3 3 -12 2 -490 3 3 -12 2 -489 2 2 -12 3 -508 2 2 -12 3 -507 2 2 -12 3 -506 2 2 -12 3 -505 2 2 -12 3 -504 2 2 -12 3 -503 2 2 -12 3 -502 2 2 -12 3 -501 2 2 -12 3 -500 2 2 -12 3 -499 2 2 -12 3 -498 2 2 -12 3 -497 2 2 -12 3 -496 2 2 -12 3 -495 2 2 -12 3 -494 2 2 -12 3 -493 2 2 -12 3 -492 3 3 -12 3 -491 2 2 -12 3 -490 2 2 -12 3 -489 215 215 -12 4 -491 3 3 -11 2 -508 3 3 -11 2 -507 3 3 -11 2 -506 3 3 -11 2 -505 3 3 -11 2 -504 2 2 -11 2 -503 3 3 -11 2 -502 2 2 -11 2 -501 2 2 -11 2 -500 3 3 -11 2 -499 3 3 -11 2 -498 2 2 -11 2 -497 3 3 -11 2 -496 2 2 -11 2 -495 2 2 -11 2 -494 2 2 -11 2 -493 3 3 -11 2 -492 3 3 -11 2 -491 3 3 -11 2 -490 3 3 -11 2 -489 2 2 -11 3 -508 2 2 -11 3 -507 2 2 -11 3 -506 2 2 -11 3 -505 2 2 -11 3 -504 3 3 -11 3 -492 2 2 -11 3 -491 2 2 -11 3 -490 2 2 -11 3 -489 2 2 -11 4 -492 3 3 -10 2 -508 3 3 -10 2 -507 3 3 -10 2 -506 3 3 -10 2 -505 3 3 -10 2 -504 2 2 -10 2 -503 3 3 -10 2 -502 3 3 -10 2 -501 3 3 -10 2 -500 3 3 -10 2 -499 3 3 -10 2 -498 3 3 -10 2 -497 3 3 -10 2 -496 3 3 -10 2 -495 3 3 -10 2 -494 4 4 -10 2 -493 4 4 -10 2 -492 4 4 -10 2 -491 4 4 -10 2 -490 4 4 -10 2 -489 2 2 -10 3 -508 2 2 -10 3 -507 2 2 -10 3 -506 2 2 -10 3 -505 2 2 -10 3 -504 2 2 -10 3 -502 3 3 -10 3 -501 3 3 -10 3 -500 3 3 -10 3 -499 3 3 -10 3 -498 2 2 -10 3 -497 2 2 -10 3 -496 2 2 -10 3 -495 2 2 -10 3 -494 13 13 -10 3 -493 13 13 -10 3 -491 13 13 -10 3 -490 13 13 -10 3 -489 4 4 -10 4 -501 4 4 -10 4 -500 4 4 -10 4 -499 4 4 -10 4 -498 4 4 -10 5 -501 4 4 -10 5 -500 4 4 -10 5 -499 4 4 -10 5 -498 4 4 -10 5 -497 4 4 -10 5 -496 4 4 -10 5 -495 4 4 -10 6 -501 4 4 -10 6 -500 4 4 -10 6 -499 4 4 -10 6 -498 4 4 -10 6 -497 102 102 -10 6 -496 4 4 -10 6 -495 4 4 -10 7 -501 102 102 -10 7 -500 4 4 -10 7 -499 4 4 -10 7 -498 4 4 -10 7 -497 102 102 -10 7 -496 4 4 -10 7 -495 4 4 -10 8 -501 4 4 -10 8 -500 4 4 -10 8 -499 4 4 -10 8 -498 4 4 -10 8 -497 4 4 -10 8 -496 4 4 -10 8 -495 4 4 -10 8 -494 4 4 -10 9 -497 4 4 -10 9 -496 4 4 -10 9 -495 4 4 -10 10 -497 102 102 -10 10 -496 4 4 -10 10 -495 4 4 -10 11 -497 102 102 -10 11 -496 4 4 -10 11 -495 4 4 -10 12 -497 4 4 -10 12 -496 4 4 -10 12 -495 4 4 -10 13 -498 4 4 -10 13 -497 4 4 -10 13 -496 4 4 -10 13 -495 4 4 -10 13 -494 3 3 -9 2 -508 3 3 -9 2 -507 3 3 -9 2 -506 3 3 -9 2 -505 3 3 -9 2 -504 2 2 -9 2 -503 3 3 -9 2 -502 3 3 -9 2 -501 3 3 -9 2 -500 3 3 -9 2 -499 3 3 -9 2 -498 3 3 -9 2 -497 3 3 -9 2 -496 3 3 -9 2 -495 3 3 -9 2 -494 4 4 -9 2 -493 4 4 -9 2 -492 4 4 -9 2 -491 4 4 -9 2 -490 4 4 -9 2 -489 2 2 -9 3 -508 2 2 -9 3 -507 2 2 -9 3 -506 2 2 -9 3 -505 2 2 -9 3 -504 3 3 -9 3 -502 3 3 -9 3 -501 3 3 -9 3 -500 3 3 -9 3 -499 3 3 -9 3 -498 3 3 -9 3 -497 3 3 -9 3 -496 3 3 -9 3 -495 3 3 -9 3 -494 13 13 -9 3 -493 13 13 -9 3 -491 13 13 -9 3 -490 13 13 -9 3 -489 4 4 -9 4 -502 4 4 -9 4 -501 4 4 -9 4 -500 4 4 -9 4 -499 4 4 -9 4 -498 4 4 -9 4 -497 4 4 -9 4 -496 4 4 -9 4 -495 4 4 -9 4 -494 4 4 -9 5 -502 4 4 -9 5 -501 4 4 -9 5 -500 67 12355 -9 5 -499 4 4 -9 5 -494 4 4 -9 6 -502 67 4163 -9 6 -501 4 4 -9 6 -494 4 4 -9 7 -502 4 4 -9 7 -494 4 4 -9 8 -502 50 4146 -9 8 -500 4 4 -9 8 -498 4 4 -9 8 -497 4 4 -9 8 -496 4 4 -9 8 -495 4 4 -9 8 -494 4 4 -9 9 -501 4 4 -9 9 -500 4 4 -9 9 -499 4 4 -9 9 -498 4 4 -9 9 -494 4 4 -9 10 -498 4 4 -9 10 -494 4 4 -9 11 -498 4 4 -9 11 -494 4 4 -9 12 -498 4 4 -9 12 -494 4 4 -9 13 -498 4 4 -9 13 -497 4 4 -9 13 -496 4 4 -9 13 -495 4 4 -9 13 -494 3 3 -8 2 -508 3 3 -8 2 -507 3 3 -8 2 -506 3 3 -8 2 -505 3 3 -8 2 -504 2 2 -8 2 -503 3 3 -8 2 -502 3 3 -8 2 -501 3 3 -8 2 -500 3 3 -8 2 -499 3 3 -8 2 -498 3 3 -8 2 -497 3 3 -8 2 -496 3 3 -8 2 -495 3 3 -8 2 -494 4 4 -8 2 -493 4 4 -8 2 -492 4 4 -8 2 -491 4 4 -8 2 -490 4 4 -8 2 -489 2 2 -8 3 -508 2 2 -8 3 -507 2 2 -8 3 -506 2 2 -8 3 -505 2 2 -8 3 -504 3 3 -8 3 -502 3 3 -8 3 -501 3 3 -8 3 -500 3 3 -8 3 -499 3 3 -8 3 -498 3 3 -8 3 -497 3 3 -8 3 -496 3 3 -8 3 -495 3 3 -8 3 -494 13 13 -8 3 -493 13 13 -8 3 -492 13 13 -8 3 -491 13 13 -8 3 -490 13 13 -8 3 -489 4 4 -8 4 -502 4 4 -8 4 -501 4 4 -8 4 -500 4 4 -8 4 -499 4 4 -8 4 -498 4 4 -8 4 -497 4 4 -8 4 -496 4 4 -8 4 -495 4 4 -8 4 -494 67 12355 -8 4 -493 3 3 -8 4 -492 4 4 -8 5 -502 4 4 -8 5 -501 67 12355 -8 5 -500 220 220 -8 5 -498 64 4160 -8 5 -494 4 4 -8 6 -502 64 32832 -8 6 -494 102 102 -8 7 -502 4 4 -8 7 -494 4 4 -8 8 -502 50 12338 -8 8 -501 50 16434 -8 8 -499 4 4 -8 8 -498 4 4 -8 8 -497 4 4 -8 8 -496 4 4 -8 8 -495 4 4 -8 8 -494 4 4 -8 9 -501 4 4 -8 9 -500 4 4 -8 9 -499 4 4 -8 9 -498 4 4 -8 9 -494 102 102 -8 10 -498 102 102 -8 10 -494 102 102 -8 11 -498 102 102 -8 11 -494 4 4 -8 12 -498 4 4 -8 12 -494 4 4 -8 13 -498 4 4 -8 13 -497 4 4 -8 13 -496 4 4 -8 13 -495 4 4 -8 13 -494 3 3 -7 2 -508 3 3 -7 2 -507 3 3 -7 2 -506 3 3 -7 2 -505 3 3 -7 2 -504 3 3 -7 2 -503 3 3 -7 2 -502 3 3 -7 2 -501 3 3 -7 2 -500 3 3 -7 2 -499 3 3 -7 2 -498 3 3 -7 2 -497 3 3 -7 2 -496 3 3 -7 2 -495 3 3 -7 2 -494 4 4 -7 2 -493 4 4 -7 2 -492 4 4 -7 2 -491 3 3 -7 2 -490 3 3 -7 2 -489 2 2 -7 3 -508 2 2 -7 3 -507 2 2 -7 3 -506 2 2 -7 3 -505 2 2 -7 3 -504 3 3 -7 3 -502 3 3 -7 3 -501 3 3 -7 3 -500 3 3 -7 3 -499 3 3 -7 3 -498 3 3 -7 3 -497 3 3 -7 3 -496 3 3 -7 3 -495 3 3 -7 3 -494 13 13 -7 3 -493 13 13 -7 3 -491 2 2 -7 3 -490 2 2 -7 3 -489 4 4 -7 4 -502 4 4 -7 4 -501 4 4 -7 4 -500 4 4 -7 4 -499 4 4 -7 4 -498 4 4 -7 4 -497 4 4 -7 4 -496 4 4 -7 4 -495 4 4 -7 4 -494 4 4 -7 5 -502 4 4 -7 5 -501 4 4 -7 5 -500 67 12355 -7 5 -499 65 16449 -7 5 -497 61 8253 -7 5 -495 4 4 -7 5 -494 4 4 -7 6 -502 67 67 -7 6 -501 65 16449 -7 6 -497 4 4 -7 6 -494 4 4 -7 7 -502 65 16449 -7 7 -497 4 4 -7 7 -494 4 4 -7 8 -502 50 8242 -7 8 -500 4 4 -7 8 -498 65 16449 -7 8 -497 4 4 -7 8 -496 4 4 -7 8 -495 4 4 -7 8 -494 4 4 -7 9 -501 4 4 -7 9 -500 4 4 -7 9 -499 4 4 -7 9 -498 65 16449 -7 9 -497 4 4 -7 9 -494 4 4 -7 10 -498 65 16449 -7 10 -497 4 4 -7 10 -494 4 4 -7 11 -498 65 16449 -7 11 -497 4 4 -7 11 -494 4 4 -7 12 -498 65 16449 -7 12 -497 4 4 -7 12 -494 4 4 -7 13 -498 65 16449 -7 13 -497 4 4 -7 13 -496 4 4 -7 13 -495 4 4 -7 13 -494 2 2 -6 2 -508 3 3 -6 2 -507 3 3 -6 2 -506 3 3 -6 2 -505 3 3 -6 2 -504 2 2 -6 2 -503 3 3 -6 2 -502 3 3 -6 2 -501 3 3 -6 2 -500 3 3 -6 2 -499 3 3 -6 2 -498 3 3 -6 2 -497 3 3 -6 2 -496 3 3 -6 2 -495 3 3 -6 2 -494 4 4 -6 2 -493 4 4 -6 2 -492 4 4 -6 2 -491 3 3 -6 2 -490 3 3 -6 2 -489 2 2 -6 3 -507 2 2 -6 3 -506 2 2 -6 3 -505 2 2 -6 3 -504 2 2 -6 3 -502 3 3 -6 3 -501 3 3 -6 3 -500 3 3 -6 3 -499 3 3 -6 3 -498 2 2 -6 3 -497 2 2 -6 3 -496 2 2 -6 3 -495 2 2 -6 3 -494 13 13 -6 3 -493 13 13 -6 3 -491 3 3 -6 3 -490 3 3 -6 3 -489 4 4 -6 4 -501 4 4 -6 4 -500 4 4 -6 4 -499 4 4 -6 4 -498 4 4 -6 4 -490 4 4 -6 4 -489 4 4 -6 5 -501 4 4 -6 5 -500 4 4 -6 5 -499 4 4 -6 5 -498 4 4 -6 5 -497 4 4 -6 5 -496 4 4 -6 5 -495 4 4 -6 5 -490 4 4 -6 5 -489 4 4 -6 6 -501 4 4 -6 6 -500 4 4 -6 6 -499 4 4 -6 6 -498 4 4 -6 6 -497 102 102 -6 6 -496 4 4 -6 6 -495 4 4 -6 6 -490 17 17 -6 6 -489 4 4 -6 7 -501 102 102 -6 7 -500 4 4 -6 7 -499 4 4 -6 7 -498 4 4 -6 7 -497 102 102 -6 7 -496 4 4 -6 7 -495 53 8245 -6 7 -491 4 4 -6 7 -490 4 4 -6 7 -489 4 4 -6 8 -501 4 4 -6 8 -500 4 4 -6 8 -499 4 4 -6 8 -498 4 4 -6 8 -497 4 4 -6 8 -496 4 4 -6 8 -495 4 4 -6 8 -494 53 8245 -6 8 -490 5 5 -6 8 -489 4 4 -6 9 -497 4 4 -6 9 -496 4 4 -6 9 -495 53 8245 -6 9 -489 4 4 -6 10 -497 102 102 -6 10 -496 4 4 -6 10 -495 4 4 -6 11 -497 102 102 -6 11 -496 4 4 -6 11 -495 4 4 -6 12 -497 4 4 -6 12 -496 4 4 -6 12 -495 4 4 -6 13 -498 4 4 -6 13 -497 4 4 -6 13 -496 4 4 -6 13 -495 4 4 -6 13 -494 2 2 -5 2 -508 3 3 -5 2 -507 3 3 -5 2 -506 3 3 -5 2 -505 2 2 -5 2 -504 3 3 -5 2 -503 2 2 -5 2 -502 2 2 -5 2 -501 2 2 -5 2 -500 3 3 -5 2 -499 2 2 -5 2 -498 3 3 -5 2 -497 2 2 -5 2 -496 2 2 -5 2 -495 2 2 -5 2 -494 4 4 -5 2 -493 4 4 -5 2 -492 4 4 -5 2 -491 3 3 -5 2 -490 3 3 -5 2 -489 2 2 -5 3 -507 2 2 -5 3 -506 2 2 -5 3 -505 3 3 -5 3 -503 13 13 -5 3 -491 3 3 -5 3 -490 3 3 -5 3 -489 3 3 -5 4 -503 4 4 -5 4 -490 5 5 -5 4 -489 3 3 -5 5 -503 4 4 -5 5 -490 3 3 -5 6 -503 5 5 -5 6 -490 3 3 -5 7 -503 53 8245 -5 7 -491 5 5 -5 7 -490 3 3 -5 8 -503 53 8245 -5 8 -490 5 5 -5 8 -489 3 3 -5 9 -503 53 8245 -5 9 -489 3 3 -5 10 -503 3 3 -5 11 -503 3 3 -5 12 -503 3 3 -5 13 -503 3 3 -4 2 -508 3 3 -4 2 -507 3 3 -4 2 -506 3 3 -4 2 -505 3 3 -4 2 -504 3 3 -4 2 -503 3 3 -4 2 -502 3 3 -4 2 -501 3 3 -4 2 -500 3 3 -4 2 -499 3 3 -4 2 -498 3 3 -4 2 -497 3 3 -4 2 -496 3 3 -4 2 -495 3 3 -4 2 -494 4 4 -4 2 -493 4 4 -4 2 -492 4 4 -4 2 -491 3 3 -4 2 -490 3 3 -4 2 -489 2 2 -4 3 -508 2 2 -4 3 -507 2 2 -4 3 -506 2 2 -4 3 -505 2 2 -4 3 -504 2 2 -4 3 -503 2 2 -4 3 -502 2 2 -4 3 -501 2 2 -4 3 -500 2 2 -4 3 -499 2 2 -4 3 -498 2 2 -4 3 -497 2 2 -4 3 -496 2 2 -4 3 -495 2 2 -4 3 -494 13 13 -4 3 -493 13 13 -4 3 -492 13 13 -4 3 -491 3 3 -4 3 -490 3 3 -4 3 -489 67 8259 -4 4 -491 4 4 -4 4 -490 5 5 -4 4 -489 64 4160 -4 5 -490 64 32832 -4 6 -490 53 8245 -4 7 -491 5 5 -4 7 -490 50 12338 -4 7 -489 53 8245 -4 8 -490 5 5 -4 8 -489 53 8245 -4 9 -489 3 3 -3 2 -508 3 3 -3 2 -507 3 3 -3 2 -506 3 3 -3 2 -505 3 3 -3 2 -504 3 3 -3 2 -503 3 3 -3 2 -502 3 3 -3 2 -501 3 3 -3 2 -500 3 3 -3 2 -499 3 3 -3 2 -498 3 3 -3 2 -497 3 3 -3 2 -496 3 3 -3 2 -495 3 3 -3 2 -494 4 4 -3 2 -493 4 4 -3 2 -492 4 4 -3 2 -491 3 3 -3 2 -490 3 3 -3 2 -489 2 2 -3 3 -508 2 2 -3 3 -507 2 2 -3 3 -506 2 2 -3 3 -505 2 2 -3 3 -504 2 2 -3 3 -503 2 2 -3 3 -502 2 2 -3 3 -501 2 2 -3 3 -500 2 2 -3 3 -499 2 2 -3 3 -498 2 2 -3 3 -497 2 2 -3 3 -496 2 2 -3 3 -495 2 2 -3 3 -494 13 13 -3 3 -493 13 13 -3 3 -492 13 13 -3 3 -491 3 3 -3 3 -490 3 3 -3 3 -489 4 4 -3 4 -490 5 5 -3 4 -489 4 4 -3 5 -490 5 5 -3 6 -490 53 8245 -3 7 -491 5 5 -3 7 -490 53 8245 -3 8 -490 5 5 -3 8 -489 53 8245 -3 9 -489 3 3 -2 2 -508 3 3 -2 2 -507 3 3 -2 2 -506 3 3 -2 2 -505 3 3 -2 2 -504 3 3 -2 2 -503 3 3 -2 2 -502 3 3 -2 2 -501 3 3 -2 2 -500 3 3 -2 2 -499 3 3 -2 2 -498 3 3 -2 2 -497 3 3 -2 2 -496 3 3 -2 2 -495 3 3 -2 2 -494 4 4 -2 2 -493 4 4 -2 2 -492 4 4 -2 2 -491 3 3 -2 2 -490 3 3 -2 2 -489 2 2 -2 3 -508 2 2 -2 3 -507 2 2 -2 3 -506 2 2 -2 3 -505 2 2 -2 3 -504 2 2 -2 3 -503 2 2 -2 3 -502 2 2 -2 3 -501 2 2 -2 3 -500 2 2 -2 3 -499 2 2 -2 3 -498 2 2 -2 3 -497 2 2 -2 3 -496 2 2 -2 3 -495 2 2 -2 3 -494 13 13 -2 3 -493 13 13 -2 3 -492 13 13 -2 3 -491 3 3 -2 3 -490 3 3 -2 3 -489 4 4 -2 4 -490 5 5 -2 4 -489 4 4 -2 5 -490 17 17 -2 6 -490 53 8245 -2 7 -491 5 5 -2 7 -490 53 8245 -2 8 -490 5 5 -2 8 -489 53 8245 -2 9 -489 3 3 -1 2 -508 3 3 -1 2 -507 3 3 -1 2 -506 3 3 -1 2 -505 3 3 -1 2 -504 3 3 -1 2 -503 3 3 -1 2 -502 3 3 -1 2 -501 3 3 -1 2 -500 3 3 -1 2 -499 3 3 -1 2 -498 3 3 -1 2 -497 3 3 -1 2 -496 3 3 -1 2 -495 3 3 -1 2 -494 4 4 -1 2 -493 4 4 -1 2 -492 4 4 -1 2 -491 3 3 -1 2 -490 3 3 -1 2 -489 2 2 -1 3 -508 2 2 -1 3 -507 2 2 -1 3 -506 2 2 -1 3 -505 2 2 -1 3 -504 2 2 -1 3 -503 2 2 -1 3 -502 2 2 -1 3 -501 2 2 -1 3 -500 2 2 -1 3 -499 2 2 -1 3 -498 2 2 -1 3 -497 2 2 -1 3 -496 2 2 -1 3 -495 2 2 -1 3 -494 13 13 -1 3 -493 13 13 -1 3 -492 13 13 -1 3 -491 3 3 -1 3 -490 3 3 -1 3 -489 4 4 -1 4 -490 5 5 -1 4 -489 4 4 -1 5 -490 102 102 -1 6 -490 53 8245 -1 7 -491 5 5 -1 7 -490 53 8245 -1 8 -490 5 5 -1 8 -489 53 8245 -1 9 -489 3 3 0 2 -508 3 3 0 2 -507 3 3 0 2 -506 3 3 0 2 -505 3 3 0 2 -504 3 3 0 2 -503 3 3 0 2 -502 3 3 0 2 -501 3 3 0 2 -500 3 3 0 2 -499 3 3 0 2 -498 3 3 0 2 -497 3 3 0 2 -496 3 3 0 2 -495 3 3 0 2 -494 4 4 0 2 -493 4 4 0 2 -492 4 4 0 2 -491 3 3 0 2 -490 3 3 0 2 -489 2 2 0 3 -508 2 2 0 3 -507 2 2 0 3 -506 2 2 0 3 -505 2 2 0 3 -504 2 2 0 3 -503 2 2 0 3 -502 2 2 0 3 -501 2 2 0 3 -500 2 2 0 3 -499 2 2 0 3 -498 2 2 0 3 -497 2 2 0 3 -496 2 2 0 3 -495 2 2 0 3 -494 13 13 0 3 -493 13 13 0 3 -492 13 13 0 3 -491 3 3 0 3 -490 3 3 0 3 -489 4 4 0 4 -490 5 5 0 4 -489 4 4 0 5 -490 17 17 0 6 -490 53 8245 0 7 -491 5 5 0 7 -490 53 8245 0 8 -490 5 5 0 8 -489 53 8245 0 9 -489 2 2 1 2 -508 3 3 1 2 -507 3 3 1 2 -506 3 3 1 2 -505 3 3 1 2 -504 3 3 1 2 -503 3 3 1 2 -502 3 3 1 2 -501 3 3 1 2 -500 3 3 1 2 -499 3 3 1 2 -498 3 3 1 2 -497 3 3 1 2 -496 3 3 1 2 -495 3 3 1 2 -494 4 4 1 2 -493 4 4 1 2 -492 4 4 1 2 -491 3 3 1 2 -490 3 3 1 2 -489 2 2 1 3 -507 2 2 1 3 -506 2 2 1 3 -505 2 2 1 3 -504 2 2 1 3 -503 2 2 1 3 -502 2 2 1 3 -501 2 2 1 3 -500 2 2 1 3 -499 2 2 1 3 -498 2 2 1 3 -497 2 2 1 3 -496 2 2 1 3 -495 2 2 1 3 -494 13 13 1 3 -493 13 13 1 3 -492 13 13 1 3 -491 3 3 1 3 -490 3 3 1 3 -489 4 4 1 4 -490 5 5 1 4 -489 4 4 1 5 -490 5 5 1 6 -490 53 8245 1 7 -491 5 5 1 7 -490 53 8245 1 8 -490 5 5 1 8 -489 53 8245 1 9 -489 > } gui { # puedes Deshabilitar la gui si es que te da problemas B:"Gui Enable"=true # Tamaño de la gui I:"Gui Size"=30 # corrige la posicion de la gui I:"Gui pos X"=0 I:"Gui pos Y"=0 } guns { # Autorecarga de Magazines, # Solo funciona si hay otro cargador # compatible Disponible en el inventario B:"autoreload Activated"=true } mobs { # Signo de exclamacion cunado te ve uno de mis mobs B:Exclamaciones=true # habran mas Zombies diferentes en el juego B:"Zombies variados"=true # Quieres creeper's con ak47's vagando por hay B:"ak47 whith Creeper"=true # uno de cada 20 sera un Zombie mejorado B:"enhanced Zombies"=true }
  21. no rellay need to fuck up whith pitch mi entityes really look like storm troopers whithouth geting the pich and ading a little up and wass almost imposible to hit little things like spiders
  22. good days i been working in a custome villager, and end in the conclusion than the best way to make it spawn in all the villages including mod villages is to catch the event when a vainilla villager spawns in the world and spawns mi villager in that same spot. but for reasons i end whith villages whith 10 vainilla villagers and 200 of mi custome villagers when there must be like three or four max 6 i been using this i tink for some reason is trigering more than one time per spawned villager // ########################################################################################################################3 // replace mobs @SubscribeEvent public void onEntityEnter(EnteringChunk event) { boolean disable = false; boolean enable = true; if ( enable & event.entity instanceof EntityVillager & !(event.entity instanceof aldeanoMercenario )) { int R = ((int) (Math.random() * 100)); if (R < 60) { mercenarymod.entidades.aldeanoMercenario aldeanoMercenario = new mercenarymod.entidades.aldeanoMercenario(event.entity.worldObj); aldeanoMercenario.setPosition(event.entity.posX, event.entity.posY, event.entity.posZ); event.entity.worldObj.spawnEntityInWorld(aldeanoMercenario); //event.entity.setDead(); } } } ¿¿¿ another event bether suited for this or another solution would be very apreciated Thanks for reading
  23. no really i alredy have that in the contructor this is to make a custom villager entity to aim a fire gun to a target entity and shoot i wass playing whith the lookhelper method this.theWatcher.getLookHelper().setLookPosition(this.closestEntity.posX, this.closestEntity.posY + (double)this.closestEntity.getEyeHeight(), this.closestEntity.posZ, 10.0F, (float)this.theWatcher.getVerticalFaceSpeed()); --this.lookTime; but i could'n really make it work get tired a redoid again // ################################## // corregir altura del disparo private void corregirAim(Entity shtA, Entity tgtB) { if (shtA != null & tgtB != null) { // shtA = this; double x = shtA.posX; double y = shtA.posY; double z = shtA.posZ; float yaw = shtA.getRotationYawHead(); // shtA.rotationYaw; float pitch = shtA.rotationPitch; double d0 = tgtB.posX - shtA.posX; double d1 = (tgtB.posY + tgtB.getEyeHeight()) - (shtA.posY + (double) shtA.getEyeHeight() - 0.10000000149011612D); double d2 = tgtB.posZ - shtA.posZ; double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2); if (d3 >= 1.0E-7D) { float f2 = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; // yaw float f3 = (float) ((Math.tan(d1 / d3)) * 180.0D / Math.PI); float f4 = (float) ((Math.atan(d1 / d3) * -1) * 180.0D / Math.PI); pitch = f4; // pitch yaw = f2; // yaw } shtA.setPositionAndRotation(x, y, z, yaw, pitch); } } public float gradosAradianes(float x) { return (float) ((x * Math.PI) / 180); } public float radianesAgrados(float x) { return (float) ((x * 180) / Math.PI); } // ################################################################################################################# but thanks
  24. thats "java.util.zip.ZipException" you have a mod compresed in a zip ?? i think all forge ends like jars
  25. good days i solve this time ago but lost mi code and dont wanna write that again, so maiby in the default tools of forge could be something usefull any way, i have an entityA (mi custome villager) and there is an entityB(Ramdom mob) soo i wana force the entity A to look at entity B for that i need to get the rotation pitch and yaw maching the entityB position first i get the eyes vector whith Vec3 Avec3 = entityA.getPositionVector().addVector(0, entityA.getEyeHeight(), 0); Vec3 Bvec3 = entityB.getPositionVector().addVector(0, entityB.getEyeHeight(), 0); two then made a bunch of math whith this values three set entityA whith rotationPitch / yaw to look at B four profit but i dont wanna code that again, the quesion is, ¿there a method in forge to do this ?
×
×
  • Create New...

Important Information

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