Navigation

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    SOLVED [1.12.2] reset TileEntity en changeant le blockState

    1.12.x
    1.12.2
    2
    3
    341
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      Chokearth last edited by

      Bonjour,
      Je souhaite changer les propriétés du BlockState de mon block en fonction du block d’en dessous, pour cela j’utilise la fonction neighborChanged(), mais lorsque je change mon blockState ma TileEntity ce reset.

      @Override
          public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) {
              IBlockState stateD = worldIn.getBlockState(new BlockPos(pos.getX(), pos.getY()-1, pos.getZ()));
              if (stateD != null && stateD.getBlock() == BlockInit.DRYING_RACK_BIG)
                  worldIn.setBlockState(pos, state.withProperty(FACING, stateD.getValue(FACING)).withProperty(TWO_STATE, EnumTwoState.TWO));
              else
                  worldIn.setBlockState(pos, state.withProperty(TWO_STATE, EnumTwoState.ONE));
          }
      

      Comment changer le blockState sans reset la TileEntity ?

      Merci d’avance.

      1 Reply Last reply Reply Quote 0
      • LeBossMax2
        LeBossMax2 last edited by

        Il y a la méthode shouldRefresh qui est justement faite pour ça. Si tu return false, ça ne va pas recréer le TileEntity.

        C 1 Reply Last reply Reply Quote 0
        • C
          Chokearth @LeBossMax2 last edited by

          @lebossmax2 Merci, ça fait deux heures que j’essaie de corriger ça ^_^ .

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Design by Woryk
          Contact / Mentions Légales / Faire un don

          MINECRAFT FORGE FRANCE © 2018

          Powered by NodeBB