• Transformer un item en un autre comme les fioles 2

    Résolu 1.8
    7
    0 Votes
    7 Messages
    1k Vues
    EryahE
    Ok, THX pour le renseignement, je pensais que c’était un bloc avec énormément de metadata moi Envoyé de mon SM-G357FZ en utilisant Tapatalk
  • Un item jettable

    Résolu 1.8
    11
    0 Votes
    11 Messages
    2k Vues
    EryahE
    C’est bon je me suis démerdé Pour ceux qui sont dans le même cas que moi (Entity invisible ), qu’il sachent qu’il faut modifier l’id des entités, sinon il y aura conflit avec ceux déjà existant l’id du mod ce trouve dans la classe principale ​EntityRegistry.registerModEntity(ELavaBottle.class, "lavaBottle", **21051**, this.instance, 40, 1, true); ( PS : Sa marche uniquement pour ma potion, mon poulet et mon bateau sont toujours invisible )
  • Restaurer la barre d'oxygène ( Et quelques demandes pour potions )

    Résolu 1.8
    14
    0 Votes
    14 Messages
    3k Vues
    robin4002R
    C’est bon je m’en suis chargé.
  • Transformer un item en un autre comme les fioles

    Résolu 1.8
    16
    0 Votes
    16 Messages
    3k Vues
    EryahE
    Il faut également supprimer le printIn, sinon cela ne fonctionne pas Plus d’erreur, je lance mon client j’espère que cela va fonctionner ! Ça fonctionne Merci beaucoup robin pour ton aide
  • Demie-dalle

    Résolu 1.8
    7
    0 Votes
    7 Messages
    2k Vues
    EmotionFoxE
    Bon bah je crois que c’est “bon”, en tous cas merci quand même à Robin et pour l’info l’item permet de placer la deuxième demie-dalle pour former une double demie-dalle. Avant en faite j’avais beaucoup de mal avec les jsons et je débutais le coding donc forcement j’arrivais pas vraiment à bidouiller mais maintenant c’est bon Bon ça à pas le même rendue étant donné que j’utilise la fonction : public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ){} Pour placer la deuxième demie-dalle parce que je sais pas vraiment comment faire sinon pour faire en sorte que quand on clique droit sur le dessus du bloc seulement ça marche (en ajoutant le son du placement de bois qui n’est du coup pas présent) mais c’est déjà très bien comme ça et ça doit être encore améliorable alors. Bref sinon voilà le code pour les personnes pas très téméraire qui voudrais faire ça facilement (méthode ultra condensée) : public class BaseSlab extends BaseBlock { public static final PropertyEnum HALF = PropertyEnum.create("half", BaseSlab.EnumBlockHalf.class); private boolean isDouble; public BaseSlab(boolean par1, Material materialIn) { super(materialIn); isDouble = par1; IBlockState iblockstate = this.blockState.getBaseState(); if(!isDouble) { this.fullBlock = true; this.setCreativeTab(EmotionTab.EmotionCreativeTab5); iblockstate = iblockstate.withProperty(HALF, BaseSlab.EnumBlockHalf.BOTTOM); } else { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); } this.setHardness(2.0F); this.setResistance(5.0F); this.setStepSound(soundTypeWood); this.setLightOpacity(255); } public Item getItemDropped(IBlockState state, Random rand, int fortune) { if(this == EmotionBlocks.cherryDoubleSlab) return Item.getItemFromBlock(EmotionBlocks.cherrySlab); if(this == EmotionBlocks.pearDoubleSlab) return Item.getItemFromBlock(EmotionBlocks.pearSlab); if(this == EmotionBlocks.orangeDoubleSlab) return Item.getItemFromBlock(EmotionBlocks.orangeSlab); if(this == EmotionBlocks.atlasDoubleSlab) return Item.getItemFromBlock(EmotionBlocks.atlasSlab); if(this == EmotionBlocks.pineDoubleSlab) return Item.getItemFromBlock(EmotionBlocks.pineSlab); if(this == EmotionBlocks.cocoDoubleSlab) return Item.getItemFromBlock(EmotionBlocks.cocoSlab); return Item.getItemFromBlock(this); } @SideOnly(Side.CLIENT) public Item getItem(World worldIn, BlockPos pos) { if(this == EmotionBlocks.cherryDoubleSlab) return Item.getItemFromBlock(EmotionBlocks.cherrySlab); if(this == EmotionBlocks.pearDoubleSlab) return Item.getItemFromBlock(EmotionBlocks.pearSlab); if(this == EmotionBlocks.orangeDoubleSlab) return Item.getItemFromBlock(EmotionBlocks.orangeSlab); if(this == EmotionBlocks.atlasDoubleSlab) return Item.getItemFromBlock(EmotionBlocks.atlasSlab); if(this == EmotionBlocks.pineDoubleSlab) return Item.getItemFromBlock(EmotionBlocks.pineSlab); if(this == EmotionBlocks.cocoDoubleSlab) return Item.getItemFromBlock(EmotionBlocks.cocoSlab); return Item.getItemFromBlock(this); } public IBlockState getStateFromMeta(int meta) { IBlockState iblockstate = this.getDefaultState(); if(!isDouble) { iblockstate = iblockstate.withProperty(HALF, (meta & 8) == 0 ? BaseSlab.EnumBlockHalf.BOTTOM : BaseSlab.EnumBlockHalf.TOP); } return iblockstate; } public int getMetaFromState(IBlockState state) { byte b0 = 0; int i = b0; if(!isDouble && state.getValue(HALF) == BaseSlab.EnumBlockHalf.TOP) { i |= 8; } return i; } protected BlockState createBlockState() { return isDouble ? new BlockState(this) : new BlockState(this, new IProperty[] {HALF}); } public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) { if(player.getCurrentEquippedItem() != null) { if(player.getCurrentEquippedItem().getItem() == Item.getItemFromBlock(EmotionBlocks.cherrySlab)) world.setBlockState(pos, EmotionBlocks.cherryDoubleSlab.getDefaultState()); if(player.getCurrentEquippedItem().getItem() == Item.getItemFromBlock(EmotionBlocks.pearSlab)) world.setBlockState(pos, EmotionBlocks.pearDoubleSlab.getDefaultState()); if(player.getCurrentEquippedItem().getItem() == Item.getItemFromBlock(EmotionBlocks.orangeSlab)) world.setBlockState(pos, EmotionBlocks.orangeDoubleSlab.getDefaultState()); if(player.getCurrentEquippedItem().getItem() == Item.getItemFromBlock(EmotionBlocks.atlasSlab)) world.setBlockState(pos, EmotionBlocks.atlasDoubleSlab.getDefaultState()); if(player.getCurrentEquippedItem().getItem() == Item.getItemFromBlock(EmotionBlocks.pineSlab)) world.setBlockState(pos, EmotionBlocks.pineDoubleSlab.getDefaultState()); if(player.getCurrentEquippedItem().getItem() == Item.getItemFromBlock(EmotionBlocks.cocoSlab)) world.setBlockState(pos, EmotionBlocks.cocoDoubleSlab.getDefaultState()); if(!player.capabilities.isCreativeMode && –player.inventory.getCurrentItem().stackSize <= 0) { player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); } return true; } return false; } protected boolean canSilkHarvest() { return false; } public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { if(isDouble) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } else { IBlockState iblockstate = worldIn.getBlockState(pos); if(iblockstate.getBlock() == this) { if(iblockstate.getValue(HALF) == BaseSlab.EnumBlockHalf.TOP) { this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); } else { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); } } } } public void setBlockBoundsForItemRender() { if(isDouble) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } else { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); } } public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) { this.setBlockBoundsBasedOnState(worldIn, pos); super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); } public boolean isOpaqueCube() { return isDouble; } public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { IBlockState iblockstate = super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(HALF, BaseSlab.EnumBlockHalf.BOTTOM); return isDouble ? iblockstate : (facing != EnumFacing.DOWN && (facing == EnumFacing.UP || (double)hitY <= 0.5D) ? iblockstate : iblockstate.withProperty(HALF, BaseSlab.EnumBlockHalf.TOP)); } public int quantityDropped(Random random) { return isDouble ? 2 : 1; } public boolean isFullCube() { return isDouble; } @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) { if(isDouble) { return super.shouldSideBeRendered(worldIn, pos, side); } else if(side != EnumFacing.UP && side != EnumFacing.DOWN && !super.shouldSideBeRendered(worldIn, pos, side)) { return false; } else { BlockPos blockpos1 = pos.offset(side.getOpposite()); IBlockState iblockstate = worldIn.getBlockState(pos); IBlockState iblockstate1 = worldIn.getBlockState(blockpos1); boolean flag = isSlab(iblockstate.getBlock()) && iblockstate.getValue(HALF) == BaseSlab.EnumBlockHalf.TOP; boolean flag1 = isSlab(iblockstate1.getBlock()) && iblockstate1.getValue(HALF) == BaseSlab.EnumBlockHalf.TOP; return flag1 ? (side == EnumFacing.DOWN ? true : (side == EnumFacing.UP && super.shouldSideBeRendered(worldIn, pos, side) ? true : !isSlab(iblockstate.getBlock()) || !flag)) : (side == EnumFacing.UP ? true : (side == EnumFacing.DOWN && super.shouldSideBeRendered(worldIn, pos, side) ? true : !isSlab(iblockstate.getBlock()) || flag)); } } @SideOnly(Side.CLIENT) protected static boolean isSlab(Block blockIn) { return blockIn == EmotionBlocks.cherrySlab || blockIn == EmotionBlocks.pearSlab || blockIn == EmotionBlocks.orangeSlab || blockIn == EmotionBlocks.atlasSlab || blockIn == EmotionBlocks.pineSlab || blockIn == EmotionBlocks.cocoSlab; } public int getDamageValue(World worldIn, BlockPos pos) { return super.getDamageValue(worldIn, pos) & 7; } public static enum EnumBlockHalf implements IStringSerializable { TOP("top"), BOTTOM("bottom"); private final String name; private EnumBlockHalf(String name) { this.name = name; } public String toString() { return this.name; } public String getName() { return this.name; } } }
  • Problème de crash [My Bad, inutile]

    Résolu 1.8
    12
    0 Votes
    12 Messages
    2k Vues
    EryahE
    J’ai donc check ma classe principale, en oubliant que le chemin du ClientProxy était dans une autre classe
  • Ce sujet a été supprimé !

    Résolu
    3
    0 Votes
    3 Messages
    906 Vues
  • Texture qui ne s'affiche pas

    Résolu 1.8
    8
    0 Votes
    8 Messages
    2k Vues
    Alexandre1156A
    Merci encore robin4002 pour m’avoir un peu plus éclairé ! Je met le post en résolus
  • Ce sujet a été supprimé !

    Résolu
    3
    0 Votes
    3 Messages
    796 Vues
  • Ce sujet a été supprimé !

    4
    0 Votes
    4 Messages
    851 Vues
  • Bouton menu launcher

    Résolu 1.8
    31
    0 Votes
    31 Messages
    7k Vues
    C
    D’accord merci je vais prendre mon temps pour lire tout ça, vous pouvez fermer ou supprimer le sujet. Et dsl pour le dérangement j’ai mis du temps a comprendre^^
  • Ce sujet a été supprimé !

    8
    0 Votes
    8 Messages
    1k Vues
  • Render Models

    Résolu 1.8
    18
    0 Votes
    18 Messages
    3k Vues
    checconioC
    @‘EmotionFox’: Il s’agit du bloc qui permet de réparer l’armure, tu peux aussi mettre un item :    @Override    public boolean getIsRepairable(ItemStack input, ItemStack repair)    {        if(repair.getItem() == Items.apple)        {            return true;        }        return false;    } A ok merci
  • GuiMainMenu custom 1.8

    Résolu 1.8
    18
    0 Votes
    18 Messages
    5k Vues
    robin4002R
    Remplacer new GuiMain() par this …
  • Problème json fence gate

    Résolu 1.8
    15
    0 Votes
    15 Messages
    3k Vues
    robin4002R
    Tu as juste à modifier la version de Forge dans le build.gradle et refaire un setup.
  • Champ de texte et boutons

    Résolu 1.8
    4
    0 Votes
    4 Messages
    1k Vues
    robin4002R
    Sauf que si sur ton serveur le joueur n’a pas la permission de faire /tp il ne pourra pas se tp. Avec setRotationAndAngles il revient à sa position car tu essayes de le bouger côté client, or il faut le faire bouger côté serveur. Donc il faut utiliser un paquet.
  • Generation de minerai

    Résolu 1.8
    4
    0 Votes
    4 Messages
    884 Vues
    EryahE
    C’est bon, je me suis démérdé, et j’ai réussi
  • Erreur sur Classe de recettes

    Résolu 1.8
    9
    0 Votes
    9 Messages
    2k Vues
    EryahE
    Après avoir testé 5/6 des imports possible, j’ai enfin trouvé ceului qu’il faut c’est bon ( Si il y a encore un problème… --’ ) Les Imports ​import java.util.HashMap; import java.util.Map.Entry; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack;
  • Problème d'affichage de TileEntity

    Résolu 1.8
    11
    0 Votes
    11 Messages
    2k Vues
    EryahE
    Effectivement, ça marche beaucoup mieux maintenant Merci beaucoup robin
  • Model de bloc custom/avancé

    Résolu 1.8
    29
    0 Votes
    29 Messages
    4k Vues
    EryahE
    Ah ok Je faisais : “textures” [  { car c’est ce que me disait de faire jsonlint d’ailleurs, merci beaucoup pour ce site Le bloc n’est pas encore orientable, mais dès que j’aurait le temps, je le ferais